mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-30 19:23:50 +00:00
Merge branch 'gloas-move-commitments-to-bid' into unstable
This commit is contained in:
@@ -49,7 +49,7 @@ pub enum PubsubMessage<E: EthSpec> {
|
||||
/// Gossipsub message providing notification of a payload attestation message.
|
||||
PayloadAttestation(Box<PayloadAttestationMessage>),
|
||||
/// Gossipsub message providing notification of a signed execution payload bid.
|
||||
ExecutionPayloadBid(Box<SignedExecutionPayloadBid>),
|
||||
ExecutionPayloadBid(Box<SignedExecutionPayloadBid<E>>),
|
||||
/// Gossipsub message providing notification of signed proposer preferences.
|
||||
ProposerPreferences(Box<SignedProposerPreferences>),
|
||||
/// Gossipsub message providing notification of a light client finality update.
|
||||
|
||||
@@ -3252,7 +3252,7 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
||||
self: &Arc<Self>,
|
||||
message_id: MessageId,
|
||||
peer_id: PeerId,
|
||||
payload_bid: SignedExecutionPayloadBid,
|
||||
payload_bid: SignedExecutionPayloadBid<T::EthSpec>,
|
||||
) {
|
||||
// TODO(EIP-7732): Implement proper payload bid gossip processing.
|
||||
// This should integrate with a payload execution bid verification module once it's implemented.
|
||||
|
||||
@@ -448,7 +448,7 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
||||
self: &Arc<Self>,
|
||||
message_id: MessageId,
|
||||
peer_id: PeerId,
|
||||
execution_payload_bid: Box<SignedExecutionPayloadBid>,
|
||||
execution_payload_bid: Box<SignedExecutionPayloadBid<T::EthSpec>>,
|
||||
) -> Result<(), Error<T::EthSpec>> {
|
||||
let processor = self.clone();
|
||||
let process_fn = move || {
|
||||
|
||||
@@ -167,7 +167,7 @@ pub struct BeaconBlockBody<E: EthSpec, Payload: AbstractExecPayload<E> = FullPay
|
||||
#[superstruct(only(Electra, Fulu))]
|
||||
pub execution_requests: ExecutionRequests<E>,
|
||||
#[superstruct(only(Gloas))]
|
||||
pub signed_execution_payload_bid: SignedExecutionPayloadBid,
|
||||
pub signed_execution_payload_bid: SignedExecutionPayloadBid<E>,
|
||||
#[superstruct(only(Gloas))]
|
||||
pub payload_attestations: VariableList<PayloadAttestation<E>, E::MaxPayloadAttestations>,
|
||||
#[superstruct(only(Base, Altair, Gloas))]
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use crate::kzg_ext::KzgCommitments;
|
||||
use crate::test_utils::TestRandom;
|
||||
use crate::{Address, ExecutionBlockHash, ForkName, Hash256, SignedRoot, Slot};
|
||||
use crate::{Address, EthSpec, ExecutionBlockHash, ForkName, Hash256, SignedRoot, Slot};
|
||||
use context_deserialize::context_deserialize;
|
||||
use educe::Educe;
|
||||
use serde::{Deserialize, Serialize};
|
||||
@@ -10,11 +11,16 @@ use tree_hash_derive::TreeHash;
|
||||
#[derive(
|
||||
Default, Debug, Clone, Serialize, Encode, Decode, Deserialize, TreeHash, Educe, TestRandom,
|
||||
)]
|
||||
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
|
||||
#[cfg_attr(
|
||||
feature = "arbitrary",
|
||||
derive(arbitrary::Arbitrary),
|
||||
arbitrary(bound = "E: EthSpec")
|
||||
)]
|
||||
#[educe(PartialEq, Hash)]
|
||||
#[serde(bound = "E: EthSpec")]
|
||||
#[context_deserialize(ForkName)]
|
||||
// https://github.com/ethereum/consensus-specs/blob/master/specs/gloas/beacon-chain.md#executionpayloadbid
|
||||
pub struct ExecutionPayloadBid {
|
||||
pub struct ExecutionPayloadBid<E: EthSpec> {
|
||||
pub parent_block_hash: ExecutionBlockHash,
|
||||
pub parent_block_root: Hash256,
|
||||
pub block_hash: ExecutionBlockHash,
|
||||
@@ -30,14 +36,15 @@ pub struct ExecutionPayloadBid {
|
||||
pub value: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
pub execution_payment: u64,
|
||||
pub blob_kzg_commitments_root: Hash256,
|
||||
pub blob_kzg_commitments: KzgCommitments<E>,
|
||||
}
|
||||
|
||||
impl SignedRoot for ExecutionPayloadBid {}
|
||||
impl<E: EthSpec> SignedRoot for ExecutionPayloadBid<E> {}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::MainnetEthSpec;
|
||||
|
||||
ssz_and_tree_hash_tests!(ExecutionPayloadBid);
|
||||
ssz_and_tree_hash_tests!(ExecutionPayloadBid<MainnetEthSpec>);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
use crate::execution::{ExecutionPayloadGloas, ExecutionRequests};
|
||||
use crate::test_utils::TestRandom;
|
||||
use crate::{
|
||||
EthSpec, ExecutionPayloadGloas, ExecutionRequests, ForkName, Hash256, KzgCommitments,
|
||||
SignedRoot, Slot,
|
||||
};
|
||||
use crate::{EthSpec, ForkName, Hash256, SignedRoot, Slot};
|
||||
use context_deserialize::context_deserialize;
|
||||
use educe::Educe;
|
||||
use serde::{Deserialize, Serialize};
|
||||
@@ -21,7 +19,6 @@ pub struct ExecutionPayloadEnvelope<E: EthSpec> {
|
||||
pub builder_index: u64,
|
||||
pub beacon_block_root: Hash256,
|
||||
pub slot: Slot,
|
||||
pub blob_kzg_commitments: KzgCommitments<E>,
|
||||
pub state_root: Hash256,
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use crate::execution::ExecutionPayloadBid;
|
||||
use crate::test_utils::TestRandom;
|
||||
use crate::{ExecutionPayloadBid, ForkName};
|
||||
use crate::{EthSpec, ForkName};
|
||||
use bls::Signature;
|
||||
use context_deserialize::context_deserialize;
|
||||
use educe::Educe;
|
||||
@@ -9,16 +10,21 @@ use test_random_derive::TestRandom;
|
||||
use tree_hash_derive::TreeHash;
|
||||
|
||||
#[derive(TestRandom, TreeHash, Debug, Clone, Encode, Decode, Serialize, Deserialize, Educe)]
|
||||
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
|
||||
#[cfg_attr(
|
||||
feature = "arbitrary",
|
||||
derive(arbitrary::Arbitrary),
|
||||
arbitrary(bound = "E: EthSpec")
|
||||
)]
|
||||
#[educe(PartialEq, Hash)]
|
||||
#[serde(bound = "E: EthSpec")]
|
||||
#[context_deserialize(ForkName)]
|
||||
// https://github.com/ethereum/consensus-specs/blob/master/specs/gloas/beacon-chain.md#signedexecutionpayloadbid
|
||||
pub struct SignedExecutionPayloadBid {
|
||||
pub message: ExecutionPayloadBid,
|
||||
pub struct SignedExecutionPayloadBid<E: EthSpec> {
|
||||
pub message: ExecutionPayloadBid<E>,
|
||||
pub signature: Signature,
|
||||
}
|
||||
|
||||
impl SignedExecutionPayloadBid {
|
||||
impl<E: EthSpec> SignedExecutionPayloadBid<E> {
|
||||
pub fn empty() -> Self {
|
||||
Self {
|
||||
message: ExecutionPayloadBid::default(),
|
||||
@@ -30,6 +36,7 @@ impl SignedExecutionPayloadBid {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::MainnetEthSpec;
|
||||
|
||||
ssz_and_tree_hash_tests!(SignedExecutionPayloadBid);
|
||||
ssz_and_tree_hash_tests!(SignedExecutionPayloadBid<MainnetEthSpec>);
|
||||
}
|
||||
|
||||
@@ -547,7 +547,7 @@ where
|
||||
pub latest_execution_payload_header: ExecutionPayloadHeaderFulu<E>,
|
||||
#[superstruct(only(Gloas))]
|
||||
#[metastruct(exclude_from(tree_lists))]
|
||||
pub latest_execution_payload_bid: ExecutionPayloadBid,
|
||||
pub latest_execution_payload_bid: ExecutionPayloadBid<E>,
|
||||
#[superstruct(only(Capella, Deneb, Electra, Fulu, Gloas), partial_getter(copy))]
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[metastruct(exclude_from(tree_lists))]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# To download/extract nightly tests, run:
|
||||
# CONSENSUS_SPECS_TEST_VERSION=nightly make
|
||||
CONSENSUS_SPECS_TEST_VERSION ?= v1.7.0-alpha.1
|
||||
CONSENSUS_SPECS_TEST_VERSION ?= nightly-21573464110
|
||||
REPO_NAME := consensus-spec-tests
|
||||
OUTPUT_DIR := ./$(REPO_NAME)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ set -Eeuo pipefail
|
||||
TESTS=("general" "minimal" "mainnet")
|
||||
|
||||
version=${1}
|
||||
if [[ "$version" == "nightly" ]]; then
|
||||
if [[ "$version" == "nightly" || "$version" == nightly-* ]]; then
|
||||
if [[ -z "${GITHUB_TOKEN:-}" ]]; then
|
||||
echo "Error GITHUB_TOKEN is not set"
|
||||
exit 1
|
||||
@@ -21,17 +21,22 @@ if [[ "$version" == "nightly" ]]; then
|
||||
api="https://api.github.com"
|
||||
auth_header="Authorization: token ${GITHUB_TOKEN}"
|
||||
|
||||
run_id=$(curl -s -H "${auth_header}" \
|
||||
"${api}/repos/${repo}/actions/workflows/generate_vectors.yml/runs?branch=dev&status=success&per_page=1" |
|
||||
jq -r '.workflow_runs[0].id')
|
||||
if [[ "$version" == nightly-* ]]; then
|
||||
# Extract run_id from nightly-<run_id> format
|
||||
run_id="${version#nightly-}"
|
||||
else
|
||||
run_id=$(curl -v -H "${auth_header}" \
|
||||
"${api}/repos/${repo}/actions/workflows/generate_vectors.yml/runs?branch=dev&status=success&per_page=1" |
|
||||
jq -r '.workflow_runs[0].id')
|
||||
|
||||
if [[ "${run_id}" == "null" || -z "${run_id}" ]]; then
|
||||
echo "No successful nightly workflow run found"
|
||||
exit 1
|
||||
if [[ "${run_id}" == "null" || -z "${run_id}" ]]; then
|
||||
echo "No successful nightly workflow run found"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Downloading nightly test vectors for run: ${run_id}"
|
||||
curl -s -H "${auth_header}" "${api}/repos/${repo}/actions/runs/${run_id}/artifacts" |
|
||||
curl -v -H "${auth_header}" "${api}/repos/${repo}/actions/runs/${run_id}/artifacts" |
|
||||
jq -c '.artifacts[] | {name, url: .archive_download_url}' |
|
||||
while read -r artifact; do
|
||||
name=$(echo "${artifact}" | jq -r .name)
|
||||
|
||||
@@ -55,6 +55,7 @@ type_name_generic!(BeaconBlockBodyCapella, "BeaconBlockBody");
|
||||
type_name_generic!(BeaconBlockBodyDeneb, "BeaconBlockBody");
|
||||
type_name_generic!(BeaconBlockBodyElectra, "BeaconBlockBody");
|
||||
type_name_generic!(BeaconBlockBodyFulu, "BeaconBlockBody");
|
||||
type_name_generic!(BeaconBlockBodyGloas, "BeaconBlockBody");
|
||||
type_name!(BeaconBlockHeader);
|
||||
type_name_generic!(BeaconState);
|
||||
type_name!(BlobIdentifier);
|
||||
@@ -78,6 +79,7 @@ type_name_generic!(ExecutionPayloadCapella, "ExecutionPayload");
|
||||
type_name_generic!(ExecutionPayloadDeneb, "ExecutionPayload");
|
||||
type_name_generic!(ExecutionPayloadElectra, "ExecutionPayload");
|
||||
type_name_generic!(ExecutionPayloadFulu, "ExecutionPayload");
|
||||
type_name_generic!(ExecutionPayloadGloas, "ExecutionPayload");
|
||||
type_name_generic!(FullPayload, "ExecutionPayload");
|
||||
type_name_generic!(ExecutionPayloadHeader);
|
||||
type_name_generic!(ExecutionPayloadHeaderBellatrix, "ExecutionPayloadHeader");
|
||||
|
||||
@@ -369,6 +369,10 @@ mod ssz_static {
|
||||
.run();
|
||||
SszStaticHandler::<BeaconBlockBodyFulu<MinimalEthSpec>, MinimalEthSpec>::fulu_only().run();
|
||||
SszStaticHandler::<BeaconBlockBodyFulu<MainnetEthSpec>, MainnetEthSpec>::fulu_only().run();
|
||||
SszStaticHandler::<BeaconBlockBodyGloas<MinimalEthSpec>, MinimalEthSpec>::gloas_only()
|
||||
.run();
|
||||
SszStaticHandler::<BeaconBlockBodyGloas<MainnetEthSpec>, MainnetEthSpec>::gloas_only()
|
||||
.run();
|
||||
}
|
||||
|
||||
// Altair and later
|
||||
|
||||
Reference in New Issue
Block a user