Skip to content
Merged
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
9 changes: 1 addition & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,7 @@ exclude = ["book/cli"]
[workspace.package]
authors = ["https://github.com/ReamLabs/ream/graphs/contributors"]
edition = "2024"
keywords = [
"ethereum",
"beam-chain",
"blockchain",
"consensus",
"protocol",
"ream",
]
keywords = ["ethereum", "beam-chain", "blockchain", "consensus", "protocol", "ream"]
license = "MIT"
readme = "README.md"
repository = "https://github.com/ReamLabs/ream"
Expand Down
17 changes: 17 additions & 0 deletions bin/ream/src/cli/lean_node.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::{net::IpAddr, path::PathBuf};

use clap::{Parser, error::ErrorKind};
use ream_fork_choice_lean::store::BlockProductionStrategy;
use ream_network_spec::{cli::lean_network_parser, networks::LeanNetworkSpec};
use ream_p2p::bootnodes::Bootnodes;
use url::Url;
Expand Down Expand Up @@ -92,6 +93,14 @@ pub struct LeanNodeConfig {
help = "Number of attestation committees (subnets). Each validator's subnet is `validator_id % count`."
)]
pub attestation_committee_count: u64,

#[arg(
long,
default_value = "round-based",
value_parser = block_production_parser,
help = "Attestation selection strategy for block production: round-based or tiered."
)]
pub block_production: BlockProductionStrategy,
}

impl LeanNodeConfig {
Expand All @@ -111,3 +120,11 @@ impl LeanNodeConfig {
Ok(())
}
}

fn block_production_parser(value: &str) -> Result<BlockProductionStrategy, String> {
match value {
"round-based" => Ok(BlockProductionStrategy::RoundBased),
"tiered" => Ok(BlockProductionStrategy::Tiered),
other => Err(format!("expected 'round-based' or 'tiered', got '{other}'")),
}
}
3 changes: 2 additions & 1 deletion bin/ream/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,8 @@ pub async fn run_lean_node(config: LeanNodeConfig, executor: ReamExecutor, ream_
None,
keystores.first().map(|keystore| keystore.index),
)
.expect("Could not get forkchoice store"),
.expect("Could not get forkchoice store")
.with_block_production_strategy(config.block_production),
);

let test_driver_enabled = test_driver_enabled();
Expand Down
2 changes: 2 additions & 0 deletions book/cli/ream/lean_node.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/common/consensus/lean/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ impl LeanState {
BitList::with_capacity(self.validators.len()).map_err(|err| {
anyhow!(
"Failed to initialize justification for root {:?}: {err:?}",
&attestation.target().root
attestation.target().root
)
})?,
);
Expand Down
Loading
Loading