-
Notifications
You must be signed in to change notification settings - Fork 145
Fix HASKEY BigInteger index overflow #543
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
base: master
Are you sure you want to change the base?
Conversation
shargon
left a comment
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 require a Hardfork, and new Jump table
shargon
left a comment
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.
@Jim8y could you create the jump table in neo repository?
Co-authored-by: Alvaro <[email protected]>
Co-authored-by: Alvaro <[email protected]>
Co-authored-by: Alvaro <[email protected]>
|
Why is it better than |
You are right. I'll fix it. |
340cb1a
|
Require neo-project/neo#4381 |
roman-khimov
left a comment
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.
Wish there are more tests for it (that would spot the difference in behavior), but ok logically.
Hi Roman @roman-khimov , do you have any idea how could we use test or anything that can formally define and verify the behavior of vm, i think it would be much better if we can use some kind of spec to formally and strictly define the behavior such that we can automatically discover any incompatiable issues if any. |
|
Practically current JSON-based tests are very nice to me, at least they're easy to reuse for different VM implementations. Formal spec or model is a different story. |
This pull request enhances the safety and correctness of array, buffer, and byte string index handling in the Neo VM by improving overflow and underflow checks and ensuring consistent type usage for indices. It also adds new test cases to verify these edge conditions.
Improvements to index validation and safety:
HasKeyforVMArray,Buffer, andByteStringto check both lower and upper bounds using appropriate engine limits, preventing overflow and underflow errors. [1] [2]PickItem,SetItem, andRemovemethods to useBigIntegerfor indices and explicitly cast tointonly when accessing collections, improving type safety and clarity. [1] [2] [3] [4] [5]Testing improvements:
HASKEY.jsonto verify correct FAULT behavior when array indices overflow or underflow, ensuring these edge cases are properly handled.