-
Notifications
You must be signed in to change notification settings - Fork 139
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
[Compiler] Sync with master #3744
Merged
Merged
Conversation
This file contains 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
This commit: 1. Combines all domain (non-atree) payloads into one account (non-atree) payload per account. 2. Combines all domain (atree) storage maps into one account (atree) storage map per account. 3. Uses on-the-fly (OTF) migration when an account is modified (write ops). Currently, accounts store data on-chain under pre-defined domains, such as "storage". Each domain requires domain payload (8-byte non-atree payload) and domain storage map payload (atree payload). Also, each payload requires ~2 mtrie nodes (~2x96 byte overhead). New domains were added in Cadence 1.0 and domain payloads count increased to 150 million on Sept. 4 (was 80 million pre-spork). Nearly 25% of total payloads on-chain are 8-byte domain payloads. Each account on mainnet has an average of ~4 domain payloads and ~4 domain storage maps. This commit creates 1 account (non-atree) payload and 1 account (atree) storage map per account, eliminating all domain (non-atree) payloads and domain storage maps for that given account. Based on preliminary estimates using Sept. 17, 2024 mainnet state, this approach can: - eliminate mtrie nodes: -425 million (-28.5%) - reduce payload count: -174 million (also -28.5%) This commit also includes on-the-fly migration so we can see improvements to accounts that have write activity without requiring downtime. Given this, we won't see the full benefits/impact until all accounts (including idle accounts) are eventually migrated (e.g. using full migration or other means).
This is for completeness.
…ap) into separate type
…to bastian/refactor-account-storage
Currently, various storage domains are defined in different packages, such as: - common - runtime - stdlib This commit moves storage domains from different packages to a single place: common/storagedomain.go. This change will help us avoid import cycles when using domains across different packages.
Currently, we use domain string to get StorageMap. Even though we use pre-defined domain strings, this can still be error-prone. This commit modifies GetStorageMap() to use common.StorageDomain instead of string.
…ce-domain-regsiters Combine domain payloads and provide on-the-fly migration
atree.TypeInfo interface used to include Identifier() function. However, Identifier() was removed later and is no longer part of atree.TypeInfo interface. This commit removes Identifier() function from structs implementing atree.TypeInfo interface.
…s-for-atree-typeinfo Remove unused Identifier() function from structs implementing atree.TypeInfo
Refactor storage domains to prevent import cycles and simplify maintenance
This commit replaces domain string, such as "storage", "public", "private", etc. with domain enum (integer) as the key for AccountStorageMap. Also, this uses CBOR to store the domain integer in shortest form. This optimization further improves storage efficiency of domain payloads of PR 3664.
…mbine-domain-payloads Sync `feature/combine-domain-payloads` branch with master
Cadence Benchstat comparisonThis branch with compared with the base branch onflow:feature/compiler commit 4703a34 Collapsed results for better readability
|
SupunS
approved these changes
Jan 29, 2025
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.
Thank you for updating!
jsproz
approved these changes
Jan 29, 2025
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.
Work towards #3742
Description
Merge
master
into the feature branch.Conflict resolution:
master
branchFiles changed
in the Github PR explorer