mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-19 13:58:28 +00:00
Gloas process execution payload bid (#8355)
* add proces_execution_bid * add has_builder_withdrawal_credential * process_execution_payload_bid signature is infinity check for self-build * process_execution_payload_bid updates per consensus spec v1.6.0-beta.1 release * process_execution_bid to avoid expensive lookups for 0 amount bids * verify builder not slashed even for self-building
This commit is contained in:
@@ -11,9 +11,9 @@ use types::{
|
||||
BeaconStateError, ChainSpec, DepositData, Domain, Epoch, EthSpec, Fork, Hash256,
|
||||
InconsistentFork, IndexedAttestation, IndexedAttestationRef, ProposerSlashing, PublicKey,
|
||||
PublicKeyBytes, Signature, SignedAggregateAndProof, SignedBeaconBlock, SignedBeaconBlockHeader,
|
||||
SignedBlsToExecutionChange, SignedContributionAndProof, SignedExecutionPayloadEnvelope,
|
||||
SignedRoot, SignedVoluntaryExit, SigningData, Slot, SyncAggregate, SyncAggregatorSelectionData,
|
||||
Unsigned,
|
||||
SignedBlsToExecutionChange, SignedContributionAndProof, SignedExecutionPayloadBid,
|
||||
SignedExecutionPayloadEnvelope, SignedRoot, SignedVoluntaryExit, SigningData, Slot,
|
||||
SyncAggregate, SyncAggregatorSelectionData, Unsigned,
|
||||
};
|
||||
|
||||
pub type Result<T> = std::result::Result<T, Error>;
|
||||
@@ -360,6 +360,34 @@ where
|
||||
))
|
||||
}
|
||||
|
||||
pub fn execution_payload_bid_signature_set<'a, E, F>(
|
||||
state: &'a BeaconState<E>,
|
||||
get_pubkey: F,
|
||||
signed_execution_payload_bid: &'a SignedExecutionPayloadBid,
|
||||
spec: &'a ChainSpec,
|
||||
) -> Result<SignatureSet<'a>>
|
||||
where
|
||||
E: EthSpec,
|
||||
F: Fn(usize) -> Option<Cow<'a, PublicKey>>,
|
||||
{
|
||||
let domain = spec.get_domain(
|
||||
state.current_epoch(),
|
||||
Domain::BeaconBuilder,
|
||||
&state.fork(),
|
||||
state.genesis_validators_root(),
|
||||
);
|
||||
let execution_payload_bid = &signed_execution_payload_bid.message;
|
||||
let pubkey = get_pubkey(execution_payload_bid.builder_index as usize)
|
||||
.ok_or(Error::ValidatorUnknown(execution_payload_bid.builder_index))?;
|
||||
let message = execution_payload_bid.signing_root(domain);
|
||||
|
||||
Ok(SignatureSet::single_pubkey(
|
||||
&signed_execution_payload_bid.signature,
|
||||
pubkey,
|
||||
message,
|
||||
))
|
||||
}
|
||||
|
||||
/// Returns the signature set for the given `attester_slashing` and corresponding `pubkeys`.
|
||||
pub fn attester_slashing_signature_sets<'a, E, F>(
|
||||
state: &'a BeaconState<E>,
|
||||
|
||||
Reference in New Issue
Block a user