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

Timestamp of first block is not validated #2587

Closed
ebuchman opened this issue Oct 9, 2018 · 1 comment
Closed

Timestamp of first block is not validated #2587

ebuchman opened this issue Oct 9, 2018 · 1 comment
Assignees
Labels
C:consensus Component: Consensus T:bug Type Bug (Confirmed)
Milestone

Comments

@ebuchman
Copy link
Contributor

ebuchman commented Oct 9, 2018

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.

@ebuchman ebuchman added T:bug Type Bug (Confirmed) C:consensus Component: Consensus labels Oct 9, 2018
@ebuchman ebuchman added this to the launch milestone Oct 9, 2018
@melekes melekes self-assigned this Oct 10, 2018
melekes added a commit that referenced this issue Oct 10, 2018
Refs #2587:

```
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.
```
ebuchman pushed a commit that referenced this issue Oct 12, 2018
* require block.Time of the fist block to be genesis time

Refs #2587:

```
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.
```

* do not accept blocks with negative height

* update changelog and spec

* nanos precision for test genesis time

* Fix failing test (#2607)
@ebuchman
Copy link
Contributor Author

Merged in #2594

iKapitonau pushed a commit to scrtlabs/tendermint that referenced this issue Jul 10, 2024
…2584) (tendermint#2587)

This is an automatic backport of pull request tendermint#2584 done by
[Mergify](https://mergify.com).


---


<details>
<summary>Mergify commands and options</summary>

<br />

More conditions and actions can be found in the
[documentation](https://docs.mergify.com/).

You can also trigger Mergify actions by commenting on this pull request:

- `@Mergifyio refresh` will re-evaluate the rules
- `@Mergifyio rebase` will rebase this PR on its base branch
- `@Mergifyio update` will merge the base branch into this PR
- `@Mergifyio backport <destination>` will backport this PR on
`<destination>` branch

Additionally, on Mergify [dashboard](https://dashboard.mergify.com) you
can:

- look at your merge queues
- generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com
</details>

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:consensus Component: Consensus T:bug Type Bug (Confirmed)
Projects
None yet
Development

No branches or pull requests

2 participants