Many fixes

This commit is contained in:
Eitan Seri-Levi
2026-05-09 18:58:08 +03:00
parent 2356bdd256
commit 1b2cf3ba01
45 changed files with 667 additions and 1328 deletions

View File

@@ -18,7 +18,7 @@ use tokio_util::codec::{Decoder, Encoder};
use types::SignedExecutionPayloadEnvelope;
use types::{
BlobSidecar, ChainSpec, DataColumnSidecar, DataColumnsByRootIdentifier, EthSpec, ForkContext,
ForkName, Hash256, LightClientBootstrap, LightClientFinalityUpdate,
ForkName, ForkVersionDecode, Hash256, LightClientBootstrap, LightClientFinalityUpdate,
LightClientOptimisticUpdate, LightClientUpdate, SignedBeaconBlock, SignedBeaconBlockAltair,
SignedBeaconBlockBase, SignedBeaconBlockBellatrix, SignedBeaconBlockCapella,
SignedBeaconBlockDeneb, SignedBeaconBlockElectra, SignedBeaconBlockFulu,
@@ -672,7 +672,10 @@ fn handle_rpc_response<E: EthSpec>(
Some(fork_name) => {
if fork_name.gloas_enabled() {
Ok(Some(RpcSuccessResponse::PayloadEnvelopesByRange(Arc::new(
SignedExecutionPayloadEnvelope::from_ssz_bytes(decoded_buffer)?,
SignedExecutionPayloadEnvelope::from_ssz_bytes_by_fork(
decoded_buffer,
fork_name,
)?,
))))
} else {
Err(RPCError::ErrorResponse(
@@ -693,7 +696,10 @@ fn handle_rpc_response<E: EthSpec>(
Some(fork_name) => {
if fork_name.gloas_enabled() {
Ok(Some(RpcSuccessResponse::PayloadEnvelopesByRoot(Arc::new(
SignedExecutionPayloadEnvelope::from_ssz_bytes(decoded_buffer)?,
SignedExecutionPayloadEnvelope::from_ssz_bytes_by_fork(
decoded_buffer,
fork_name,
)?,
))))
} else {
Err(RPCError::ErrorResponse(

View File

@@ -8,8 +8,8 @@ use std::io::{Error, ErrorKind};
use std::sync::Arc;
use types::{
AttesterSlashing, AttesterSlashingBase, AttesterSlashingElectra, BlobSidecar,
DataColumnSidecar, DataColumnSubnetId, EthSpec, ForkContext, ForkName, Hash256,
LightClientFinalityUpdate, LightClientOptimisticUpdate, PartialDataColumn,
DataColumnSidecar, DataColumnSubnetId, EthSpec, ForkContext, ForkName, ForkVersionDecode,
Hash256, LightClientFinalityUpdate, LightClientOptimisticUpdate, PartialDataColumn,
PartialDataColumnSidecar, PayloadAttestationMessage, ProposerSlashing, SignedAggregateAndProof,
SignedAggregateAndProofBase, SignedAggregateAndProofElectra, SignedBeaconBlock,
SignedBeaconBlockAltair, SignedBeaconBlockBase, SignedBeaconBlockBellatrix,
@@ -372,9 +372,19 @@ impl<E: EthSpec> PubsubMessage<E> {
)))
}
GossipKind::ExecutionPayload => {
let fork_name = fork_context
.get_fork_from_context_bytes(gossip_topic.fork_digest)
.ok_or_else(|| {
format!(
"Unknown gossipsub fork digest: {:?}",
gossip_topic.fork_digest
)
})?;
let execution_payload_envelope =
SignedExecutionPayloadEnvelope::from_ssz_bytes(data)
.map_err(|e| format!("{:?}", e))?;
SignedExecutionPayloadEnvelope::from_ssz_bytes_by_fork(
data, *fork_name,
)
.map_err(|e| format!("{:?}", e))?;
Ok(PubsubMessage::ExecutionPayload(Box::new(
execution_payload_envelope,
)))