-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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-4200: Allow RJUMPV
table sizes of up to 256
#6546
Conversation
✅ All reviewers have approved. |
Originally we argued against this idea to avoid the spec stating "number But we could also reframe it to mean max index of the table. |
I think this is a good change. So far I was mostly focused on the encoding but realized having 256 element jump table should be very useful for implementing any bytecode interpreter. |
Perhaps instead of size it becomes "max index" - so jumpv of 1 has two indexes, 0 and 1. Also, by that logic what's the value of jumpv 1, shouldn't 2 be the minimum? (please no, accept the inconsistency). The big advantage I see is that we can do a full byte mapping to do things such as decoding large jump tables, with a full byte. Although nybbles (4-bits) will probably be more useful for sparser tables. While we could do this pre-change it would require fallthrough handling of |
I agree that this definition can be confusing although I don't think that's a good enough reason not to include this change. I also think putting it in terms of "the byte represents the max index" is a good idea. |
I agree with the change. |
Co-authored-by: Andrei Maiboroda <andrei@ethereum.org>
Some more fixes needed: Specification, line 50 should say:
Test cases, Invalid cases, remove line 138:
Test cases, Execution, line 149 should say:
Line 155:
|
This makes sense to me. |
Co-authored-by: Andrei Maiboroda <andrei@ethereum.org>
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.
All Reviewers Have Approved; Performing Automatic Merge...
Since
RJUMPV
table sizes of0
are disallowed I'm suggesting a change that would make table sizes start at 1, meaning acount
byte of0
would indicate a table of size 1 and acount
byte0xff
would indicate a table size of 256. This would remove an unnecessary piece of validation logic and allow tables that can map the full range of a 4-bitcase
value without0xff
resulting in the default path.