From b99c0524751b8b1ec86b5d9d6fdd95643235f165 Mon Sep 17 00:00:00 2001 From: Thibault Martinez Date: Tue, 13 Aug 2024 11:45:12 +0200 Subject: [PATCH] fix(iota)!: `TransactiondOrchestrator` typo (#1751) --- .../iota-core/src/transaction_orchestrator.rs | 17 +++++++------- .../tests/transaction_orchestrator_tests.rs | 8 +++---- .../src/transaction_execution_api.rs | 6 ++--- crates/iota-node/src/lib.rs | 22 +++++++++---------- 4 files changed, 25 insertions(+), 28 deletions(-) diff --git a/crates/iota-core/src/transaction_orchestrator.rs b/crates/iota-core/src/transaction_orchestrator.rs index cc8f0d0061c..275f61ead7f 100644 --- a/crates/iota-core/src/transaction_orchestrator.rs +++ b/crates/iota-core/src/transaction_orchestrator.rs @@ -40,12 +40,8 @@ use tokio::{ }; use tracing::{debug, error, error_span, info, instrument, warn, Instrument}; -// Transaction Orchestrator is a Node component that utilizes Quorum Driver to -// submit transactions to validators for finality, and proactively executes -// finalized transactions locally, when possible. -use crate::authority::AuthorityState; use crate::{ - authority::authority_per_epoch_store::AuthorityPerEpochStore, + authority::{authority_per_epoch_store::AuthorityPerEpochStore, AuthorityState}, authority_aggregator::{AuthAggMetrics, AuthorityAggregator}, authority_client::{AuthorityAPI, NetworkAuthorityClient}, quorum_driver::{ @@ -61,7 +57,10 @@ const LOCAL_EXECUTION_TIMEOUT: Duration = Duration::from_secs(10); const WAIT_FOR_FINALITY_TIMEOUT: Duration = Duration::from_secs(30); -pub struct TransactiondOrchestrator { +/// Transaction Orchestrator is a Node component that utilizes Quorum Driver to +/// submit transactions to validators for finality, and proactively executes +/// finalized transactions locally, when possible. +pub struct TransactionOrchestrator { quorum_driver_handler: Arc>, validator_state: Arc, _local_executor_handle: JoinHandle<()>, @@ -70,7 +69,7 @@ pub struct TransactiondOrchestrator { metrics: Arc, } -impl TransactiondOrchestrator { +impl TransactionOrchestrator { pub fn new_with_network_clients( validator_state: Arc, reconfig_channel: Receiver, @@ -93,7 +92,7 @@ impl TransactiondOrchestrator { safe_client_metrics_base, auth_agg_metrics, ); - Ok(TransactiondOrchestrator::new( + Ok(TransactionOrchestrator::new( Arc::new(validators), validator_state, parent_path, @@ -103,7 +102,7 @@ impl TransactiondOrchestrator { } } -impl TransactiondOrchestrator +impl TransactionOrchestrator where A: AuthorityAPI + Send + Sync + 'static + Clone, OnsiteReconfigObserver: ReconfigObserver, diff --git a/crates/iota-e2e-tests/tests/transaction_orchestrator_tests.rs b/crates/iota-e2e-tests/tests/transaction_orchestrator_tests.rs index d67233d34f9..997b81ec0de 100644 --- a/crates/iota-e2e-tests/tests/transaction_orchestrator_tests.rs +++ b/crates/iota-e2e-tests/tests/transaction_orchestrator_tests.rs @@ -6,7 +6,7 @@ use std::{sync::Arc, time::Duration}; use iota_core::{ authority::EffectsNotifyRead, authority_client::NetworkAuthorityClient, - transaction_orchestrator::TransactiondOrchestrator, + transaction_orchestrator::TransactionOrchestrator, }; use iota_macros::sim_test; use iota_storage::{ @@ -38,7 +38,7 @@ async fn test_blocking_execution() -> Result<(), anyhow::Error> { // Start orchestrator inside container so that it will be properly shutdown. let orchestrator = handle .with(|node| { - TransactiondOrchestrator::new_with_network_clients( + TransactionOrchestrator::new_with_network_clients( node.state(), node.subscribe_to_epoch_change(), temp_dir.path(), @@ -121,7 +121,7 @@ async fn test_fullnode_wal_log() -> Result<(), anyhow::Error> { // Start orchestrator inside container so that it will be properly shutdown. let orchestrator = handle .with(|node| { - TransactiondOrchestrator::new_with_network_clients( + TransactionOrchestrator::new_with_network_clients( node.state(), node.subscribe_to_epoch_change(), temp_dir.path(), @@ -309,7 +309,7 @@ async fn test_tx_across_epoch_boundaries() { } async fn execute_with_orchestrator( - orchestrator: &TransactiondOrchestrator, + orchestrator: &TransactionOrchestrator, txn: Transaction, request_type: ExecuteTransactionRequestType, ) -> Result { diff --git a/crates/iota-json-rpc/src/transaction_execution_api.rs b/crates/iota-json-rpc/src/transaction_execution_api.rs index 8767f2477e0..1ec0e7602d9 100644 --- a/crates/iota-json-rpc/src/transaction_execution_api.rs +++ b/crates/iota-json-rpc/src/transaction_execution_api.rs @@ -8,7 +8,7 @@ use async_trait::async_trait; use fastcrypto::{encoding::Base64, traits::ToFromBytes}; use iota_core::{ authority::AuthorityState, authority_client::NetworkAuthorityClient, - transaction_orchestrator::TransactiondOrchestrator, + transaction_orchestrator::TransactionOrchestrator, }; use iota_json_rpc_api::{JsonRpcMetrics, WriteApiOpenRpc, WriteApiServer}; use iota_json_rpc_types::{ @@ -45,14 +45,14 @@ use crate::{ pub struct TransactionExecutionApi { state: Arc, - transaction_orchestrator: Arc>, + transaction_orchestrator: Arc>, metrics: Arc, } impl TransactionExecutionApi { pub fn new( state: Arc, - transaction_orchestrator: Arc>, + transaction_orchestrator: Arc>, metrics: Arc, ) -> Self { Self { diff --git a/crates/iota-node/src/lib.rs b/crates/iota-node/src/lib.rs index 0d8dc6f1077..d58941bff88 100644 --- a/crates/iota-node/src/lib.rs +++ b/crates/iota-node/src/lib.rs @@ -69,7 +69,7 @@ use iota_core::{ signature_verifier::SignatureVerifierMetrics, state_accumulator::StateAccumulator, storage::RocksDbStore, - transaction_orchestrator::TransactiondOrchestrator, + transaction_orchestrator::TransactionOrchestrator, }; use iota_json_rpc::{ coin_api::CoinReadApi, governance_api::GovernanceReadApi, indexer_api::IndexerApi, @@ -208,7 +208,7 @@ pub struct IotaNode { /// experimental rest service _http_server: Option>, state: Arc, - transaction_orchestrator: Option>>, + transaction_orchestrator: Option>>, registry_service: RegistryService, metrics: Arc, @@ -655,14 +655,12 @@ impl IotaNode { broadcast::channel(config.end_of_epoch_broadcast_channel_capacity); let transaction_orchestrator = if is_full_node && run_with_range.is_none() { - Some(Arc::new( - TransactiondOrchestrator::new_with_network_clients( - state.clone(), - end_of_epoch_receiver, - &config.db_path(), - &prometheus_registry, - )?, - )) + Some(Arc::new(TransactionOrchestrator::new_with_network_clients( + state.clone(), + end_of_epoch_receiver, + &config.db_path(), + &prometheus_registry, + )?)) } else { None }; @@ -1450,7 +1448,7 @@ impl IotaNode { pub fn transaction_orchestrator( &self, - ) -> Option>> { + ) -> Option>> { self.transaction_orchestrator.clone() } @@ -1889,7 +1887,7 @@ fn build_kv_store( pub async fn build_http_server( state: Arc, store: RocksDbStore, - transaction_orchestrator: &Option>>, + transaction_orchestrator: &Option>>, config: &NodeConfig, prometheus_registry: &Registry, _custom_runtime: Option,