-
Notifications
You must be signed in to change notification settings - Fork 781
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
Update EIP 3074 AUTHCALL #1867
Update EIP 3074 AUTHCALL #1867
Conversation
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. |
looks good. is it possible to add code coverage for the newly added/missed lines? just for completeness sake |
This would need a cherry-picked re-submission against the latest rebased |
When writing tests, I found that the new spec is not entirely clear regarding the gas schedule, so have to wait on the remarks on that. I will expand the test suite to cover the new lines. |
Clarified: ethereum/EIPs#5093 This is also what we do at this point. |
Thanks for the update, so just to make sure we are on the same page: do you still plan to write additional tests here (as announced above) or is the PR now ready and just needs a final branch/conflict update? |
Yes, there need to be a few more tests added to cover the new EIP rules 😄 👍 |
9b94c43
to
4072576
Compare
f13738e
to
1e2caf9
Compare
Let's maybe wait here on merging until the initial EVM/VM refactor PR #1862 is settled and merge to not complicate any further over there. This one already needed so many patient reworks that we really should prioritize over there. 🙂 |
(given this a "Blocked" label for now for this reason, can be removed once the above PR is merged into |
I can remove |
1e2caf9
to
73c682d
Compare
Thanks, yes, rebased this via UI (locally tested) and will review. 🙂 |
@SamWilsn would it eventually be possible for you to do a review here? |
73c682d
to
41d3e25
Compare
Rebased via UI after local test rebase. |
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.
A bit more superficial review than I would have wished, but I think I got the essence of it and this should be sufficient.
Great, thanks Jochem, will merge!
const yParity = bufferToBigInt(mem[31]) | ||
const r = mem.slice(32, 64) | ||
const s = mem.slice(64, 96) | ||
const commit = mem.slice(96, 128) |
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.
Ok, so this is this new authority + signature in memory change.
let mem = runState.memory.read(Number(memOffset), Number(memLength)) | ||
if (mem.length < 128) { | ||
mem = setLengthRight(mem, 128) | ||
} |
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 length
is greater than 128, the extra bytes are ignored. Bytes outside the range (in the event length
is less than 128) are treated as if they had been zeroes."
👍
PUSH32, | ||
addressBuffer, | ||
AUTH, | ||
]) |
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 will trust the PR author that these test updates are correct. 😅 😀
const result = await vm.runTx({ tx, block }) | ||
const buf = result.execResult.returnValue | ||
st.ok(buf.equals(zeros(32)), 'auth puts 0') | ||
}) |
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.
Nice additional test cases! 👍
* vm: update eip 3074 * vm: eip3074 test fixes start * vm: fix eip3074 tests * vm: expand eip3074 tests * vm: add eip 3074 tests * vm: address 128n -> BigInt(128)
mem = setLengthRight(mem, 128) | ||
} | ||
|
||
const yParity = BigInt(mem[31]) |
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.
Hm, I don't think this line is correct. EIP-3074 says that:
memory[offset : offset+32 ]
-yParity
So yParity
could, in theory, be larger than one byte. As specified, signature verification would fail in that case, but with this implementation, it looks like the higher bytes are ignored?
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.
@jochem-brouwer could you have a look?
* vm: update eip 3074 * vm: eip3074 test fixes start * vm: fix eip3074 tests * vm: expand eip3074 tests * vm: add eip 3074 tests * vm: address 128n -> BigInt(128)
This updates the AUTHCALL EIP. Changes were made: ethereum/EIPs#4967