Skip to content

Commit 6444bbe

Browse files
committed
fix(core): hex encode validators/validator/penalties in Header JSON
Ensure JSON marshal/unmarshal uses hex for validators, validator, and penalties so Header encoding is consistent with RPC output.
1 parent cc21093 commit 6444bbe

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

core/state_processor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ func ProcessParentBlockHash(prevHash common.Hash, vmenv *vm.EVM, statedb vm.Stat
728728
}
729729
vmenv.Reset(NewEVMTxContext(msg), statedb)
730730
statedb.AddAddressToAccessList(params.HistoryStorageAddress)
731-
_, _, err := vmenv.Call(vm.AccountRef(msg.From), *msg.To, msg.Data, 30_000_000, common.U2560)
731+
_, _, err := vmenv.Call(msg.From, *msg.To, msg.Data, 30_000_000, common.U2560)
732732
if err != nil {
733733
panic(err)
734734
}

core/types/block.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ type headerMarshaling struct {
9595
GasUsed hexutil.Uint64
9696
Time hexutil.Uint64
9797
Extra hexutil.Bytes
98+
Validators hexutil.Bytes
99+
Validator hexutil.Bytes
100+
Penalties hexutil.Bytes
98101
BaseFee *hexutil.Big
99102
Hash common.Hash `json:"hash"` // adds call to Hash() in MarshalJSON
100103
}

core/types/gen_header_json.go

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)