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

Cleanup block header fields #9640

Open
Longarithm opened this issue Oct 5, 2023 · 0 comments
Open

Cleanup block header fields #9640

Longarithm opened this issue Oct 5, 2023 · 0 comments
Labels
C-housekeeping Category: Refactoring, cleanups, code quality T-core Team: issues relevant to the core team

Comments

@Longarithm
Copy link
Member

Longarithm commented Oct 5, 2023

There are many fields in block header (BlockHeader::BlockHeaderV5, as of 5 Oct 2023), which are either not used, or their usecase is unclear. This leads to unclear block validation logic, see https://github.com/near/nearcore-private/issues/38. The good practice is to sign as less data as possible, to minimize vulnerability angles, in cases when malicious actor sends invalid data.

We can take analysis from #9618 and:

  • remove obviously unused fields, like challenges_*, chunk_tx_root.
  • specify use case of fields like block_ordinal, epoch_sync_data_hash , prev_validator_proposals. Document why we need to sign these fields.
  • group necessary fields by usecases to simplify reading, for example:
    • fields for runtime: gas price - to deduct balances correctly, random value - to use randomness in contracts, etc.
    • fields for epoch manager: validator_proposals, chunk_mask, latest_protocol_version
    • consensus: approvals, *_final_block, ...
    • something else?
@Longarithm Longarithm added C-housekeeping Category: Refactoring, cleanups, code quality T-core Team: issues relevant to the core team labels Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-housekeeping Category: Refactoring, cleanups, code quality T-core Team: issues relevant to the core team
Projects
None yet
Development

No branches or pull requests

1 participant