Skip to content

Commit

Permalink
builder: drop use of Arc for Context and fix error with genesis d…
Browse files Browse the repository at this point in the history
…etails
  • Loading branch information
ralexstokes committed Feb 28, 2023
1 parent a9d0adf commit ce3cba3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions mev-build-rs/src/mempool_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub struct Inner {
proposer_scheduler: ProposerScheduler,
engine_api_client: EngineApiClient,
proxy: Arc<Proxy>,
context: Arc<Context>,
context: Context,
state: Mutex<State>,
}

Expand All @@ -59,7 +59,7 @@ impl Builder {
secret_key: SecretKey,
genesis_validators_root: Root,
client: Client,
context: Arc<Context>,
context: Context,
engine_api_client: EngineApiClient,
proxy: Arc<Proxy>,
) -> Self {
Expand Down
7 changes: 3 additions & 4 deletions mev-build-rs/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,15 @@ impl Service {

let context =
if let Some(context) = context { context } else { Context::try_from(&network)? };
let clock = context.clock(Option::from(genesis_details.genesis_time));
let context = Arc::new(context);
let (tx, rx) = mpsc::channel(BUILD_JOB_BUFFER_SIZE);
let engine_api_client = EngineApiClient::new(&engine_api_proxy.engine_api_endpoint);
let http_client = HttpClient::new();
let proxy = Arc::new(Proxy::new(http_client, &engine_api_proxy.engine_api_endpoint, tx));
let engine_api_proxy = EngineApiProxy::new(engine_api_proxy);

let genesis_validators_root =
client.get_genesis_details().await.map(|details| details.genesis_validators_root)?;
let genesis_details = client.get_genesis_details().await?;
let genesis_validators_root = genesis_details.genesis_validators_root;
let clock = context.clock(Some(genesis_details.genesis_time));
let builder = Builder::new(
secret_key,
genesis_validators_root,
Expand Down

0 comments on commit ce3cba3

Please sign in to comment.