Skip to content

Commit

Permalink
Caplin: Proper "Normalization" of length of ForkVersions to 8 hex cha…
Browse files Browse the repository at this point in the history
…racters (#10512)
  • Loading branch information
Giulio2002 authored and yperbasis committed May 31, 2024
1 parent efed89b commit 540c1a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cl/clparams/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package clparams

import (
"crypto/rand"
"encoding/binary"
"fmt"
"math"
"math/big"
Expand Down Expand Up @@ -315,7 +316,9 @@ func (b ConfigByte) MarshalJSON() ([]byte, error) {
type ConfigForkVersion uint32

func (v ConfigForkVersion) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("\"0x%x\"", v)), nil
tmp := make([]byte, 4)
binary.BigEndian.PutUint32(tmp, uint32(v))
return []byte(fmt.Sprintf("\"0x%x\"", tmp)), nil
}

// BeaconChainConfig contains constant configs for node to participate in beacon chain.
Expand Down

0 comments on commit 540c1a4

Please sign in to comment.