Skip to content

Commit

Permalink
gomod: bump go-eth2-client to v0.13.1 (#954)
Browse files Browse the repository at this point in the history
Bumps go-eth2-client to latest version.

category: misc
ticket: none
  • Loading branch information
corverroos authored Aug 10, 2022
1 parent e55f167 commit b40678b
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 26 deletions.
7 changes: 6 additions & 1 deletion cluster/confighash.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,19 @@ type staticDefinition struct {
addresses []string
}

// GetTree ssz hashes the staticDefinition object.
func (d staticDefinition) GetTree() (*ssz.Node, error) {
return ssz.ProofTree(d) //nolint:wrapcheck
}

// HashTreeRoot ssz hashes the staticDefinition object.
func (d staticDefinition) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(d) //nolint:wrapcheck
}

// HashTreeRootWith ssz hashes the staticDefinition object by including all the fields inside Operator.
// This is done in order to calculate definition_hash of the final Definition object.
func (d staticDefinition) HashTreeRootWith(hh *ssz.Hasher) error {
func (d staticDefinition) HashTreeRootWith(hh ssz.HashWalker) error {
indx := hh.Index()

// Field (0) 'uuid'
Expand Down
7 changes: 6 additions & 1 deletion cluster/definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,19 @@ func (d Definition) ConfigHash() ([32]byte, error) {
return configHash(d)
}

// GetTree ssz hashes the Definition object.
func (d Definition) GetTree() (*ssz.Node, error) {
return ssz.ProofTree(d) //nolint:wrapcheck
}

// HashTreeRoot ssz hashes the Definition object.
func (d Definition) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(d) //nolint:wrapcheck
}

// HashTreeRootWith ssz hashes the Definition object by including all the fields inside Operator.
// This is done in order to calculate definition_hash of the final Definition object.
func (d Definition) HashTreeRootWith(hh *ssz.Hasher) error {
func (d Definition) HashTreeRootWith(hh ssz.HashWalker) error {
indx := hh.Index()

// Field (0) 'UUID'
Expand Down
7 changes: 6 additions & 1 deletion cluster/distvalidator.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,18 @@ type DistValidator struct {
FeeRecipientAddress string `json:"fee_recipient_address,omitempty"`
}

// GetTree ssz hashes the DistValidator object.
func (v DistValidator) GetTree() (*ssz.Node, error) {
return ssz.ProofTree(v) //nolint:wrapcheck
}

// HashTreeRoot ssz hashes the Lock object.
func (v DistValidator) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(v) //nolint:wrapcheck
}

// HashTreeRootWith ssz hashes the Lock object with a hasher.
func (v DistValidator) HashTreeRootWith(hh *ssz.Hasher) error {
func (v DistValidator) HashTreeRootWith(hh ssz.HashWalker) error {
indx := hh.Index()

// Field (0) 'PubKey'
Expand Down
7 changes: 6 additions & 1 deletion cluster/lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,18 @@ type Lock struct {
SignatureAggregate []byte
}

// GetTree ssz hashes the Lock object.
func (l Lock) GetTree() (*ssz.Node, error) {
return ssz.ProofTree(l) //nolint:wrapcheck
}

// HashTreeRoot ssz hashes the Lock object.
func (l Lock) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(l) //nolint:wrapcheck
}

// HashTreeRootWith ssz hashes the Lock object with a hasher.
func (l Lock) HashTreeRootWith(hh *ssz.Hasher) error {
func (l Lock) HashTreeRootWith(hh ssz.HashWalker) error {
indx := hh.Index()

// Field (0) 'Definition'
Expand Down
7 changes: 6 additions & 1 deletion cluster/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,18 @@ func (o Operator) getName() (string, error) {
return p2p.PeerName(peer.ID), nil
}

// GetTree ssz hashes the Operator object.
func (o Operator) GetTree() (*ssz.Node, error) {
return ssz.ProofTree(o) //nolint:wrapcheck
}

// HashTreeRoot ssz hashes the Definition object.
func (o Operator) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(o) //nolint:wrapcheck
}

// HashTreeRootWith ssz hashes the Operator object with a hasher.
func (o Operator) HashTreeRootWith(hh *ssz.Hasher) error {
func (o Operator) HashTreeRootWith(hh ssz.HashWalker) error {
indx := hh.Index()

// Field (0) 'Address'
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ module github.com/obolnetwork/charon
go 1.18

require (
github.com/attestantio/go-eth2-client v0.11.8-0.20220725205133-c05328b73d87
github.com/attestantio/go-eth2-client v0.13.1
github.com/bufbuild/buf v1.7.0
github.com/coinbase/kryptology v1.5.6-0.20220316191335-269410e1b06b
github.com/ethereum/go-ethereum v1.10.21
github.com/ferranbt/fastssz v0.0.0-20220103083642-bc5fefefa28b
github.com/ferranbt/fastssz v0.1.1
github.com/goccy/go-yaml v1.9.5
github.com/gorilla/mux v1.8.0
github.com/ipfs/go-log/v2 v2.5.1
Expand Down Expand Up @@ -95,7 +95,7 @@ require (
github.com/jhump/protocompile v0.0.0-20220216033700-d705409f108f // indirect
github.com/jhump/protoreflect v1.12.1-0.20220721211354-060cc04fc18b // indirect
github.com/klauspost/compress v1.15.9 // indirect
github.com/klauspost/cpuid/v2 v2.0.12 // indirect
github.com/klauspost/cpuid/v2 v2.1.0 // indirect
github.com/klauspost/pgzip v1.2.5 // indirect
github.com/koron/go-ssdp v0.0.2 // indirect
github.com/libp2p/go-buffer-pool v0.0.2 // indirect
Expand Down Expand Up @@ -177,7 +177,7 @@ require (
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.0.0-20220726230323-06994584191e // indirect
golang.org/x/sys v0.0.0-20220727055044-e65921a090b8 // indirect
golang.org/x/sys v0.0.0-20220731174439-a90be440212d // indirect
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df // indirect
Expand Down
20 changes: 9 additions & 11 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/attestantio/go-eth2-client v0.11.8-0.20220725205133-c05328b73d87 h1:rG3xHSJSanANf/oQSc6z7y0UMWdfVP/GZMSyCUAljQY=
github.com/attestantio/go-eth2-client v0.11.8-0.20220725205133-c05328b73d87/go.mod h1:zXL/BxC0cBBhxj+tP7QG7t9Ufoa8GwQLdlbvZRd9+dM=
github.com/attestantio/go-eth2-client v0.13.1 h1:9cIfsQ2yW7hf14/soFVH/JeZabGomDUewnzNO1ZPcCk=
github.com/attestantio/go-eth2-client v0.13.1/go.mod h1:bcg5gfjVcm+MtcaZfzv/uSWNHU4i8hGamVG+9JCZnC0=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
Expand Down Expand Up @@ -186,8 +186,8 @@ github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYF
github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk=
github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/ferranbt/fastssz v0.0.0-20210905181407-59cf6761a7d5/go.mod h1:S8yiDeAXy8f88W4Ul+0dBMPx49S05byYbmZD6Uv94K4=
github.com/ferranbt/fastssz v0.0.0-20220103083642-bc5fefefa28b h1:Jea4sHxe4sTegJgpfhWvxSjFF2nyq4/R/qWm6AziPiI=
github.com/ferranbt/fastssz v0.0.0-20220103083642-bc5fefefa28b/go.mod h1:S8yiDeAXy8f88W4Ul+0dBMPx49S05byYbmZD6Uv94K4=
github.com/ferranbt/fastssz v0.1.1 h1:hBYNxKu51wjPC9sQYCjicmy5wtJqubENp3IiRVcdJBM=
github.com/ferranbt/fastssz v0.1.1/go.mod h1:U2ZsxlYyvGeQGmadhz8PlEqwkBzDIhHwd3xuKrg2JIs=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/flynn/noise v1.0.0 h1:DlTHqmzmvcEiKj+4RYo/imoswx/4r6iBlCMfVtrMXpQ=
github.com/flynn/noise v1.0.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag=
Expand Down Expand Up @@ -420,9 +420,8 @@ github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQan
github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/cpuid/v2 v2.0.11/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c=
github.com/klauspost/cpuid/v2 v2.0.12 h1:p9dKCg8i4gmOxtv35DvrYoWqYzQrvEVdjQ762Y0OqZE=
github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c=
github.com/klauspost/cpuid/v2 v2.1.0 h1:eyi1Ad2aNJMW95zcSbmGg7Cg6cq3ADwLpMAP96d8rF0=
github.com/klauspost/cpuid/v2 v2.1.0/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE=
github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
Expand Down Expand Up @@ -543,7 +542,6 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/moby/buildkit v0.10.3 h1:/dGykD8FW+H4p++q5+KqKEo6gAkYKyBQHdawdjVwVAU=
Expand Down Expand Up @@ -1072,12 +1070,12 @@ golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220727055044-e65921a090b8 h1:dyU22nBWzrmTQxtNrr4dzVOvaw35nUYE279vF9UmsI8=
golang.org/x/sys v0.0.0-20220727055044-e65921a090b8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220731174439-a90be440212d h1:Sv5ogFZatcgIMMtBSTTAgMYsicp25MXBubjXNDKwm80=
golang.org/x/sys v0.0.0-20220731174439-a90be440212d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
Expand Down
11 changes: 9 additions & 2 deletions testutil/beaconmock/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ func defaultMock(httpMock HTTPMock, httpServer *http.Server, clock clockwork.Clo
DepositCount: 0,
BlockHash: testutil.RandomBytes32(),
},
Graffiti: graffiti,
Graffiti: array32(graffiti),
ProposerSlashings: []*eth2p0.ProposerSlashing{},
AttesterSlashings: []*eth2p0.AttesterSlashing{},
Attestations: []*eth2p0.Attestation{testutil.RandomAttestation(), testutil.RandomAttestation()},
Expand All @@ -379,7 +379,7 @@ func defaultMock(httpMock HTTPMock, httpServer *http.Server, clock clockwork.Clo
DepositCount: 0,
BlockHash: testutil.RandomBytes32(),
},
Graffiti: graffiti,
Graffiti: array32(graffiti),
ProposerSlashings: []*eth2p0.ProposerSlashing{},
AttesterSlashings: []*eth2p0.AttesterSlashing{},
Attestations: []*eth2p0.Attestation{testutil.RandomAttestation(), testutil.RandomAttestation()},
Expand Down Expand Up @@ -453,6 +453,13 @@ func defaultMock(httpMock HTTPMock, httpServer *http.Server, clock clockwork.Clo
}
}

func array32(slice []byte) [32]byte {
var resp [32]byte
copy(resp[:], slice)

return resp
}

func mustPKFromHex(pubkeyHex string) eth2p0.BLSPubKey {
pubkeyHex = strings.TrimPrefix(pubkeyHex, "0x")
b, err := hex.DecodeString(pubkeyHex)
Expand Down
8 changes: 4 additions & 4 deletions testutil/random.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func RandomPhase0BeaconBlockBody() *eth2p0.BeaconBlockBody {
DepositCount: 0,
BlockHash: RandomBytes32(),
},
Graffiti: RandomBytes32(),
Graffiti: RandomArray32(),
ProposerSlashings: []*eth2p0.ProposerSlashing{},
AttesterSlashings: []*eth2p0.AttesterSlashing{},
Attestations: []*eth2p0.Attestation{RandomAttestation(), RandomAttestation()},
Expand Down Expand Up @@ -142,7 +142,7 @@ func RandomAltairBeaconBlockBody(t *testing.T) *altair.BeaconBlockBody {
DepositCount: 0,
BlockHash: RandomBytes32(),
},
Graffiti: RandomBytes32(),
Graffiti: RandomArray32(),
ProposerSlashings: []*eth2p0.ProposerSlashing{},
AttesterSlashings: []*eth2p0.AttesterSlashing{},
Attestations: []*eth2p0.Attestation{RandomAttestation(), RandomAttestation()},
Expand Down Expand Up @@ -174,7 +174,7 @@ func RandomBellatrixBeaconBlockBody(t *testing.T) *bellatrix.BeaconBlockBody {
DepositCount: 0,
BlockHash: RandomBytes32(),
},
Graffiti: RandomBytes32(),
Graffiti: RandomArray32(),
ProposerSlashings: []*eth2p0.ProposerSlashing{},
AttesterSlashings: []*eth2p0.AttesterSlashing{},
Attestations: []*eth2p0.Attestation{RandomAttestation(), RandomAttestation()},
Expand Down Expand Up @@ -232,7 +232,7 @@ func RandomBellatrixBlindedBeaconBlockBody(t *testing.T) *eth2v1.BlindedBeaconBl
DepositCount: 0,
BlockHash: RandomBytes32(),
},
Graffiti: RandomBytes32(),
Graffiti: RandomArray32(),
ProposerSlashings: []*eth2p0.ProposerSlashing{},
AttesterSlashings: []*eth2p0.AttesterSlashing{},
Attestations: []*eth2p0.Attestation{RandomAttestation(), RandomAttestation()},
Expand Down

0 comments on commit b40678b

Please sign in to comment.