-
Notifications
You must be signed in to change notification settings - Fork 14
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
Audit/entry store packing verification #40
Conversation
Audit specification: - Add checks in pack of EntryStorePacking to avoid bit overflow
Output from Compare Snapshot:
|
Output from Compare Snapshot:
|
Output from Compare Snapshot:
|
Output from Compare Snapshot:
|
Output from Compare Snapshot:
|
The objective here is to make sure that the timestamp, the volume and the value fits within the range defined in the packing system: 32 for the timestamp, 100 for the volume and 120 for the price. To do so I suggest using the bitwise AND operation before packing the elements. Let's take the example of the timestamp: if we can assert that |
Output from Compare Snapshot:
|
Entry and Checkpoint Store packing overflow verification. The verification is done leveraging the difference between felt252 (252 bits) and u256 ( 256 bits). We store the max felt252 in a u256 in order to make the comparison: https://cairo-by-example.com/examples/felt252/