Skip to content
Draft
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
12 changes: 5 additions & 7 deletions Cargo.lock

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

22 changes: 16 additions & 6 deletions crates/iota-archival/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,18 @@ impl ArchiveReader {
.await
}

/// Load checkpoints from archive into the input store `S` for the given
/// checkpoint range. Summaries are downloaded out of order and inserted
/// without verification
pub async fn read_summaries_for_range_no_verify<S>(
/// Load checkpoint summaries for `checkpoint_range` from the archive into
/// `store`, in sequence order.
///
/// A summary already present in `store` is left untouched; a new one is
/// inserted only after [`verify_checkpoint`] checks it against the
/// previous summary (its committee signature and `previous_digest`
/// linkage). Unlike a bulk unverified load, this never overwrites an
/// existing summary and never persists an unverified one — so it is safe
/// to run against a live node's store. Summaries are processed in
/// sequence order (each is verified against the previous one), so the
/// genesis checkpoint must already be present.
pub async fn read_summaries_for_range<S>(
&self,
store: S,
checkpoint_range: Range<CheckpointSequenceNumber>,
Expand All @@ -307,7 +315,9 @@ impl ArchiveReader {
})
.boxed();
stream
.buffer_unordered(self.concurrency)
// Ordered: `get_or_insert_verified_checkpoint` verifies each
// summary against the previous one, which must already be inserted.
.buffered(self.concurrency)
.try_for_each(|summary_data| {
let result: Result<(), anyhow::Error> =
make_iterator::<CertifiedCheckpointSummary, Reader<Bytes>>(
Expand All @@ -321,7 +331,7 @@ impl ArchiveReader {
&& s.sequence_number < checkpoint_range.end
})
.try_for_each(|summary| {
Self::insert_certified_checkpoint(&store, summary)?;
Self::get_or_insert_verified_checkpoint(&store, summary, true)?;
checkpoint_counter.fetch_add(1, Ordering::Relaxed);
Ok::<(), anyhow::Error>(())
})
Expand Down
10 changes: 0 additions & 10 deletions crates/iota-cluster-test/src/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,6 @@ impl LocalNewCluster {
impl Cluster for LocalNewCluster {
async fn start(options: &ClusterTestOpt) -> Result<Self, anyhow::Error> {
let data_ingestion_path = tempdir()?.keep();
// TODO: options should contain port instead of address
let fullnode_rpc_addr = options.fullnode_address.as_ref().map(|addr| {
addr.parse::<SocketAddr>()
.expect("unable to parse fullnode address")
});

let indexer_address = options.indexer_address.as_ref().map(|addr| {
addr.parse::<SocketAddr>()
.expect("unable to parse indexer address")
Expand Down Expand Up @@ -226,10 +220,6 @@ impl Cluster for LocalNewCluster {
}
}

if let Some(fullnode_rpc_addr) = fullnode_rpc_addr {
cluster_builder = cluster_builder.with_fullnode_rpc_addr(fullnode_rpc_addr);
}

let mut test_cluster = cluster_builder.build().await;

// Use the wealthy account for faucet
Expand Down
26 changes: 1 addition & 25 deletions crates/iota-cluster-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use iota_test_transaction_builder::batch_make_transfer_transactions;
use iota_types::{
base_types::TransactionDigest,
gas_coin::GasCoin,
iota_system_state::iota_system_state_summary::IotaSystemStateSummary,
quorum_driver_types::ExecuteTransactionRequestType,
transaction::{Transaction, TransactionData},
};
Expand All @@ -29,7 +28,7 @@ use jsonrpsee::{
http_client::HttpClientBuilder,
};
use test_case::{
coin_index_test::CoinIndexTest, coin_merge_split_test::CoinMergeSplitTest,
coin_merge_split_test::CoinMergeSplitTest,
fullnode_build_publish_transaction_test::FullNodeBuildPublishTransactionTest,
fullnode_execute_transaction_test::FullNodeExecuteTransactionTest,
native_transfer_test::NativeTransferTest, random_beacon_test::RandomBeaconTest,
Expand Down Expand Up @@ -95,10 +94,6 @@ impl TestContext {
self.client.get_fullnode_client()
}

fn clone_fullnode_client(&self) -> IotaClient {
self.client.get_fullnode_client().clone()
}

fn get_fullnode_rpc_url(&self) -> &str {
self.cluster.fullnode_url()
}
Expand All @@ -107,24 +102,6 @@ impl TestContext {
self.client.get_wallet()
}

async fn get_latest_iota_system_state(&self) -> IotaSystemStateSummary {
self.client
.get_fullnode_client()
.governance_api()
.get_latest_iota_system_state()
.await
.unwrap()
}

async fn get_reference_gas_price(&self) -> u64 {
self.client
.get_fullnode_client()
.governance_api()
.get_reference_gas_price()
.await
.unwrap()
}

fn get_wallet_address(&self) -> Address {
self.client.get_wallet_address()
}
Expand Down Expand Up @@ -311,7 +288,6 @@ impl ClusterTest {
TestCase::new(SharedCounterTest {}),
TestCase::new(FullNodeExecuteTransactionTest {}),
TestCase::new(FullNodeBuildPublishTransactionTest {}),
TestCase::new(CoinIndexTest {}),
TestCase::new(RandomBeaconTest {}),
];

Expand Down
1 change: 0 additions & 1 deletion crates/iota-cluster-test/src/test_case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Modifications Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

pub mod coin_index_test;
pub mod coin_merge_split_test;
pub mod fullnode_build_publish_transaction_test;
pub mod fullnode_execute_transaction_test;
Expand Down
Loading
Loading