From be2c8f582676bc830d33b449c663db1ae01d0516 Mon Sep 17 00:00:00 2001 From: Jim McDonald Date: Thu, 25 Apr 2024 10:09:37 +0100 Subject: [PATCH] Remove proposal checks for graffiti. --- CHANGELOG.md | 6 ++++++ http/blindedproposal.go | 12 +++--------- http/http.go | 2 +- http/proposal.go | 10 +--------- 4 files changed, 11 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5dc9cf7..97e7330e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +0.21.3: + - relax requirement for proposals to use the graffiti we request + +0.21.2: + - fuzz testing fixes + 0.21.1: - fix potential crash when unmarshaling Gwei values - add `WithReducedMemoryUsage()` option for http service diff --git a/http/blindedproposal.go b/http/blindedproposal.go index f1f8d143..3f4b1443 100644 --- a/http/blindedproposal.go +++ b/http/blindedproposal.go @@ -29,6 +29,8 @@ import ( ) // BlindedProposal fetches a proposal for signing. +// +// Deprecated: use `Proposal` instead. func (s *Service) BlindedProposal(ctx context.Context, opts *api.BlindedProposalOpts, ) ( @@ -85,7 +87,7 @@ func (s *Service) BlindedProposal(ctx context.Context, return nil, errors.Join(fmt.Errorf("blinded beacon block proposal for slot %d; expected %d", blockSlot, opts.Slot), client.ErrInconsistentResult) } - // Only check the RANDAO reveal and graffiti if we are not connected to DVT middleware, + // Only check the RANDAO reveal if we are not connected to DVT middleware, // as the returned values will be decided by the middleware. if !s.connectedToDVTMiddleware { blockRandaoReveal, err := response.Data.RandaoReveal() @@ -95,14 +97,6 @@ func (s *Service) BlindedProposal(ctx context.Context, if !bytes.Equal(blockRandaoReveal[:], opts.RandaoReveal[:]) { return nil, errors.Join(fmt.Errorf("blinded beacon block proposal has RANDAO reveal %#x; expected %#x", blockRandaoReveal[:], opts.RandaoReveal[:]), client.ErrInconsistentResult) } - - blockGraffiti, err := response.Data.Graffiti() - if err != nil { - return nil, err - } - if !bytes.Equal(blockGraffiti[:], opts.Graffiti[:]) { - return nil, errors.Join(fmt.Errorf("blinded beacon block proposal has graffiti %#x; expected %#x", blockGraffiti[:], opts.Graffiti[:]), client.ErrInconsistentResult) - } } return response, nil diff --git a/http/http.go b/http/http.go index 9387c6c3..a328527a 100644 --- a/http/http.go +++ b/http/http.go @@ -34,7 +34,7 @@ import ( ) // defaultUserAgent is sent with requests if no other user agent has been supplied. -const defaultUserAgent = "go-eth2-client/0.21.2" +const defaultUserAgent = "go-eth2-client/0.21.3" // post sends an HTTP post request and returns the body. func (s *Service) post(ctx context.Context, endpoint string, body io.Reader) (io.Reader, error) { diff --git a/http/proposal.go b/http/proposal.go index f99dd816..4c0f0871 100644 --- a/http/proposal.go +++ b/http/proposal.go @@ -97,7 +97,7 @@ func (s *Service) Proposal(ctx context.Context, return nil, errors.Join(fmt.Errorf("beacon block proposal for slot %d; expected %d", blockSlot, opts.Slot), client.ErrInconsistentResult) } - // Only check the RANDAO reveal and graffiti if we are not connected to DVT middleware, + // Only check the RANDAO reveal if we are not connected to DVT middleware, // as the returned values will be decided by the middleware. if !s.connectedToDVTMiddleware { blockRandaoReveal, err := response.Data.RandaoReveal() @@ -107,14 +107,6 @@ func (s *Service) Proposal(ctx context.Context, if !bytes.Equal(blockRandaoReveal[:], opts.RandaoReveal[:]) { return nil, errors.Join(fmt.Errorf("beacon block proposal has RANDAO reveal %#x; expected %#x", blockRandaoReveal[:], opts.RandaoReveal[:]), client.ErrInconsistentResult) } - - blockGraffiti, err := response.Data.Graffiti() - if err != nil { - return nil, err - } - if !bytes.Equal(blockGraffiti[:], opts.Graffiti[:]) { - return nil, errors.Join(fmt.Errorf("beacon block proposal has graffiti %#x; expected %#x", blockGraffiti[:], opts.Graffiti[:]), client.ErrInconsistentResult) - } } return response, nil