Skip to content

Commit

Permalink
Merge pull request ethereum#109 from OffchainLabs/arbos-version-in-he…
Browse files Browse the repository at this point in the history
…ader

Add ArbOS version to header mix digest field
  • Loading branch information
PlasmaPower authored Jun 16, 2022
2 parents fe17647 + 107cfc4 commit e2e32a7
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 e2e32a7

Please sign in to comment.