Skip to content

Commit

Permalink
Add ArbOS version to header mix digest field
Browse files Browse the repository at this point in the history
  • Loading branch information
PlasmaPower committed Jun 15, 2022
1 parent 53740c7 commit 107cfc4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions core/types/arb_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}

Expand All @@ -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
}

0 comments on commit 107cfc4

Please sign in to comment.