-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Support EIP-7702 Delegations in Forge #9236
Merged
Merged
Changes from 47 commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
2467a3f
add EIP-7702 cheatcodes: createDelegation, signDelegation, attachDele…
evchip b16edd8
add cheatcode implementations for EIP-7702: createDelegationCall, sig…
evchip a286c7d
add delegations hashmap to Cheatcodes struct
evchip a6de137
add revm crate
evchip 619aa1e
create AttachDelegationTest for EIP-7702 transactions
evchip d5ae337
regen cheatcodes.json
evchip 05cdad8
cargo fmt
evchip 1d8f42e
move broadcast under attachDelegation
evchip c819383
Merge branch 'master' into feature/forge-eip-7702
evchip da62cc8
combine createDelegationCall logic with signDelegationCall in order t…
evchip bad6230
remove revm import from workspace
evchip b3666aa
combine createDelegation logic inton signDelegation for simplicity
evchip 376a092
remove revm from forge script deps
evchip 93963ee
combine createDelegation with signDelegation
evchip df33332
WIP - refactor test to use SimpleDelegateContract and ERC20 - test cu…
evchip 912ce6d
add logic to include authorization_list for EIP 7702 in TransactionRe…
evchip e97e185
add address authority param to attachDelegation; remove nonce param f…
evchip 40fd5f1
remove 7702 tx request construction logic - now handled in attachDele…
evchip bdef83c
refactor attachDelegation cheatcode implementation to handle verifyin…
evchip e4082b1
remove nonce param from attachDelegation cheatcode in favor of loadin…
evchip f18a0e8
refactor test to check for code on alice account and call execute on …
evchip d8ea3ec
revert refactor on TransactionRequest
evchip 0bd6f42
format
evchip 8f480fe
cargo fmt
evchip 25aeea7
fix clippy errors
evchip 4310c2d
remove faulty logic comparing nonce to itself - nonce still checked b…
evchip bdc0b78
add more tests to cover revert cases on attachDelegation and multiple…
evchip c10be3e
cargo fmt
evchip 7090999
restore logic to check if there's an active delegation when building …
evchip af7e39c
remove obsolete comment
evchip 4394065
add comments explaining delegations and active_delegation
evchip aa0ece7
cargo fmt
evchip a833dd6
add logic to increase gas limit by PER_EMPTY_ACCOUNT_COST(25k) if tx …
evchip f432430
revert logic to add PER_EMPTY_ACCOUNT_COST for EIP 7702 txs - handled…
evchip 6d46417
remove manually setting transaction type to 4 if auth list is present…
evchip d79f376
add method set_delegation to Executor for setting EIP-7702 authorizat…
evchip edbaf4c
Merge branch 'master' into feature/forge-eip-7702
evchip c050393
remove redundancy with TransactionMaybeSigned var tx
evchip cdfe503
cargo fmt
evchip 475216d
refactor: use authorization_list() helper to return authorization_lis…
evchip d0ad8bd
refactor: change Cheatcodes::active_delegation to Option<SignedAuthor…
evchip 113854c
replace verbose logic to set bytecode on EOA with journaled_state.set…
evchip 0a93989
cargo fmt
evchip 74302de
increment nonce of authority account
evchip de9dea4
add logic to set authorization_list to None if active_delegation is None
evchip d560464
add test testSwitchDelegation to assert that attaching an additional …
evchip 2a30b42
remove set_delegation logic in favor of adding call_raw_with_authoriz…
evchip 713bd64
refactor signDelegation to return struct SignedDelegation and for att…
evchip 89cd62d
update delegation tests to reflect change in cheatcode interface for …
evchip 7df7dcb
add cheatcode signAndAttachDelegation
evchip 5151459
add signAndAttachDelegationCall cheatcode logic; refactor helper meth…
evchip 1c6e7d0
add test testCallSingleSignAndAttachDelegation for new cheatcode sign…
evchip ff2801c
add comments to SignedDelegation struct and cargo fmt
evchip 002221a
cargo fmt
evchip e829b6e
fix ci
klkvr d2d2376
fix spec
klkvr 8fa8e64
Merge branch 'master' into feature/forge-eip-7702
grandizzy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove authority argument from here. it's redundant as we are always recovering it from signature
also wdyt on adding
signAndAttach
method? I think common flow would be calling both of the cheatcodesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not seeing how to construct the authorization without the authority's nonce, which we'd need to recover the authority from the signature. Can you clarify the flow you're thinking of?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can get the nonce from state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, but to get the nonce from state we need the authority's address to load their account - am I missing some other way to get their nonce?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in
signDelegation
we can get authority address from private key, then get nonce, construct and sign delegationand in
attachDelegation
we can just recover authority from the signed delegation. right now the passed authority address is anyway expected to be the same as recovered one making it redundantThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah I see what you mean. didn't notice that
attachDelegation
doesn't acceptnonce
let's make
signDelegation
return a newstruct SignedDelegation
which will containv,r,s,nonce,implementation
. And thenattachDelegation
would just accept this objectThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've implemented a new cheatcode
signAndAttachDelegation
and refactored the existing cheatcodes to usestruct SignedDelegation
. Let me know what you think. Thanks!