Skip to content

Commit 8b261dd

Browse files
authored
fix blob_sidecar SSE versioned_hash field to be 0x-prefixed hex (#5844)
1 parent 87052eb commit 8b261dd

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

beacon_chain/nimbus_beacon_node.nim

+2-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ proc initFullNode(
258258
index: data.index,
259259
slot: data.signed_block_header.message.slot,
260260
kzg_commitment: data.kzg_commitment,
261-
versioned_hash: data.kzg_commitment.kzg_commitment_to_versioned_hash))
261+
versioned_hash:
262+
data.kzg_commitment.kzg_commitment_to_versioned_hash.to0xHex))
262263
proc onBlockAdded(data: ForkedTrustedSignedBeaconBlock) =
263264
let optimistic =
264265
if node.currentSlot().epoch() >= dag.cfg.BELLATRIX_FORK_EPOCH:

beacon_chain/spec/datatypes/deneb.nim

+5-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ type
4040

4141
# TODO this apparently is suppposed to be SSZ-equivalent to Bytes32, but
4242
# current spec doesn't ever SSZ-serialize it or hash_tree_root it
43+
# TODO make `distinct` then add a REST serialization for it specifically, via
44+
# basically to0xHex, then fix BlobSidecarInfoObject to use VersionedHash, not
45+
# string, and rely on REST serialization, rather than serialize VersionedHash
46+
# field manually
4347
VersionedHash* = array[32, byte]
4448

4549
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.6/specs/deneb/beacon-chain.md#custom-types
@@ -68,7 +72,7 @@ type
6872
index*: BlobIndex
6973
slot*: Slot
7074
kzg_commitment*: KzgCommitment
71-
versioned_hash*: VersionedHash
75+
versioned_hash*: string # TODO should be string; VersionedHash not distinct
7276

7377
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/deneb/p2p-interface.md#blobidentifier
7478
BlobIdentifier* = object

0 commit comments

Comments
 (0)