diff --git a/crates/eth-sparse-mpt/src/v2/mod.rs b/crates/eth-sparse-mpt/src/v2/mod.rs index 5fb7fce39..4986e84f7 100644 --- a/crates/eth-sparse-mpt/src/v2/mod.rs +++ b/crates/eth-sparse-mpt/src/v2/mod.rs @@ -47,7 +47,7 @@ impl SharedCacheV2 { } } -#[derive(Debug, PartialEq, Eq)] +#[derive(Debug, Clone, PartialEq, Eq)] enum StorageTrieStatus { InsertsNotProcessed, InsertsProcessed, @@ -64,7 +64,6 @@ impl StorageTrieStatus { } } -/// WARN: Clone will not clone changed tries #[derive(Debug, Default)] pub struct RootHashCalculator { storage: DashMap
>, FxBuildHasher>, @@ -81,8 +80,20 @@ pub struct RootHashCalculator { impl Clone for RootHashCalculator { fn clone(&self) -> Self { Self { + storage: self + .storage + .iter() + .map(|entry| { + ( + *entry.key(), + Arc::new(Mutex::new(entry.value().lock().clone())), + ) + }) + .collect(), + changed_account: Arc::new(RwLock::new(self.changed_account.read().clone())), + account_trie: self.account_trie.clone(), shared_cache: self.shared_cache.clone(), - ..Default::default() + incremental_account_change: self.incremental_account_change.clone(), } } } diff --git a/crates/rbuilder-operator/src/bidding_service_wrapper/bidding_service.rs b/crates/rbuilder-operator/src/bidding_service_wrapper/bidding_service.rs index 32e52cda6..d36e65a2b 100644 --- a/crates/rbuilder-operator/src/bidding_service_wrapper/bidding_service.rs +++ b/crates/rbuilder-operator/src/bidding_service_wrapper/bidding_service.rs @@ -1,14 +1,4 @@ // This file is @generated by prost-build. -/// Mapping of build_info::Version -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BidderVersionInfo { - #[prost(string, tag = "1")] - pub git_commit: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub git_ref: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub build_time_utc: ::prost::alloc::string::String, -} #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Empty {} #[derive(Clone, Copy, PartialEq, ::prost::Message)] @@ -54,10 +44,41 @@ pub struct LandedBlockInfo { } #[derive(Clone, PartialEq, ::prost::Message)] pub struct LandedBlocksParams { - /// Added field name #[prost(message, repeated, tag = "1")] pub landed_block_info: ::prost::alloc::vec::Vec {
/// If set to true blocks will be finalized before notifying BiddingService
/// This reduces latency for creating block with concrete proposer payout value.
adjust_finalized_blocks: bool,
+ /// relay sets well get on bids.
+ relay_sets: Vec {
@@ -78,12 +88,14 @@ impl {
block_sink_factory: RelaySubmitSinkFactory,
wallet_balance_watcher: WalletBalanceWatcher ,
adjust_finalized_blocks: bool,
+ relay_sets: Vec {
}
}
- let finished_block_sink = self
- .block_sink_factory
- .create_builder_sink(slot_data.clone(), cancel.clone());
-
let input = UnfinishedBuiltBlocksInput::new(
built_block_cache,
- finished_block_sink,
+ slot_data.relay_registrations.keys().cloned().collect(),
self.adjust_finalized_blocks,
+ self.relay_sets.clone(),
cancel.clone(),
);
@@ -131,12 +140,32 @@ impl {
.spawn(move || input_clone.run_prefinalize_thread(slot_bidder))
.unwrap();
- let input_clone = input.clone();
- std::thread::Builder::new()
- .name("finalize_worker".into())
- .spawn(move || input_clone.run_finalize_thread())
- .unwrap();
-
+ let block_sink: Arc (
base_config: &BaseConfig,
l1_config: &L1Config,
+ relay_sets: Vec ,
bid_observer: Box (
where
P: StateProviderFactory + Clone + 'static,
{
- let (sink_sealed_factory, slot_info_provider, adjustment_fee_payers) =
- l1_config.create_relays_sealed_sink_factory(base_config.chain_spec()?, bid_observer)?;
+ let (sink_sealed_factory, slot_info_provider, adjustment_fee_payers) = l1_config
+ .create_relays_sealed_sink_factory(
+ base_config.chain_spec()?,
+ relay_sets.clone(),
+ bid_observer,
+ )?;
if !l1_config.relay_bid_scrapers.is_empty() {
let sender = Arc::new(BiddingService2BidSender::new(bidding_service.clone()));
@@ -1080,6 +1118,7 @@ where
sink_sealed_factory,
wallet_balance_watcher,
base_config.adjust_finalized_blocks,
+ relay_sets,
);
Ok((sink_factory, slot_info_provider, adjustment_fee_payers))
diff --git a/crates/rbuilder/src/mev_boost/mod.rs b/crates/rbuilder/src/mev_boost/mod.rs
index 27e083770..1ca77c523 100644
--- a/crates/rbuilder/src/mev_boost/mod.rs
+++ b/crates/rbuilder/src/mev_boost/mod.rs
@@ -71,7 +71,7 @@ fn is_ignorable_relay_error(code: StatusCode, text: &str) -> bool {
#[derive(Debug, Clone, Deserialize, PartialEq, Eq, Default)]
#[serde(deny_unknown_fields)]
pub struct RelayConfig {
- pub name: String,
+ pub name: MevBoostRelayID,
pub url: String,
#[serde(default)]
pub grpc_url: Option