Skip to content

Commit

Permalink
use radom coinbase address for simualations
Browse files Browse the repository at this point in the history
  • Loading branch information
dvush committed Dec 17, 2024
1 parent 171d8fc commit 43db8ba
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion crates/rbuilder/src/live_builder/simulation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{
},
live_builder::order_input::orderpool::OrdersForBlock,
primitives::{OrderId, SimulatedOrder},
utils::gen_uid,
utils::{gen_uid, Signer},
};
use ahash::HashMap;
use parking_lot::Mutex;
Expand Down Expand Up @@ -107,6 +107,15 @@ where
) -> SlotOrderSimResults {
let (slot_sim_results_sender, slot_sim_results_receiver) = mpsc::channel(10_000);

let ctx = {
// use random coinbase for simulations to make top of the block simulation bypass harder
let mut ctx = ctx;
let signer = Signer::random();
ctx.block_env.coinbase = signer.address;
ctx.builder_signer = Some(signer);
ctx
};

let provider = self.provider.clone();
let current_contexts = Arc::clone(&self.current_contexts);
let block_context: BlockContextId = gen_uid();
Expand Down

0 comments on commit 43db8ba

Please sign in to comment.