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

state-sync: State part with only values and boundary nodes, instead of full trie slice #12386

Open
1 task
tayfunelmas opened this issue Nov 5, 2024 · 0 comments
Assignees
Labels
A-chain Area: Chain, client & related community Issues created by community

Comments

@tayfunelmas
Copy link
Contributor

Contact Details

No response

Feature Request

Today we split the state into parts when dumping and sending it to validators that need state sync.

Each part is a slice of the State trie that contains the part of the trie between two boundary keys.

This function implements the core logic for building this slice of the trie:

pub fn get_trie_nodes_for_part_with_flat_storage(

The basic idea is to split the logic in this function (which is all executed on the state-dumper side today) into two parts: the state-dumper still identifies the state values and boundary nodes, but it does not create and traverse the trie at step 3 and 4. The receiver builds the trie from the values and boundary nodes and verifies the part.

The proposal is to send only the leaves and boundary nodes in the state part and building the rest of the trie on the receiver side. This would save from network/disk cost but will add to CPU cost on the receiver side.

Beneficiary

Node operators and nearcore. The difference between network savings versus CPU savings should still be experimented with.

Priority

Medium.

Contributing

  • Yes, I am interested
@tayfunelmas tayfunelmas added A-chain Area: Chain, client & related community Issues created by community labels Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-chain Area: Chain, client & related community Issues created by community
Projects
None yet
Development

No branches or pull requests

2 participants