Skip to content

Commit

Permalink
flesh out the engine controller
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell committed Dec 3, 2024
1 parent 756a6e0 commit be165b2
Show file tree
Hide file tree
Showing 8 changed files with 563 additions and 346 deletions.
556 changes: 263 additions & 293 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[patch.crates-io]
kona-derive = { git = "https://github.com/anton-rs/kona", branch = "rf/bump-other-deps" }
kona-driver = { git = "https://github.com/anton-rs/kona", branch = "rf/bump-other-deps" }
kona-derive = { git = "https://github.com/anton-rs/kona", branch = "rf/fix/executor-trait" }
kona-driver = { git = "https://github.com/anton-rs/kona", branch = "rf/fix/executor-trait" }

[workspace.dependencies]
# Workspace
Expand Down
1 change: 1 addition & 0 deletions crates/engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ alloy-rpc-types-engine = { workspace = true, features = ["jwt", "serde"] }
# Op Alloy
op-alloy-genesis.workspace = true
op-alloy-provider.workspace = true
op-alloy-consensus.workspace = true
op-alloy-protocol.workspace = true
op-alloy-rpc-types-engine.workspace = true

Expand Down
20 changes: 16 additions & 4 deletions crates/engine/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use alloy_primitives::{Bytes, B256};
use alloy_provider::{ReqwestProvider, RootProvider};
use alloy_rpc_client::RpcClient;
use alloy_rpc_types_engine::{
ExecutionPayloadV3, ForkchoiceState, ForkchoiceUpdated, JwtSecret, PayloadId, PayloadStatus,
ExecutionPayloadEnvelopeV2,
ExecutionPayloadEnvelopeV2, ExecutionPayloadInputV2, ExecutionPayloadV2, ExecutionPayloadV3,
ForkchoiceState, ForkchoiceUpdated, JwtSecret, PayloadId, PayloadStatus,
};
use alloy_transport_http::{
hyper_util::{
Expand Down Expand Up @@ -79,7 +79,6 @@ impl Engine for EngineClient {
self.engine.get_payload_v3(payload_id).await.map_err(|_| EngineError::PayloadError)
}


async fn forkchoice_update(
&self,
state: ForkchoiceState,
Expand All @@ -88,7 +87,20 @@ impl Engine for EngineClient {
self.engine.fork_choice_updated_v2(state, attr).await.map_err(|_| EngineError::PayloadError)
}

async fn new_payload(
async fn new_payload_v2(
&self,
payload: ExecutionPayloadV2,
) -> Result<PayloadStatus, Self::Error> {
self.engine
.new_payload_v2(ExecutionPayloadInputV2 {
execution_payload: payload.payload_inner,
withdrawals: Some(payload.withdrawals),
})
.await
.map_err(|_| EngineError::PayloadError)
}

async fn new_payload_v3(
&self,
payload: ExecutionPayloadV3,
parent_beacon_block_root: B256,
Expand Down
Loading

0 comments on commit be165b2

Please sign in to comment.