Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed .gitmodules
Empty file.
927 changes: 715 additions & 212 deletions Cargo.lock

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ members = [
"crypto/kzg",
"database_manager",
"lcli",
"lean_client",
"lean_client/validator_service",
"lean_client/consensus",
"lean_client/lean_network",
"lean_client/forkchoice",
"lean_client/crypto",
"lean_client/store",
"lean_client/keystore",
"lean_client/common/lean_genesis",
"lean_client/common/lean_config",
"lean_client/common/lean_network_config",
"lighthouse",
"lighthouse/environment",
"slasher",
Expand Down Expand Up @@ -279,6 +290,21 @@ zeroize = { version = "1", features = ["zeroize_derive", "serde"] }
zip = "0.6"
zstd = "0.13"

# lean chain crates
lean_client = { path = "lean_client" }
lean_validator_service = { path = "lean_client/validator_service" }
lean_consensus = { path = "lean_client/consensus" }
lean_network = { path = "lean_client/lean_network" }
lean_forkchoice = { path = "lean_client/forkchoice" }
lean_crypto = { path = "lean_client/crypto"}
lean_store = { path = "lean_client/store" }
lean_keystore = { path = "lean_client/keystore" }
lean_genesis = { path = "lean_client/common/lean_genesis" }
lean_config = { path = "lean_client/common/lean_config" }
lean_network_config = { path = "lean_client/common/lean_network_config" }
leansig = { git = "https://github.com/leanEthereum/leanSig" }


[profile.maxperf]
inherits = "release"
lto = "fat"
Expand Down
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 @@ -3369,6 +3369,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {

// Start the Prometheus timer.
let _full_timer = metrics::start_timer(&metrics::BLOCK_PROCESSING_TIMES);
let _interop_timer = metrics::start_timer(&metrics::BLOCK_PROCESSING_DURATION_SECONDS);

// Increment the Prometheus counter for block processing requests.
metrics::inc_counter(&metrics::BLOCK_PROCESSING_REQUESTS);
Expand Down
12 changes: 12 additions & 0 deletions beacon_node/beacon_chain/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ pub static BLOCK_PROCESSING_TIMES: LazyLock<Result<Histogram>> = LazyLock::new(|
"Full runtime of block processing",
)
});
pub static CHAIN_ONBLOCK_DURATION_SECONDS: LazyLock<Result<Histogram>> = LazyLock::new(|| {
try_create_histogram(
"chain_onblock_duration_seconds",
"Time taken to process a block in the chain's onBlock function.",
)
});
pub static BLOCK_PROCESSING_DURATION_SECONDS: LazyLock<Result<Histogram>> = LazyLock::new(|| {
try_create_histogram(
"block_processing_duration_seconds",
"Time taken to process a block in the state transition function.",
)
});
pub static BLOCK_PROCESSING_BLOCK_ROOT: LazyLock<Result<Histogram>> = LazyLock::new(|| {
try_create_histogram(
"beacon_block_processing_block_root_seconds",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use beacon_chain::{
observed_operations::ObservationOutcome,
sync_committee_verification::{self, Error as SyncCommitteeError},
validator_monitor::{get_block_delay_ms, get_slot_delay_ms},
metrics::CHAIN_ONBLOCK_DURATION_SECONDS,
};
use beacon_processor::{Work, WorkEvent};
use lighthouse_network::{Client, MessageAcceptance, MessageId, PeerAction, PeerId, ReportSource};
Expand Down Expand Up @@ -1498,6 +1499,7 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
"fetch_blobs_gossip",
);

let _interop_timer = metrics::start_timer(&CHAIN_ONBLOCK_DURATION_SECONDS);
let result = self
.chain
.process_block(
Expand All @@ -1508,6 +1510,7 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|| Ok(()),
)
.await;
drop(_interop_timer);
register_process_result_metrics(&result, metrics::BlockSource::Gossip, "block");

match &result {
Expand Down
1 change: 1 addition & 0 deletions common/directory/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::path::{Path, PathBuf};
/// Names for the default directories.
pub const DEFAULT_ROOT_DIR: &str = ".lighthouse";
pub const DEFAULT_BEACON_NODE_DIR: &str = "beacon";
pub const DEFAULT_LEAN_NODE_DIR: &str = "lean";
pub const DEFAULT_NETWORK_DIR: &str = "network";
pub const DEFAULT_VALIDATOR_DIR: &str = "validators";
pub const DEFAULT_SECRET_DIR: &str = "secrets";
Expand Down
12 changes: 9 additions & 3 deletions consensus/types/src/core/eth_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ pub trait EthSpec: 'static + Default + Sync + Send + Clone + Debug + PartialEq +
type BuilderPendingPaymentsLimit: Unsigned + Clone + Sync + Send + Debug + PartialEq;
type BuilderPendingWithdrawalsLimit: Unsigned + Clone + Sync + Send + Debug + PartialEq;

/// Lean chain
type JustificationValidators: Unsigned + Clone + Sync + Send + Debug + PartialEq;

fn default_spec() -> ChainSpec;

fn spec_name() -> EthSpecId;
Expand Down Expand Up @@ -457,8 +460,8 @@ impl EthSpec for MainnetEthSpec {
type SlotsPerHistoricalRoot = U8192;
type EpochsPerHistoricalVector = U65536;
type EpochsPerSlashingsVector = U8192;
type HistoricalRootsLimit = U16777216;
type ValidatorRegistryLimit = U1099511627776;
type HistoricalRootsLimit = U262144;
type ValidatorRegistryLimit = U4096;
type BuilderPendingPaymentsLimit = U64; // 2 * SLOTS_PER_EPOCH = 2 * 32 = 64
type BuilderPendingWithdrawalsLimit = U1048576;
type MaxProposerSlashings = U16;
Expand Down Expand Up @@ -500,7 +503,8 @@ impl EthSpec for MainnetEthSpec {
type MaxAttesterSlashingsElectra = U1;
type MaxAttestationsElectra = U8;
type MaxWithdrawalRequestsPerPayload = U16;
type MaxPendingDepositsPerEpoch = U16;
type MaxPendingDepositsPerEpoch = U16; // participation. If a larger size is needed, consider using a different data structure.
type JustificationValidators = U1073741824;
type PTCSize = U512;
type MaxPayloadAttestations = U4;

Expand Down Expand Up @@ -546,6 +550,7 @@ impl EthSpec for MinimalEthSpec {
type NumberOfColumns = U128;
type ProposerLookaheadSlots = U16; // Derived from (MIN_SEED_LOOKAHEAD + 1) * SLOTS_PER_EPOCH
type BuilderPendingPaymentsLimit = U16; // 2 * SLOTS_PER_EPOCH = 2 * 8 = 16
type JustificationValidators = U1073741824;

params_from_eth_spec!(MainnetEthSpec {
JustificationBitsLength,
Expand Down Expand Up @@ -652,6 +657,7 @@ impl EthSpec for GnosisEthSpec {
type ProposerLookaheadSlots = U32; // Derived from (MIN_SEED_LOOKAHEAD + 1) * SLOTS_PER_EPOCH
type PTCSize = U512;
type MaxPayloadAttestations = U2;
type JustificationValidators = U1073741824;

fn default_spec() -> ChainSpec {
ChainSpec::gnosis()
Expand Down
35 changes: 35 additions & 0 deletions lean_client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[package]
name = "lean_client"
version = "0.1.0"
authors = ["Sigma Prime <[email protected]>"]
edition.workspace = true

[dependencies]
clap = { workspace = true }
clap_utils = { workspace = true }
lean_consensus = { workspace = true }
environment = { workspace = true }
health_metrics = { workspace = true }

lean_genesis = { workspace = true }
lean_keystore = { path = "keystore" }
lean_network = { workspace = true }
lean_network_config = { workspace = true }
lean_store = { path = "store" }
lean_validator_service = { workspace = true }
lean_config = { workspace = true }
lighthouse_version = { workspace = true }
logging = { workspace = true }
metrics = { workspace = true }
serde = { workspace = true }
slot_clock = { workspace = true }
store = { workspace = true, features = ["redb"] }
task_executor = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }
types = { workspace = true }
warp = { workspace = true }
warp_utils = { workspace = true }

[dev-dependencies]
tempfile = { workspace = true }
23 changes: 23 additions & 0 deletions lean_client/common/lean_config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "lean_config"
version = "0.1.0"
edition.workspace = true

[dependencies]
lean_consensus = { workspace = true }
lean_genesis = { workspace = true }
lean_keystore = { workspace = true }
lean_network = { workspace = true }
lean_network_config = { workspace = true }
lean_store = { workspace = true }
ethereum_ssz = "0.10.0"
tree_hash = { workspace = true }
slot_clock = { workspace = true }
store = { workspace = true, features = ["redb"] }
tracing = { workspace = true }
types = { workspace = true }
hex = { workspace = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
serde = { workspace = true, features = ["derive"] }
ssz_types = { workspace = true }
Loading
Loading