feat!: support key compression for storage diffs in pubdata#393
Open
antoniolocascio wants to merge 20 commits intoalocascio-prover-input-runfrom
Open
feat!: support key compression for storage diffs in pubdata#393antoniolocascio wants to merge 20 commits intoalocascio-prover-input-runfrom
antoniolocascio wants to merge 20 commits intoalocascio-prover-input-runfrom
Conversation
basic_system/src/system_implementation/flat_storage_model/key_compression.rs
Outdated
Show resolved
Hide resolved
basic_system/src/system_implementation/flat_storage_model/key_compression.rs
Outdated
Show resolved
Hide resolved
Contributor
|
Gains are not clear, but lgtm. |
Contributor
|
Btw, we may use similar approch we use in Era, like first diffs with compressed key, then with full - https://docs.zksync.io/zksync-protocol/rollup/pubdata-compression . It will probably be more efficient |
Contributor
Author
|
@AntonD3 I fixed the index to be variable length. As we discussed offline, it might be worth changing the format to group together (initial_account_write, initial_slot_writes, repeated_writes), but maybe we can do that later. There's one thing that isn't clear to me tho. On Era, it seems like all repeated writes use the same length to encode the index. This means two things:
|
Contributor
Benchmark report
|
To be used in testing
8029932 to
5a04a70
Compare
8768261 to
232d117
Compare
1208ff0 to
f94dc60
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What ❔
This PR introduces a modification to the pubdata format to support compression of keys. Previously, we published the full 32-byte key for every storage diff (account or general slot diff). Now we add a header for diffs, where we declare: total number of diffs, nb of initial account writes and nb of initial slot writes and index encoding length. After which, we publish all initial account writes, all initial slot writes and repeated writes. More details about the format can be found in the docs.
Why ❔
Is this a breaking change?
Checklist