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
1 change: 1 addition & 0 deletions bin/ream/assets/lean/sample_spec.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
SECONDS_PER_SLOT: 12
GENESIS_TIME: 0
JUSTIFICATION_LOOKBACK_SLOTS: 3
NUM_VALIDATORS: 4
2 changes: 2 additions & 0 deletions crates/common/network_spec/src/networks/lean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub static LEAN_NETWORK_SPEC: OnceLock<Arc<LeanNetworkSpec>> = OnceLock::new();
#[serde(rename_all = "UPPERCASE")]
pub struct LeanNetworkSpec {
pub genesis_time: u64,
pub justification_lookback_slots: u64,
pub seconds_per_slot: u64,
pub num_validators: u64,
}
Expand All @@ -27,6 +28,7 @@ impl LeanNetworkSpec {

Arc::new(Self {
genesis_time: current_timestamp + 3,
justification_lookback_slots: 3,
seconds_per_slot: 4,
num_validators: 4,
})
Expand Down
5 changes: 3 additions & 2 deletions crates/networking/p2p/src/gossipsub/lean/configurations.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::time::Duration;

use libp2p::gossipsub::{Config, ConfigBuilder, MessageId, ValidationMode};
use ream_consensus_misc::constants::beacon::SLOTS_PER_EPOCH;
use ream_network_spec::networks::lean_network_spec;
use sha2::{Digest, Sha256};

Expand Down Expand Up @@ -31,7 +30,9 @@ impl Default for LeanGossipsubConfig {
.history_gossip(3)
.max_messages_per_rpc(Some(500))
.duplicate_cache_time(Duration::from_secs(
SLOTS_PER_EPOCH * lean_network_spec().seconds_per_slot * 2,
lean_network_spec().justification_lookback_slots
* lean_network_spec().seconds_per_slot
* 2,
))
.validate_messages()
.validation_mode(ValidationMode::Anonymous)
Expand Down
Loading