-
Notifications
You must be signed in to change notification settings - Fork 221
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
feat!: add new header field #6686
feat!: add new header field #6686
Conversation
Test Results (CI) 3 files 129 suites 35m 36s ⏱️ Results for commit 389c3d2. ♻️ This comment has been updated with latest results. |
Test Results (Integration tests) 2 files + 2 11 suites +11 25m 18s ⏱️ + 25m 18s For more details on these failures, see this check. Results for commit 389c3d2. ± Comparison against base commit a2aa20e. ♻️ This comment has been updated with latest results. |
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.
utACK
Looks good, some nits only, apart from CI that should pass
Description --- Add new header field, block output mmr which only tracks outputs in current block Motivation and Context --- This is needed in order to validate that all outputs included in the block is correctly captured in the pow of the header. The current strategy is to only use the output smt, which commits to all outputs on the blockchain. This is required for horizon sync and prune mode to verify the blockchain as we sync. But someone else wants to verify the block outputs, they have to have the entire outputs set aka entire blockchain in order to verify that the outputs are indeed locked behind pow. This addition allows any person to take only the block and know that the outputs contained in that block, is correctly locked behind the pow of the header. The output field is constructed as two merkle mountain ranges. the primary one used in the header field is constructed as [coinbase_1, coinbase_2, .., coinbase_x, non_coinbase_ouputs_merkle_root] with the non_coinbase_ouputs_merkle_root constructed as [output_1, output_2, .., output_x] This double mountain range approach allows you to prove the output are in the block header, as well as create a proof for a specific output. But separating them allows p2pool to only need to store a single hash + list of all outputs in order to verify all coin bases are correctly included in the header. Rather than all outputs or before this pr, the entire block. Breaking change --- Need to resync database
Description
Add new header field, block output mmr which only tracks outputs in current block
Motivation and Context
This is needed in order to validate that all outputs included in the block is correctly captured in the pow of the header. The current strategy is to only use the output smt, which commits to all outputs on the blockchain. This is required for horizon sync and prune mode to verify the blockchain as we sync.
But someone else wants to verify the block outputs, they have to have the entire outputs set aka entire blockchain in order to verify that the outputs are indeed locked behind pow.
This addition allows any person to take only the block and know that the outputs contained in that block, is correctly locked behind the pow of the header.
The output field is constructed as two merkle mountain ranges.
the primary one used in the header field is constructed as
[coinbase_1, coinbase_2, .., coinbase_x, non_coinbase_ouputs_merkle_root]
with the non_coinbase_ouputs_merkle_root constructed as
[output_1, output_2, .., output_x]
This double mountain range approach allows you to prove the output are in the block header, as well as create a proof for a specific output. But separating them allows p2pool to only need to store a single hash + list of all outputs in order to verify all coin bases are correctly included in the header. Rather than all outputs or before this pr, the entire block.
Breaking change
Need to resync database