Use EMPTY_SIGNATURE
for temporary block header
#796
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Changes
get_temporary_block_header(..)
to useEMPTY_SIGNATURE
instead ofblock.signature
.Why
state.latest_block_header.signature
is different between producing and processing a block.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.