diff --git a/Cargo.toml b/Cargo.toml index 63261ea..e4e8899 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,8 +3,8 @@ name = "zenith-builder-example" version = "0.1.1" description = "Zenith Builder Example" -edition = "2021" -rust-version = "1.82" +edition = "2024" +rust-version = "1.85" authors = ["init4"] license = "Apache-2.0 OR MIT" homepage = "https://github.com/init4tech/builder" diff --git a/bin/submit_transaction.rs b/bin/submit_transaction.rs index 1f5af9e..3955a49 100644 --- a/bin/submit_transaction.rs +++ b/bin/submit_transaction.rs @@ -6,7 +6,7 @@ use alloy::{ signers::aws::AwsSigner, }; use aws_config::BehaviorVersion; -use builder::config::{load_address, load_string, load_u64, load_url, Provider}; +use builder::config::{Provider, load_address, load_string, load_u64, load_url}; use init4_bin_base::{ deps::metrics::{counter, histogram}, init4, diff --git a/src/config.rs b/src/config.rs index 6fdbd73..1e8a6fa 100644 --- a/src/config.rs +++ b/src/config.rs @@ -3,11 +3,11 @@ use alloy::{ network::{Ethereum, EthereumWallet}, primitives::Address, providers::{ + Identity, ProviderBuilder, RootProvider, fillers::{ BlobGasFiller, ChainIdFiller, FillProvider, GasFiller, JoinFill, NonceFiller, WalletFiller, }, - Identity, ProviderBuilder, RootProvider, }, transports::BoxTransport, }; diff --git a/src/service.rs b/src/service.rs index 99ecd01..df14133 100644 --- a/src/service.rs +++ b/src/service.rs @@ -1,10 +1,10 @@ use std::{fmt::Debug, net::SocketAddr}; use axum::{ + Router, http::StatusCode, response::{IntoResponse, Response}, routing::get, - Router, }; use tracing::{Instrument, Span}; diff --git a/src/signer.rs b/src/signer.rs index 9de0a6c..6883cb4 100644 --- a/src/signer.rs +++ b/src/signer.rs @@ -1,8 +1,8 @@ use alloy::consensus::SignableTransaction; -use alloy::primitives::{Address, ChainId, B256}; +use alloy::primitives::{Address, B256, ChainId}; +use alloy::signers::Signature; use alloy::signers::aws::{AwsSigner, AwsSignerError}; use alloy::signers::local::{LocalSignerError, PrivateKeySigner}; -use alloy::signers::Signature; use aws_config::BehaviorVersion; /// Abstraction over local signer or diff --git a/src/tasks/block.rs b/src/tasks/block.rs index 6a8c384..6ba1e8e 100644 --- a/src/tasks/block.rs +++ b/src/tasks/block.rs @@ -5,15 +5,15 @@ use crate::config::{BuilderConfig, WalletlessProvider}; use alloy::{ consensus::{SidecarBuilder, SidecarCoder, TxEnvelope}, eips::eip2718::Decodable2718, - primitives::{keccak256, Bytes, B256}, + primitives::{B256, Bytes, keccak256}, providers::Provider as _, rlp::Buf, }; use std::time::{SystemTime, UNIX_EPOCH}; use std::{sync::OnceLock, time::Duration}; use tokio::{sync::mpsc, task::JoinHandle}; -use tracing::{debug, error, info, trace, Instrument}; -use zenith_types::{encode_txns, Alloy2718Coder, ZenithEthBundle}; +use tracing::{Instrument, debug, error, info, trace}; +use zenith_types::{Alloy2718Coder, ZenithEthBundle, encode_txns}; /// Ethereum's slot time in seconds. pub const ETHEREUM_SLOT_TIME: u64 = 12; @@ -267,7 +267,7 @@ mod tests { use alloy::{ eips::eip2718::Encodable2718, network::{EthereumWallet, TransactionBuilder}, - rpc::types::{mev::EthSendBundle, TransactionRequest}, + rpc::types::{TransactionRequest, mev::EthSendBundle}, signers::local::PrivateKeySigner, }; use zenith_types::ZenithEthBundle; diff --git a/src/tasks/bundler.rs b/src/tasks/bundler.rs index 5eba850..670ecc5 100644 --- a/src/tasks/bundler.rs +++ b/src/tasks/bundler.rs @@ -86,11 +86,7 @@ impl BundlePoller { .iter() .filter_map( |(key, expiry)| { - if expiry.elapsed().is_zero() { - Some(key.clone()) - } else { - None - } + if expiry.elapsed().is_zero() { Some(key.clone()) } else { None } }, ) .collect(); diff --git a/src/tasks/oauth.rs b/src/tasks/oauth.rs index 7bb4ad1..64c8859 100644 --- a/src/tasks/oauth.rs +++ b/src/tasks/oauth.rs @@ -4,9 +4,9 @@ use std::sync::Arc; use crate::config::BuilderConfig; use oauth2::{ + AuthUrl, ClientId, ClientSecret, EmptyExtraTokenFields, StandardTokenResponse, TokenUrl, basic::{BasicClient, BasicTokenType}, reqwest::async_http_client, - AuthUrl, ClientId, ClientSecret, EmptyExtraTokenFields, StandardTokenResponse, TokenUrl, }; use tokio::{sync::RwLock, task::JoinHandle}; diff --git a/src/tasks/submit.rs b/src/tasks/submit.rs index 0b911e0..0f1b0bf 100644 --- a/src/tasks/submit.rs +++ b/src/tasks/submit.rs @@ -5,7 +5,7 @@ use crate::{ utils::extract_signature_components, }; use alloy::{ - consensus::{constants::GWEI_TO_WEI, SimpleCoder}, + consensus::{SimpleCoder, constants::GWEI_TO_WEI}, eips::BlockNumberOrTag, network::{TransactionBuilder, TransactionBuilder4844}, primitives::{FixedBytes, TxHash, U256}, diff --git a/src/utils.rs b/src/utils.rs index 1bb1843..69b78dd 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,4 +1,4 @@ -use alloy::primitives::{PrimitiveSignature, B256}; +use alloy::primitives::{B256, PrimitiveSignature}; /// Extracts the components of a signature. /// Currently alloy has no function for extracting the components of a signature. diff --git a/tests/tx_poller_test.rs b/tests/tx_poller_test.rs index a42afa6..f0c4756 100644 --- a/tests/tx_poller_test.rs +++ b/tests/tx_poller_test.rs @@ -2,8 +2,8 @@ mod tests { use std::str::FromStr; use alloy::consensus::{SignableTransaction, TxEip1559, TxEnvelope}; - use alloy::primitives::{bytes, Address, TxKind, U256}; - use alloy::signers::{local::PrivateKeySigner, SignerSync}; + use alloy::primitives::{Address, TxKind, U256, bytes}; + use alloy::signers::{SignerSync, local::PrivateKeySigner}; use builder::config::BuilderConfig; use builder::tasks::tx_poller; use eyre::{Ok, Result};