-
Notifications
You must be signed in to change notification settings - Fork 997
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
Block header signature issue #797
Comments
Initially, I thought this could be fixed by ensuring that However, that raises another issue: all the hashes in latest block roots are just hashes of:
We no longer have I'm guessing this arose as a desire to remove |
Yeah, you're right there's a circular dependency. If we want the pre-state root of block N+1 to include a commitment to the signature, then the signature can't be over the post-state-root of block N as that's the same as the pre-state root of block N+1. I'm inclined to say
I don't think we need to worry about this, because the state root itself does get included in the header (at the start of processing the next block). |
Argh, I messed up!
One of the considerations discussed with @djrtwo is cleanliness around identifier schemes. We probably want to have a consistent "canonical" notion of message identifier, if anything for block explorers. If we exclude signatures then we may end up with the two types of identifiers used in the wild. Also, if we exclude signatures from block identifiers we may want to the same thing for attestations, transfers, etc. Maybe the best approach is simply to revert to a |
|
Possible fix for #797. (Not lobbying for this, merely putting it up as an option.)
Possible fix for #797. Revert back to `(pre_state, previous_block_root, block) -> (post_state, error)` state transition function with "oracle access" to `previous_block_root`.
Ok, I think I've found a satisfactory solution (see #799). Basically we remove |
I'm currently thinking that the cleanest way forward is to use @JustinDrake We can use EDIT: I was wondering why this didn't come up in tests and realized it is essentially what was being done in the tests anyway. I was assuming |
The main challenge with this is that it introduces another point of ugliness which is the distinction between "signed post-state root" and "real post-state root". |
Here's what seems to be a complete categorization of alternatives:
(1) is current status quo, (4) is original status quo. (3) is just a version of (4). (5) seems bad because it means that "a chain" does not contain enough information to build on top of the chain (namely, the signature). (2) seems annoying because it creates the distinction between "signed post-state root" and "real post-state root", unless we change the rule so the state root of a block is the pre-state root, which seems like a bad idea. |
I'm opting for (1) with the modification that we cache block roots as PR here #816 |
This was fixed in 0.5.1 |
state.latest_block_header.signature
is different between producing and processing a block and this is causing block processing to fail because of a mismatch onblock.state_root
.Producing
When calling
per_block_processing
,state.latest_block_header.signature
isEMPTY_SIGNATURE
.It's impossible to have the real block signature here as you need the output of
per_block_processing(..)
(the updated state root) before you can produce thestate.latest_block_header.signature
and the value ofstate.latest_block_header.signature
changes the state root, which changes the signature, and so on.Processing
When calling
per_block_processing
,state.latest_block_header.signature
is (hopefully) a real block signature.The text was updated successfully, but these errors were encountered: