Refactoring Checkpoint: (WIP)

This commit is contained in:
2025-12-14 10:29:31 +03:00
parent 6588d9a1f2
commit 0c5d19e3a0
1423 changed files with 6413 additions and 6062 deletions
@@ -17,14 +17,14 @@
//! Utilities for checking whether a candidate has been approved under a given block.
use bitvec::{order::Lsb0 as BitOrderLsb0, slice::BitSlice};
use pezkuwi_node_primitives::approval::v1::DelayTranche;
use pezkuwi_pez_node_primitives::approval::v1::DelayTranche;
use pezkuwi_primitives::ValidatorIndex;
use crate::{
persisted_entries::{ApprovalEntry, CandidateEntry, TrancheEntry},
MAX_RECORDED_NO_SHOW_VALIDATORS_PER_CANDIDATE,
};
use pezkuwi_node_primitives::approval::time::Tick;
use pezkuwi_pez_node_primitives::approval::time::Tick;
/// Result of counting the necessary tranches needed for approving a block.
#[derive(Debug, PartialEq, Clone)]
@@ -16,7 +16,7 @@
use bitvec::{order::Lsb0 as BitOrderLsb0, vec::BitVec};
use pezkuwi_node_primitives::approval::{
use pezkuwi_pez_node_primitives::approval::{
v1::{AssignmentCert, AssignmentCertKind, VrfProof, VrfSignature, RELAY_VRF_MODULO_CONTEXT},
v2::VrfPreOutput,
};
@@ -23,7 +23,7 @@
//! require a db migration (check `node/service/src/teyrchains_db/upgrade.rs`).
use codec::{Decode, Encode};
use pezkuwi_node_primitives::approval::v1::{AssignmentCert, DelayTranche};
use pezkuwi_pez_node_primitives::approval::v1::{AssignmentCert, DelayTranche};
use pezkuwi_primitives::{
BlockNumber, CandidateHash, CandidateReceiptV2 as CandidateReceipt, CoreIndex, GroupIndex,
Hash, SessionIndex, ValidatorIndex, ValidatorSignature,
@@ -24,7 +24,7 @@ use crate::{
backend::Backend,
};
use pezkuwi_node_primitives::approval::v1::AssignmentCertKind;
use pezkuwi_pez_node_primitives::approval::v1::AssignmentCertKind;
use pezkuwi_node_subsystem_util::database::Database;
use pezsp_application_crypto::pezsp_core::H256;
use std::{collections::HashSet, sync::Arc};
@@ -17,7 +17,7 @@
//! Version 2 of the DB schema.
use codec::{Decode, Encode};
use pezkuwi_node_primitives::approval::{v1::DelayTranche, v2::AssignmentCertV2};
use pezkuwi_pez_node_primitives::approval::{v1::DelayTranche, v2::AssignmentCertV2};
use pezkuwi_node_subsystem::{SubsystemError, SubsystemResult};
use pezkuwi_node_subsystem_util::database::{DBTransaction, Database};
use pezkuwi_primitives::{
@@ -24,7 +24,7 @@ use crate::{
},
backend::{Backend, V2ReadBackend},
};
use pezkuwi_node_primitives::approval::v1::AssignmentCertKind;
use pezkuwi_pez_node_primitives::approval::v1::AssignmentCertKind;
use pezkuwi_node_subsystem_util::database::Database;
use pezsp_application_crypto::pezsp_core::H256;
use std::{collections::HashSet, sync::Arc};
@@ -20,7 +20,7 @@
//! and adds a new field `pending_signatures` for `BlockEntry`
use codec::{Decode, Encode};
use pezkuwi_node_primitives::approval::v2::CandidateBitfield;
use pezkuwi_pez_node_primitives::approval::v2::CandidateBitfield;
use pezkuwi_node_subsystem::SubsystemResult;
use pezkuwi_node_subsystem_util::database::{DBTransaction, Database};
use pezkuwi_overseer::SubsystemError;
@@ -18,10 +18,10 @@
use codec::Encode;
use itertools::Itertools;
pub use pezkuwi_node_primitives::approval::criteria::{
pub use pezkuwi_pez_node_primitives::approval::criteria::{
AssignmentCriteria, Config, InvalidAssignment, InvalidAssignmentReason, OurAssignment,
};
use pezkuwi_node_primitives::approval::{
use pezkuwi_pez_node_primitives::approval::{
self as approval_types,
v1::{AssignmentCert, AssignmentCertKind, DelayTranche, RelayVRFStory},
v2::{
@@ -28,7 +28,7 @@
//!
//! We maintain a rolling window of session indices. This starts as empty
use pezkuwi_node_primitives::{
use pezkuwi_pez_node_primitives::{
approval::{
self as approval_types,
v1::{BlockApprovalMeta, RelayVRFStory},
@@ -65,7 +65,7 @@ use crate::{
persisted_entries::CandidateEntry,
};
use pezkuwi_node_primitives::approval::time::{slot_number_to_tick, Tick};
use pezkuwi_pez_node_primitives::approval::time::{slot_number_to_tick, Tick};
use super::{State, LOG_TARGET};
@@ -612,7 +612,7 @@ pub(crate) mod tests {
};
use approval_types::time::Clock;
use assert_matches::assert_matches;
use pezkuwi_node_primitives::{
use pezkuwi_pez_node_primitives::{
approval::v1::{VrfSignature, VrfTranscript},
DISPUTE_WINDOW,
};
@@ -689,7 +689,7 @@ pub(crate) mod tests {
fn compute_assignments(
&self,
_keystore: &LocalKeystore,
_relay_vrf_story: pezkuwi_node_primitives::approval::v1::RelayVRFStory,
_relay_vrf_story: pezkuwi_pez_node_primitives::approval::v1::RelayVRFStory,
_config: &criteria::Config,
_leaving_cores: Vec<(
CandidateHash,
@@ -704,13 +704,13 @@ pub(crate) mod tests {
fn check_assignment_cert(
&self,
_claimed_core_bitfield: pezkuwi_node_primitives::approval::v2::CoreBitfield,
_claimed_core_bitfield: pezkuwi_pez_node_primitives::approval::v2::CoreBitfield,
_validator_index: pezkuwi_primitives::ValidatorIndex,
_config: &criteria::Config,
_relay_vrf_story: pezkuwi_node_primitives::approval::v1::RelayVRFStory,
_assignment: &pezkuwi_node_primitives::approval::v2::AssignmentCertV2,
_relay_vrf_story: pezkuwi_pez_node_primitives::approval::v1::RelayVRFStory,
_assignment: &pezkuwi_pez_node_primitives::approval::v2::AssignmentCertV2,
_backing_groups: Vec<pezkuwi_primitives::GroupIndex>,
) -> Result<pezkuwi_node_primitives::approval::v1::DelayTranche, criteria::InvalidAssignment>
) -> Result<pezkuwi_pez_node_primitives::approval::v1::DelayTranche, criteria::InvalidAssignment>
{
Ok(0)
}
+2 -2
View File
@@ -22,7 +22,7 @@
//! been sufficiently approved to finalize.
use futures_timer::Delay;
use pezkuwi_node_primitives::{
use pezkuwi_pez_node_primitives::{
approval::{
v1::{BlockApprovalMeta, DelayTranche},
v2::{
@@ -92,7 +92,7 @@ use approval_checking::RequiredTranches;
use bitvec::{order::Lsb0, vec::BitVec};
pub use criteria::{AssignmentCriteria, Config as AssignmentConfig, RealAssignmentCriteria};
use persisted_entries::{ApprovalEntry, BlockEntry, CandidateEntry};
use pezkuwi_node_primitives::approval::time::{
use pezkuwi_pez_node_primitives::approval::time::{
slot_number_to_tick, Clock, ClockExt, DelayedApprovalTimer, SystemClock, Tick,
};
@@ -21,7 +21,7 @@
//! data and logic are intertwined.
use itertools::Itertools;
use pezkuwi_node_primitives::approval::{
use pezkuwi_pez_node_primitives::approval::{
v1::{DelayTranche, RelayVRFStory},
v2::{AssignmentCertV2, CandidateBitfield},
};
@@ -38,7 +38,7 @@ use crate::approval_db::v2::Bitfield;
use super::criteria::OurAssignment;
use pezkuwi_node_primitives::approval::time::Tick;
use pezkuwi_pez_node_primitives::approval::time::Tick;
/// Metadata regarding a specific tranche of assignments for a specific candidate.
#[derive(Debug, Clone, PartialEq)]
@@ -22,7 +22,7 @@ use overseer::prometheus::{
prometheus::{IntCounter, IntCounterVec},
Histogram, HistogramOpts, HistogramVec, Opts,
};
use pezkuwi_node_primitives::{
use pezkuwi_pez_node_primitives::{
approval::{
v1::{
AssignmentCert, AssignmentCertKind, DelayTranche, VrfPreOutput, VrfProof, VrfSignature,
@@ -239,7 +239,7 @@ where
fn compute_assignments(
&self,
_keystore: &LocalKeystore,
_relay_vrf_story: pezkuwi_node_primitives::approval::v1::RelayVRFStory,
_relay_vrf_story: pezkuwi_pez_node_primitives::approval::v1::RelayVRFStory,
_config: &criteria::Config,
_leaving_cores: Vec<(
CandidateHash,
@@ -253,13 +253,13 @@ where
fn check_assignment_cert(
&self,
_claimed_core_bitfield: pezkuwi_node_primitives::approval::v2::CoreBitfield,
_claimed_core_bitfield: pezkuwi_pez_node_primitives::approval::v2::CoreBitfield,
validator_index: ValidatorIndex,
_config: &criteria::Config,
_relay_vrf_story: pezkuwi_node_primitives::approval::v1::RelayVRFStory,
_assignment: &pezkuwi_node_primitives::approval::v2::AssignmentCertV2,
_relay_vrf_story: pezkuwi_pez_node_primitives::approval::v1::RelayVRFStory,
_assignment: &pezkuwi_pez_node_primitives::approval::v2::AssignmentCertV2,
_backing_groups: Vec<pezkuwi_primitives::GroupIndex>,
) -> Result<pezkuwi_node_primitives::approval::v1::DelayTranche, criteria::InvalidAssignment> {
) -> Result<pezkuwi_pez_node_primitives::approval::v1::DelayTranche, criteria::InvalidAssignment> {
self.1(validator_index)
}
}