EnsoFinance / temper

Temper your expectations - Ethereum Transaction Simulator
MIT License
343 stars 43 forks source link

Add Support for Specifying Access Lists #19

Closed nlordell closed 11 months ago

nlordell commented 11 months ago

This PR adds support for specifying access lists to simulations. It is mostly straight forward, we overwrite the foundry::Evm's TxEnv to additionally include a simulation's access list (just requires some type conversions as the revm crate uses slightly different types to ethers).

call_raw_* Functions now take a single CallRawRequest as the number of arguments were growing and hit Clippy's "too many arguments" lint.

Manual Testing:

Run simulations with and without access lists and see different gas used amounts: ``` % curl -s http://localhost:8080/api/v1/simulate -H 'Content-Type: application/json' --data '@-' <
fleupold commented 11 months ago

Awesome!

devanoneth commented 11 months ago

Thanks again @nlordell, this looks great!

Do you mind resolving conflicts here too and adding an integration test to tests/api.rs? It should be relatively straight forward to turn your manual test into an integration test but please ping me if you have any questions on that.

nlordell commented 11 months ago

Do you mind resolving conflicts here too

I'll do #18 first and this one afterwards, as there will be more merge conflicts from that PR as well.

nlordell commented 11 months ago

Updated the PR to:

devanoneth commented 11 months ago

Thanks for the contribution again @nlordell!