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 tracing::{info, info_span, instrument::Instrumented, Instrument};
use hyperlane_base::{ use hyperlane_base::{
chains::TransactionSubmissionType, run_all, BaseAgent, CachingInterchainGasPaymaster, run_all, BaseAgent, CachingInterchainGasPaymaster, CachingMailbox, ContractSyncMetrics,
CachingMailbox, ContractSyncMetrics, CoreMetrics, HyperlaneAgentCore, CoreMetrics, HyperlaneAgentCore,
}; };
use hyperlane_core::U256; use hyperlane_core::U256;
use hyperlane_core::{db::DB, HyperlaneChain, HyperlaneDomain, ValidatorAnnounce}; 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())) .unwrap_or_else(|_| panic!("No chain setup found for {}", chain.name()))
.clone(); .clone();
let txsubmission = chain_setup.txsubmission;
let metadata_builder = BaseMetadataBuilder::new( let metadata_builder = BaseMetadataBuilder::new(
chain_setup, chain_setup,
prover_sync.clone(), prover_sync.clone(),
@ -166,7 +165,6 @@ impl BaseAgent for Relayer {
tasks.push(self.run_destination_mailbox( tasks.push(self.run_destination_mailbox(
mailbox.clone(), mailbox.clone(),
metadata_builder.clone(), metadata_builder.clone(),
txsubmission,
self.gas_payment_enforcer.clone(), self.gas_payment_enforcer.clone(),
receive_channel, receive_channel,
)); ));
@ -244,39 +242,31 @@ impl Relayer {
&self, &self,
destination_mailbox: CachingMailbox, destination_mailbox: CachingMailbox,
metadata_builder: BaseMetadataBuilder, metadata_builder: BaseMetadataBuilder,
tx_submission: TransactionSubmissionType,
gas_payment_enforcer: Arc<GasPaymentEnforcer>, gas_payment_enforcer: Arc<GasPaymentEnforcer>,
msg_receive: UnboundedReceiver<PendingMessage>, msg_receive: UnboundedReceiver<PendingMessage>,
) -> Instrumented<JoinHandle<Result<()>>> { ) -> Instrumented<JoinHandle<Result<()>>> {
let origin_mailbox = self.mailboxes.get(&self.origin_chain).unwrap(); let origin_mailbox = self.mailboxes.get(&self.origin_chain).unwrap();
let destination = destination_mailbox.domain(); let destination = destination_mailbox.domain();
let submit_fut = match tx_submission { let transaction_gas_limit = if self
TransactionSubmissionType::Signer => { .skip_transaction_gas_limit_for
let transaction_gas_limit = if self .contains(&destination.id())
.skip_transaction_gas_limit_for {
.contains(&destination.id()) None
{ } else {
None self.transaction_gas_limit
} 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 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 { tokio::spawn(async move {
let res = tokio::try_join!(submit_fut)?; 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 /// Addresses for mailbox chain contracts
#[derive(Clone, Debug, Default)] #[derive(Clone, Debug, Default)]
pub struct CoreContractAddresses { pub struct CoreContractAddresses {
@ -192,8 +182,6 @@ pub struct ChainConf {
pub addresses: CoreContractAddresses, pub addresses: CoreContractAddresses,
/// The chain connection details /// The chain connection details
pub connection: Option<ChainConnectionConf>, pub connection: Option<ChainConnectionConf>,
/// How transactions to this chain are submitted.
pub txsubmission: TransactionSubmissionType,
/// Configure chain-specific metrics information. This will automatically /// Configure chain-specific metrics information. This will automatically
/// add all contract addresses but will not override any set explicitly. /// add all contract addresses but will not override any set explicitly.
/// Use `metrics_conf()` to get the metrics. /// Use `metrics_conf()` to get the metrics.
@ -214,8 +202,6 @@ pub struct RawChainConf {
addresses: Option<RawCoreContractAddresses>, addresses: Option<RawCoreContractAddresses>,
#[serde(flatten, default)] #[serde(flatten, default)]
connection: Option<RawChainConnectionConf>, connection: Option<RawChainConnectionConf>,
#[serde(default)]
txsubmission: Option<String>,
// TODO: if people actually use the metrics conf we should also add a raw form. // TODO: if people actually use the metrics conf we should also add a raw form.
#[serde(default)] #[serde(default)]
metrics_conf: Option<PrometheusMiddlewareConf>, metrics_conf: Option<PrometheusMiddlewareConf>,
@ -274,11 +260,6 @@ impl FromRawConf<'_, RawChainConf> for ChainConf {
}) })
.unwrap_or(0); .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 let index = raw
.index .index
.and_then(|v| v.parse_config(&cwp.join("index")).take_config_err(&mut err)) .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(), addresses: addresses.unwrap(),
signer, signer,
finality_blocks, finality_blocks,
txsubmission,
index, index,
metrics_conf, metrics_conf,
}) })

Loading…
Cancel
Save