Skip to content

Conversation

@noot
Copy link
Contributor

@noot noot commented Apr 30, 2024

Summary

set current app hash properly when creating app

Background

this was causing issues if the node was restarted as the app hash would be empty, and this is written to state in ibc begin_block, causing an app hash mismatch on the next synced block

Changes

  • set current app hash properly when creating app

Testing

local testnet with 4 validators and restarting one node, previously failed, now it works

@noot noot requested a review from a team as a code owner April 30, 2024 00:29
@noot noot requested a review from SuperFluffy April 30, 2024 00:29
@github-actions github-actions bot added the sequencer pertaining to the astria-sequencer crate label Apr 30, 2024
@noot noot changed the title fix(sequencer): set current app hash properly when initializing app fix(sequencer): set current app hash properly when creating app Apr 30, 2024
pub(crate) async fn new(snapshot: Snapshot) -> anyhow::Result<Self> {
tracing::debug!("initializing App instance");

let app_hash: AppHash = snapshot
Copy link
Member

Choose a reason for hiding this comment

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

will this fail if init_chain has not been called yet?

Copy link
Contributor Author

@noot noot Apr 30, 2024

Choose a reason for hiding this comment

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

no, it'll just return the root hash of an empty tree. confirmed that syncing from genesis with an empty state works

@noot noot added this pull request to the merge queue Apr 30, 2024
Merged via the queue into main with commit 6fac8bb Apr 30, 2024
@noot noot deleted the noot/app-hash-fix branch April 30, 2024 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sequencer pertaining to the astria-sequencer crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants