Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
use correct consensus state root
Browse files Browse the repository at this point in the history
  • Loading branch information
rnbguy committed Jun 11, 2024
1 parent 8cf305b commit cc11b18
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions modules/sov-consensus-state-tracker/src/celestia_da.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use sov_rollup_interface::da::BlockHeaderTrait;
use crate::HasConsensusState;

impl HasConsensusState for CelestiaSpec {
fn consensus_state(header: &CelestiaHeader) -> HostConsensusState {
let sovereign_params = CommitmentRoot::from_bytes(header.hash().as_ref()).into();
fn consensus_state(header: &CelestiaHeader, user_hash: [u8; 32]) -> HostConsensusState {
let sovereign_params = CommitmentRoot::from_bytes(&user_hash).into();

let da_params = TmConsensusParams::new(
tendermint::Time::from_unix_timestamp(
Expand Down
4 changes: 2 additions & 2 deletions modules/sov-consensus-state-tracker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use sov_state::Storage;
/// Implement HasConsensusState for all DaSpecs that you wish to support, and
/// extract the consensus state from the header.
pub trait HasConsensusState: DaSpec {
fn consensus_state(header: &Self::BlockHeader) -> HostConsensusState;
fn consensus_state(header: &Self::BlockHeader, user_hash: [u8; 32]) -> HostConsensusState;
}

#[derive(Clone)]
Expand Down Expand Up @@ -137,7 +137,7 @@ where
.host_height_map
.set(&height, kernel_working_set.inner);

let consensus_state = Da::consensus_state(slot_header);
let consensus_state = Da::consensus_state(slot_header, pre_state_root.clone().into());

self.ibc.host_timestamp_map.set(
&consensus_state.timestamp().into(),
Expand Down
4 changes: 2 additions & 2 deletions modules/sov-consensus-state-tracker/src/mock_da.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use sov_rollup_interface::da::BlockHeaderTrait;
use crate::HasConsensusState;

impl HasConsensusState for MockDaSpec {
fn consensus_state(header: &Self::BlockHeader) -> HostConsensusState {
let sovereign_params = CommitmentRoot::from_bytes(header.hash().as_ref()).into();
fn consensus_state(header: &Self::BlockHeader, user_hash: [u8; 32]) -> HostConsensusState {
let sovereign_params = CommitmentRoot::from_bytes(&user_hash).into();

let da_params = TmConsensusParams::new(
tendermint::Time::from_unix_timestamp(
Expand Down

0 comments on commit cc11b18

Please sign in to comment.