Skip to content

Commit 67dac1c

Browse files
committed
use signet-sdk
- align to alloy @ 0.12.6 - transfer off of zenith-rs and use signet-sdk instead
1 parent 947cc68 commit 67dac1c

File tree

6 files changed

+36
-25
lines changed

6 files changed

+36
-25
lines changed

Cargo.toml

+15-5
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,21 @@ name = "transaction-submitter"
2222
path = "bin/submit_transaction.rs"
2323

2424
[dependencies]
25-
init4-bin-base = "0.1.0"
26-
27-
zenith-types = "0.15"
28-
29-
alloy = { version = "=0.11.1", features = ["full", "json-rpc", "signer-aws", "rpc-types-mev", "rlp", "node-bindings"] }
25+
init4-bin-base = { path = "../bin-base" }
26+
27+
signet-bundle = { git = "https://github.com/init4tech/signet-sdk", branch = "prestwich/update-trevm" }
28+
signet-types = { git = "https://github.com/init4tech/signet-sdk", branch = "prestwich/update-trevm" }
29+
signet-zenith = { git = "https://github.com/init4tech/signet-sdk", branch = "prestwich/update-trevm" }
30+
31+
alloy = { version = "0.12.6", features = [
32+
"full",
33+
"json-rpc",
34+
"signer-aws",
35+
"rpc-types-mev",
36+
"rlp",
37+
"node-bindings",
38+
"serde",
39+
] }
3040

3141
aws-config = "1.1.7"
3242
aws-sdk-kms = "1.15.0"

