Skip to content

Commit 56f0e60

Browse files
authored
Merge pull request #7 from pawanjay176/electra
Electra support and minor fixes
2 parents cb9a15e + 3b08ff4 commit 56f0e60

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ members = [
1616
async-trait = "0.1"
1717
axum = { version = "0.7", features = ["ws"] }
1818
bytes = "1.6"
19-
eth2 = { git = "https://github.com/realbigsean/lighthouse.git", rev = "10ce60633859ab4f20308ef42bb88e219e09fee5" }
20-
ethereum_serde_utils = "0.5.2"
21-
ethereum_ssz = "0.5.4"
22-
ethereum_ssz_derive = "0.5.4"
19+
eth2 = { git = "https://github.com/sigp/lighthouse.git", rev = "c33307d70287fd3b7a70785f89dadcb737214903" }
20+
ethereum_serde_utils = "0.7"
21+
ethereum_ssz = "0.7"
22+
ethereum_ssz_derive = "0.7"
2323
flate2 = "1.0"
2424
futures = "0.3.30"
2525
http = "1"
@@ -30,5 +30,5 @@ superstruct = "0.8"
3030
tokio = { version = "1", default-features = false, features = ["signal", "rt-multi-thread"] }
3131
tokio-tungstenite = "0.24.0"
3232
tracing = { version = "0.1", features = ["attributes"] }
33-
types = { git = "https://github.com/realbigsean/lighthouse.git", rev = "10ce60633859ab4f20308ef42bb88e219e09fee5" }
33+
types = { git = "https://github.com/sigp/lighthouse.git", rev = "c33307d70287fd3b7a70785f89dadcb737214903" }
3434
rand = "0.8"

builder-server/src/builder.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
use async_trait::async_trait;
22
use builder_api_types::{
3-
builder_bid::SignedBuilderBid, eth_spec::EthSpec, ExecutionBlockHash, ExecutionPayload,
4-
ForkName, PublicKeyBytes, SignedBlindedBeaconBlock, SignedValidatorRegistrationData, Slot,
3+
builder_bid::SignedBuilderBid, eth_spec::EthSpec, ExecutionBlockHash, ForkName,
4+
FullPayloadContents, PublicKeyBytes, SignedBlindedBeaconBlock, SignedValidatorRegistrationData,
5+
Slot,
56
};
67
use ethereum_apis_common::ErrorResponse;
78

@@ -15,7 +16,7 @@ pub trait Builder<E: EthSpec> {
1516
async fn submit_blinded_block(
1617
&self,
1718
block: SignedBlindedBeaconBlock<E>,
18-
) -> Result<ExecutionPayload<E>, ErrorResponse>;
19+
) -> Result<FullPayloadContents<E>, ErrorResponse>;
1920

2021
async fn get_header(
2122
&self,

builder-server/src/server.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use axum::{
88
};
99
use builder_api_types::{
1010
eth_spec::EthSpec, fork_versioned_response::EmptyMetadata, ExecutionBlockHash,
11-
ForkVersionedResponse, PublicKeyBytes, SignedBlindedBeaconBlock,
11+
ForkVersionedResponse, FullPayloadContents, PublicKeyBytes, SignedBlindedBeaconBlock,
1212
SignedValidatorRegistrationData, Slot,
1313
};
1414
use ethereum_apis_common::build_response;
@@ -64,10 +64,18 @@ where
6464
.as_ref()
6565
.submit_blinded_block(block)
6666
.await
67-
.map(|payload| ForkVersionedResponse {
68-
version: Some(payload.fork_name()),
69-
metadata: EmptyMetadata {},
70-
data: payload,
67+
.map(|payload| {
68+
let fork_name = match &payload {
69+
FullPayloadContents::Payload(payload) => payload.fork_name(),
70+
FullPayloadContents::PayloadAndBlobs(payload_and_blobs) => {
71+
payload_and_blobs.execution_payload.fork_name()
72+
}
73+
};
74+
ForkVersionedResponse {
75+
version: Some(fork_name),
76+
metadata: EmptyMetadata {},
77+
data: payload,
78+
}
7179
});
7280
build_response(res).await
7381
}

0 commit comments

Comments
 (0)