Skip to content

Commit 3fe51be

Browse files
michaelsproulWoodpile37
authored andcommitted
Delete DB schema migrations for v11 and earlier (sigp#3761)
## Proposed Changes Now that the Gnosis merge is scheduled, all users should have upgraded beyond Lighthouse v3.0.0. Accordingly we can delete schema migrations for versions prior to v3.0.0. ## Additional Info I also deleted the state cache stuff I added in sigp#3714 as it turned out to be useless for the light client proofs due to the one-slot offset.
1 parent 4408d2d commit 3fe51be

1 file changed

Lines changed: 0 additions & 40 deletions

File tree

beacon_node/beacon_chain/src/beacon_chain.rs

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -999,46 +999,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
999999
Ok(self.store.get_state(state_root, slot)?)
10001000
}
10011001

1002-
/// Run a function with mutable access to a state for `block_root`.
1003-
///
1004-
/// The primary purpose of this function is to borrow a state with its tree hash cache
1005-
/// from the snapshot cache *without moving it*. This means that calls to this function should
1006-
/// be kept to an absolute minimum, because holding the snapshot cache lock has the ability
1007-
/// to delay block import.
1008-
///
1009-
/// If there is no appropriate state in the snapshot cache then one will be loaded from disk.
1010-
/// If no state is found on disk then `Ok(None)` will be returned.
1011-
///
1012-
/// The 2nd parameter to the closure is a bool indicating whether the snapshot cache was used,
1013-
/// which can inform logging/metrics.
1014-
///
1015-
/// NOTE: the medium-term plan is to delete this function and the snapshot cache in favour
1016-
/// of `tree-states`, where all caches are CoW and everything is good in the world.
1017-
pub fn with_mutable_state_for_block<F, V, Payload: ExecPayload<T::EthSpec>>(
1018-
&self,
1019-
block: &SignedBeaconBlock<T::EthSpec, Payload>,
1020-
block_root: Hash256,
1021-
f: F,
1022-
) -> Result<Option<V>, Error>
1023-
where
1024-
F: FnOnce(&mut BeaconState<T::EthSpec>, bool) -> Result<V, Error>,
1025-
{
1026-
if let Some(state) = self
1027-
.snapshot_cache
1028-
.try_write_for(BLOCK_PROCESSING_CACHE_LOCK_TIMEOUT)
1029-
.ok_or(Error::SnapshotCacheLockTimeout)?
1030-
.borrow_unadvanced_state_mut(block_root)
1031-
{
1032-
let cache_hit = true;
1033-
f(state, cache_hit).map(Some)
1034-
} else if let Some(mut state) = self.get_state(&block.state_root(), Some(block.slot()))? {
1035-
let cache_hit = false;
1036-
f(&mut state, cache_hit).map(Some)
1037-
} else {
1038-
Ok(None)
1039-
}
1040-
}
1041-
10421002
/// Return the sync committee at `slot + 1` from the canonical chain.
10431003
///
10441004
/// This is useful when dealing with sync committee messages, because messages are signed

0 commit comments

Comments
 (0)