-
Notifications
You must be signed in to change notification settings - Fork 310
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
feat!: using WithHash<T>
in SharedMutable
+ fixing slot allocation
#11716
base: master
Are you sure you want to change the base?
feat!: using WithHash<T>
in SharedMutable
+ fixing slot allocation
#11716
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
WithHash<T>
in SharedMutable
+ fixing slot allocation
bb6e548
to
30bfe9c
Compare
5e7fc3f
to
5553ac3
Compare
WithHash<T>
in SharedMutable
+ fixing slot allocationWithHash<T>
in SharedMutable
+ fixing slot allocation
faac2b8
to
e6b47b8
Compare
3cb4e85
to
6f11f09
Compare
6f11f09
to
98c0571
Compare
Docs PreviewHey there! 👋 You can check your preview at https://67a4aed4fdbdfc1bf677d60a--aztec-docs-dev.netlify.app |
Changes to public function bytecode sizes
🧾 Summary (100% most significant diffs)
Full diff report 👇
|
noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/scheduled_value_change.nr
Show resolved
Hide resolved
@@ -142,7 +144,7 @@ impl<let INITIAL_DELAY: u32> Packable<1> for ScheduledDelayChange<INITIAL_DELAY> | |||
[packed.to_integer()] | |||
} | |||
|
|||
fn unpack(input: [Field; 1]) -> Self { | |||
fn unpack(input: [Field; SCHEDULED_DELAY_CHANGE_PCKD_LEN]) -> Self { |
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.
Insted of defining packable for svc and sdc, we can create the struct that contains both and just implement packable for that. If we do this, we can combine sdc and svc, since svc has a block of change (32 bits) that can be merged into sdc. Then we'd have 2N+1 total instead of 2N+2, which makes public writes cheaper and private reads a bit cheaper (less hashing).
We can do this in a separate PR.
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.
We discussed 2 days ago that we want to be able to read svc and sdc individually in public. For this reason they each need to implement packable (storage_read
requires it). Here is where we read it individually.
But when writing both values get written at once as they are wrapped in SharedMutableValues
.
8d1b517
to
c386ccf
Compare
Co-authored-by: Nicolás Venturo <[email protected]>
806e647
to
69aa267
Compare
With the introduction of
WithHash<T>
it made sense to use it inSharedMutable
as well. Given that I was dealing with storage I decided to tackle otherSharedMutable
related issues.Fixes #5492
Fixes #5491