reducing default timeout for transactions to 2 mins

This commit is contained in:
Godmode Galactus 2023-06-23 09:42:37 +02:00
parent f63c8538c3
commit 18a3fa9a6f
No known key found for this signature in database
GPG Key ID: A04142C71ABB0DEA
3 changed files with 11 additions and 7 deletions

View File

@ -18,7 +18,7 @@ pub const DEFAULT_LITE_RPC_ADDR: &str = "http://0.0.0.0:8890";
pub const DEFAULT_WS_ADDR: &str = "ws://0.0.0.0:8900";
#[from_env]
pub const DEFAULT_MAX_NUMBER_OF_TXS_IN_QUEUE: usize = 40_000;
pub const DEFAULT_MAX_NUMBER_OF_TXS_IN_QUEUE: usize = 200_000;
/// 25 slots in 10s send to little more leaders
#[from_env]
@ -30,6 +30,6 @@ pub const MAX_RETRIES: usize = 40;
pub const DEFAULT_RETRY_TIMEOUT: u64 = 2;
#[from_env]
pub const DEFAULT_CLEAN_INTERVAL_MS: u64 = 5 * 60 * 1000; // five minute
pub const DEFAULT_CLEAN_INTERVAL_MS: u64 = 10 * 60 * 1000; // two minute
pub const DEFAULT_TRANSACTION_CONFIRMATION_STATUS: TransactionConfirmationStatus =
TransactionConfirmationStatus::Finalized;

View File

@ -45,7 +45,11 @@ impl Cleaner {
BLOCKS_IN_BLOCKSTORE.set(self.block_store.number_of_blocks_in_store() as i64);
}
pub fn start(self, ttl_duration: Duration) -> JoinHandle<anyhow::Result<()>> {
pub fn start(
self,
ttl_transactions: Duration,
ttl_duration: Duration,
) -> JoinHandle<anyhow::Result<()>> {
let mut ttl = tokio::time::interval(ttl_duration);
tokio::spawn(async move {
@ -54,7 +58,7 @@ impl Cleaner {
loop {
ttl.tick().await;
self.clean_tx_sender(ttl_duration);
self.clean_tx_sender(ttl_transactions);
self.clean_block_listeners(ttl_duration);
self.clean_block_store(ttl_duration).await;
}

View File

@ -87,10 +87,10 @@ impl TransactionServiceBuilder {
tpu_service.get_estimated_slot_holder(),
);
let processed_block_listener = block_listner.clone().listen_processed();
// transactions get invalid in around 1 mins, because the block hash expires in 150 blocks so 150 * 400ms = 60s
// Setting it to two to give some margin of error / as not all the blocks are filled.
let cleaner = Cleaner::new(tx_sender.clone(), block_listner.clone(), block_store_t)
.start(clean_interval);
.start(Duration::from_secs(120), clean_interval);
tokio::select! {
res = tpu_service_fx => {