Refactor consensus/types (#7827)

Organize and categorize `consensus/types` into modules based on their relation to key consensus structures/concepts.
This is a precursor to a sensible public interface.

While this refactor is very opinionated, I am open to suggestions on module names, or type groupings if my current ones are inappropriate.


Co-Authored-By: Mac L <mjladson@pm.me>
This commit is contained in:
Mac L
2025-12-04 13:28:52 +04:00
committed by GitHub
parent 51d0336020
commit 4e958a92d3
167 changed files with 2117 additions and 1751 deletions

View File

@@ -33,6 +33,7 @@ use lighthouse_network::{
};
use matches::assert_matches;
use slot_clock::SlotClock;
use ssz_types::RuntimeVariableList;
use std::collections::HashSet;
use std::iter::Iterator;
use std::sync::Arc;
@@ -42,8 +43,8 @@ use types::blob_sidecar::{BlobIdentifier, FixedBlobSidecarList};
use types::{
AttesterSlashing, BlobSidecar, BlobSidecarList, ChainSpec, DataColumnSidecarList,
DataColumnSubnetId, Epoch, EthSpec, Hash256, MainnetEthSpec, ProposerSlashing,
RuntimeVariableList, SignedAggregateAndProof, SignedBeaconBlock, SignedVoluntaryExit,
SingleAttestation, Slot, SubnetId,
SignedAggregateAndProof, SignedBeaconBlock, SignedVoluntaryExit, SingleAttestation, Slot,
SubnetId,
};
type E = MainnetEthSpec;

View File

@@ -7,11 +7,12 @@ use lighthouse_network::{
BlobsByRangeRequestId, BlocksByRangeRequestId, DataColumnsByRangeRequestId,
},
};
use ssz_types::RuntimeVariableList;
use std::{collections::HashMap, sync::Arc};
use tracing::{Span, debug};
use types::{
BlobSidecar, ChainSpec, ColumnIndex, DataColumnSidecar, DataColumnSidecarList, EthSpec,
Hash256, RuntimeVariableList, SignedBeaconBlock,
Hash256, SignedBeaconBlock,
};
use crate::sync::network_context::MAX_COLUMN_RETRIES;

View File

@@ -1929,8 +1929,8 @@ mod deneb_only {
block_verification_types::{AsBlock, RpcBlock},
data_availability_checker::AvailabilityCheckError,
};
use ssz_types::RuntimeVariableList;
use std::collections::VecDeque;
use types::RuntimeVariableList;
struct DenebTester {
rig: TestRig,