Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mempool] On node start set mempool_client_sender in admin service
Browse files Browse the repository at this point in the history
hariria committed Oct 9, 2024
1 parent 3b816ee commit ce5de93
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion aptos-node/src/lib.rs
Original file line number Diff line number Diff line change
@@ -578,7 +578,7 @@ where
let config = OnChainJWKConsensusConfig::default_enabled();
println!("Flag `INITIALIZE_JWK_CONSENSUS` detected, will enable JWK Consensus for all default OIDC providers in genesis: {:?}", config);
Some(config)
},
}
_ => None,
};
})))
@@ -704,6 +704,7 @@ pub fn setup_environment_and_start_node(
indexer_runtime,
indexer_grpc_runtime,
internal_indexer_db_runtime,
mempool_client_sender,
) = services::bootstrap_api_and_indexer(
&node_config,
db_rw.clone(),
@@ -714,6 +715,9 @@ pub fn setup_environment_and_start_node(
indexer_grpc_port_tx,
)?;

// Set mempool client sender in order to enable the Mempool API in the admin service
admin_service.set_mempool_client_sender(mempool_client_sender);

// Create mempool and get the consensus to mempool sender
let (mempool_runtime, consensus_to_mempool_sender) =
services::start_mempool_runtime_and_get_consensus_sender(
8 changes: 6 additions & 2 deletions aptos-node/src/services.rs
Original file line number Diff line number Diff line change
@@ -19,7 +19,9 @@ use aptos_indexer_grpc_table_info::runtime::{
bootstrap as bootstrap_indexer_table_info, bootstrap_internal_indexer_db,
};
use aptos_logger::{debug, telemetry_log_writer::TelemetryLog, LoggerFilterUpdater};
use aptos_mempool::{network::MempoolSyncMsg, MempoolClientRequest, QuorumStoreRequest};
use aptos_mempool::{
network::MempoolSyncMsg, MempoolClientRequest, MempoolClientSender, QuorumStoreRequest,
};
use aptos_mempool_notifications::MempoolNotificationListener;
use aptos_network::application::{interface::NetworkClientInterface, storage::PeersAndMetadata};
use aptos_network_benchmark::{run_netbench_service, NetbenchMessage};
@@ -59,6 +61,7 @@ pub fn bootstrap_api_and_indexer(
Option<Runtime>,
Option<Runtime>,
Option<Runtime>,
MempoolClientSender,
)> {
// Create the mempool client and sender
let (mempool_client_sender, mempool_client_receiver) =
@@ -120,7 +123,7 @@ pub fn bootstrap_api_and_indexer(
node_config,
chain_id,
db_rw.reader.clone(),
mempool_client_sender,
mempool_client_sender.clone(),
)?;

Ok((
@@ -130,6 +133,7 @@ pub fn bootstrap_api_and_indexer(
indexer_runtime,
indexer_grpc,
db_indexer_runtime,
mempool_client_sender,
))
}

0 comments on commit ce5de93

Please sign in to comment.