Skip to content

Commit 7e359c5

Browse files
authored
chore(deps): upgrade to latest alloy/sdk/trevm (#99)
1 parent dda4506 commit 7e359c5

File tree

4 files changed

+34
-19
lines changed

4 files changed

+34
-19
lines changed

Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ path = "bin/submit_transaction.rs"
2525
integration = []
2626

2727
[dependencies]
28-
init4-bin-base = { version = "0.3.4", features = ["perms"] }
28+
init4-bin-base = { version = "0.4.1", features = ["perms"] }
2929

30-
signet-constants = { git = "https://github.com/init4tech/signet-sdk", rev = "b8251ff0fec7cb14ca87e6f95c14f56bc2593049" }
31-
signet-sim = { git = "https://github.com/init4tech/signet-sdk", rev = "b8251ff0fec7cb14ca87e6f95c14f56bc2593049" }
32-
signet-tx-cache = { git = "https://github.com/init4tech/signet-sdk", rev = "b8251ff0fec7cb14ca87e6f95c14f56bc2593049" }
33-
signet-types = { git = "https://github.com/init4tech/signet-sdk", rev = "b8251ff0fec7cb14ca87e6f95c14f56bc2593049" }
34-
signet-zenith = { git = "https://github.com/init4tech/signet-sdk", rev = "b8251ff0fec7cb14ca87e6f95c14f56bc2593049" }
30+
signet-constants = { git = "https://github.com/init4tech/signet-sdk", rev = "bd183b627dcb0eb682da801093b13f1f8311446b" }
31+
signet-sim = { git = "https://github.com/init4tech/signet-sdk", rev = "bd183b627dcb0eb682da801093b13f1f8311446b" }
32+
signet-tx-cache = { git = "https://github.com/init4tech/signet-sdk", rev = "bd183b627dcb0eb682da801093b13f1f8311446b" }
33+
signet-types = { git = "https://github.com/init4tech/signet-sdk", rev = "bd183b627dcb0eb682da801093b13f1f8311446b" }
34+
signet-zenith = { git = "https://github.com/init4tech/signet-sdk", rev = "bd183b627dcb0eb682da801093b13f1f8311446b" }
3535

36-
trevm = { version = "0.20.10", features = ["concurrent-db", "test-utils"] }
36+
trevm = { version = "0.23.4", features = ["concurrent-db", "test-utils"] }
3737

38-
alloy = { version = "0.12.6", features = [
38+
alloy = { version = "1.0.5", features = [
3939
"full",
4040
"json-rpc",
4141
"signer-aws",

bin/submit_transaction.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
use alloy::{
22
network::{EthereumWallet, TransactionBuilder},
33
primitives::{Address, U256},
4-
providers::{Provider as _, ProviderBuilder, WalletProvider},
4+
providers::{
5+
Provider as _, ProviderBuilder, WalletProvider,
6+
fillers::{BlobGasFiller, SimpleNonceManager},
7+
},
58
rpc::types::eth::TransactionRequest,
69
};
710
use builder::config::HostProvider;
@@ -31,7 +34,12 @@ impl Config {
3134
async fn provider(&self) -> HostProvider {
3235
let signer = self.kms_key_id.connect_remote().await.unwrap();
3336

34-
ProviderBuilder::new()
37+
ProviderBuilder::new_with_network()
38+
.disable_recommended_fillers()
39+
.filler(BlobGasFiller)
40+
.with_gas_estimation()
41+
.with_nonce_management(SimpleNonceManager::default())
42+
.fetch_chain_id()
3543
.wallet(EthereumWallet::from(signer))
3644
.connect(&self.rpc_url)
3745
.await

src/config.rs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use alloy::{
1313
Identity, ProviderBuilder, RootProvider,
1414
fillers::{
1515
BlobGasFiller, ChainIdFiller, FillProvider, GasFiller, JoinFill, NonceFiller,
16-
WalletFiller,
16+
SimpleNonceManager, WalletFiller,
1717
},
1818
},
1919
};
@@ -35,19 +35,21 @@ use trevm::revm::context::BlockEnv;
3535
pub type RuProvider = RootProvider<Ethereum>;
3636

3737
/// A [`Zenith`] contract instance using [`Provider`] as the provider.
38-
pub type ZenithInstance<P = HostProvider> = Zenith::ZenithInstance<(), P, alloy::network::Ethereum>;
38+
pub type ZenithInstance<P = HostProvider> = Zenith::ZenithInstance<P, alloy::network::Ethereum>;
3939

4040
/// Type alias for the provider used to build and submit blocks to the host.
4141
pub type HostProvider = FillProvider<
4242
JoinFill<
4343
JoinFill<
44-
Identity,
45-
JoinFill<GasFiller, JoinFill<BlobGasFiller, JoinFill<NonceFiller, ChainIdFiller>>>,
44+
JoinFill<
45+
JoinFill<JoinFill<Identity, BlobGasFiller>, GasFiller>,
46+
NonceFiller<SimpleNonceManager>,
47+
>,
48+
ChainIdFiller,
4649
>,
4750
WalletFiller<EthereumWallet>,
4851
>,
4952
RootProvider,
50-
Ethereum,
5153
>;
5254

5355
/// Configuration for a builder running a specific rollup on a specific host
@@ -187,7 +189,12 @@ impl BuilderConfig {
187189
/// Connect to the Host rpc provider.
188190
pub async fn connect_host_provider(&self) -> eyre::Result<HostProvider> {
189191
let builder_signer = self.connect_builder_signer().await?;
190-
ProviderBuilder::new()
192+
ProviderBuilder::new_with_network()
193+
.disable_recommended_fillers()
194+
.filler(BlobGasFiller)
195+
.with_gas_estimation()
196+
.with_nonce_management(SimpleNonceManager::default())
197+
.fetch_chain_id()
191198
.wallet(EthereumWallet::from(builder_signer))
192199
.connect(&self.host_rpc_url)
193200
.await

src/utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
use alloy::primitives::{B256, PrimitiveSignature};
1+
use alloy::primitives::{B256, Signature};
22

33
/// Extracts the components of a signature.
44
/// Currently alloy has no function for extracting the components of a signature.
55
/// Returns a tuple of (v, r, s) where:
66
/// - `v` is the recovery id
77
/// - `r` is the r component of the signature
88
/// - `s` is the s component of the signature
9-
pub fn extract_signature_components(sig: &PrimitiveSignature) -> (u8, B256, B256) {
9+
pub fn extract_signature_components(sig: &Signature) -> (u8, B256, B256) {
1010
let v = sig.as_bytes()[64];
1111
let r = sig.r().into();
1212
let s = sig.s().into();
@@ -23,7 +23,7 @@ mod tests {
2323
let r = U256::from(123456789);
2424
let s = U256::from(987654321);
2525
let y_parity = true;
26-
let sig = PrimitiveSignature::new(r, s, y_parity);
26+
let sig = Signature::new(r, s, y_parity);
2727
let (v, r_bytes, s_bytes) = extract_signature_components(&sig);
2828
assert_eq!(v, 28);
2929
assert_eq!(U256::from_be_bytes(r_bytes.0), r);

0 commit comments

Comments
 (0)