Skip to content

Commit ba06501

Browse files
committed
Merge branch 'electra-alpha7' of https://github.com/pawanjay176/lighthouse into single_attestation
2 parents 5e28a01 + c5c9aca commit ba06501

File tree

4 files changed

+19
-15
lines changed

4 files changed

+19
-15
lines changed

beacon_node/execution_layer/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ impl<E: EthSpec> TryFrom<BuilderBid<E>> for ProvenancedPayload<BlockProposalCont
121121
block_value: builder_bid.value,
122122
kzg_commitments: builder_bid.blob_kzg_commitments,
123123
blobs_and_proofs: None,
124-
// TODO(electra): update this with builder api returning the requests
125-
requests: None,
124+
requests: Some(builder_bid.execution_requests),
126125
},
127126
};
128127
Ok(ProvenancedPayload::Builder(

beacon_node/execution_layer/src/test_utils/mock_builder.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::test_utils::{DEFAULT_BUILDER_PAYLOAD_VALUE_WEI, DEFAULT_JWT_SECRET};
1+
use crate::test_utils::DEFAULT_JWT_SECRET;
22
use crate::{Config, ExecutionLayer, PayloadAttributes};
33
use eth2::types::{BlobsBundle, BlockId, StateId, ValidatorId};
44
use eth2::{BeaconNodeHttpClient, Timeouts, CONSENSUS_VERSION_HEADER};
@@ -543,7 +543,7 @@ pub fn serve<E: EthSpec>(
543543
let mut message = match payload_response_type {
544544
crate::GetPayloadResponseType::Full(payload_response) => {
545545
#[allow(clippy::type_complexity)]
546-
let (payload, _block_value, maybe_blobs_bundle, _maybe_requests): (
546+
let (payload, value, maybe_blobs_bundle, maybe_requests): (
547547
ExecutionPayload<E>,
548548
Uint256,
549549
Option<BlobsBundle<E>>,
@@ -559,8 +559,9 @@ pub fn serve<E: EthSpec>(
559559
blob_kzg_commitments: maybe_blobs_bundle
560560
.map(|b| b.commitments)
561561
.unwrap_or_default(),
562-
value: Uint256::from(DEFAULT_BUILDER_PAYLOAD_VALUE_WEI),
562+
value,
563563
pubkey: builder.builder_sk.public_key().compress(),
564+
execution_requests: maybe_requests.unwrap_or_default(),
564565
}),
565566
ForkName::Deneb => BuilderBid::Deneb(BuilderBidDeneb {
566567
header: payload
@@ -570,23 +571,23 @@ pub fn serve<E: EthSpec>(
570571
blob_kzg_commitments: maybe_blobs_bundle
571572
.map(|b| b.commitments)
572573
.unwrap_or_default(),
573-
value: Uint256::from(DEFAULT_BUILDER_PAYLOAD_VALUE_WEI),
574+
value,
574575
pubkey: builder.builder_sk.public_key().compress(),
575576
}),
576577
ForkName::Capella => BuilderBid::Capella(BuilderBidCapella {
577578
header: payload
578579
.as_capella()
579580
.map_err(|_| reject("incorrect payload variant"))?
580581
.into(),
581-
value: Uint256::from(DEFAULT_BUILDER_PAYLOAD_VALUE_WEI),
582+
value,
582583
pubkey: builder.builder_sk.public_key().compress(),
583584
}),
584585
ForkName::Bellatrix => BuilderBid::Bellatrix(BuilderBidBellatrix {
585586
header: payload
586587
.as_bellatrix()
587588
.map_err(|_| reject("incorrect payload variant"))?
588589
.into(),
589-
value: Uint256::from(DEFAULT_BUILDER_PAYLOAD_VALUE_WEI),
590+
value,
590591
pubkey: builder.builder_sk.public_key().compress(),
591592
}),
592593
ForkName::Base | ForkName::Altair => {
@@ -596,7 +597,7 @@ pub fn serve<E: EthSpec>(
596597
}
597598
crate::GetPayloadResponseType::Blinded(payload_response) => {
598599
#[allow(clippy::type_complexity)]
599-
let (payload, _block_value, maybe_blobs_bundle, _maybe_requests): (
600+
let (payload, value, maybe_blobs_bundle, maybe_requests): (
600601
ExecutionPayload<E>,
601602
Uint256,
602603
Option<BlobsBundle<E>>,
@@ -611,8 +612,9 @@ pub fn serve<E: EthSpec>(
611612
blob_kzg_commitments: maybe_blobs_bundle
612613
.map(|b| b.commitments)
613614
.unwrap_or_default(),
614-
value: Uint256::from(DEFAULT_BUILDER_PAYLOAD_VALUE_WEI),
615+
value,
615616
pubkey: builder.builder_sk.public_key().compress(),
617+
execution_requests: maybe_requests.unwrap_or_default(),
616618
}),
617619
ForkName::Deneb => BuilderBid::Deneb(BuilderBidDeneb {
618620
header: payload
@@ -622,23 +624,23 @@ pub fn serve<E: EthSpec>(
622624
blob_kzg_commitments: maybe_blobs_bundle
623625
.map(|b| b.commitments)
624626
.unwrap_or_default(),
625-
value: Uint256::from(DEFAULT_BUILDER_PAYLOAD_VALUE_WEI),
627+
value,
626628
pubkey: builder.builder_sk.public_key().compress(),
627629
}),
628630
ForkName::Capella => BuilderBid::Capella(BuilderBidCapella {
629631
header: payload
630632
.as_capella()
631633
.map_err(|_| reject("incorrect payload variant"))?
632634
.into(),
633-
value: Uint256::from(DEFAULT_BUILDER_PAYLOAD_VALUE_WEI),
635+
value,
634636
pubkey: builder.builder_sk.public_key().compress(),
635637
}),
636638
ForkName::Bellatrix => BuilderBid::Bellatrix(BuilderBidBellatrix {
637639
header: payload
638640
.as_bellatrix()
639641
.map_err(|_| reject("incorrect payload variant"))?
640642
.into(),
641-
value: Uint256::from(DEFAULT_BUILDER_PAYLOAD_VALUE_WEI),
643+
value,
642644
pubkey: builder.builder_sk.public_key().compress(),
643645
}),
644646
ForkName::Base | ForkName::Altair => {

beacon_node/execution_layer/src/test_utils/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub use execution_block_generator::{
3030
static_valid_tx, Block, ExecutionBlockGenerator,
3131
};
3232
pub use hook::Hook;
33-
pub use mock_builder::{MockBuilder, Operation};
33+
pub use mock_builder::{MockBuilder, Operation, serve as serve_mock_builder};
3434
pub use mock_execution_layer::MockExecutionLayer;
3535

3636
pub const DEFAULT_TERMINAL_DIFFICULTY: u64 = 6400;

consensus/types/src/builder_bid.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ use crate::beacon_block_body::KzgCommitments;
22
use crate::{
33
ChainSpec, EthSpec, ExecutionPayloadHeaderBellatrix, ExecutionPayloadHeaderCapella,
44
ExecutionPayloadHeaderDeneb, ExecutionPayloadHeaderElectra, ExecutionPayloadHeaderRef,
5-
ExecutionPayloadHeaderRefMut, ForkName, ForkVersionDeserialize, SignedRoot, Uint256,
5+
ExecutionPayloadHeaderRefMut, ExecutionRequests, ForkName, ForkVersionDeserialize, SignedRoot,
6+
Uint256,
67
};
78
use bls::PublicKeyBytes;
89
use bls::Signature;
@@ -33,6 +34,8 @@ pub struct BuilderBid<E: EthSpec> {
3334
pub header: ExecutionPayloadHeaderElectra<E>,
3435
#[superstruct(only(Deneb, Electra))]
3536
pub blob_kzg_commitments: KzgCommitments<E>,
37+
#[superstruct(only(Electra))]
38+
pub execution_requests: ExecutionRequests<E>,
3639
#[serde(with = "serde_utils::quoted_u256")]
3740
pub value: Uint256,
3841
pub pubkey: PublicKeyBytes,

0 commit comments

Comments
 (0)