mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-18 21:38:31 +00:00
Merge branch 'unstable' into merge-unstable-to-deneb-20231005
# Conflicts: # .github/workflows/test-suite.yml # Cargo.lock # beacon_node/execution_layer/Cargo.toml # beacon_node/execution_layer/src/test_utils/mock_builder.rs # beacon_node/execution_layer/src/test_utils/mod.rs # beacon_node/network/src/service/tests.rs # consensus/types/src/builder_bid.rs
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
use crate::beacon_block_body::KzgCommitments;
|
||||
use crate::{
|
||||
BlobRootsList, ChainSpec, EthSpec, ExecutionPayloadHeaderCapella, ExecutionPayloadHeaderDeneb,
|
||||
ExecutionPayloadHeaderMerge, ExecutionPayloadHeaderRef, ForkName, ForkVersionDeserialize,
|
||||
KzgProofs, SignedRoot, Uint256,
|
||||
ExecutionPayloadHeaderMerge, ExecutionPayloadHeaderRef, ExecutionPayloadHeaderRefMut, ForkName,
|
||||
ForkVersionDeserialize, KzgProofs, SignedRoot, Uint256,
|
||||
};
|
||||
use bls::PublicKeyBytes;
|
||||
use bls::Signature;
|
||||
@@ -26,7 +26,8 @@ pub struct BlindedBlobsBundle<E: EthSpec> {
|
||||
derive(PartialEq, Debug, Serialize, Deserialize, TreeHash, Clone),
|
||||
serde(bound = "E: EthSpec", deny_unknown_fields)
|
||||
),
|
||||
map_ref_into(ExecutionPayloadHeaderRef)
|
||||
map_ref_into(ExecutionPayloadHeaderRef),
|
||||
map_ref_mut_into(ExecutionPayloadHeaderRefMut)
|
||||
)]
|
||||
#[derive(PartialEq, Debug, Serialize, Deserialize, TreeHash, Clone)]
|
||||
#[serde(bound = "E: EthSpec", deny_unknown_fields, untagged)]
|
||||
@@ -59,6 +60,14 @@ impl<'a, E: EthSpec> BuilderBidRef<'a, E> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, E: EthSpec> BuilderBidRefMut<'a, E> {
|
||||
pub fn header_mut(self) -> ExecutionPayloadHeaderRefMut<'a, E> {
|
||||
map_builder_bid_ref_mut_into_execution_payload_header_ref_mut!(&'a _, self, |bid, cons| {
|
||||
cons(&mut bid.header)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: EthSpec> SignedRoot for BuilderBid<E> {}
|
||||
|
||||
/// Validator registration, for use in interacting with servers implementing the builder API.
|
||||
|
||||
@@ -21,3 +21,17 @@ pub struct ValidatorRegistrationData {
|
||||
}
|
||||
|
||||
impl SignedRoot for ValidatorRegistrationData {}
|
||||
|
||||
impl SignedValidatorRegistrationData {
|
||||
pub fn verify_signature(&self, spec: &ChainSpec) -> bool {
|
||||
self.message
|
||||
.pubkey
|
||||
.decompress()
|
||||
.map(|pubkey| {
|
||||
let domain = spec.get_builder_domain();
|
||||
let message = self.message.signing_root(domain);
|
||||
self.signature.verify(&pubkey, message)
|
||||
})
|
||||
.unwrap_or(false)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user