Skip to content

Commit

Permalink
fix: change add invoke tx ordering logic
Browse files Browse the repository at this point in the history
  • Loading branch information
datactor committed Feb 16, 2024
1 parent 4214c4f commit cb7cdaf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/client/block-proposer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ where
};

match submit_extrinsic_with_order(pool, best_block_hash, extrinsic, order).await {
Ok(_hash) => log::info!("Successfully submitted extrinsic"),
Ok(_hash) => log::debug!("Successfully submitted extrinsic"),
Err(e) => log::error!("Failed to submit extrinsic: {e:?}"),
}
}),
Expand Down
2 changes: 1 addition & 1 deletion crates/client/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ where
locked_encrypted_mempool.get_or_init_block_encrypted_transaction_pool(block_height);
}

block_transaction_pool.increase_raw_tx_count() - 1
block_transaction_pool.increase_order() - 1
};

submit_extrinsic_with_order(self.pool.clone(), best_block_hash, extrinsic, order).await?;
Expand Down
6 changes: 6 additions & 0 deletions crates/client/transaction-pool/src/graph/encrypted_mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ impl BlockEncryptedTransactionPool {
self.raw_tx_count
}

/// increase order
pub fn increase_order(&mut self) -> u64 {
self.order += 1;
self.order
}

/// encrypted txs orders
pub fn encrypted_transaction_pool_orders(&self) -> impl Iterator<Item = &u64> {
self.encrypted_transaction_pool.keys()
Expand Down

0 comments on commit cb7cdaf

Please sign in to comment.