-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
imp(docs): Add more info on replay protection and EVM access control (#…
…165) Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Loading branch information
1 parent
0fefce1
commit 7ea8525
Showing
7 changed files
with
118 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
# EIP-155: Replay Protection | ||
|
||
[EIP-155](https://eips.ethereum.org/EIPS/eip-155) is an Ethereum Improvement Proposal, | ||
that has introduced a simple replay protection mechanism, | ||
by including the chain ID information into the signed transaction data. | ||
This was necessary, because Ethereum-based transactions rely on the Hex representation of addresses, | ||
which are not necessarily unique to a given network. | ||
This means that single signed transaction could be valid on multiple networks, | ||
as the same addresses are involved e.g. in a token transfer. | ||
This holds the potential for exploits and is addressed by enforcing the EIP-155 replay protection. | ||
|
||
Cosmos SDK-based blockchains use Bech32 representations for addresses, which contain a unique prefix per chain. | ||
This means, that for Cosmos transactions, replay protection is inherently present as addresses of a given chain | ||
are not valid addresses on other chains. | ||
However, as Evmos also accepts EVM transactions, handling only those transactions that conform to EIP-155 | ||
becomes a requirement again. | ||
|
||
This requires special care to be taken when selecting an EIP-155 compliant [chain ID](./chain-id.mdx) | ||
to avoid duplication amongst chains. | ||
|
||
## Configuring Replay Protection | ||
|
||
By default, replay protection is enabled on any Evmos node. | ||
There are two distinct steps required to accept unprotected transactions, i.e. those that do not contain the chain ID | ||
in the signed transaction data: | ||
|
||
1. **Disable Module Parameter**: | ||
The [EVM module](../modules/evm.md#parameters) contains a governance controlled parameter, | ||
that globally dictates if unprotected transactions are supported. | ||
This has to be disabled via a governance vote or | ||
by setting the `allow_unprotected_txs` field to `true` in the genesis of a [local node](../evmos-cli/single-node.mdx). | ||
|
||
2. **Adjust Node Configuration**: | ||
When the global parameter is set accordingly, each node operator has the option to individually opt into allowing | ||
unprotected transactions to be sent to their nodes. | ||
This configuration is explained in the section on | ||
[node configuration](../../validate/setup-and-configuration/configuration.md#eip-155-replay-protection). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ In `~/.evmosd/config/config.toml` you can set your peers. | |
See the [Add persistent peers section](./../testnet#add-persistent-peers) in our docs for an automated method, but | ||
field should look something like a comma separated string of peers (do not copy this, just an example): | ||
|
||
```bash | ||
```toml | ||
persistent_peers = "[email protected]:24656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656" | ||
``` | ||
|
||
|
@@ -68,13 +68,29 @@ ac29d21d0a6885465048a4481d16c12f59b2e58b | |
|
||
### Healthy peers | ||
|
||
If you are relying on just seed node and no persistent peers or a low amount of them, | ||
If you are relying on just a seed node and no persistent peers or a low amount of them, | ||
please increase the following params in the `config.toml`: | ||
|
||
```bash | ||
```toml | ||
# Maximum number of inbound peers | ||
max_num_inbound_peers = 120 | ||
|
||
# Maximum number of outbound peers to connect to, excluding persistent peers | ||
max_num_outbound_peers = 60 | ||
``` | ||
|
||
## EIP-155 Replay Protection | ||
|
||
The EIP-155 replay protection is enabled globally in the EVM module parameters. | ||
In case this is disabled as a global requirement, node operators can opt into supporting unprotected transactions | ||
by adjusting the corresponding setting in the [node configuration](https://github.com/evmos/evmos/blob/v18.1.0/server/config/toml.go#L74-L76): | ||
|
||
```toml | ||
# in $HOME/.evmosd/config/config.toml | ||
|
||
# AllowUnprotectedTxs restricts unprotected (non EIP-155 signed) transactions to be submitted via | ||
# the node's RPC when the global parameter is disabled. | ||
allow-unprotected-txs = true # false by default | ||
``` | ||
|
||
More information about EIP-155 can be found here: [EIP-155: Replay Protection](../../protocol/concepts/replay-protection.md). |