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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ test-devnet2: # Run all tests for for Devnet 2.

.PHONY: test-devnet3
test-devnet3: # Run all tests for for Devnet 3.
cargo test --workspace --no-default-features --features "devnet3" -- --nocapture
cargo test --workspace --no-default-features --features "devnet3" -- --nocapture --test-threads=1


.PHONY: fmt
Expand Down
19 changes: 16 additions & 3 deletions bin/ream/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ pub async fn run_lean_node(config: LeanNodeConfig, executor: ReamExecutor, ream_
lean_db,
None,
#[cfg(feature = "devnet3")]
None,
keystores.first().map(|keystore| keystore.index),
)
.expect("Could not get forkchoice store"),
);
Expand Down Expand Up @@ -876,6 +876,11 @@ mod tests {

#[test]
fn test_lean_node_finalizes() {
let _ = tracing_subscriber::fmt()
.with_env_filter(Verbosity::Info.directive())
.with_test_writer()
.try_init();

let cli = Cli::parse_from([
"ream",
"--ephemeral",
Expand Down Expand Up @@ -905,8 +910,8 @@ mod tests {
run_lean_node(*config, executor_handle, cloned_db).await;
});

let result = timeout(Duration::from_secs(60), async {
sleep(Duration::from_secs(60)).await;
let result = timeout(Duration::from_secs(120), async {
sleep(Duration::from_secs(120)).await;
Ok::<_, ()>(())
})
.await;
Expand All @@ -927,6 +932,14 @@ mod tests {
let justfication_lag = 4;
let finalization_lag = 5;

info!(
"Test results: head_slot={}, justified_slot={}, finalized_slot={}, head_root={:?}",
head_state.slot,
head_state.latest_justified.slot,
head_state.latest_finalized.slot,
head
);

assert!(
head_state.slot > finalization_lag,
"Expected the head slot to be greater than finalization lag"
Expand Down
2 changes: 1 addition & 1 deletion crates/common/chain/lean/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl LeanChainService {
}
if self.sync_status == SyncStatus::Synced {
#[cfg(feature = "devnet2")]
self.store.write().await.tick_interval(tick_count % 4 == 1).await.expect("Failed to tick interval");
self.store.write().await.tick_interval(tick_count % INTERVALS_PER_SLOT == 1).await.expect("Failed to tick interval");
#[cfg(feature = "devnet3")]
{
// TODO: update is_aggregator logic from devnet config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl ForwardBackgroundSyncer {
#[cfg(feature = "devnet2")]
self.store.write().await.on_tick(time, false).await?;
#[cfg(feature = "devnet3")]
self.store.write().await.on_tick(time, false, false).await?;
self.store.write().await.on_tick(time, false, true).await?;
self.store.write().await.on_block(&block, true).await?;
}

Expand Down
Loading
Loading