sei-protocol / sei-chain

Apache License 2.0
2.7k stars 805 forks source link

Remove interoperability hop limit with isolated EVM instances #1729

Closed codchen closed 3 months ago

codchen commented 3 months ago

Describe your changes and provide context

Previously interop hop was limited to 1 due to concerns of reentrancy attacks. This PR removes the limit and now relies on the fact that each hop would instantiate a new, isolated EVM instance as base of operation. This creates the need of bubbling up EVM events generated in those isolated EVM instances, which is solved by a dedicated event manager in context.

Testing performed to validate your change

integration test that calls the wasmd precompile which calls a CW->ERC pointer

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 60.91%. Comparing base (92f1773) to head (e2b018c).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1729/graphs/tree.svg?width=650&height=150&src=pr&token=DG7ZZJ3PVV&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol)](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1729?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol) ```diff @@ Coverage Diff @@ ## main #1729 +/- ## ========================================== - Coverage 60.97% 60.91% -0.06% ========================================== Files 371 371 Lines 27466 27472 +6 ========================================== - Hits 16747 16735 -12 - Misses 9578 9594 +16 - Partials 1141 1143 +2 ``` | [Files](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1729?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol) | Coverage Δ | | |---|---|---| | [evmrpc/tx.go](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1729?src=pr&el=tree&filepath=evmrpc%2Ftx.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol#diff-ZXZtcnBjL3R4Lmdv) | `67.26% <100.00%> (+0.14%)` | :arrow_up: | | [precompiles/wasmd/wasmd.go](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1729?src=pr&el=tree&filepath=precompiles%2Fwasmd%2Fwasmd.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol#diff-cHJlY29tcGlsZXMvd2FzbWQvd2FzbWQuZ28=) | `62.62% <100.00%> (+0.65%)` | :arrow_up: | | [x/evm/keeper/evm.go](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1729?src=pr&el=tree&filepath=x%2Fevm%2Fkeeper%2Fevm.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol#diff-eC9ldm0va2VlcGVyL2V2bS5nbw==) | `65.87% <100.00%> (-0.54%)` | :arrow_down: | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1729/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol)