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

Chain MMR commitment in block headers #305

Closed
bobbinth opened this issue Nov 3, 2023 · 1 comment · Fixed by #421
Closed

Chain MMR commitment in block headers #305

bobbinth opened this issue Nov 3, 2023 · 1 comment · Fixed by #421
Assignees
Milestone

Comments

@bobbinth
Copy link
Contributor

bobbinth commented Nov 3, 2023

As pointed out by @plafer, block header cannot contain current chain MMR commitment because this would make the block header self-referential (e.g., we need MMR commitment to compute block header hash and we need block header hash to compute the current MMR commitment).

One solution to this is to say that current block header contain commitment to the chain MMR prior to this block. That is, current MMR at block height $n$ is a combination of block_header.chain_root at block $n$ and the block header itself.

Conceptually, this shouldn't break anything - but we need to be careful in several places and potentially make some updates. Specifically:

  • In the transaction kernel, chain_root in the specified block header cannot be used to verify inclusion of notes created in the block. I'm not sure if this breaks anything (it might) - but if it does, there are probably a couple of ways to fix it. cc @frisitano
  • The MMR data returned from various store/RPC endpoints, we may need to return not the current data but the data as of last block (this probably affects sync_state and get_block_inputs endpoints). cc @hackaugusto.

There are may be also other solutions to address this - so, any suggestions are welcome.

@frisitano
Copy link
Contributor

I don't think there are any implications here for the transaction kernel. This would be relevant in the context of the block kernel when constructing new blocks. The way I see this working is in the prologue of the block kernel we read in the block hash and chain root of the previous block and insert the previous block hash into the mmr to get the new chain root.

Currently in the testing we have it structured as you described. Block header for block number 4 contains a commitment to the chain root of the mmr which includes blocks 0 - 3.

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

Successfully merging a pull request may close this issue.

2 participants