Remove SignedBeaconBlockAndBlobsSidecar (#4683)
This commit removes SignedBeaconBlockAndBlobsSidecar and all remaining references.
This commit is contained in:
parent
88092bb411
commit
1de3cf5246
|
@ -23,7 +23,7 @@ import
|
||||||
|
|
||||||
from ../spec/datatypes/capella import SignedBeaconBlock
|
from ../spec/datatypes/capella import SignedBeaconBlock
|
||||||
from ../spec/datatypes/eip4844 import
|
from ../spec/datatypes/eip4844 import
|
||||||
SignedBeaconBlock, SignedBeaconBlockAndBlobsSidecar, BLS_MODULUS
|
SignedBeaconBlock, BLS_MODULUS
|
||||||
|
|
||||||
from libp2p/protocols/pubsub/pubsub import ValidationResult
|
from libp2p/protocols/pubsub/pubsub import ValidationResult
|
||||||
|
|
||||||
|
|
|
@ -801,7 +801,7 @@ func chunkMaxSize[T](): uint32 =
|
||||||
MAX_CHUNK_SIZE_BELLATRIX
|
MAX_CHUNK_SIZE_BELLATRIX
|
||||||
|
|
||||||
from ../spec/datatypes/capella import SignedBeaconBlock
|
from ../spec/datatypes/capella import SignedBeaconBlock
|
||||||
from ../spec/datatypes/eip4844 import SignedBeaconBlockAndBlobsSidecar
|
from ../spec/datatypes/eip4844 import SignedBeaconBlock
|
||||||
|
|
||||||
template gossipMaxSize(T: untyped): uint32 =
|
template gossipMaxSize(T: untyped): uint32 =
|
||||||
const maxSize = static:
|
const maxSize = static:
|
||||||
|
|
|
@ -55,18 +55,13 @@ type
|
||||||
|
|
||||||
Blob* = array[BYTES_PER_FIELD_ELEMENT * FIELD_ELEMENTS_PER_BLOB, byte]
|
Blob* = array[BYTES_PER_FIELD_ELEMENT * FIELD_ELEMENTS_PER_BLOB, byte]
|
||||||
|
|
||||||
# TODO remove BlobsSidecar and SignedBeaconBlockAndBlobsSidecar; they're not
|
# TODO remove BlobsSidecar; it's not in rc.3 anymore
|
||||||
# in rc.3 anymore
|
|
||||||
BlobsSidecar* = object
|
BlobsSidecar* = object
|
||||||
beacon_block_root*: Eth2Digest
|
beacon_block_root*: Eth2Digest
|
||||||
beacon_block_slot*: Slot
|
beacon_block_slot*: Slot
|
||||||
blobs*: List[Blob, Limit MAX_BLOBS_PER_BLOCK]
|
blobs*: List[Blob, Limit MAX_BLOBS_PER_BLOCK]
|
||||||
kzg_aggregated_proof*: KZGProof
|
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
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/p2p-interface.md#blobsidecar
|
||||||
BlobSidecar* = object
|
BlobSidecar* = object
|
||||||
block_root*: Eth2Digest
|
block_root*: Eth2Digest
|
||||||
|
|
|
@ -59,10 +59,6 @@ template readSszBytes*(
|
||||||
template readSszBytes*(
|
template readSszBytes*(
|
||||||
data: openArray[byte], val: var deneb.TrustedSignedBeaconBlock, updateRoot = true) =
|
data: openArray[byte], val: var deneb.TrustedSignedBeaconBlock, updateRoot = true) =
|
||||||
readAndUpdateRoot(data, val, updateRoot)
|
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*(
|
template readSszBytes*(
|
||||||
data: openArray[byte], val: var auto, updateRoot: bool) =
|
data: openArray[byte], val: var auto, updateRoot: bool) =
|
||||||
|
|
|
@ -510,7 +510,6 @@ template toFork*[T:
|
||||||
deneb.ExecutionPayloadHeader |
|
deneb.ExecutionPayloadHeader |
|
||||||
deneb.BeaconBlock |
|
deneb.BeaconBlock |
|
||||||
deneb.SignedBeaconBlock |
|
deneb.SignedBeaconBlock |
|
||||||
deneb.SignedBeaconBlockAndBlobsSidecar |
|
|
||||||
deneb.TrustedBeaconBlock |
|
deneb.TrustedBeaconBlock |
|
||||||
deneb.SigVerifiedSignedBeaconBlock |
|
deneb.SigVerifiedSignedBeaconBlock |
|
||||||
deneb.MsgTrustedSignedBeaconBlock |
|
deneb.MsgTrustedSignedBeaconBlock |
|
||||||
|
|
|
@ -120,24 +120,6 @@ proc readChunkPayload*(
|
||||||
else:
|
else:
|
||||||
return neterr InvalidContextBytes
|
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*(
|
proc readChunkPayload*(
|
||||||
conn: Connection, peer: Peer, MsgType: type (ref BlobsSidecar)):
|
conn: Connection, peer: Peer, MsgType: type (ref BlobsSidecar)):
|
||||||
Future[NetRes[MsgType]] {.async.} =
|
Future[NetRes[MsgType]] {.async.} =
|
||||||
|
|
|
@ -141,8 +141,6 @@ suite "EF - Deneb - SSZ consensus objects " & preset():
|
||||||
checkSSZ(SignedAggregateAndProof, path, hash)
|
checkSSZ(SignedAggregateAndProof, path, hash)
|
||||||
of "SignedBeaconBlock":
|
of "SignedBeaconBlock":
|
||||||
checkSSZ(deneb.SignedBeaconBlock, path, hash)
|
checkSSZ(deneb.SignedBeaconBlock, path, hash)
|
||||||
of "SignedBeaconBlockAndBlobsSidecar":
|
|
||||||
checkSSZ(deneb.SignedBeaconBlockAndBlobsSidecar, path, hash)
|
|
||||||
of "SignedBeaconBlockHeader":
|
of "SignedBeaconBlockHeader":
|
||||||
checkSSZ(SignedBeaconBlockHeader, path, hash)
|
checkSSZ(SignedBeaconBlockHeader, path, hash)
|
||||||
of "SignedBlobSidecar": checkSSZ(SignedBlobSidecar, path, hash)
|
of "SignedBlobSidecar": checkSSZ(SignedBlobSidecar, path, hash)
|
||||||
|
|
Loading…
Reference in New Issue