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

Add merkle tree of the block headers of the epoch into the block header #2632

Closed
MaksymZavershynskyi opened this issue May 12, 2020 · 2 comments · Fixed by #2643
Closed

Add merkle tree of the block headers of the epoch into the block header #2632

MaksymZavershynskyi opened this issue May 12, 2020 · 2 comments · Fixed by #2643
Assignees
Labels
A-chain Area: Chain, client & related P-critical Priority: critical

Comments

@MaksymZavershynskyi
Copy link
Contributor

Supersedes the design proposed here: #2631

As discussed with @k06a , @abacabadabacaba , @SkidanovAlex , @bowenwang1996 we won't be able to submit every LightClientBlockView into Near2EthClient, because there are too many of them. Instead, we will be submitting it once every epoch. However, this means that if one wants to verify a proof towards certain transaction outcome they would need to submit a proof that chains through all blocks until the submitted block. Such chain would be too long to process, since we have ~43k blocks in epoch. Instead we decided to compute merkle tree of all blocks up to the current block and store its root in the block header.

@MaksymZavershynskyi MaksymZavershynskyi added A-chain Area: Chain, client & related P-critical Priority: critical labels May 12, 2020
@MaksymZavershynskyi
Copy link
Contributor Author

Setting estimate to 13 (~2 weeks) which is how @bowenwang1996 estimated the work. Also setting priority to P0 since this is blocking the rest of our work on the bridge, like making sure the Near2EthProver works correctly, and also our bridge work is P0.

@MaksymZavershynskyi
Copy link
Contributor Author

This sounds simpler than #2631 so adjusting estimate to 8. @bowenwang1996 please adjust it if you think it is incorrect.

bowenwang1996 added a commit that referenced this issue May 18, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Add block merkle root to block header so that we light client can verify transaction outcomes in blocks that are not known by the light client. Resolves #2632.

Test plan
----------
* Unit tests `test_merkle_tree` and `test_invalid_block_merkle_root`.
* Manually trigger nightly to see if anything breaks.
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 P-critical Priority: critical
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants