Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi: bump btcd version. #9154

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions channeldb/migration_01_to_11/migration_11_invoices_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package migration_01_to_11

import (
"bytes"
"fmt"
"testing"
"time"

Expand Down Expand Up @@ -154,12 +153,7 @@ func signDigestCompact(hash []byte) ([]byte, error) {
privKey, _ := btcec.PrivKeyFromBytes(testPrivKeyBytes)

// ecdsa.SignCompact returns a pubkey-recoverable signature
sig, err := ecdsa.SignCompact(privKey, hash, isCompressedKey)
if err != nil {
return nil, fmt.Errorf("can't sign the hash: %w", err)
}

return sig, nil
return ecdsa.SignCompact(privKey, hash, isCompressedKey), nil
}

// getPayReq creates a payment request for the given net.
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ require (
github.com/NebulousLabs/go-upnp v0.0.0-20180202185039-29b680b06c82
github.com/Yawning/aez v0.0.0-20211027044916-e49e68abd344
github.com/andybalholm/brotli v1.0.4
github.com/btcsuite/btcd v0.24.2-beta.rc1.0.20240625142744-cc26860b4026
github.com/btcsuite/btcd/btcec/v2 v2.3.3
github.com/btcsuite/btcd v0.24.3-0.20240921052913-67b8efd3ba53
github.com/btcsuite/btcd/btcec/v2 v2.3.4
github.com/btcsuite/btcd/btcutil v1.1.5
github.com/btcsuite/btcd/btcutil/psbt v1.1.8
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r
github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=
github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M=
github.com/btcsuite/btcd v0.23.5-0.20231215221805-96c9fd8078fd/go.mod h1:nm3Bko6zh6bWP60UxwoT5LzdGJsQJaPo6HjduXq9p6A=
github.com/btcsuite/btcd v0.24.2-beta.rc1.0.20240625142744-cc26860b4026 h1:s8/96vQSj05bqLl9RyM/eMX8gLtiayEj520TVE4YGy0=
github.com/btcsuite/btcd v0.24.2-beta.rc1.0.20240625142744-cc26860b4026/go.mod h1:5C8ChTkl5ejr3WHj8tkQSCmydiMEPB0ZhQhehpq7Dgg=
github.com/btcsuite/btcd v0.24.3-0.20240921052913-67b8efd3ba53 h1:XOZ/wRGHkKv0AqxfDks5IkzaQ1Ge6fq322ZOOG5VIkU=
github.com/btcsuite/btcd v0.24.3-0.20240921052913-67b8efd3ba53/go.mod h1:zHK7t7sw8XbsCkD64WePHE3r3k9/XoGAcf6mXV14c64=
github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA=
github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE=
github.com/btcsuite/btcd/btcec/v2 v2.3.3 h1:6+iXlDKE8RMtKsvK0gshlXIuPbyWM/h84Ensb7o3sC0=
github.com/btcsuite/btcd/btcec/v2 v2.3.3/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ=
github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A=
github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE=
github.com/btcsuite/btcd/btcutil v1.1.5 h1:+wER79R5670vs/ZusMTF1yTcRYE5GUsFbdjdisflzM8=
Expand Down
7 changes: 1 addition & 6 deletions invoices/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"crypto/rand"
"encoding/binary"
"encoding/hex"
"fmt"
"sync"
"testing"
"time"
Expand Down Expand Up @@ -69,11 +68,7 @@ var (
testMessageSigner = zpay32.MessageSigner{
SignCompact: func(msg []byte) ([]byte, error) {
hash := chainhash.HashB(msg)
sig, err := ecdsa.SignCompact(testPrivKey, hash, true)
if err != nil {
return nil, fmt.Errorf("can't sign the "+
"message: %v", err)
}
sig := ecdsa.SignCompact(testPrivKey, hash, true)

return sig, nil
},
Expand Down
8 changes: 2 additions & 6 deletions invoices/test_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,8 @@ var (
testMessageSigner = zpay32.MessageSigner{
SignCompact: func(msg []byte) ([]byte, error) {
hash := chainhash.HashB(msg)
sig, err := ecdsa.SignCompact(testPrivKey, hash, true)
if err != nil {
return nil, fmt.Errorf("can't sign the "+
"message: %v", err)
}
return sig, nil

return ecdsa.SignCompact(testPrivKey, hash, true), nil
},
}

Expand Down
3 changes: 2 additions & 1 deletion keychain/btcwallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,8 @@ func (b *BtcWalletKeyRing) SignMessageCompact(keyLoc KeyLocator,
} else {
digest = chainhash.HashB(msg)
}
return ecdsa.SignCompact(privKey, digest, true)

return ecdsa.SignCompact(privKey, digest, true), nil
}

// SignMessageSchnorr uses the Schnorr signature algorithm to sign the given
Expand Down
3 changes: 2 additions & 1 deletion keychain/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ func (p *PrivKeyMessageSigner) SignMessageCompact(msg []byte,
} else {
digest = chainhash.HashB(msg)
}
return ecdsa.SignCompact(p.privKey, digest, true)

return ecdsa.SignCompact(p.privKey, digest, true), nil
}

var _ SingleKeyMessageSigner = (*PubKeyMessageSigner)(nil)
Expand Down
2 changes: 1 addition & 1 deletion lnrpc/invoicesrpc/addinvoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ func AddInvoice(ctx context.Context, cfg *AddInvoiceConfig,

return ecdsa.SignCompact(
ephemKey, chainhash.HashB(msg), true,
)
), nil
},
})
if err != nil {
Expand Down
5 changes: 1 addition & 4 deletions lnrpc/walletrpc/walletkit_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2647,10 +2647,7 @@ func (w *WalletKit) SignMessageWithAddr(_ context.Context,
"fetched from wallet database: %w", err)
}

sigBytes, err := ecdsa.SignCompact(privKey, digest, pubKey.Compressed())
if err != nil {
return nil, fmt.Errorf("failed to create signature: %w", err)
}
sigBytes := ecdsa.SignCompact(privKey, digest, pubKey.Compressed())

// Bitcoin signatures are base64 encoded (being compatible with
// bitcoin-core and btcd).
Expand Down
3 changes: 2 additions & 1 deletion lntest/mock/secretkeyring.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ func (s *SecretKeyRing) SignMessageCompact(_ keychain.KeyLocator,
} else {
digest = chainhash.HashB(msg)
}
return ecdsa.SignCompact(s.RootKey, digest, true)

return ecdsa.SignCompact(s.RootKey, digest, true), nil
}

// SignMessageSchnorr signs the passed message and ignores the KeyDescriptor.
Expand Down
10 changes: 3 additions & 7 deletions zpay32/invoice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,8 @@ var (
testMessageSigner = MessageSigner{
SignCompact: func(msg []byte) ([]byte, error) {
hash := chainhash.HashB(msg)
sig, err := ecdsa.SignCompact(testPrivKey, hash, true)
if err != nil {
return nil, fmt.Errorf("can't sign the "+
"message: %v", err)
}
return sig, nil

return ecdsa.SignCompact(testPrivKey, hash, true), nil
},
}

Expand Down Expand Up @@ -1043,7 +1039,7 @@ func TestInvoiceChecksumMalleability(t *testing.T) {
msgSigner := MessageSigner{
SignCompact: func(msg []byte) ([]byte, error) {
hash := chainhash.HashB(msg)
return ecdsa.SignCompact(privKey, hash, true)
return ecdsa.SignCompact(privKey, hash, true), nil
},
}
opts := []func(*Invoice){Description("test")}
Expand Down
Loading