Skip to content

Commit 2152ccc

Browse files
committed
fix: update fortuna version to 7.4.5 and enhance transaction submission logging
1 parent c1bec00 commit 2152ccc

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

apps/fortuna/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/fortuna/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "fortuna"
3-
version = "7.4.4"
3+
version = "7.4.5"
44
edition = "2021"
55

66
[lib]

apps/fortuna/src/eth_utils/utils.rs

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@ use {
22
crate::eth_utils::nonce_manager::NonceManaged,
33
anyhow::{anyhow, Result},
44
backoff::ExponentialBackoff,
5-
ethers::types::TransactionReceipt,
6-
ethers::types::U256,
7-
ethers::{contract::ContractCall, middleware::Middleware},
8-
std::sync::atomic::AtomicU64,
9-
std::sync::Arc,
5+
ethers::{
6+
contract::ContractCall,
7+
middleware::Middleware,
8+
types::{TransactionReceipt, U256},
9+
},
10+
std::sync::{atomic::AtomicU64, Arc},
1011
tokio::time::{timeout, Duration},
1112
tracing,
1213
};
1314

15+
pub type ChainId = String;
16+
1417
const TX_CONFIRMATION_TIMEOUT_SECS: u64 = 30;
1518

1619
#[derive(Debug)]
@@ -154,6 +157,8 @@ pub async fn submit_tx_with_backoff<T: Middleware + NonceManaged + 'static>(
154157
call: ContractCall<T, ()>,
155158
gas_limit: U256,
156159
escalation_policy: EscalationPolicy,
160+
chain_id: ChainId,
161+
sequence_number: u64,
157162
) -> Result<SubmitTxResult> {
158163
let start_time = std::time::Instant::now();
159164

@@ -178,6 +183,8 @@ pub async fn submit_tx_with_backoff<T: Middleware + NonceManaged + 'static>(
178183
gas_limit,
179184
gas_multiplier_pct,
180185
fee_multiplier_pct,
186+
chain_id.clone(),
187+
sequence_number,
181188
)
182189
.await
183190
},
@@ -217,6 +224,8 @@ pub async fn submit_tx<T: Middleware + NonceManaged + 'static>(
217224
// A value of 100 submits the tx with the same gas/fee as the estimate.
218225
gas_estimate_multiplier_pct: u64,
219226
fee_estimate_multiplier_pct: u64,
227+
chain_id: ChainId,
228+
sequence_number: u64,
220229
) -> Result<TransactionReceipt, backoff::Error<anyhow::Error>> {
221230
let gas_estimate_res = call.estimate_gas().await;
222231

@@ -261,6 +270,13 @@ pub async fn submit_tx<T: Middleware + NonceManaged + 'static>(
261270
/ 100,
262271
);
263272

273+
tracing::info!(
274+
"Chain ID: {}, Sequence Number: {}, Tx: {:?}",
275+
chain_id,
276+
sequence_number,
277+
transaction
278+
);
279+
264280
let pending_tx = client
265281
.send_transaction(transaction.clone(), None)
266282
.await

apps/fortuna/src/keeper/process_event.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ pub async fn process_event_with_backoff(
5353
contract_call,
5454
gas_limit,
5555
escalation_policy,
56+
chain_state.id,
57+
event.sequence_number,
5658
)
5759
.await;
5860

0 commit comments

Comments
 (0)