Skip to content
This repository has been archived by the owner on Feb 6, 2025. It is now read-only.

Commit

Permalink
fix: ci issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Keefe Liu committed Nov 20, 2024
1 parent 1996a30 commit 38f21d0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@clippy
with:
toolchain: ${{ env.TOOL_CHAIN_NIGHTLY }}
components: clippy
- uses: Swatinem/rust-cache@v2
with:
Expand Down
9 changes: 6 additions & 3 deletions crates/engine/tree/src/persistence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ where
UnifiedStorageWriter::commit(provider_rw, static_file_provider)?;
}
self.metrics.save_blocks_duration_seconds.record(start_time.elapsed());
self.metrics.persistence_height.set(last_block_hash_num.as_ref().map(|b| b.number).unwrap_or(0) as f64);
self.metrics
.persistence_height
.set(last_block_hash_num.as_ref().map(|b| b.number).unwrap_or(0) as f64);
Ok(last_block_hash_num)
}

Expand Down Expand Up @@ -493,12 +495,13 @@ mod tests {
use alloy_primitives::B256;
use reth_chain_state::test_utils::TestBlockBuilder;
use reth_exex_types::FinishedExExHeight;
use reth_provider::test_utils::create_test_provider_factory;
use reth_provider::{providers::BlockchainProvider2, test_utils::create_test_provider_factory};
use reth_prune::Pruner;
use tokio::sync::mpsc::unbounded_channel;

fn default_persistence_handle() -> PersistenceHandle {
let provider = create_test_provider_factory();
let view_provider = BlockchainProvider2::new(provider.clone()).unwrap();

let (_finished_exex_height_tx, finished_exex_height_rx) =
tokio::sync::watch::channel(FinishedExExHeight::NoExExs);
Expand All @@ -515,7 +518,7 @@ mod tests {
);

let (sync_metrics_tx, _sync_metrics_rx) = unbounded_channel();
PersistenceHandle::spawn_service(provider, pruner, sync_metrics_tx, false)
PersistenceHandle::spawn_service(provider, view_provider, pruner, sync_metrics_tx, false)
}

#[tokio::test]
Expand Down
4 changes: 2 additions & 2 deletions crates/engine/tree/src/tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3208,10 +3208,10 @@ mod tests {
let blocks: Vec<_> = test_block_builder
.get_executed_blocks(1..tree_config.persistence_threshold() + 2)
.collect();
let test_harness = TestHarness::new(chain_spec).with_blocks(blocks.clone());
let mut test_harness = TestHarness::new(chain_spec).with_blocks(blocks.clone());
std::thread::Builder::new()
.name("Tree Task".to_string())
.spawn(|| test_harness.tree.run())
.spawn(move || test_harness.tree.run())
.unwrap();

// send a message to the tree to enter the main loop.
Expand Down

0 comments on commit 38f21d0

Please sign in to comment.