!feat(evm): Reject not replay-protected tx to prevent replay attack (#1124)

* Reject not replay-protected tx to prevent replay attack

Closes: #1122

- reject such txs in ante handler

* add reject unprotected parameter

* Update CHANGELOG.md

* Apply suggestions from code review

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* pr suggestions

* add unit test case

* Reject not replay-protected tx to prevent replay attack

Closes: #1122

- reject such txs in ante handler

add reject unprotected parameter

Update CHANGELOG.md

Apply suggestions from code review

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

pr suggestions

add unit test case

use var

* add migrations

* Apply suggestions from code review

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* rename

* update comments

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
yihuang
2022-06-13 09:41:53 +00:00
committed by GitHub
co-authored by Federico Kunze Küllmer
parent 82835307c7
commit 8f932ddc6a
19 changed files with 4371 additions and 119 deletions
+2
View File
@@ -24,6 +24,8 @@ message Params {
(gogoproto.moretags) = "yaml:\"chain_config\"",
(gogoproto.nullable) = false
];
// reject replay-unprotected transactions
bool reject_unprotected_tx = 6;
}
// ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values
+1
View File
@@ -36,6 +36,7 @@ message MsgEthereumTx {
}
// LegacyTx is the transaction data of regular Ethereum transactions.
// NOTE: All non-protected transactions (i.e non EIP155 signed) will fail if the RejectUnprotectedTx parameter is enabled.
message LegacyTx {
option (gogoproto.goproto_getters) = false;
option (cosmos_proto.implements_interface) = "TxData";