From a110a461b4d2b14afe515dbb2d0261c5c5ca347f Mon Sep 17 00:00:00 2001 From: Jun Song Date: Mon, 25 Aug 2025 22:08:05 +0900 Subject: [PATCH 1/5] chore: add genesis_time filed for Config --- crates/common/chain/lean/src/genesis.rs | 10 +++++++--- crates/common/consensus/lean/src/config.rs | 1 + crates/common/consensus/lean/src/state.rs | 23 ++++++++++++---------- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/crates/common/chain/lean/src/genesis.rs b/crates/common/chain/lean/src/genesis.rs index 2c1e0e435..d52d83dcb 100644 --- a/crates/common/chain/lean/src/genesis.rs +++ b/crates/common/chain/lean/src/genesis.rs @@ -13,15 +13,19 @@ fn genesis_block(state_root: B256) -> Block { } } -fn genesis_state(num_validators: u64) -> LeanState { - LeanState::new(num_validators) +fn genesis_state(num_validators: u64, genesis_time: u64) -> LeanState { + LeanState::new(num_validators, genesis_time) } /// Setup the genesis block and state for the Lean chain. /// /// Reference: https://github.com/ethereum/research/blob/d225a6775a9b184b5c1fd6c830cc58a375d9535f/3sf-mini/test_p2p.py#L119-L131 pub fn setup_genesis() -> (Block, LeanState) { - let mut genesis_state = genesis_state(lean_network_spec().num_validators); + let (num_validators, genesis_time) = { + let network_spec = lean_network_spec(); + (network_spec.num_validators, network_spec.genesis_time) + }; + let mut genesis_state = genesis_state(num_validators, genesis_time); genesis_state .historical_block_hashes .push(B256::ZERO) diff --git a/crates/common/consensus/lean/src/config.rs b/crates/common/consensus/lean/src/config.rs index 82ed0def5..d2063398e 100644 --- a/crates/common/consensus/lean/src/config.rs +++ b/crates/common/consensus/lean/src/config.rs @@ -5,4 +5,5 @@ use tree_hash_derive::TreeHash; #[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize, Encode, Decode, TreeHash)] pub struct Config { pub num_validators: u64, + pub genesis_time: u64, } diff --git a/crates/common/consensus/lean/src/state.rs b/crates/common/consensus/lean/src/state.rs index 8a228d6db..626c58a36 100644 --- a/crates/common/consensus/lean/src/state.rs +++ b/crates/common/consensus/lean/src/state.rs @@ -11,6 +11,10 @@ use tree_hash_derive::TreeHash; use crate::{checkpoint::Checkpoint, config::Config}; +/// Represents the state of the Lean chain. +/// +/// See the [Lean specification](https://github.com/leanEthereum/leanSpec/blob/main/docs/client/containers.md#state) +/// for detailed protocol information. #[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize, Encode, Decode, TreeHash)] pub struct LeanState { pub config: Config, @@ -21,18 +25,17 @@ pub struct LeanState { pub historical_block_hashes: VariableList, pub justified_slots: VariableList, - // Diverged from Python implementation: - // Originally `justifications: Dict[str, List[bool]]` pub justifications_roots: VariableList, - // The size is MAX_HISTORICAL_BLOCK_HASHES * VALIDATOR_REGISTRY_LIMIT - // to accommodate equivalent to `justifications[root][validator_id]` pub justifications_roots_validators: BitList, } impl LeanState { - pub fn new(num_validators: u64) -> LeanState { + pub fn new(num_validators: u64, genesis_time: u64) -> LeanState { LeanState { - config: Config { num_validators }, + config: Config { + num_validators, + genesis_time, + }, latest_justified: Checkpoint::default(), latest_finalized: Checkpoint::default(), @@ -171,7 +174,7 @@ mod test { #[test] fn initialize_justifications_for_root() { - let mut state = LeanState::new(1); + let mut state = LeanState::new(1, 0); // Initialize 1st root state @@ -206,7 +209,7 @@ mod test { #[test] fn set_justification() { - let mut state = LeanState::new(1); + let mut state = LeanState::new(1, 0); let root0 = B256::repeat_byte(1); let root1 = B256::repeat_byte(2); let validator_id = 7u64; @@ -238,7 +241,7 @@ mod test { #[test] fn count_justifications() { - let mut state = LeanState::new(1); + let mut state = LeanState::new(1, 0); let root0 = B256::repeat_byte(1); let root1 = B256::repeat_byte(2); @@ -265,7 +268,7 @@ mod test { #[test] fn remove_justifications() { // Assuming 3 roots & 4 validators - let mut state = LeanState::new(3); + let mut state = LeanState::new(3, 0); let root0 = B256::repeat_byte(1); let root1 = B256::repeat_byte(2); let root2 = B256::repeat_byte(3); From 522a40bb7a1c8c92b60b10af76af35302064b3df Mon Sep 17 00:00:00 2001 From: Jun Song Date: Mon, 25 Aug 2025 22:14:47 +0900 Subject: [PATCH 2/5] chore: make consistent with current lean spec --- crates/common/chain/lean/src/genesis.rs | 12 ++++++--- crates/common/chain/lean/src/lean_chain.rs | 25 +++++++++++-------- crates/common/chain/lean/src/service.rs | 8 +++--- crates/common/consensus/lean/src/block.rs | 14 ++++++++--- crates/common/consensus/lean/src/lib.rs | 17 ++++++++----- crates/common/validator/lean/src/service.rs | 4 +-- crates/networking/p2p/src/network/lean/mod.rs | 4 +-- 7 files changed, 53 insertions(+), 31 deletions(-) diff --git a/crates/common/chain/lean/src/genesis.rs b/crates/common/chain/lean/src/genesis.rs index d52d83dcb..a570b237f 100644 --- a/crates/common/chain/lean/src/genesis.rs +++ b/crates/common/chain/lean/src/genesis.rs @@ -1,15 +1,19 @@ use alloy_primitives::B256; -use ream_consensus_lean::{block::Block, state::LeanState}; +use ream_consensus_lean::{ + block::{Block, BlockBody}, + state::LeanState, +}; use ream_network_spec::networks::lean_network_spec; -use ssz_types::VariableList; use tree_hash::TreeHash; fn genesis_block(state_root: B256) -> Block { Block { slot: 1, - parent: B256::ZERO, - votes: VariableList::empty(), + // Round-robin proposer selection for genesis + proposer_index: 1, + parent_root: B256::ZERO, state_root, + body: BlockBody::default(), } } diff --git a/crates/common/chain/lean/src/lean_chain.rs b/crates/common/chain/lean/src/lean_chain.rs index d016cf601..4dc595fbb 100644 --- a/crates/common/chain/lean/src/lean_chain.rs +++ b/crates/common/chain/lean/src/lean_chain.rs @@ -3,12 +3,15 @@ use std::collections::HashMap; use alloy_primitives::B256; use anyhow::anyhow; use ream_consensus_lean::{ - block::Block, checkpoint::Checkpoint, get_fork_choice_head, get_latest_justified_hash, - is_justifiable_slot, process_block, state::LeanState, vote::Vote, + block::{Block, BlockBody}, + checkpoint::Checkpoint, + get_fork_choice_head, get_latest_justified_hash, is_justifiable_slot, process_block, + state::LeanState, + vote::Vote, }; use ream_metrics::{PROPOSE_BLOCK_TIME, start_timer_vec, stop_timer}; +use ream_network_spec::networks::lean_network_spec; use ream_sync::rwlock::{Reader, Writer}; -use ssz_types::VariableList; use tree_hash::TreeHash; use crate::slot::get_current_slot; @@ -108,10 +111,11 @@ impl LeanChain { .ok_or_else(|| anyhow!("Post state not found for head: {}", self.head))?; let mut new_block = Block { slot, - parent: self.head, - votes: VariableList::empty(), + proposer_index: slot % lean_network_spec().num_validators, + parent_root: self.head, // Diverged from Python implementation: Using `B256::ZERO` instead of `None`) state_root: B256::ZERO, + body: BlockBody::default(), }; stop_timer(initialize_block_timer); @@ -127,7 +131,7 @@ impl LeanChain { .clone() .into_iter() .filter(|vote| vote.source.root == state.latest_justified.root) - .filter(|vote| !new_block.votes.contains(vote)) + .filter(|vote| !new_block.body.votes.contains(vote)) .collect::>(); if new_votes_to_add.is_empty() { @@ -136,6 +140,7 @@ impl LeanChain { for vote in new_votes_to_add { new_block + .body .votes .push(vote) .map_err(|err| anyhow!("Failed to add vote to new_block: {err:?}"))?; @@ -169,10 +174,10 @@ impl LeanChain { anyhow!("Block not found for safe target hash: {}", self.safe_target) })?; if target_block.slot > safe_target_block.slot { - target_block = self.chain.get(&target_block.parent).ok_or_else(|| { + target_block = self.chain.get(&target_block.parent_root).ok_or_else(|| { anyhow!( "Block not found for target block's parent hash: {}", - target_block.parent + target_block.parent_root ) })?; } @@ -181,10 +186,10 @@ impl LeanChain { // If the latest finalized slot is very far back, then only some slots are // valid to justify, make sure the target is one of those while !is_justifiable_slot(&state.latest_finalized.slot, &target_block.slot) { - target_block = self.chain.get(&target_block.parent).ok_or_else(|| { + target_block = self.chain.get(&target_block.parent_root).ok_or_else(|| { anyhow!( "Block not found for target block's parent hash: {}", - target_block.parent + target_block.parent_root ) })?; } diff --git a/crates/common/chain/lean/src/service.rs b/crates/common/chain/lean/src/service.rs index f8809dbbd..09a5c8109 100644 --- a/crates/common/chain/lean/src/service.rs +++ b/crates/common/chain/lean/src/service.rs @@ -134,7 +134,7 @@ impl LeanChainService { let block_hash = block.tree_hash_root(); info!( "Received block at slot {} with hash {block_hash:?} from parent {:?}", - block.slot, block.parent + block.slot, block.parent_root ); self.handle_block(block).await } @@ -170,11 +170,11 @@ impl LeanChainService { return Ok(()); } - match lean_chain.post_states.get(&block.parent) { + match lean_chain.post_states.get(&block.parent_root) { Some(parent_state) => { let state = process_block(parent_state, &block)?; - for vote in &block.votes { + for vote in &block.body.votes { if !lean_chain.known_votes.contains(vote) { lean_chain.known_votes.push(vote.clone()); } @@ -199,7 +199,7 @@ impl LeanChainService { // If we have not yet seen the block's parent, ignore for now, // process later once we actually see the parent self.dependencies - .entry(block.parent) + .entry(block.parent_root) .or_default() .push(QueueItem::Block(block)); } diff --git a/crates/common/consensus/lean/src/block.rs b/crates/common/consensus/lean/src/block.rs index 76331831a..66020bf08 100644 --- a/crates/common/consensus/lean/src/block.rs +++ b/crates/common/consensus/lean/src/block.rs @@ -9,7 +9,7 @@ use crate::vote::Vote; #[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize, Encode, Decode, TreeHash)] pub struct SignedBlock { - pub data: Block, + pub message: Block, pub signature: PQSignature, } @@ -18,9 +18,17 @@ pub struct SignedBlock { )] pub struct Block { pub slot: u64, + pub proposer_index: u64, // Diverged from Python implementation: Disallow `None` (uses `B256::ZERO` instead) - pub parent: B256, - pub votes: VariableList, + pub parent_root: B256, // Diverged from Python implementation: Disallow `None` (uses `B256::ZERO` instead) pub state_root: B256, + pub body: BlockBody, +} + +#[derive( + Debug, Default, PartialEq, Eq, Clone, Serialize, Deserialize, Encode, Decode, TreeHash, +)] +pub struct BlockBody { + pub votes: VariableList, } diff --git a/crates/common/consensus/lean/src/lib.rs b/crates/common/consensus/lean/src/lib.rs index 05512deb8..51c9a11c1 100644 --- a/crates/common/consensus/lean/src/lib.rs +++ b/crates/common/consensus/lean/src/lib.rs @@ -48,8 +48,10 @@ pub fn process_block(pre_state: &LeanState, block: &Block) -> anyhow::Result anyhow::Result= min_score { - children_map.entry(block.parent).or_default().push(*hash); + if block.parent_root != B256::ZERO && *vote_weights.get(hash).unwrap_or(&0) >= min_score { + children_map + .entry(block.parent_root) + .or_default() + .push(*hash); } } diff --git a/crates/common/validator/lean/src/service.rs b/crates/common/validator/lean/src/service.rs index 3537907c9..2e88c3095 100644 --- a/crates/common/validator/lean/src/service.rs +++ b/crates/common/validator/lean/src/service.rs @@ -93,8 +93,8 @@ impl ValidatorService { "Validator {} built block: slot={}, parent={:?}, votes={}, state_root={:?}", keystore.id, new_block.slot, - new_block.parent, - new_block.votes.len(), + new_block.parent_root, + new_block.body.votes.len(), new_block.state_root ); diff --git a/crates/networking/p2p/src/network/lean/mod.rs b/crates/networking/p2p/src/network/lean/mod.rs index 5eb8d0250..ce0e6f7c5 100644 --- a/crates/networking/p2p/src/network/lean/mod.rs +++ b/crates/networking/p2p/src/network/lean/mod.rs @@ -302,12 +302,12 @@ impl LeanNetworkService { if let Err(err) = self.chain_message_sender .send(LeanChainServiceMessage::QueueItem(QueueItem::Block( - (signed_block).data.clone(), + (signed_block).message.clone(), ))) { warn!( "failed to send block for slot {} item to chain: {err:?}", - signed_block.data.slot + signed_block.message.slot ); } } From aa2fdebf81b74f74b17660b23802debdd0487022 Mon Sep 17 00:00:00 2001 From: Jun Song Date: Mon, 25 Aug 2025 22:19:35 +0900 Subject: [PATCH 3/5] docs: add rust docstrings with spec links --- crates/common/consensus/lean/src/block.rs | 12 ++++++++++++ crates/common/consensus/lean/src/checkpoint.rs | 4 ++++ crates/common/consensus/lean/src/config.rs | 4 ++++ crates/common/consensus/lean/src/vote.rs | 8 ++++++++ 4 files changed, 28 insertions(+) diff --git a/crates/common/consensus/lean/src/block.rs b/crates/common/consensus/lean/src/block.rs index 66020bf08..ca21ba974 100644 --- a/crates/common/consensus/lean/src/block.rs +++ b/crates/common/consensus/lean/src/block.rs @@ -7,12 +7,20 @@ use tree_hash_derive::TreeHash; use crate::vote::Vote; +/// Represents a signed block in the Lean chain. +/// +/// See the [Lean specification](https://github.com/leanEthereum/leanSpec/blob/main/docs/client/containers.md#signedblock) +/// for detailed protocol information. #[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize, Encode, Decode, TreeHash)] pub struct SignedBlock { pub message: Block, pub signature: PQSignature, } +/// Represents a block in the Lean chain. +/// +/// See the [Lean specification](https://github.com/leanEthereum/leanSpec/blob/main/docs/client/containers.md#block) +/// for detailed protocol information. #[derive( Debug, Default, PartialEq, Eq, Clone, Serialize, Deserialize, Encode, Decode, TreeHash, )] @@ -26,6 +34,10 @@ pub struct Block { pub body: BlockBody, } +/// Represents the body of a block in the Lean chain. +/// +/// See the [Lean specification](https://github.com/leanEthereum/leanSpec/blob/main/docs/client/containers.md#blockbody) +/// for detailed protocol information. #[derive( Debug, Default, PartialEq, Eq, Clone, Serialize, Deserialize, Encode, Decode, TreeHash, )] diff --git a/crates/common/consensus/lean/src/checkpoint.rs b/crates/common/consensus/lean/src/checkpoint.rs index 63445af38..550810485 100644 --- a/crates/common/consensus/lean/src/checkpoint.rs +++ b/crates/common/consensus/lean/src/checkpoint.rs @@ -3,6 +3,10 @@ use serde::{Deserialize, Serialize}; use ssz_derive::{Decode, Encode}; use tree_hash_derive::TreeHash; +/// Represents a checkpoint in the Lean chain. +/// +/// See the [Lean specification](https://github.com/leanEthereum/leanSpec/blob/main/docs/client/containers.md#checkpoint) +/// for detailed protocol information. #[derive( Debug, Default, PartialEq, Eq, Clone, Serialize, Deserialize, Encode, Decode, TreeHash, )] diff --git a/crates/common/consensus/lean/src/config.rs b/crates/common/consensus/lean/src/config.rs index d2063398e..9a2b5dbef 100644 --- a/crates/common/consensus/lean/src/config.rs +++ b/crates/common/consensus/lean/src/config.rs @@ -2,6 +2,10 @@ use serde::{Deserialize, Serialize}; use ssz_derive::{Decode, Encode}; use tree_hash_derive::TreeHash; +/// Configuration for the Lean chain. +/// +/// See the [Lean specification](https://github.com/leanEthereum/leanSpec/blob/main/docs/client/containers.md#config) +/// for detailed protocol information. #[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize, Encode, Decode, TreeHash)] pub struct Config { pub num_validators: u64, diff --git a/crates/common/consensus/lean/src/vote.rs b/crates/common/consensus/lean/src/vote.rs index 13e9ad27e..a495cdd59 100644 --- a/crates/common/consensus/lean/src/vote.rs +++ b/crates/common/consensus/lean/src/vote.rs @@ -5,12 +5,20 @@ use tree_hash_derive::TreeHash; use crate::checkpoint::Checkpoint; +/// Represents a signed vote in the Lean chain. +/// +/// See the [Lean specification](https://github.com/leanEthereum/leanSpec/blob/main/docs/client/containers.md#signedvote) +/// for detailed protocol information. #[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize, Encode, Decode, TreeHash)] pub struct SignedVote { pub data: Vote, pub signature: PQSignature, } +/// Represents a vote in the Lean chain. +/// +/// See the [Lean specification](https://github.com/leanEthereum/leanSpec/blob/main/docs/client/containers.md#vote) +/// for detailed protocol information. #[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize, Encode, Decode, TreeHash)] pub struct Vote { pub validator_id: u64, From 5d4e4dc7dcbc576931d7842be3e8c57d37f760bf Mon Sep 17 00:00:00 2001 From: Jun Song Date: Mon, 25 Aug 2025 22:20:50 +0900 Subject: [PATCH 4/5] chore: remove prefix for gossip topics --- bin/ream/src/main.rs | 4 ++-- .../p2p/src/gossipsub/lean/message.rs | 4 ++-- .../p2p/src/gossipsub/lean/topics.rs | 20 +++++++++---------- crates/networking/p2p/src/network/lean/mod.rs | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/bin/ream/src/main.rs b/bin/ream/src/main.rs index 18be2d93a..c5d5f1773 100644 --- a/bin/ream/src/main.rs +++ b/bin/ream/src/main.rs @@ -154,11 +154,11 @@ pub async fn run_lean_node(config: LeanNodeConfig, executor: ReamExecutor) { let topics: Vec = vec![ LeanGossipTopic { fork: fork.clone(), - kind: LeanGossipTopicKind::LeanBlock, + kind: LeanGossipTopicKind::Block, }, LeanGossipTopic { fork, - kind: LeanGossipTopicKind::LeanVote, + kind: LeanGossipTopicKind::Vote, }, ]; diff --git a/crates/networking/p2p/src/gossipsub/lean/message.rs b/crates/networking/p2p/src/gossipsub/lean/message.rs index 925985c8f..2a590d3bc 100644 --- a/crates/networking/p2p/src/gossipsub/lean/message.rs +++ b/crates/networking/p2p/src/gossipsub/lean/message.rs @@ -14,10 +14,10 @@ pub enum LeanGossipsubMessage { impl LeanGossipsubMessage { pub fn decode(topic: &TopicHash, data: &[u8]) -> Result { match LeanGossipTopic::from_topic_hash(topic)?.kind { - LeanGossipTopicKind::LeanBlock => { + LeanGossipTopicKind::Block => { Ok(Self::Block(Box::new(SignedBlock::from_ssz_bytes(data)?))) } - LeanGossipTopicKind::LeanVote => { + LeanGossipTopicKind::Vote => { Ok(Self::Vote(Box::new(SignedVote::from_ssz_bytes(data)?))) } } diff --git a/crates/networking/p2p/src/gossipsub/lean/topics.rs b/crates/networking/p2p/src/gossipsub/lean/topics.rs index 6d344c164..65793ab98 100644 --- a/crates/networking/p2p/src/gossipsub/lean/topics.rs +++ b/crates/networking/p2p/src/gossipsub/lean/topics.rs @@ -6,8 +6,8 @@ use crate::gossipsub::error::GossipsubError; pub const TOPIC_PREFIX: &str = "leanconsensus"; pub const ENCODING_POSTFIX: &str = "ssz_snappy"; -pub const LEAN_BLOCK_TOPIC: &str = "lean_block"; -pub const LEAN_VOTE_TOPIC: &str = "lean_vote"; +pub const LEAN_BLOCK_TOPIC: &str = "block"; +pub const LEAN_VOTE_TOPIC: &str = "vote"; #[derive(Debug, Clone, Hash, PartialEq, Eq)] pub struct LeanGossipTopic { @@ -30,8 +30,8 @@ impl LeanGossipTopic { let fork = topic_parts[1].to_string(); let kind = match topic_parts[2] { - LEAN_BLOCK_TOPIC => LeanGossipTopicKind::LeanBlock, - LEAN_VOTE_TOPIC => LeanGossipTopicKind::LeanVote, + LEAN_BLOCK_TOPIC => LeanGossipTopicKind::Block, + LEAN_VOTE_TOPIC => LeanGossipTopicKind::Vote, other => { return Err(GossipsubError::InvalidTopic(format!( "Invalid topic: {other:?}" @@ -71,8 +71,8 @@ impl From for String { impl From for TopicHash { fn from(val: LeanGossipTopic) -> Self { let kind_str = match &val.kind { - LeanBlock => LEAN_BLOCK_TOPIC, - LeanVote => LEAN_VOTE_TOPIC, + Block => LEAN_BLOCK_TOPIC, + Vote => LEAN_VOTE_TOPIC, }; TopicHash::from_raw(format!( "/{}/{}/{}/{}", @@ -86,15 +86,15 @@ impl From for TopicHash { #[derive(Debug, Hash, Clone, Copy, PartialEq, Eq)] pub enum LeanGossipTopicKind { - LeanBlock, - LeanVote, + Block, + Vote, } impl std::fmt::Display for LeanGossipTopicKind { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - LeanGossipTopicKind::LeanBlock => write!(f, "{LEAN_BLOCK_TOPIC}"), - LeanGossipTopicKind::LeanVote => write!(f, "{LEAN_VOTE_TOPIC}"), + LeanGossipTopicKind::Block => write!(f, "{LEAN_BLOCK_TOPIC}"), + LeanGossipTopicKind::Vote => write!(f, "{LEAN_VOTE_TOPIC}"), } } } diff --git a/crates/networking/p2p/src/network/lean/mod.rs b/crates/networking/p2p/src/network/lean/mod.rs index ce0e6f7c5..3d55ba62f 100644 --- a/crates/networking/p2p/src/network/lean/mod.rs +++ b/crates/networking/p2p/src/network/lean/mod.rs @@ -206,7 +206,7 @@ impl LeanNetworkService { .gossipsub_config .topics .iter() - .find(|block_topic| matches!(block_topic.kind, LeanGossipTopicKind::LeanBlock)) + .find(|block_topic| matches!(block_topic.kind, LeanGossipTopicKind::Block)) .map(|block_topic| IdentTopic::from(block_topic.clone())) .expect("LeanBlock topic configured"), block.as_ssz_bytes(), @@ -231,7 +231,7 @@ impl LeanNetworkService { .gossipsub_config .topics .iter() - .find(|vote_topic| matches!(vote_topic.kind, LeanGossipTopicKind::LeanVote)) + .find(|vote_topic| matches!(vote_topic.kind, LeanGossipTopicKind::Vote)) .map(|vote_topic| IdentTopic::from(vote_topic.clone())) .expect("LeanVote topic configured"), bytes, From 763515b26150d1bef310dcb9ce1fc5ec98d8e1de Mon Sep 17 00:00:00 2001 From: Jun Song Date: Mon, 25 Aug 2025 22:27:55 +0900 Subject: [PATCH 5/5] fix: make mcache_len 6 --- crates/networking/p2p/src/gossipsub/lean/configurations.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/networking/p2p/src/gossipsub/lean/configurations.rs b/crates/networking/p2p/src/gossipsub/lean/configurations.rs index 817c97bb1..daa79a3ee 100644 --- a/crates/networking/p2p/src/gossipsub/lean/configurations.rs +++ b/crates/networking/p2p/src/gossipsub/lean/configurations.rs @@ -27,7 +27,7 @@ impl Default for LeanGossipsubConfig { .mesh_n_low(6) .mesh_n_high(12) .gossip_lazy(6) - .history_length(12) + .history_length(6) .history_gossip(3) .max_messages_per_rpc(Some(500)) .duplicate_cache_time(Duration::from_secs(