Skip to content

Conversation

@noot
Copy link
Contributor

@noot noot commented Nov 1, 2023

Summary

previously, we were storing a block's last_commit in SequencerBlockData and verifying it in the conductor. however, we were never doing anything (correctly) with this commit verification - if it failed, we would reject the current block, where we should have rejected the previous. also, we don't want to delay block execution 1 block by waiting for the canonical commit in the next block, as we can retrieve a valid commit for the latest block from our sequencer node the moment the block is finalized.

Background

see summary.

also, note that the tendermint latest block is finalized and thus will always have a commit available for it, so this PR changes the verification code in conductor to fetch and use that commit when verifying a block from DA. we don't care if the commit is canonical, as whichever commit we receive will be valid, since the block would not have finalized without it. (canonical meaning the commit all nodes agreed on, aka last_commit. at the moment of finalization, nodes on the network will see different sets of >2/3 votes which consist of their local commit for the block, the "canonical commit" is not chosen until the next block is finalized)

Changes

  • remove last_commit from SequencerBlockData
  • update conductor block verification code to fetch the commit for that block from the sequencer and verify it. last_commit is no longer used as it is not relevant.

Testing

unit tests

Breaking Changelist

  • SequencerBlockData no longer contains last_commit

Related Issues

closes #401

@github-actions github-actions bot added the conductor pertaining to the astria-conductor crate label Nov 1, 2023
@noot noot changed the title rector: verify current block commit in conductor; remove last_commit from SequencerBlockData refactor: verify current block commit in conductor; remove last_commit from SequencerBlockData Nov 1, 2023
@github-actions github-actions bot added the composer pertaining to composer label Nov 1, 2023
@github-actions github-actions bot removed the composer pertaining to composer label Nov 2, 2023
block,
block::{
self,
Commit,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't import Commit directly, just qualify with block::Commit.

Copy link
Contributor

@SuperFluffy SuperFluffy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks, I like the simplification.

@noot noot merged commit 95a0be1 into main Nov 6, 2023
@noot noot deleted the noot/commit-verification branch November 6, 2023 18:33
sambukowski pushed a commit that referenced this pull request Nov 6, 2023
…it` from `SequencerBlockData` (#560)

## Summary
previously, we were storing a block's `last_commit` in
`SequencerBlockData` and verifying it in the conductor. however, we were
never doing anything (correctly) with this commit verification - if it
failed, we would reject the *current* block, where we should have
rejected the previous. also, we don't want to delay block execution 1
block by waiting for the canonical commit in the next block, as we can
retrieve a valid commit for the latest block from our sequencer node the
moment the block is finalized.

## Background
see summary.

also, note that the tendermint latest block is finalized and thus will
always have a commit available for it, so this PR changes the
verification code in conductor to fetch and use that commit when
verifying a block from DA. we don't care if the commit is canonical, as
whichever commit we receive will be valid, since the block would not
have finalized without it. (canonical meaning the commit all nodes
agreed on, aka `last_commit`. at the moment of finalization, nodes on
the network will see different sets of >2/3 votes which consist of their
local commit for the block, the "canonical commit" is not chosen until
the next block is finalized)

## Changes
-  remove `last_commit` from `SequencerBlockData`
- update conductor block verification code to fetch the commit for
*that* block from the sequencer and verify it. `last_commit` is no
longer used as it is not relevant.

## Testing
unit tests

## Breaking Changelist
- `SequencerBlockData` no longer contains `last_commit`

## Related Issues

closes #401
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conductor pertaining to the astria-conductor crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

conductor: remove unnecessary commit verification

4 participants