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

Expose the internal state of Merkle Tree to allow more efficient sub root digest calculation #831

Open
masih opened this issue Jan 16, 2025 · 1 comment

Comments

@masih
Copy link
Member

masih commented Jan 16, 2025

As part of chain exchange, once we receive a chain the key for every subchain of it is calculated to speed up discovery, implemented here. The current implementation uses the naive/simple approach by calling merkle.Tree for every sub chain. This effectively re-hashes the same information over and over for smaller sub-chains.

The digest calculation can be made much cheaper if the merkle implementation exposes internal state such that the intermediate state from calculating the longest sub-chain can be used to calculate the smaller sub-chain digests.

@github-project-automation github-project-automation bot moved this to Todo in F3 Jan 16, 2025
@masih masih added this to the M2: Mainnet Passive Testing milestone Jan 16, 2025
@masih
Copy link
Member Author

masih commented Jan 16, 2025

Discussed in standup 16-01-2025: Lower priority; stretch for M2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant