Skip to content

Commit

Permalink
Merge pull request #549 from chainbound/proofs
Browse files Browse the repository at this point in the history
chore(bolt-sidecar): use proofs from alloy and clean up imports
  • Loading branch information
merklefruit authored Dec 11, 2024
2 parents 3f1c44d + 305ca71 commit 91bce59
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
17 changes: 8 additions & 9 deletions bolt-sidecar/src/builder/fallback/payload_builder.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use alloy::{
consensus::Transaction,
consensus::{proofs, Transaction},
eips::{calc_excess_blob_gas, calc_next_block_base_fee, eip1559::BaseFeeParams},
primitives::{Address, Bytes},
};
use reth_primitives::{proofs, SealedBlock, TransactionSigned};
use reth_primitives::{SealedBlock, TransactionSigned};
use tracing::debug;

use super::{
Expand Down Expand Up @@ -144,7 +144,9 @@ impl FallbackPayloadBuilder {
mod tests {
use std::time::{SystemTime, UNIX_EPOCH};

use alloy::consensus::constants;
use alloy::{
consensus::proofs,
eips::eip2718::{Decodable2718, Encodable2718},
network::{EthereumWallet, TransactionBuilder},
primitives::{hex, Address},
Expand Down Expand Up @@ -193,9 +195,9 @@ mod tests {
let raw_encoded = tx_signed.encoded_2718();
let tx_signed_reth = TransactionSigned::decode_2718(&mut raw_encoded.as_slice())?;

let slot = genesis_time +
(SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs() / cfg.chain.slot_time()) +
1;
let slot = genesis_time
+ (SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs() / cfg.chain.slot_time())
+ 1;

let block = builder.build_fallback_payload(slot, &[tx_signed_reth]).await?;

Expand All @@ -207,9 +209,6 @@ mod tests {
#[test]
fn test_empty_el_withdrawals_root() {
// Withdrawal root in the execution layer header is MPT.
assert_eq!(
reth_primitives::proofs::calculate_withdrawals_root(&Vec::new()),
alloy::consensus::constants::EMPTY_WITHDRAWALS
);
assert_eq!(proofs::calculate_withdrawals_root(&Vec::new()), constants::EMPTY_WITHDRAWALS);
}
}
3 changes: 2 additions & 1 deletion bolt-sidecar/src/client/execution.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::ops::{Deref, DerefMut};

use alloy::rpc::client::RpcClient;
use alloy::{
eips::BlockNumberOrTag,
primitives::{Address, Bytes, TxHash, B256, U256, U64},
Expand All @@ -22,7 +23,7 @@ use crate::primitives::AccountState;
#[derive(Clone, Debug)]
pub struct ExecutionClient {
/// The custom RPC client that allows us to add custom batching and extend the provider.
rpc: alloy::rpc::client::RpcClient<Http<Client>>,
rpc: RpcClient<Http<Client>>,
/// The inner provider that implements all the JSON-RPC methods, that can be
/// easily used via dereferencing this struct.
inner: RootProvider<Http<Client>>,
Expand Down

0 comments on commit 91bce59

Please sign in to comment.