Add scenario access list support with placeholder resolution#588
Conversation
77f485b to
8cf063a
Compare
8cf063a to
a48759f
Compare
|
Re-targeted per @zeroXbrock's request — reopened as a clean diff on top of #581 here: karlfloersch#1 (base |
|
@zeroXbrock rebased this on top of #581 ( I couldn't re-point the PR base to Build + access-list tests green on |
|
For the clean diff-over-Karl review, I opened a fork-to-fork PR against |
zeroXbrock
left a comment
There was a problem hiding this comment.
thanks @jelias2 -- design looks fine, but I'm having trouble testing it. I updated scenarios/simple.toml with this:
[[spam]]
[spam.tx]
to = "{SpamMe5}"
signature = "callPrecompile(string memory method, uint256 iterations)"
args = ["ecMul", "5"]
[[access_list]]
address = "{SpamMe5}"
storageKeys = [
"0x0100000000000000000000000000000000000000000000000000000000000000",
"0x0300000000000000000000000000000000000000000000000000000000000000",
]but I'm not seeing access_list in the transactions that are being sent.
Could you also resolve the merge conflicts?
|
Thanks for testing @zeroXbrock. That's a TOML pathing gotcha, not the feature itself. [[spam]]
[spam.tx]
to = "{SpamMe5}"
signature = "callPrecompile(string memory method, uint256 iterations)"
args = ["ecMul", "5"]
[[spam.tx.access_list]]
address = "{SpamMe5}"
storageKeys = [
"0x0100000000000000000000000000000000000000000000000000000000000000",
"0x0300000000000000000000000000000000000000000000000000000000000000",
]Parse check of the two forms:
|
|
Confirmed live with the fully-qualified path: spamming interop tx |
Supersedes flashbots#581. Adds an `access_list` field to FunctionCallDefinition that accepts {placeholder} strings in `address` and `storageKeys`, resolved during the loose-to-strict conversion via the existing templater + DB map. Coexists with max_priority_fee_per_gas (flashbots#580) and alloy 2.0 (flashbots#561).
37cd34a to
025f0d3
Compare
|
@jelias2 is there any way you could revise this branch to include @karlfloersch's commits? This PR strips his credit. |
|
Appreciate it @zeroXbrock but we don't need to give me credit, that way if something goes wrong folks point their finger at @jelias2 instead of at me 😁 Let's ship! Thanks yall |
zeroXbrock
left a comment
There was a problem hiding this comment.
thanks @jelias2 @karlfloersch, works great! Just made a little change to support [env] placeholders as well.
Summary
Builds on #581 to address @zeroXbrock's reviewer feedback: allow
{placeholder}strings in access listaddressandstorageKeys.PR #581 currently uses alloy's typed
AccessListItemon both the loose and strict sides, which cannot hold placeholder strings during the loose-to-strict conversion phase. This PR:LooseAccessListItem { address: String, storage_keys: Vec<String> }on the loose side (keepsstorageKeyscamelCase from Add scenario access list support #581).AccessListItem(per @zeroXbrock's design).make_strict_callvia the existing templater + DB-driven map, parsing intoAddress/B256.find_fncall_placeholdersto scan access list strings so the DB lookup pre-populates referenced contract addresses.openrpc.jsonregenerated bycli/build.rs.Example
Relationship to #581
This branch was built on top of #581 (
scenario-access-list-support, head6460cb4). If #581 is the preferred merge vehicle, this PR could be re-targeted at karlfloersch's branch so the placeholder support lands inside the existing review thread. Filing here againstmainas the more flexible default — happy to retarget.Tests
cargo +1.94 test -p contender_core access_list --lib— 3 passedcargo +1.94 test -p contender_testfile --lib— 22 passedcargo +1.94 fmt --check— cleanaccess_list_parses_placeholders_from_toml(contender_core)parses_spam_tx_access_list_with_placeholders_toml(contender_testfile)Test plan
cargo fmt --checkcleanaccess_liststill build and broadcast correctly{Contract}placeholder for address resolve correctly{slot}placeholder for storage keys resolve correctly