Skip to content
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 remerkleable; mul/div bound checks, update config loading #1709

Merged
merged 1 commit into from
Apr 6, 2020

Conversation

protolambda
Copy link
Collaborator

Update the SSZ library from v0.1.12 to v0.1.13, now with bound checks and type preservation on mul and floordiv. To catch overflow/underflow cases better. See #1701

This remerkleable release is fully backwards compatible.

Updating one test helper value that was supposed to be a signed integer, and was previously (mul output was an int), but needed to be updated.

And updating the config loader to load config values with their existing types, and ignore unknown config keys (we do not want phase1 keys to leak into phase0 unnecessarily). An optional argument can make the ignored values explicit for debugging.


Notes about new remerkleable functionality:

One other new feature is that it offers some readonly_iter() iterators to allow for much faster stack-based iteration of compound views. Useful for users outside of the spec that want things to run faster. I am considering making this the default, but what should be noted here is that "readonly" means that updates/removals/additions of items in the iterated container during iteration cannot be seen until after the iteration is done. Maybe not so bad, given that many program languages default to not allowing modifications at all, or do the same?

Additionally, this readonly iter is the default for Container (since we don't normally iterate it dynamically), and enables fast unpacking:

class Foo(Container):
    a: uint64
    b: uint8
    c: Vector[uint16, 123]

foo = Foo(b=42)
a, b, c = foo
assert b == 42

@djrtwo djrtwo merged commit a34d0d7 into dev Apr 6, 2020
@djrtwo djrtwo deleted the check-ops-better branch April 6, 2020 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants