Remove txsubmission type (#2094)

### Description

Removes a vestigial organ from the gelato days. We no longer need a
config to denote txsubmission type.

### Drive-by changes

No

### Related issues

- https://discord.com/channels/935678348330434570/1096400530722537513

### Backward compatibility

_Are these changes backward compatible?_

Yes

_Are there any infrastructure implications, e.g. changes that would
prohibit deploying older commits using this infra tooling?_

None


### Testing

_What kind of testing have these changes undergone?_

Unit Tests
pull/2095/head
Mattie Conover 2 years ago committed by GitHub
parent 1722f4ee7e
commit 91837d8a20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 50
      rust/agents/relayer/src/relayer.rs
  2. 20
      rust/hyperlane-base/src/settings/chains.rs

@ -11,8 +11,8 @@ use tokio::task::JoinHandle;
use tracing::{info, info_span, instrument::Instrumented, Instrument};
use hyperlane_base::{
chains::TransactionSubmissionType, run_all, BaseAgent, CachingInterchainGasPaymaster,
CachingMailbox, ContractSyncMetrics, CoreMetrics, HyperlaneAgentCore,
run_all, BaseAgent, CachingInterchainGasPaymaster, CachingMailbox, ContractSyncMetrics,
CoreMetrics, HyperlaneAgentCore,
};
use hyperlane_core::U256;
use hyperlane_core::{db::DB, HyperlaneChain, HyperlaneDomain, ValidatorAnnounce};
@ -155,7 +155,6 @@ impl BaseAgent for Relayer {
.unwrap_or_else(|_| panic!("No chain setup found for {}", chain.name()))
.clone();
let txsubmission = chain_setup.txsubmission;
let metadata_builder = BaseMetadataBuilder::new(
chain_setup,
prover_sync.clone(),
@ -166,7 +165,6 @@ impl BaseAgent for Relayer {
tasks.push(self.run_destination_mailbox(
mailbox.clone(),
metadata_builder.clone(),
txsubmission,
self.gas_payment_enforcer.clone(),
receive_channel,
));
@ -244,39 +242,31 @@ impl Relayer {
&self,
destination_mailbox: CachingMailbox,
metadata_builder: BaseMetadataBuilder,
tx_submission: TransactionSubmissionType,
gas_payment_enforcer: Arc<GasPaymentEnforcer>,
msg_receive: UnboundedReceiver<PendingMessage>,
) -> Instrumented<JoinHandle<Result<()>>> {
let origin_mailbox = self.mailboxes.get(&self.origin_chain).unwrap();
let destination = destination_mailbox.domain();
let submit_fut = match tx_submission {
TransactionSubmissionType::Signer => {
let transaction_gas_limit = if self
.skip_transaction_gas_limit_for
.contains(&destination.id())
{
None
} else {
self.transaction_gas_limit
};
let serial_submitter = SerialSubmitter::new(
msg_receive,
destination_mailbox.clone(),
metadata_builder,
origin_mailbox.db().clone(),
SerialSubmitterMetrics::new(
&self.core.metrics,
&self.origin_chain,
destination,
),
gas_payment_enforcer,
transaction_gas_limit,
);
serial_submitter.spawn()
}
let transaction_gas_limit = if self
.skip_transaction_gas_limit_for
.contains(&destination.id())
{
None
} else {
self.transaction_gas_limit
};
let serial_submitter = SerialSubmitter::new(
msg_receive,
destination_mailbox.clone(),
metadata_builder,
origin_mailbox.db().clone(),
SerialSubmitterMetrics::new(&self.core.metrics, &self.origin_chain, destination),
gas_payment_enforcer,
transaction_gas_limit,
);
let submit_fut = serial_submitter.spawn();
tokio::spawn(async move {
let res = tokio::try_join!(submit_fut)?;

@ -68,16 +68,6 @@ impl ChainConnectionConf {
}
}
/// Ways in which transactions can be submitted to a blockchain.
#[derive(Copy, Clone, Debug, Default, Deserialize)]
#[serde(tag = "type", rename_all = "camelCase")]
pub enum TransactionSubmissionType {
/// Use the configured signer to sign and submit transactions in the
/// "default" manner.
#[default]
Signer,
}
/// Addresses for mailbox chain contracts
#[derive(Clone, Debug, Default)]
pub struct CoreContractAddresses {
@ -192,8 +182,6 @@ pub struct ChainConf {
pub addresses: CoreContractAddresses,
/// The chain connection details
pub connection: Option<ChainConnectionConf>,
/// How transactions to this chain are submitted.
pub txsubmission: TransactionSubmissionType,
/// Configure chain-specific metrics information. This will automatically
/// add all contract addresses but will not override any set explicitly.
/// Use `metrics_conf()` to get the metrics.
@ -214,8 +202,6 @@ pub struct RawChainConf {
addresses: Option<RawCoreContractAddresses>,
#[serde(flatten, default)]
connection: Option<RawChainConnectionConf>,
#[serde(default)]
txsubmission: Option<String>,
// TODO: if people actually use the metrics conf we should also add a raw form.
#[serde(default)]
metrics_conf: Option<PrometheusMiddlewareConf>,
@ -274,11 +260,6 @@ impl FromRawConf<'_, RawChainConf> for ChainConf {
})
.unwrap_or(0);
let txsubmission = raw
.txsubmission
.and_then(|v| serde_json::from_str(&v).take_err(&mut err, || cwp + "txsubmission"))
.unwrap_or_default();
let index = raw
.index
.and_then(|v| v.parse_config(&cwp.join("index")).take_config_err(&mut err))
@ -293,7 +274,6 @@ impl FromRawConf<'_, RawChainConf> for ChainConf {
addresses: addresses.unwrap(),
signer,
finality_blocks,
txsubmission,
index,
metrics_conf,
})

Loading…
Cancel
Save