From b6d2349214baa2e13ae132e1d6fc6aeb5fae94f3 Mon Sep 17 00:00:00 2001 From: dwasse Date: Thu, 28 Dec 2023 14:53:56 -0600 Subject: [PATCH] Fix: attempt to fix v+27 (#1720) --- agents/types/utils.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/agents/types/utils.go b/agents/types/utils.go index 0c789f48b6..9825a4be57 100644 --- a/agents/types/utils.go +++ b/agents/types/utils.go @@ -3,6 +3,7 @@ package types import ( "context" "fmt" + "math/big" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" @@ -27,9 +28,11 @@ func signEncoder(ctx context.Context, signer signer.Signer, encoder Encoder, sal } // Sign the message. - signature, err := signer.SignMessage(ctx, core.BytesToSlice(hashedDigest), false) + sig, err := signer.SignMessage(ctx, core.BytesToSlice(hashedDigest), false) if err != nil { return nil, nil, common.Hash{}, fmt.Errorf("could not sign: %w", err) } - return signature, encoded, hashedDigest, nil + + sig = NewSignature(new(big.Int).Add(big.NewInt(27), sig.V()), sig.R(), sig.S()) + return sig, encoded, hashedDigest, nil }