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

[1.0.1] Verify block signature first when creating block_state #700

Merged
merged 4 commits into from
Sep 6, 2024

Conversation

heifner
Copy link
Member

@heifner heifner commented Sep 4, 2024

When creating a block_state, verify the block signature before ingesting anything from the block.

@heifner heifner requested a review from arhag September 4, 2024 19:00
@heifner heifner added the OCI Work exclusive to OCI team label Sep 4, 2024
@heifner heifner changed the title [1.01] Verify block signature first when creating block_state [1.0.1] Verify block signature first when creating block_state Sep 4, 2024
@greg7mdp
Copy link
Contributor

greg7mdp commented Sep 4, 2024

Shouldn't we verify the block signature even before we start validating the block header extensions? First thing in create_block_state_i?

@heifner
Copy link
Member Author

heifner commented Sep 4, 2024

Shouldn't we verify the block signature even before we start validating the block header extensions? First thing in create_block_state_i?

I think in general we should consider verification to be allowed in parallel. The point of this PR is that we complete block signature verification before integrating the block. The order of any verification before integration shouldn't matter.

@greg7mdp
Copy link
Contributor

greg7mdp commented Sep 4, 2024

Shouldn't we verify the block signature even before we start validating the block header extensions? First thing in create_block_state_i?

I think in general we should consider verification to be allowed in parallel. The point of this PR is that we complete block signature verification before integrating the block. The order of any verification before integration shouldn't matter.

In general I agree, except that our extension/qc verification code itself could have bugs causing nodeos to abort. It seems safer to be to validate signatures first (old reliable code), to ensure that the block header extensions that we verify next were not tampered with.

@heifner heifner added this to the Spring v1.0.1 milestone Sep 4, 2024
@ericpassmore
Copy link
Contributor

ericpassmore commented Sep 5, 2024

Note:start
group: STABILITY
category: INTERNALS
summary: When creating a block_state, verify the block signature before ingesting anything from the block.
Note:end

Base automatically changed from legacy_qc_ext_checks-harden-checks to release/1.0 September 5, 2024 02:37
@heifner heifner requested a review from greg7mdp September 5, 2024 12:11
libraries/chain/block_state.cpp Outdated Show resolved Hide resolved
@heifner heifner self-assigned this Sep 5, 2024
@heifner heifner requested a review from linh2931 September 5, 2024 18:19
@heifner heifner merged commit a7fbf07 into release/1.0 Sep 6, 2024
36 checks passed
@heifner heifner deleted the verify_block_sig_first branch September 6, 2024 15:36
@ericpassmore
Copy link
Contributor

Note:start
category: Other
component: Internal
summary: When creating a block_state, verify the block signature before ingesting anything from the block.
Note:end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI Work exclusive to OCI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants