Skip to content

Commit

Permalink
comment reason why v is 0/1
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-shim committed May 6, 2024
1 parent c73bf4e commit c641906
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions signerv2/kms_signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ func NewKMSSigner(ctx context.Context, svc *kms.Client, pk *ecdsa.PublicKey, key
// Heavily taken from https://github.com/welthee/go-ethereum-aws-kms-tx-signer
// It constructs R and S values from KMS, and constructs the recovery id (V) by trying to recover with both 0 and 1 values:
// ref: https://github.com/aws-samples/aws-kms-ethereum-accounts?tab=readme-ov-file#the-recovery-identifier-v
//
// Its V value is 0/1 instead of 27/28 because `types.LatestSignerForChainID` expects 0/1 which turns it into 27/28
func KMSSignerFn(ctx context.Context, svc *kms.Client, pk *ecdsa.PublicKey, keyId string, chainID *big.Int) (bind.SignerFn, error) {
if chainID == nil {
return nil, errors.New("chainID is required")
Expand Down

0 comments on commit c641906

Please sign in to comment.