hold for now

This commit is contained in:
Mark Mackey
2025-10-15 10:15:44 -05:00
parent acac0503ed
commit 29e5a1f599
7 changed files with 712 additions and 1 deletions

View File

@@ -12,7 +12,7 @@ use types::{
InconsistentFork, IndexedAttestation, IndexedAttestationRef, ProposerSlashing, PublicKey,
PublicKeyBytes, Signature, SignedAggregateAndProof, SignedBeaconBlock, SignedBeaconBlockHeader,
SignedBlsToExecutionChange, SignedContributionAndProof, SignedRoot, SignedVoluntaryExit,
SigningData, Slot, SyncAggregate, SyncAggregatorSelectionData, Unsigned,
SigningData, Slot, SyncAggregate, SyncAggregatorSelectionData, Unsigned, SignedExecutionPayloadEnvelope,
};
pub type Result<T> = std::result::Result<T, Error>;
@@ -331,6 +331,34 @@ where
Ok(SignatureSet::multiple_pubkeys(signature, pubkeys, message))
}
pub fn execution_envelope_signature_set<'a, E, F>(
state: &'a BeaconState<E>,
get_pubkey: F,
signed_envelope: &'a SignedExecutionPayloadEnvelope<E>,
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 message = signed_envelope.message().signing_root(domain);
let pubkey = get_pubkey(signed_envelope.message().builder_index() as usize).ok_or(
Error::ValidatorUnknown(signed_envelope.message().builder_index()),
)?;
Ok(SignatureSet::single_pubkey(
signed_envelope.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>,