From 501fd5ce4dcc3d36ddfc6ea4bec3fcfe7f1b4e6f Mon Sep 17 00:00:00 2001 From: Diego Jose Date: Tue, 22 Oct 2024 13:27:09 -0300 Subject: [PATCH] Mixed styling/content fixes and changes --- source/api/grpc.rst | 2 +- source/smart-contracts/lua/guide.md | 12 +++++++----- source/smart-contracts/lua/reference.md | 8 ++++---- source/specs/p2p/peerconnect.rst | 22 +++++++++++----------- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/source/api/grpc.rst b/source/api/grpc.rst index e37814e..d8821c6 100644 --- a/source/api/grpc.rst +++ b/source/api/grpc.rst @@ -4,7 +4,7 @@ Using gRPC gRPC is a standard for RPC APIs using protobuffer messages for data exchange. The main advantages are typed messages and efficiency: data is packed tightly and sent over HTTP2. -If you want to use the gRPC API directly, please refer to the `official documentation `_ to get started. +If you want to use the gRPC API directly, please refer to the `grpc's official documentation `_ to get started. You can find the protobuf definitions in `aergoio/aergo-protobuf `_. Alternatively, you can use one of the `SDKs <../sdks/index.html>`_ which wrap the same functionality in language-specific styles. \ No newline at end of file diff --git a/source/smart-contracts/lua/guide.md b/source/smart-contracts/lua/guide.md index d697af4..9c282b8 100644 --- a/source/smart-contracts/lua/guide.md +++ b/source/smart-contracts/lua/guide.md @@ -590,7 +590,7 @@ function query_names(ids) end ``` -.. warning:: +**Warning:** **DO NOT** concatenate values when building SQL commands! This would make your smart contract vulnerable to `SQL injection` attacks. @@ -614,10 +614,12 @@ end [LiteTree](https://github.com/aergoio/litetree) is used as the SQL processing engine for Aergo smart contracts. LiteTree is implemented based on SQLite. -Detailed SQL usage can be found at https://sqlite.org/lang.html and https://sqlite.org/lang_corefunc.html +Detailed SQL usage can be found at [SQL as understood by SQLite](https://sqlite.org/lang.html) and [Built-in Scalar SQL functions](https://sqlite.org/lang_corefunc.html) However, we do not provide full SQL functionality. There are some limitations due to stability and security. +When working with SQL functionality, please consider the following: + **Data types** Allow only SQL datatypes corresponding to Lua strings and numbers(int, float). @@ -655,9 +657,9 @@ A list of other functions and descriptions is available via the links below. * data and time : https://www.sqlite.org/lang_datefunc.html * aggregation : https://www.sqlite.org/lang_aggfunc.html -**contraints** +**Constraints** -You can use the following contraints: +You can use the following constraints: * NOT NULL * DEFAULT @@ -683,7 +685,7 @@ It provides smart contract-related commands as follows: * receipt get * event list/stream -* [Reference](../../tools/aergocli.html) +* [Reference](../../tools/aergocli.rst) ### brick diff --git a/source/smart-contracts/lua/reference.md b/source/smart-contracts/lua/reference.md index 7121182..916b222 100644 --- a/source/smart-contracts/lua/reference.md +++ b/source/smart-contracts/lua/reference.md @@ -330,9 +330,9 @@ The following is an unavailable list * sqlite_XXX function For a list of other functions and descriptions, please refer to the links below. -* Core: -* Date and time: -* Aggregation: +* [Core](https://sqlite.org/lang_corefunc.html) +* [Date and time](https://www.sqlite.org/lang_datefunc.html) +* [Aggregation](https://www.sqlite.org/lang_aggfunc.html) #### Constraint The following constraints can be used. @@ -366,7 +366,7 @@ end ## json package -Json package is provided for user convenience in input and output. This package allows automatic conversion between JSON format strings and Lua Table structures. +JSON package is provided for user convenience in input and output. This package allows automatic conversion between JSON format strings and Lua Table structures. ### encode(arg) This function returns a JSON-formatted string with the given lua value. diff --git a/source/specs/p2p/peerconnect.rst b/source/specs/p2p/peerconnect.rst index 23ea57f..00374f2 100644 --- a/source/specs/p2p/peerconnect.rst +++ b/source/specs/p2p/peerconnect.rst @@ -25,15 +25,6 @@ Dynamic peer discovery ---------------------- Aergo server requests peer list from other connected peers as well as Polaris if it cannot find enough peers. -Choosing remote peers ---------------------- - -(This feature is currently work in progress) - -The list of peers to connect to is managed in Kademlia-like manner. -The number of peers that are closer to the peer is larger and the number of peers that are connected to the peer is smaller. -The peer's distance is based on the difference based on the hash value, not the physical distance. - Peer connect process ==================== The network communication of Aergo server operates on libp2p basis, and libp2p is responsible for encryption and node distinction at transmission level. @@ -51,11 +42,20 @@ Aergo server maintains a connection-based communication. Both peers disconnect when the internally defined retention score increases beyond a certain level. This score decreases to a low level when a query is requested, and increases when a bad block or TX notification is sent. + +Ongoing Development Features +============================ + Peer blacklist -------------- -(This feature is currently work in progress) - When an internally defined ban score exceeds a certain level, the Aergo server blocks the peer's connection. This score increases due to the connection being disconnected due to exceeding the connection maintenance score, etc., and the blocking period is also changed by calculating the score or the number of blocking times. You can also permanently block by specifying a block address in the configuration file. + +Choosing remote peers +--------------------- + +The list of peers to connect to is managed in Kademlia-like manner. +The number of peers that are closer to the peer is larger and the number of peers that are connected to the peer is smaller. +The peer's distance is based on the difference based on the hash value, not the physical distance. \ No newline at end of file