From 1effebbac6f8e71aced0fcdfc4dd8b4da128a03f Mon Sep 17 00:00:00 2001 From: weekday Date: Wed, 31 Jul 2024 02:27:07 +0000 Subject: [PATCH] Fix remaining compilation errors eth2_libp2p needed changes as expected. The changes on this branch are making some tests fail. They are failing in 5 crates as opposed to 1 on electra-alpha3-containers. That is most likely due to changed definitions of hash_tree_root and BlobSidecar. There is a branch of consensus-spec-tests for EIP-7688, but it may be based on a different version. The oversight with proof lengths should be fixed. The cause of the crash while attesting is still unknown. It may be specific to Kurtosis. The changes made on this branch should not have affected anything until Electra (now Deneb). The built-in-validator test case only fails in slot 40 (Electra), which is unchanged from electra-alpha3-containers. --- eth2_libp2p | 2 +- http_api/src/standard.rs | 9 +++------ p2p/src/messages.rs | 6 ++++-- p2p/src/network.rs | 16 +++++++++------- types/src/combined.rs | 3 ++- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/eth2_libp2p b/eth2_libp2p index ab94ca10..b081a959 160000 --- a/eth2_libp2p +++ b/eth2_libp2p @@ -1 +1 @@ -Subproject commit ab94ca1064109fba0c194957c9421329780f6267 +Subproject commit b081a959d7b5979042fd476a13d4ff7fe61a89d7 diff --git a/http_api/src/standard.rs b/http_api/src/standard.rs index e890ecb2..fd38c26b 100644 --- a/http_api/src/standard.rs +++ b/http_api/src/standard.rs @@ -58,14 +58,11 @@ use types::{ }, capella::containers::{SignedBlsToExecutionChange, Withdrawal}, combined::{ - Attestation, AttesterSlashing, BeaconBlock, BeaconState, SignedAggregateAndProof, - SignedBeaconBlock, SignedBlindedBeaconBlock, + Attestation, AttesterSlashing, BeaconBlock, BeaconState, BlobSidecar, + SignedAggregateAndProof, SignedBeaconBlock, SignedBlindedBeaconBlock, }, config::Config as ChainConfig, - deneb::{ - containers::{BlobIdentifier, BlobSidecar}, - primitives::BlobIndex, - }, + deneb::{containers::BlobIdentifier, primitives::BlobIndex}, nonstandard::{ BlockRewards, Phase, RelativeEpoch, ValidationOutcome, WithBlobsAndMev, WithStatus, WEI_IN_GWEI, diff --git a/p2p/src/messages.rs b/p2p/src/messages.rs index 5e7fa6d1..a65061e2 100644 --- a/p2p/src/messages.rs +++ b/p2p/src/messages.rs @@ -14,8 +14,10 @@ use operation_pools::PoolRejectionReason; use serde::Serialize; use types::{ altair::containers::{SignedContributionAndProof, SyncCommitteeMessage}, - combined::{Attestation, AttesterSlashing, SignedAggregateAndProof, SignedBeaconBlock}, - deneb::containers::{BlobIdentifier, BlobSidecar}, + combined::{ + Attestation, AttesterSlashing, BlobSidecar, SignedAggregateAndProof, SignedBeaconBlock, + }, + deneb::containers::BlobIdentifier, nonstandard::Phase, phase0::{ containers::{ProposerSlashing, SignedVoluntaryExit}, diff --git a/p2p/src/network.rs b/p2p/src/network.rs index 5cb11a42..d74317fb 100644 --- a/p2p/src/network.rs +++ b/p2p/src/network.rs @@ -41,8 +41,10 @@ use thiserror::Error; use types::{ altair::containers::{SignedContributionAndProof, SyncCommitteeMessage}, capella::containers::SignedBlsToExecutionChange, - combined::{Attestation, AttesterSlashing, SignedAggregateAndProof, SignedBeaconBlock}, - deneb::containers::{BlobIdentifier, BlobSidecar}, + combined::{ + Attestation, AttesterSlashing, BlobSidecar, SignedAggregateAndProof, SignedBeaconBlock, + }, + deneb::containers::BlobIdentifier, nonstandard::{Phase, WithStatus}, phase0::{ consts::{FAR_FUTURE_EPOCH, GENESIS_EPOCH}, @@ -535,7 +537,7 @@ impl Network

{ } fn publish_blob_sidecar(&self, blob_sidecar: Arc>) { - let subnet_id = misc::compute_subnet_for_blob_sidecar(blob_sidecar.index); + let subnet_id = misc::compute_subnet_for_blob_sidecar(blob_sidecar.index()); let blob_identifier: BlobIdentifier = blob_sidecar.as_ref().into(); self.log( @@ -1269,12 +1271,12 @@ impl Network

{ format_args!( "received BlobsByRange response chunk \ (request_id: {request_id}, peer_id: {peer_id}, blob_sidecar.slot: {:?})", - blob_sidecar.signed_block_header.message.slot, + blob_sidecar.signed_block_header().message.slot, ), ); let blob_identifier = blob_sidecar.as_ref().into(); - let blob_sidecar_slot = blob_sidecar.signed_block_header.message.slot; + let blob_sidecar_slot = blob_sidecar.signed_block_header().message.slot; if self.register_new_received_blob_sidecar(blob_identifier, blob_sidecar_slot) { let block_seen = self @@ -1299,12 +1301,12 @@ impl Network

{ format_args!( "received BlobsByRoot response chunk \ (request_id: {request_id}, peer_id: {peer_id}, blob_sidecar.slot: {:?})", - blob_sidecar.signed_block_header.message.slot, + blob_sidecar.signed_block_header().message.slot, ), ); let blob_identifier = blob_sidecar.as_ref().into(); - let blob_sidecar_slot = blob_sidecar.signed_block_header.message.slot; + let blob_sidecar_slot = blob_sidecar.signed_block_header().message.slot; self.log_with_feature(format_args!( "received blob from RPC (blob_id: {blob_identifier:?}, slot: {blob_sidecar_slot}, peer_id: {peer_id}, request_id: {request_id})", diff --git a/types/src/combined.rs b/types/src/combined.rs index 523b89da..2987d32e 100644 --- a/types/src/combined.rs +++ b/types/src/combined.rs @@ -1463,7 +1463,8 @@ impl LightClientOptimisticUpdate

{ } } -#[derive(Debug, From)] +#[derive(PartialEq, Eq, Debug, From, Deserialize, Serialize)] +#[serde(bound = "", untagged)] pub enum BlobSidecar { Deneb(DenebBlobSidecar

), Electra(ElectraBlobSidecar

),