From 107cfc479a1c27ccb4a66995edc6f09dc6e961e9 Mon Sep 17 00:00:00 2001 From: Lee Bousfield Date: Wed, 15 Jun 2022 09:06:09 -0500 Subject: [PATCH] Add ArbOS version to header mix digest field --- core/types/arb_types.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/types/arb_types.go b/core/types/arb_types.go index b97bbecba85a..5f379c5449ef 100644 --- a/core/types/arb_types.go +++ b/core/types/arb_types.go @@ -389,9 +389,10 @@ func (d *ArbitrumInternalTx) setSignatureValues(chainID, v, r, s *big.Int) { } type HeaderInfo struct { - SendRoot common.Hash - SendCount uint64 - L1BlockNumber uint64 + SendRoot common.Hash + SendCount uint64 + L1BlockNumber uint64 + ArbOSFormatVersion uint64 } func (info HeaderInfo) extra() []byte { @@ -402,6 +403,7 @@ func (info HeaderInfo) mixDigest() [32]byte { mixDigest := common.Hash{} binary.BigEndian.PutUint64(mixDigest[:8], info.SendCount) binary.BigEndian.PutUint64(mixDigest[8:16], info.L1BlockNumber) + binary.BigEndian.PutUint64(mixDigest[16:24], info.ArbOSFormatVersion) return mixDigest } @@ -422,5 +424,6 @@ func DeserializeHeaderExtraInformation(header *Header) (HeaderInfo, error) { copy(extra.SendRoot[:], header.Extra) extra.SendCount = binary.BigEndian.Uint64(header.MixDigest[:8]) extra.L1BlockNumber = binary.BigEndian.Uint64(header.MixDigest[8:16]) + extra.ArbOSFormatVersion = binary.BigEndian.Uint64(header.MixDigest[16:24]) return extra, nil }