Remove SignedBeaconBlockAndBlobsSidecar (#4683)

This commit removes SignedBeaconBlockAndBlobsSidecar and all remaining
references.
This commit is contained in:
henridf 2023-03-02 15:12:04 +01:00 committed by GitHub
parent 88092bb411
commit 1de3cf5246
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 3 additions and 33 deletions

View File

@ -23,7 +23,7 @@ import
from ../spec/datatypes/capella import SignedBeaconBlock
from ../spec/datatypes/eip4844 import
SignedBeaconBlock, SignedBeaconBlockAndBlobsSidecar, BLS_MODULUS
SignedBeaconBlock, BLS_MODULUS
from libp2p/protocols/pubsub/pubsub import ValidationResult

View File

@ -801,7 +801,7 @@ func chunkMaxSize[T](): uint32 =
MAX_CHUNK_SIZE_BELLATRIX
from ../spec/datatypes/capella import SignedBeaconBlock
from ../spec/datatypes/eip4844 import SignedBeaconBlockAndBlobsSidecar
from ../spec/datatypes/eip4844 import SignedBeaconBlock
template gossipMaxSize(T: untyped): uint32 =
const maxSize = static:

View File

@ -55,18 +55,13 @@ type
Blob* = array[BYTES_PER_FIELD_ELEMENT * FIELD_ELEMENTS_PER_BLOB, byte]
# TODO remove BlobsSidecar and SignedBeaconBlockAndBlobsSidecar; they're not
# in rc.3 anymore
# TODO remove BlobsSidecar; it's not in rc.3 anymore
BlobsSidecar* = object
beacon_block_root*: Eth2Digest
beacon_block_slot*: Slot
blobs*: List[Blob, Limit MAX_BLOBS_PER_BLOCK]
kzg_aggregated_proof*: KZGProof
SignedBeaconBlockAndBlobsSidecar* = object
beacon_block*: SignedBeaconBlock
blobs_sidecar*: BlobsSidecar
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/p2p-interface.md#blobsidecar
BlobSidecar* = object
block_root*: Eth2Digest

View File

@ -59,10 +59,6 @@ template readSszBytes*(
template readSszBytes*(
data: openArray[byte], val: var deneb.TrustedSignedBeaconBlock, updateRoot = true) =
readAndUpdateRoot(data, val, updateRoot)
template readSszBytes*(
data: openArray[byte], val: var deneb.SignedBeaconBlockAndBlobsSidecar, updateRoot = true) =
readSszValue(data, val)
val.beacon_block.root = hash_tree_root(val.beacon_block.message)
template readSszBytes*(
data: openArray[byte], val: var auto, updateRoot: bool) =

View File

@ -510,7 +510,6 @@ template toFork*[T:
deneb.ExecutionPayloadHeader |
deneb.BeaconBlock |
deneb.SignedBeaconBlock |
deneb.SignedBeaconBlockAndBlobsSidecar |
deneb.TrustedBeaconBlock |
deneb.SigVerifiedSignedBeaconBlock |
deneb.MsgTrustedSignedBeaconBlock |

View File

@ -120,24 +120,6 @@ proc readChunkPayload*(
else:
return neterr InvalidContextBytes
proc readChunkPayload*(
conn: Connection, peer: Peer, MsgType: type (ref SignedBeaconBlockAndBlobsSidecar)):
Future[NetRes[MsgType]] {.async.} =
var contextBytes: ForkDigest
try:
await conn.readExactly(addr contextBytes, sizeof contextBytes)
except CatchableError:
return neterr UnexpectedEOF
if contextBytes == peer.network.forkDigests.eip4844:
let res = await readChunkPayload(conn, peer, SignedBeaconBlockAndBlobsSidecar)
if res.isOk:
return ok newClone(res.get)
else:
return err(res.error)
else:
return neterr InvalidContextBytes
proc readChunkPayload*(
conn: Connection, peer: Peer, MsgType: type (ref BlobsSidecar)):
Future[NetRes[MsgType]] {.async.} =

View File

@ -141,8 +141,6 @@ suite "EF - Deneb - SSZ consensus objects " & preset():
checkSSZ(SignedAggregateAndProof, path, hash)
of "SignedBeaconBlock":
checkSSZ(deneb.SignedBeaconBlock, path, hash)
of "SignedBeaconBlockAndBlobsSidecar":
checkSSZ(deneb.SignedBeaconBlockAndBlobsSidecar, path, hash)
of "SignedBeaconBlockHeader":
checkSSZ(SignedBeaconBlockHeader, path, hash)
of "SignedBlobSidecar": checkSSZ(SignedBlobSidecar, path, hash)