Skip to content

Commit

Permalink
Backwards compatible PersistedBeaconChain
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed Dec 24, 2024
1 parent fc623fe commit f4d44e4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions beacon_node/beacon_chain/src/beacon_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
PersistedBeaconChain {
_canonical_head_block_root: DUMMY_CANONICAL_HEAD_BLOCK_ROOT,
genesis_block_root,
ssz_head_tracker: <_>::default(),
}
}

Expand Down
11 changes: 10 additions & 1 deletion beacon_node/beacon_chain/src/persisted_beacon_chain.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use ssz::{Decode, Encode};
use ssz_derive::{Decode, Encode};
use store::{DBColumn, Error as StoreError, StoreItem};
use types::Hash256;
use types::{Hash256, Slot};

/// Dummy value to use for the canonical head block root, see below.
pub const DUMMY_CANONICAL_HEAD_BLOCK_ROOT: Hash256 = Hash256::repeat_byte(0xff);
Expand All @@ -17,6 +17,15 @@ pub struct PersistedBeaconChain {
/// https://github.com/sigp/lighthouse/issues/1784
pub _canonical_head_block_root: Hash256,
pub genesis_block_root: Hash256,
/// DEPRECATED
pub ssz_head_tracker: SszHeadTracker,
}

/// DEPRECATED
#[derive(Encode, Decode, Clone, Default)]
pub struct SszHeadTracker {
roots: Vec<Hash256>,
slots: Vec<Slot>,
}

impl StoreItem for PersistedBeaconChain {
Expand Down

0 comments on commit f4d44e4

Please sign in to comment.