From 6d201e61c6f8e52bdf3ab81ce212d782cd37f21f Mon Sep 17 00:00:00 2001 From: Mario Vega Date: Tue, 4 Aug 2026 20:00:08 -0600 Subject: [PATCH] core: genesis slot number parsing (#35464) Small fix to the parsing of the `slotNumber` in the genesis file. Found during hive testing. --- core/gen_genesis.go | 8 ++++---- core/genesis.go | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/gen_genesis.go b/core/gen_genesis.go index b94825b185..2904717a00 100644 --- a/core/gen_genesis.go +++ b/core/gen_genesis.go @@ -34,7 +34,7 @@ func (g Genesis) MarshalJSON() ([]byte, error) { BaseFee *math.HexOrDecimal256 `json:"baseFeePerGas"` ExcessBlobGas *math.HexOrDecimal64 `json:"excessBlobGas"` BlobGasUsed *math.HexOrDecimal64 `json:"blobGasUsed"` - SlotNumber *uint64 `json:"slotNumber"` + SlotNumber *math.HexOrDecimal64 `json:"slotNumber"` } var enc Genesis enc.Config = g.Config @@ -57,7 +57,7 @@ func (g Genesis) MarshalJSON() ([]byte, error) { enc.BaseFee = (*math.HexOrDecimal256)(g.BaseFee) enc.ExcessBlobGas = (*math.HexOrDecimal64)(g.ExcessBlobGas) enc.BlobGasUsed = (*math.HexOrDecimal64)(g.BlobGasUsed) - enc.SlotNumber = g.SlotNumber + enc.SlotNumber = (*math.HexOrDecimal64)(g.SlotNumber) return json.Marshal(&enc) } @@ -79,7 +79,7 @@ func (g *Genesis) UnmarshalJSON(input []byte) error { BaseFee *math.HexOrDecimal256 `json:"baseFeePerGas"` ExcessBlobGas *math.HexOrDecimal64 `json:"excessBlobGas"` BlobGasUsed *math.HexOrDecimal64 `json:"blobGasUsed"` - SlotNumber *uint64 `json:"slotNumber"` + SlotNumber *math.HexOrDecimal64 `json:"slotNumber"` } var dec Genesis if err := json.Unmarshal(input, &dec); err != nil { @@ -137,7 +137,7 @@ func (g *Genesis) UnmarshalJSON(input []byte) error { g.BlobGasUsed = (*uint64)(dec.BlobGasUsed) } if dec.SlotNumber != nil { - g.SlotNumber = dec.SlotNumber + g.SlotNumber = (*uint64)(dec.SlotNumber) } return nil } diff --git a/core/genesis.go b/core/genesis.go index 7fad915ce2..4073d0f86c 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -263,6 +263,7 @@ type genesisSpecMarshaling struct { BaseFee *math.HexOrDecimal256 ExcessBlobGas *math.HexOrDecimal64 BlobGasUsed *math.HexOrDecimal64 + SlotNumber *math.HexOrDecimal64 } // GenesisMismatchError is raised when trying to overwrite an existing