Skip to content

Commit

Permalink
Fix remaining compilation errors
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
weekday-grandine-io committed Jul 31, 2024
1 parent 753623f commit 1effebb
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion eth2_libp2p
9 changes: 3 additions & 6 deletions http_api/src/standard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 4 additions & 2 deletions p2p/src/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
16 changes: 9 additions & 7 deletions p2p/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -535,7 +537,7 @@ impl<P: Preset> Network<P> {
}

fn publish_blob_sidecar(&self, blob_sidecar: Arc<BlobSidecar<P>>) {
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(
Expand Down Expand Up @@ -1269,12 +1271,12 @@ impl<P: Preset> Network<P> {
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
Expand All @@ -1299,12 +1301,12 @@ impl<P: Preset> Network<P> {
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})",
Expand Down
3 changes: 2 additions & 1 deletion types/src/combined.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1463,7 +1463,8 @@ impl<P: Preset> LightClientOptimisticUpdate<P> {
}
}

#[derive(Debug, From)]
#[derive(PartialEq, Eq, Debug, From, Deserialize, Serialize)]
#[serde(bound = "", untagged)]
pub enum BlobSidecar<P: Preset> {
Deneb(DenebBlobSidecar<P>),
Electra(ElectraBlobSidecar<P>),
Expand Down

0 comments on commit 1effebb

Please sign in to comment.