Skip to content

Commit

Permalink
validate chain config fetched from db during catchup (#2095)
Browse files Browse the repository at this point in the history
* validate chain config from db

* replace with panic
  • Loading branch information
imabdulbasit authored Oct 8, 2024
1 parent 922be9c commit 9478ec2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion sequencer/src/catchup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,18 @@ where
&self,
commitment: Commitment<ChainConfig>,
) -> anyhow::Result<ChainConfig> {
self.db.get_chain_config(commitment).await
let cf = self.db.get_chain_config(commitment).await?;

if cf.commit() != commitment {
panic!(
"Critical error: Mismatched chain config detected. Expected chain config: {:?}, but got: {:?}.
This may indicate a compromised database",
commitment,
cf.commit()
)
}

Ok(cf)
}

fn backoff(&self) -> &BackoffParams {
Expand Down

0 comments on commit 9478ec2

Please sign in to comment.