Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EVM] Add tx replacement #1192

Open
wants to merge 60 commits into
base: evm
Choose a base branch
from
Open

[EVM] Add tx replacement #1192

wants to merge 60 commits into from

Conversation

stevenlanders
Copy link
Contributor

@stevenlanders stevenlanders commented Dec 28, 2023

Describe your changes and provide context

  • EVM transactions populate sender with a pattern {address}|{nonce}
  • The sender is used to de-dupe in the mempool (sei-tendermint)
  • A replacement transaction must have a higher priority number to replace (else reject)
  • Waiting on this PR: [EVM] Add evm tx replacement logic sei-tendermint#177

Testing performed to validate your change

  • sei-tendermint mempool unit tests

codchen and others added 30 commits September 21, 2023 17:52
* evm wip

* Create EVM module and add types/keeper

* lint

* rebase

* tests

* add tests

* address comments
* evm wip

* Create EVM module and add types/keeper

* add tests

* EVM signature verification

* refactor
* [EVM] Add gas check ante handler

* add tests and remove unnecessary configs/versions
* [EVM] implement balance related methods for state interface

* add tests
)

* Add account state to EVM state interface implementation

* add Snapshot and rollback
* [EVM] Add gas check ante handler

* [EVM] implement balance related methods for state interface

* Add account state to EVM state interface implementation

* add Snapshot and rollback

* wip

* [EVM] add remaining state interface function

* rebase
* Add account state to EVM state interface implementation

* add Snapshot and rollback

* wip

* [EVM] add remaining state interface function

* [EVM] access list

* add unit tests

* improve code coverage

---------

Co-authored-by: Jeremy Wei <[email protected]>
* [EVM] implement message server that processes EVM transactions

* add tests
* [EVM] implement message server that processes EVM transactions

* [EVM] add bank precompile

* upgrade to Go 1.20

* rename coinbase

* tests & linter
* [EVM] implement message server that processes EVM transactions

* rename coinbase

* [EVM] add RPC/WS server helpers

* tests

* fix
* [EVM] implement message server that processes EVM transactions

* rename coinbase

* [EVM] add RPC/WS server helpers

* tests

* wip

* [EVM] add getBlockByHash endpoint

* rebase
[EVM] add endpoint to get block transaction count
* [EVM] add get transaction receipt endpoint

* refactor tests
[EVM] add getTransaction endpoints
[EVM] refactor gas logic
* [EVM] add endpoint to return fee history

* bump to 1.21
* Implement get code, storage, balance endpoints

* revert logging change

* also using bank keeper to check for balances

* appease linter
* simulate api

* add tests

* linter
* [EVM] add subscription utility

* finished new filter

* finished tests for new filter

* finished uninstall filter

* query tendermint for events

* in progress

* got first couple of tests done

* finished tests for get logs

* get filter logs and get filter changes

* refactor

* get filter logs accepts multiple addresses

* use multiple addresses and use cursor map

* remove bad test

* remove prints and todos

* minor fix

* fix lint errors and failing test

* poc to pass filtercriteria into JSON RPC

* made topics 2d array and adjusted regex

* GetLogs tests work

* Finished other functions

* remove unncessary inputs from NewFilterAPI

* add expiration/timeouts for filters

* removed error from UninstallFilter

* minor fix

* appease linter

---------

Co-authored-by: codchen <[email protected]>
* [EVM] return gas info in message handler correctly

* add comments
* integration

* fix tests
* [EVM] add transaction type to associate account

* tests
* [EVM] add transaction type to associate account

* [EVM] convert balance decimal points

* [EVM] add ACL dependencies for EVM transactions

* Revert "[EVM] add ACL dependencies for EVM transactions"

This reverts commit 5376a87.

* address comments
codchen and others added 24 commits November 13, 2023 13:20
* [EVM] several bug fixes

* tests

* add CheckTx nonce handling
* [EVM] several bug fixes

* [EVM] add wasmd precompiles

* [EVM] wasmd precompile

* query method

* add tests
* added new block filter

* wip

* finished tests

* minor fix

* fix lint

* minor fix

* added basic endpoint and created sendWSRequestAndListen

* no goroutine in test

* removed params

* able to call my subscribe endpoint

* subscribe2 works but not subscribe

* got back msg from ws but hard to decode

* subscription api uses sub manager, manager thread safe

* able to send many messages through ws conn

* newHeads tests work

* newHeads works

* subscribe works need to cleanup

* test with multiple addrs, remove prints

* cleanup

* cleanup

* fix test

* fix linter

* fix linter 2

* fix linter 3

* address comments

* add unsubscribe in mock client

* fix linter 4

* fix extra subscribe param

* fix test
* [EVM] handle nonce gap in CheckTx

* disable compatibility check
* chore: forge init

* forge install: forge-std

v1.7.2

* moved foundry.toml and github workflows to top level

* forge install: openzeppelin-contracts

v5.0.0

* added impl + tests for native sei tokens as erc20s

* fix

* fix

* remove Counter boilerplate code

* minor fix
…1159)

* able to txn deployment to go through

* cleanup

* remove prints

* remove prints

* fix linter

* minor fix
…ns (#1158)

* [EVM] add granular dependency

* [EVM] define granular dependency
* Slow config for SendRawTransaction

* fixes

* fix test
* ERC721

* [EVM] add ERC721 template contract

* use whitelisted send

* add tests
* [EVM] Sign and Accounts endpoints

* add SendTransaction

* add nonce check

* Revert "add nonce check"

This reverts commit 83c7108.

* add nonce check in Exists
* fix logs

* Fix log endpoint
fix empty uncle hash
* Fix getTxByHash for pending txs

* set tx index

* bump tm

* retry
* [EVM] show bank send in GetBlock response

* add utilities
* Add basic checks

* multiple fixes

* fix race condition
Copy link

codecov bot commented Dec 28, 2023

Codecov Report

Attention: 28 lines in your changes are missing coverage. Please review.

Comparison is base (0580149) 66.17% compared to head (0cbead3) 65.76%.
Report is 2 commits behind head on evm.

❗ Current head 0cbead3 differs from pull request most recent head 88e3864. Consider uploading reports for the commit 88e3864 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              evm    #1192      +/-   ##
==========================================
- Coverage   66.17%   65.76%   -0.42%     
==========================================
  Files         329      329              
  Lines       21536    21563      +27     
==========================================
- Hits        14252    14181      -71     
- Misses       6509     6610     +101     
+ Partials      775      772       -3     
Files Coverage Δ
x/evm/types/message_evm_transaction.go 17.07% <0.00%> (-1.35%) ⬇️
app/abci.go 49.27% <0.00%> (-26.29%) ⬇️

... and 3 files with indirect coverage changes

}

// For EVM, populate sender on the response so that mempool can decide to dedupe
tx, err := app.txDecoder(req.Tx)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decoding (and the addr recovery logic below) is quite heavy so ideally we don't repeat it here. One other option is to a new field in sdk.Context, set it in the sig antehandler (where we derive address), and set it in checkTx response in sei-cosmos:baseapp:runTx.

But for now I think this is okay, since CheckTx itself doesn't directly affect chain performance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants