Skip to content

Commit

Permalink
don't request data from relayers + create gwyneth relayer
Browse files Browse the repository at this point in the history
  • Loading branch information
Brechtpd committed Sep 17, 2024
1 parent 4458389 commit ffe51b2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
8 changes: 8 additions & 0 deletions crates/rbuilder/src/live_builder/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,14 @@ impl LiveBuilderConfig for Config {
self.base_config.chain_spec()?,
Box::new(DummyBiddingService {}),
)?;

let gwyneth_relay_config = RelayConfig::default().
with_url("https://0xac6e77dfe25ecd6110b8e780608cce0dab71fdd5ebea22a16c0205200f2f8e2e3ad3b71d3499c54ad14d6c21b41a37ae@boost-relay.flashbots.net").
with_name("gwyneth");
let gwyneth_relay = MevBoostRelay::from_config(&gwyneth_relay_config)?;

relays.clone().push(gwyneth_relay);

let payload_event = MevBoostSlotDataGenerator::new(
self.l1_config.beacon_clients()?,
relays,
Expand Down
16 changes: 12 additions & 4 deletions crates/rbuilder/src/live_builder/payload_events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use crate::{
};
use ahash::HashSet;
use alloy_primitives::{utils::format_ether, Address, B256, U256};
use primitive_types::H384;
use reth::{
primitives::constants::SLOT_DURATION, rpc::types::beacon::events::PayloadAttributesEvent,
};
Expand Down Expand Up @@ -111,7 +112,7 @@ impl MevBoostSlotDataGenerator {
/// it, but even with the event being created for every slot, the fee_recipient we get from MEV-Boost might be different so we should always replace it.
/// Note that with MEV-boost the validator may change the fee_recipient when registering to the Relays.
pub fn spawn(self) -> (JoinHandle<()>, mpsc::UnboundedReceiver<MevBoostSlotData>) {
let relays = RelaysForSlotData::new(&self.relays);
//let relays = RelaysForSlotData::new(&self.relays);

let (send, receive) = mpsc::unbounded_channel();
let handle = tokio::spawn(async move {
Expand All @@ -123,20 +124,27 @@ impl MevBoostSlotDataGenerator {
);

info!("MevBoostSlotDataGenerator: started");
let mut relays = relays;
//let mut relays = relays;
let mut recently_sent_data = VecDeque::with_capacity(RECENTLY_SENT_EVENTS_BUFF);

while let Some(event) = source.recv().await {
if self.global_cancellation.is_cancelled() {
return;
}

let (slot_data, relays) =
/*let (slot_data, relays) =
if let Some(res) = relays.slot_data(event.data.proposal_slot).await {
res
} else {
continue;
};
};*/

let slot_data = SlotData {
fee_recipient: Address::default(),
gas_limit: 15_000_000,
pubkey: H384::default(),
};
let relays = vec!["gwyneth".to_owned()];

let mut correct_event = event;
correct_event
Expand Down

0 comments on commit ffe51b2

Please sign in to comment.