Add scenario access list support#581
Conversation
zeroXbrock
left a comment
There was a problem hiding this comment.
Thanks for the PR @karlfloersch!
|
Thank you! |
|
I should have mentioned this earlier: THIS CODE WAS AI GENERATED (5.5 high fwiw) |
😂 no problem, all code is welcome here. |
zeroXbrock
left a comment
There was a problem hiding this comment.
Thanks @karlfloersch!
I confirmed locally that it works, but I realized it only works with hard values, not placeholders.
I'd like to be able to use placeholder values in the address and storageKeys fields, so we could do this in scenario files:
[[spam.tx.access_list]]
address = "{SpamMe5}"
storageKeys = [
"{testkey1}",
"{testkey2}",
]This should just be a matter of running replace_placeholders on the inputs, but now that we're using alloy's AccessListItem, placeholder strings are not valid, so I think unfortunately we'll have to go back to using a proprietary AccessListItem definition that uses strings. Sorry for the confusion, I misjudged the situation on my last review.
Summary
Adds first-class EIP-2930 access-list entries to scenario-generated transaction requests. Scenario authors can now specify
[[spam.tx.access_list]]entries with an address and storage keys, and Contender threads those entries into AlloyTransactionRequest.access_list.The implementation keeps access lists generic and compatible with EIP-1559 transaction completion.
Validation
cargo +1.94.0 fmt --checkcargo +1.94.0 test -p contender_core access_list --libcargo +1.94.0 test -p contender_testfile access_list --libcargo +1.94.0 test -p contender_testfile --libNote:
cargo +1.94.0 test -p contender_core --libwas also run and had 36 passing tests with 4 existing Anvil/provider-style failures unrelated to this change.