Delete old database schemas (#6051)

* Delete old database schemas

* Fix docs (thanks CK)

* Fix beacon-chain tests
This commit is contained in:
Michael Sproul
2024-07-09 10:24:49 +10:00
committed by GitHub
parent a59a61fef9
commit 9942c18c11
14 changed files with 32 additions and 528 deletions

View File

@@ -70,7 +70,7 @@ impl InvalidationOperation {
pub type ProtoNode = ProtoNodeV17;
#[superstruct(
variants(V16, V17),
variants(V17),
variant_attributes(derive(Clone, PartialEq, Debug, Encode, Decode, Serialize, Deserialize)),
no_enum
)]
@@ -92,12 +92,6 @@ pub struct ProtoNode {
pub root: Hash256,
#[ssz(with = "four_byte_option_usize")]
pub parent: Option<usize>,
#[superstruct(only(V16))]
#[ssz(with = "four_byte_option_checkpoint")]
pub justified_checkpoint: Option<Checkpoint>,
#[superstruct(only(V16))]
#[ssz(with = "four_byte_option_checkpoint")]
pub finalized_checkpoint: Option<Checkpoint>,
#[superstruct(only(V17))]
pub justified_checkpoint: Checkpoint,
#[superstruct(only(V17))]
@@ -116,57 +110,6 @@ pub struct ProtoNode {
pub unrealized_finalized_checkpoint: Option<Checkpoint>,
}
impl TryInto<ProtoNode> for ProtoNodeV16 {
type Error = Error;
fn try_into(self) -> Result<ProtoNode, Error> {
let result = ProtoNode {
slot: self.slot,
state_root: self.state_root,
target_root: self.target_root,
current_epoch_shuffling_id: self.current_epoch_shuffling_id,
next_epoch_shuffling_id: self.next_epoch_shuffling_id,
root: self.root,
parent: self.parent,
justified_checkpoint: self
.justified_checkpoint
.ok_or(Error::MissingJustifiedCheckpoint)?,
finalized_checkpoint: self
.finalized_checkpoint
.ok_or(Error::MissingFinalizedCheckpoint)?,
weight: self.weight,
best_child: self.best_child,
best_descendant: self.best_descendant,
execution_status: self.execution_status,
unrealized_justified_checkpoint: self.unrealized_justified_checkpoint,
unrealized_finalized_checkpoint: self.unrealized_finalized_checkpoint,
};
Ok(result)
}
}
impl From<ProtoNode> for ProtoNodeV16 {
fn from(from: ProtoNode) -> ProtoNodeV16 {
ProtoNodeV16 {
slot: from.slot,
state_root: from.state_root,
target_root: from.target_root,
current_epoch_shuffling_id: from.current_epoch_shuffling_id,
next_epoch_shuffling_id: from.next_epoch_shuffling_id,
root: from.root,
parent: from.parent,
justified_checkpoint: Some(from.justified_checkpoint),
finalized_checkpoint: Some(from.finalized_checkpoint),
weight: from.weight,
best_child: from.best_child,
best_descendant: from.best_descendant,
execution_status: from.execution_status,
unrealized_justified_checkpoint: from.unrealized_justified_checkpoint,
unrealized_finalized_checkpoint: from.unrealized_finalized_checkpoint,
}
}
}
#[derive(PartialEq, Debug, Encode, Decode, Serialize, Deserialize, Copy, Clone)]
pub struct ProposerBoost {
pub root: Hash256,