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.
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
AA-521 EntryPoint support for eip-7702 #529
base: develop
Are you sure you want to change the base?
AA-521 EntryPoint support for eip-7702 #529
Changes from 17 commits
db002af
edb2255
dc43285
fc0c4e7
263a232
5b052ae
38d4714
5f0a6b7
68894e4
317d26b
2617f03
5052317
b8a9d26
d9b3f77
24b5473
fafeca8
f98cd95
fb06bc3
69499d0
bac3113
e54c2a7
146dbbe
0860e41
f25a26b
ee54899
33b294a
ea09602
8dafd94
c026b2e
1442357
b088f05
6459a16
192be39
26d6a0b
a747be1
f7c1688
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
If you write this function without the assembly tricks, how much more gas does it spend? This code is too elaborate for the task of "compare first three bytes".
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.
initCode starts with a prefix, and can be padded with zeros.
in assembly, we take advantage of ABI encoding, which pads shorter values with zeros to next 32 boundary.
In solidity, this padding would have to be done manually.
not only it would cost more, it would also be a longer code.
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.
This PR is merged so the comment may be removed.
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.
You don't need any assembly, you can just do
sender.code
. Also if the code is not exactly 23 bytes long it should revert.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.
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.
I think Solidity now supports just converting
bytes
tobytes32
touint256
so as far as I can tell there should be no difference. I may be wrong though.I am concerned some up-and-coming L2s may be a little less rigorous in their implementation of EIP-3541 and that would allow some kind of an attack down the line. It would be dirt-cheap to just double-check.
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.
yes, it is possible. but it reads read entire code, and then extract just the first 32 bytes.
rough check shows it to be 300 gas.
EIP-3541 doesn't really matter here: even if account's code starts with "EF", it will never pass validation anyway (or any other execution call)
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.
But the code is always 23 bytes long for EIP-7702, what is the problem here?
Please remove assembly if it is technically possible here. No need to overcomplicate things.
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.
Why can't we use
createSender
again? It is doing basically the same thing, callingaddress(initCode[:20]
withinitCode[20:]
, what are the main differences?If they are not critical, let's merge these two methods?