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

Use EMPTY_SIGNATURE for temporary block header #796

Closed
wants to merge 1 commit into from

Conversation

paulhauner
Copy link
Contributor

@paulhauner paulhauner commented Mar 18, 2019

What

Changes get_temporary_block_header(..) to use EMPTY_SIGNATURE instead of block.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 is EMPTY_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 the state.latest_block_header.signature and the value of state.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.

@paulhauner
Copy link
Contributor Author

paulhauner commented Mar 18, 2019

Now I run this on more blocks I'm not sure this PR is comprehensive. I'm going to move this to #797.

@paulhauner paulhauner closed this Mar 18, 2019
@paulhauner paulhauner deleted the patch-13 branch March 18, 2019 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant