Skip to content

Timestamp of first block is not validated #2587

@ebuchman

Description

@ebuchman

We only start validating block.Time when Height > 1, because there is no commit to compute the median timestamp from for the first block. This means a faulty proposer could make the first block with whatever time they want.

Instead, we should require the timestamp of block 1 to match the genesis time.

I discovered this while refactoring the ValidateBlock tests to be table-driven while working on tests for #2560.

Metadata

Metadata

Assignees

Labels

C:consensusComponent: ConsensusT:bugType Bug (Confirmed)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions