Skip to content

Commit 366e23d

Browse files
committed
don't retry consensus messages
1 parent 640a568 commit 366e23d

File tree

3 files changed

+4
-41
lines changed

3 files changed

+4
-41
lines changed

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.

tesseract/consensus/relayer/Cargo.toml

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

66
[lib]

tesseract/messaging/evm/src/tx.rs

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use alloy::{
1313
rpc::types::{TransactionReceipt, TransactionRequest},
1414
transports::TransportError,
1515
};
16-
use alloy_sol_types::{SolCall, SolEvent};
16+
use alloy_sol_types::SolEvent;
1717
use anyhow::anyhow;
1818
use codec::Decode;
1919
use ismp::{
@@ -24,7 +24,7 @@ use ismp::{
2424
use ismp_solidity_abi::{
2525
evm_host::{PostRequestHandled, PostResponseHandled},
2626
handler::{
27-
handleConsensusCall, HandlerInstance, PostRequestLeaf, PostRequestMessage,
27+
HandlerInstance, PostRequestLeaf, PostRequestMessage,
2828
PostResponseLeaf, PostResponseMessage, Proof, StateMachineHeight,
2929
},
3030
};
@@ -375,46 +375,9 @@ pub async fn submit_messages(
375375
};
376376

377377
let tx_hash = H256::from_slice(pending.tx_hash().as_slice());
378-
let is_consensus = tx
379-
.input
380-
.input()
381-
.map_or(false, |data| data.starts_with(handleConsensusCall::SELECTOR.as_slice()));
382378

383379
let evs = match wait_for_success(client, tx_hash).await? {
384380
Some(evs) => evs,
385-
None if is_consensus => {
386-
let new_gas: U256 = get_current_gas_cost_in_usd(
387-
client.state_machine,
388-
client.config.ismp_host.0.into(),
389-
client.client.clone(),
390-
)
391-
.await?
392-
.gas_price * 2;
393-
394-
tracing::info!(
395-
chain = ?client.state_machine,
396-
"Retrying consensus tx at {:.4} gwei",
397-
new_gas.low_u128() as f64 / 1e9,
398-
);
399-
400-
// Reuse the original calldata and gas limit; only bump the gas price.
401-
let retry_tx = tx.clone().gas_price(new_gas.low_u128()).transaction_type(0);
402-
403-
let pending = client.signer.send_transaction(retry_tx).await?;
404-
let retry_hash = H256::from_slice(pending.tx_hash().as_slice());
405-
406-
match wait_for_success(client, retry_hash).await? {
407-
Some(evs) => evs,
408-
None => {
409-
cancel_transaction(client, from, nonce, gas_price, retry_hash).await;
410-
return Err(anyhow!(
411-
"Consensus tx on {:?} timed out after retry",
412-
client.state_machine
413-
));
414-
},
415-
}
416-
},
417-
418381
None => {
419382
cancel_transaction(client, from, nonce, gas_price, tx_hash).await;
420383
return Err(anyhow!("Transaction to {:?} was cancelled", client.state_machine));

0 commit comments

Comments
 (0)