-
Notifications
You must be signed in to change notification settings - Fork 7
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
Use lazily loaded Merkle Tree root as EC Chain Key #825
Milestone
Comments
masih
added a commit
that referenced
this issue
Jan 20, 2025
Remove the custom ECChain key generation inside `gpbft` in favor of consistently using Merkle Tree root of chain as key. This key is already used for signature payload generation, and in the new chain exchange as a key to identify a chain. Doing so enables signature validation of messages without having to know the chain. Consistent use of Merkle Tree root hash as key enables a number of simplifications across the repo: * unblocks the unification of validation logic between partial and full validators, since caching can use a consistent way to identify messages whether they're partial or not. * reduce various type gymnastics across root and chain exchange packages by repurposing gpbft ECChain Key. The work here also introduces lazy-loading for the ECChain, which requires ECChain type to be converted to `struct`, and be passed by pointer. As part of this work, TipSet is also turned into a pointer consistently across various interfaces. The ECChain receiver functions are adopted to accommodate potential nil values for a chain. Fixes #825
masih
added a commit
that referenced
this issue
Jan 20, 2025
Remove the custom ECChain key generation inside `gpbft` in favor of consistently using Merkle Tree root of chain as key. This key is already used for signature payload generation, and in the new chain exchange as a key to identify a chain. Doing so enables signature validation of messages without having to know the chain. Consistent use of Merkle Tree root hash as key enables a number of simplifications across the repo: * unblocks the unification of validation logic between partial and full validators, since caching can use a consistent way to identify messages whether they're partial or not. * reduce various type gymnastics across root and chain exchange packages by repurposing gpbft ECChain Key. The work here also introduces lazy-loading for the ECChain, which requires ECChain type to be converted to `struct`, and be passed by pointer. As part of this work, TipSet is also turned into a pointer consistently across various interfaces. The ECChain receiver functions are adopted to accommodate potential nil values for a chain. Fixes #825
masih
added a commit
that referenced
this issue
Jan 20, 2025
Remove the custom ECChain key generation inside `gpbft` in favor of consistently using Merkle Tree root of chain as key. This key is already used for signature payload generation, and in the new chain exchange as a key to identify a chain. Doing so enables signature validation of messages without having to know the chain. Consistent use of Merkle Tree root hash as key enables a number of simplifications across the repo: * unblocks the unification of validation logic between partial and full validators, since caching can use a consistent way to identify messages whether they're partial or not. * reduce various type gymnastics across root and chain exchange packages by repurposing gpbft ECChain Key. The work here also introduces lazy-loading for the ECChain, which requires ECChain type to be converted to `struct`, and be passed by pointer. As part of this work, TipSet is also turned into a pointer consistently across various interfaces. The ECChain receiver functions are adopted to accommodate potential nil values for a chain. Fixes #825
masih
added a commit
that referenced
this issue
Jan 24, 2025
Remove the custom ECChain key generation inside `gpbft` in favor of consistently using Merkle Tree root of chain as key. This key is already used for signature payload generation, and in the new chain exchange as a key to identify a chain. Doing so enables signature validation of messages without having to know the chain. Consistent use of Merkle Tree root hash as key enables a number of simplifications across the repo: * unblocks the unification of validation logic between partial and full validators, since caching can use a consistent way to identify messages whether they're partial or not. * reduce various type gymnastics across root and chain exchange packages by repurposing gpbft ECChain Key. The work here also introduces lazy-loading for the ECChain, which requires ECChain type to be converted to `struct`, and be passed by pointer. As part of this work, TipSet is also turned into a pointer consistently across various interfaces. The ECChain receiver functions are adopted to accommodate potential nil values for a chain. Fixes #825
masih
added a commit
that referenced
this issue
Jan 24, 2025
Remove the custom ECChain key generation inside `gpbft` in favor of consistently using Merkle Tree root of chain as key. This key is already used for signature payload generation, and in the new chain exchange as a key to identify a chain. Doing so enables signature validation of messages without having to know the chain. Consistent use of Merkle Tree root hash as key enables a number of simplifications across the repo: * unblocks the unification of validation logic between partial and full validators, since caching can use a consistent way to identify messages whether they're partial or not. * reduce various type gymnastics across root and chain exchange packages by repurposing gpbft ECChain Key. The work here also introduces lazy-loading for the ECChain, which requires ECChain type to be converted to `struct`, and be passed by pointer. As part of this work, TipSet is also turned into a pointer consistently across various interfaces. The ECChain receiver functions are adopted to accommodate potential nil values for a chain. Fixes #825
github-merge-queue bot
pushed a commit
that referenced
this issue
Jan 24, 2025
* Consistently use Merkle Tree root as ECChain key Remove the custom ECChain key generation inside `gpbft` in favor of consistently using Merkle Tree root of chain as key. This key is already used for signature payload generation, and in the new chain exchange as a key to identify a chain. Doing so enables signature validation of messages without having to know the chain. Consistent use of Merkle Tree root hash as key enables a number of simplifications across the repo: * unblocks the unification of validation logic between partial and full validators, since caching can use a consistent way to identify messages whether they're partial or not. * reduce various type gymnastics across root and chain exchange packages by repurposing gpbft ECChain Key. The work here also introduces lazy-loading for the ECChain, which requires ECChain type to be converted to `struct`, and be passed by pointer. As part of this work, TipSet is also turned into a pointer consistently across various interfaces. The ECChain receiver functions are adopted to accommodate potential nil values for a chain. Fixes #825 * Bump timeout for `TestF3LateBootstrap` to unblock progress * Bump timeout for `TestF3PauseResumeCatchup` to unblock progress * Bump timeout for `TestF3LateBootstrap` to unblock progress Bumped timeout to 2 m, just to see if CI passes.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The current implementation uses two approaches for generating key for a given EC Chain:
ChainKey
construction by hashing each of the tipsetsThere are historical reasons for this: e.g. the first approach predates the second. But there is no technical reason for having two separate approaches.
In terms of computational expense, the first approach is cheaper than the second one. But in practice:
This means, if merkle tree root is generated once and cached as part of ECChain struct the computational expense becomes a non-issue if not cheaper.
Additionally, this approach would benefit #792, because chainexchange no longer needs to own the concept of generating keys for chains. We can just call
ECChain.Key
and use the same key across the entire implementation.On approach, the idea is to use
sync.Once
and cache the merkle tree root as key lazily.The text was updated successfully, but these errors were encountered: