Skip to content

Commit 8d550a2

Browse files
committed
chore: use new transaction builders for building the EIP-7594 sidecar tx
1 parent bbf7b97 commit 8d550a2

File tree

3 files changed

+12
-19
lines changed

3 files changed

+12
-19
lines changed

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ impl BuilderConfig {
214214

215215
Ok(ProviderBuilder::new_with_network()
216216
.disable_recommended_fillers()
217-
.filler(BlobGasFiller)
217+
.filler(BlobGasFiller::default())
218218
.with_gas_estimation()
219219
.with_nonce_management(SimpleNonceManager::default())
220220
.fetch_chain_id()

src/tasks/submit/flashbots.rs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,16 @@ use crate::{
66
tasks::{block::sim::SimResult, submit::SubmitPrep},
77
};
88
use alloy::{
9-
consensus::{EthereumTxEnvelope, TxEip4844Variant},
10-
eips::{Encodable2718, eip7594::BlobTransactionSidecarEip7594},
9+
consensus::TxEnvelope,
10+
eips::Encodable2718,
1111
primitives::{Bytes, TxHash},
1212
providers::ext::MevApi,
1313
rpc::types::mev::EthSendBundle,
1414
};
15-
use eyre::Context;
1615
use init4_bin_base::{deps::metrics::counter, utils::signer::LocalOrAws};
1716
use tokio::{sync::mpsc, task::JoinHandle};
1817
use tracing::{Instrument, debug, debug_span, error, instrument};
1918

20-
/// Type alias for a EIP 7594 compatible blob sidecar transaction envelope.
21-
type TxEnvelope7594 = EthereumTxEnvelope<TxEip4844Variant<BlobTransactionSidecarEip7594>>;
22-
2319
/// Handles preparation and submission of simulated rollup blocks to the
2420
/// Flashbots relay as MEV bundles.
2521
#[derive(Debug)]
@@ -100,10 +96,7 @@ impl FlashbotsTask {
10096
/// Creates a `SubmitPrep` instance to build the transaction, then fills
10197
/// and signs it using the host provider.
10298
#[instrument(skip_all, level = "debug")]
103-
async fn prepare_signed_transaction(
104-
&self,
105-
sim_result: &SimResult,
106-
) -> eyre::Result<TxEnvelope7594> {
99+
async fn prepare_signed_transaction(&self, sim_result: &SimResult) -> eyre::Result<TxEnvelope> {
107100
let prep = SubmitPrep::new(
108101
&sim_result.block,
109102
self.host_provider(),
@@ -119,8 +112,7 @@ impl FlashbotsTask {
119112
.instrument(tracing::debug_span!("fill_tx").or_current())
120113
.await?;
121114

122-
let tx_envelope =
123-
sendable.try_into_envelope()?.try_into_7594().wrap_err("failed to map 4844 to 7594")?;
115+
let tx_envelope = sendable.try_into_envelope()?;
124116
debug!(tx_hash = ?tx_envelope.hash(), "prepared signed rollup block transaction envelope");
125117

126118
Ok(tx_envelope)
@@ -130,7 +122,7 @@ impl FlashbotsTask {
130122
///
131123
/// Sends the transaction hash to the outbound channel for monitoring.
132124
/// Logs a debug message if the channel is closed.
133-
fn track_outbound_tx(&self, envelope: &TxEnvelope7594) {
125+
fn track_outbound_tx(&self, envelope: &TxEnvelope) {
134126
counter!("signet.builder.flashbots.").increment(1);
135127
let hash = *envelope.tx_hash();
136128
if self.outbound.send(hash).is_err() {

src/tasks/submit/prep.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ use crate::{
44
utils,
55
};
66
use alloy::{
7-
consensus::{BlobTransactionSidecar, Header, SimpleCoder},
8-
network::{TransactionBuilder, TransactionBuilder4844},
7+
consensus::{Header, SimpleCoder},
8+
eips::eip7594::BlobTransactionSidecarEip7594,
9+
network::{TransactionBuilder, TransactionBuilder7594},
910
primitives::{B256, Bytes, U256},
1011
providers::{Provider, WalletProvider},
1112
rpc::types::TransactionRequest,
@@ -103,10 +104,10 @@ impl<'a> SubmitPrep<'a> {
103104
self.quincey_resp().await.map(|resp| &resp.sig).map(utils::extract_signature_components)
104105
}
105106

106-
/// Encodes the rollup block into a sidecar.
107+
/// Encodes the rollup block into an EIP-7594 sidecar.
107108
#[instrument(skip(self), level = "debug")]
108-
async fn build_sidecar(&self) -> eyre::Result<BlobTransactionSidecar> {
109-
self.block.encode_blob::<SimpleCoder>().build().map_err(Into::into)
109+
async fn build_sidecar(&self) -> eyre::Result<BlobTransactionSidecarEip7594> {
110+
self.block.encode_blob::<SimpleCoder>().build_7594().map_err(Into::into)
110111
}
111112

112113
/// Build a signature and header input for the host chain transaction.

0 commit comments

Comments
 (0)