bin/submit_transaction.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ async fn connect_from_config() -> (Provider, Address, u64) {
8383

8484
let provider = ProviderBuilder::new()
8585
.wallet(EthereumWallet::from(signer))
86-
.on_builtin(&rpc_url)
86+
.connect(&rpc_url)
8787
.await
8888
.unwrap();
8989

src/config.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use alloy::{
1212
};
1313
use std::{borrow::Cow, env, num, str::FromStr};
1414

15-
use zenith_types::Zenith;
15+
use signet_zenith::Zenith;
1616

1717
// Keys for .env variables that need to be set to configure the builder.
1818
const HOST_CHAIN_ID: &str = "HOST_CHAIN_ID";
@@ -207,7 +207,7 @@ impl BuilderConfig {
207207
/// Connect to the Rollup rpc provider.
208208
pub async fn connect_ru_provider(&self) -> Result<WalletlessProvider, ConfigError> {
209209
let provider = ProviderBuilder::new()
210-
.on_builtin(&self.ru_rpc_url)
210+
.connect(&self.ru_rpc_url)
211211
.await
212212
.map_err(ConfigError::Provider)?;
213213

@@ -219,7 +219,7 @@ impl BuilderConfig {
219219
let builder_signer = self.connect_builder_signer().await?;
220220
let provider = ProviderBuilder::new()
221221
.wallet(EthereumWallet::from(builder_signer))
222-
.on_builtin(&self.host_rpc_url)
222+
.connect(&self.host_rpc_url)
223223
.await
224224
.map_err(ConfigError::Provider)?;
225225

@@ -234,7 +234,7 @@ impl BuilderConfig {
234234
Vec::with_capacity(self.tx_broadcast_urls.len());
235235
for url in self.tx_broadcast_urls.iter() {
236236
let provider =
237-
ProviderBuilder::new().on_builtin(url).await.map_err(ConfigError::Provider)?;
237+
ProviderBuilder::new().connect(url).await.map_err(ConfigError::Provider)?;
238238

239239
providers.push(provider);
240240
}

src/tasks/block.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use super::oauth::Authenticator;
33
use super::tx_poller::TxPoller;
44
use crate::config::{BuilderConfig, WalletlessProvider};
55
use alloy::{
6-
consensus::{SidecarBuilder, SidecarCoder, TxEnvelope},
6+
consensus::{SidecarBuilder, SidecarCoder, transaction::TxEnvelope},
77
eips::eip2718::Decodable2718,
88
primitives::{B256, Bytes, keccak256},
99
providers::Provider as _,
@@ -13,7 +13,8 @@ use std::time::{SystemTime, UNIX_EPOCH};
1313
use std::{sync::OnceLock, time::Duration};
1414
use tokio::{sync::mpsc, task::JoinHandle};
1515
use tracing::{Instrument, debug, error, info, trace};
16-
use zenith_types::{Alloy2718Coder, ZenithEthBundle, encode_txns};
16+
use signet_zenith::{Alloy2718Coder, encode_txns};
17+
use signet_bundle::SignetEthBundle;
1718

1819
/// Ethereum's slot time in seconds.
1920
pub const ETHEREUM_SLOT_TIME: u64 = 12;
@@ -183,7 +184,7 @@ impl BlockBuilder {
183184
}
184185

185186
/// Simulates a Zenith bundle against the rollup state
186-
async fn simulate_bundle(&mut self, bundle: &ZenithEthBundle) -> eyre::Result<()> {
187+
async fn simulate_bundle(&mut self, bundle: &SignetEthBundle) -> eyre::Result<()> {
187188
// TODO: Simulate bundles with the Simulation Engine
188189
// [ENG-672](https://linear.app/initiates/issue/ENG-672/add-support-for-bundles)
189190
debug!(hash = ?bundle.bundle.bundle_hash(), block_number = ?bundle.block_number(), "bundle simulations is not implemented yet - skipping simulation");
@@ -269,7 +270,7 @@ mod tests {
269270
rpc::types::{TransactionRequest, mev::EthSendBundle},
270271
signers::local::PrivateKeySigner,
271272
};
272-
use zenith_types::ZenithEthBundle;
273+
use signet_bundle::SignetEthBundle;
273274

274275
/// Create a mock bundle for testing with a single transaction
275276
async fn create_mock_bundle(wallet: &EthereumWallet) -> Bundle {
@@ -294,7 +295,7 @@ mod tests {
294295
replacement_uuid: Some("replacement_uuid".to_owned()),
295296
};
296297

297-
let zenith_bundle = ZenithEthBundle { bundle: eth_bundle, host_fills: None };
298+
let zenith_bundle = SignetEthBundle { bundle: eth_bundle, host_fills: None };
298299

299300
Bundle { id: "mock_bundle".to_owned(), bundle: zenith_bundle }
300301
}

src/tasks/bundler.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ use reqwest::Url;
66
use serde::{Deserialize, Serialize};
77
use tokio::sync::mpsc::{UnboundedReceiver, unbounded_channel};
88
use tokio::task::JoinHandle;
9-
use zenith_types::ZenithEthBundle;
9+
use signet_bundle::SignetEthBundle;
1010

1111
/// Holds a bundle from the cache with a unique ID and a Zenith bundle.
1212
#[derive(Debug, Clone, Serialize, Deserialize)]
1313
pub struct Bundle {
1414
/// Cache identifier for the bundle
1515
pub id: String,
1616
/// The Zenith bundle for this bundle
17-
pub bundle: ZenithEthBundle,
17+
pub bundle: SignetEthBundle,
1818
}
1919

2020
/// Response from the tx-pool containing a list of bundles.

src/tasks/submit.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ use alloy::{
1818
use eyre::{bail, eyre};
1919
use init4_bin_base::deps::metrics::{counter, histogram};
2020
use oauth2::TokenResponse;
21+
use signet_types::{SignRequest, SignResponse};
22+
use signet_zenith::{
23+
BundleHelper::{self, BlockHeader, FillPermit2, submitCall},
24+
Zenith::IncorrectHostBlock,
25+
};
2126
use std::time::Instant;
2227
use tokio::{sync::mpsc, task::JoinHandle};
2328
use tracing::{debug, error, instrument, trace};
24-
use zenith_types::{
25-
BundleHelper::{self, FillPermit2},
26-
SignRequest, SignResponse,
27-
Zenith::IncorrectHostBlock,
28-
};
2929

3030
macro_rules! spawn_provider_send {
3131
($provider:expr, $tx:expr) => {
@@ -127,7 +127,7 @@ impl SubmitTask {
127127
s: FixedBytes<32>,
128128
in_progress: &InProgressBlock,
129129
) -> eyre::Result<TransactionRequest> {
130-
let data = zenith_types::BundleHelper::submitCall { fills, header, v, r, s }.abi_encode();
130+
let data = submitCall { fills, header, v, r, s }.abi_encode();
131131

132132
let sidecar = in_progress.encode_blob::<SimpleCoder>().build()?;
133133
Ok(TransactionRequest::default()
@@ -151,7 +151,7 @@ impl SubmitTask {
151151
) -> eyre::Result<ControlFlow> {
152152
let (v, r, s) = extract_signature_components(&resp.sig);
153153

154-
let header = zenith_types::BundleHelper::BlockHeader {
154+
let header = BlockHeader {
155155
hostBlockNumber: resp.req.host_block_number,
156156
rollupChainId: U256::from(self.config.ru_chain_id),
157157
gasLimit: resp.req.gas_limit,
@@ -167,7 +167,7 @@ impl SubmitTask {
167167
.with_gas_limit(1_000_000);
168168

169169
if let Err(TransportError::ErrorResp(e)) =
170-
self.host_provider.call(&tx).block(BlockNumberOrTag::Pending.into()).await
170+
self.host_provider.call(tx.clone()).block(BlockNumberOrTag::Pending.into()).await
171171
{
172172
error!(
173173
code = e.code,

0 commit comments

Comments
 (0)