Skip to content

Commit

Permalink
update dependencies (LND v0.18.0-beta and co)
Browse files Browse the repository at this point in the history
Updated versions:

  - lnd: v0.17.4-beta -> v0.18.0-beta
  - lnd/kvdb: v1.4.4 -> v1.4.8
  - lnd/tor: v1.1.2 -> v1.1.3
  - lnd/healthcheck: v1.2.3 -> v1.2.4
  - lnd/tlv: v1.1.1 -> v1.2.6
  - neutrino: v0.16.0 -> v0.16.1-0.20240425105051-602843d34ffd
  - neutrino/cache: v1.1.1 -> v1.1.2
  - lndclient: v0.17.4-1 -> v0.18.0-1
  - loop: v0.26.6-beta -> v0.28.3
  - loop/swapserverrpc: v1.0.5 -> v1.0.8
  - pool: v0.6.2-beta.0.20230329135228-c3bffb52df3a ->
        v0.6.5-beta.0.20240531084722-4000ec802aaa
  - pool/auctioneerrpc: v1.0.7 -> v1.1.2
  - aperture: v0.1.21-beta.0.20230705004936-87bb996a4030 -> v0.3.2-beta
  - replace of protobuf: v1.30.0-hex-display -> v1.33.0-hex-display
  - Go: 1.21 -> 1.22.3

Pool version v0.6.5-beta.0.20240531084722-4000ec802aaa was used because it uses
LND v0.18.0-beta, not v0.18.0-beta.rc3.

Fixed imports and API changes.

Updated Go version in README.
  • Loading branch information
starius committed Jun 3, 2024
1 parent 85f207c commit 6a93e42
Show file tree
Hide file tree
Showing 15 changed files with 624 additions and 254 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
# go needs absolute directories, using the $HOME variable doesn't work here.
GOCACHE: /home/runner/work/go/pkg/build
GOPATH: /home/runner/work/go
GO_VERSION: 1.21.3
GO_VERSION: 1.22.3

jobs:
########################
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ $ sudo mv chantools-*/chantools /usr/local/bin/

If there isn't a pre-built binary for your operating system or architecture
available or you want to build `chantools` from source for another reason, you
need to make sure you have `go 1.21.x` (or later) and `make` installed and can
need to make sure you have `go 1.22.3` (or later) and `make` installed and can
then run the following commands:

```bash
Expand Down Expand Up @@ -519,4 +519,4 @@ Legend:

[discussions]: https://github.com/lightningnetwork/lnd/discussions

[zombie-recovery]: doc/zombierecovery.md
[zombie-recovery]: doc/zombierecovery.md
2 changes: 1 addition & 1 deletion cmd/chantools/closepoolaccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ func closePoolAccount(extendedKey *hdkeychain.ExtendedKey, apiURL string,
signDesc.SignMethod = input.TaprootScriptSpendSignMethod
}
feeRateKWeight := chainfee.SatPerKVByte(1000 * feeRate).FeePerKWeight()
totalFee := feeRateKWeight.FeeForWeight(int64(estimator.Weight()))
totalFee := feeRateKWeight.FeeForWeight(estimator.Weight())

// Add our sweep destination output.
sweepTx.TxOut = []*wire.TxOut{{
Expand Down
2 changes: 1 addition & 1 deletion cmd/chantools/doublespendinputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (c *doubleSpendInputs) Execute(_ *cobra.Command, _ []string) error {

// Calculate the fee.
feeRateKWeight := chainfee.SatPerKVByte(1000 * c.FeeRate).FeePerKWeight()
totalFee := feeRateKWeight.FeeForWeight(int64(estimator.Weight()))
totalFee := feeRateKWeight.FeeForWeight(estimator.Weight())

// Create the transaction.
tx := wire.NewMsgTx(2)
Expand Down
9 changes: 5 additions & 4 deletions cmd/chantools/dropchannelgraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/lightninglabs/chantools/lnd"
"github.com/lightningnetwork/lnd/chainreg"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/channeldb/models"
"github.com/lightningnetwork/lnd/keychain"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -174,8 +175,8 @@ func newChanAnnouncement(localPubKey, remotePubKey *btcec.PublicKey,
localFundingKey *keychain.KeyDescriptor,
remoteFundingKey *btcec.PublicKey, shortChanID lnwire.ShortChannelID,
fwdMinHTLC, fwdMaxHTLC lnwire.MilliSatoshi, capacity btcutil.Amount,
channelPoint wire.OutPoint) (*channeldb.ChannelEdgeInfo,
*channeldb.ChannelEdgePolicy, error) {
channelPoint wire.OutPoint) (*models.ChannelEdgeInfo,
*models.ChannelEdgePolicy, error) {

chainHash := *chainParams.GenesisHash

Expand Down Expand Up @@ -226,7 +227,7 @@ func newChanAnnouncement(localPubKey, remotePubKey *btcec.PublicKey,
return nil, nil, err
}

edge := &channeldb.ChannelEdgeInfo{
edge := &models.ChannelEdgeInfo{
ChannelID: chanAnn.ShortChannelID.ToUint64(),
ChainHash: chanAnn.ChainHash,
NodeKey1Bytes: chanAnn.NodeID1,
Expand Down Expand Up @@ -264,7 +265,7 @@ func newChanAnnouncement(localPubKey, remotePubKey *btcec.PublicKey,
FeeRate: uint32(chainreg.DefaultBitcoinFeeRate),
}

update := &channeldb.ChannelEdgePolicy{
update := &models.ChannelEdgePolicy{
SigBytes: chanUpdateAnn.Signature.ToSignatureBytes(),
ChannelID: chanAnn.ShortChannelID.ToUint64(),
LastUpdate: time.Now(),
Expand Down
2 changes: 1 addition & 1 deletion cmd/chantools/pullanchor.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func createPullTransactionTemplate(rootKey *hdkeychain.ExtendedKey,
anchorAmt := uint64(len(anchorAddrs)) * 330
totalOutputValue := btcutil.Amount(sponsorTxOut.Value + anchorAmt)
feeRateKWeight := chainfee.SatPerKVByte(1000 * feeRate).FeePerKWeight()
totalFee := feeRateKWeight.FeeForWeight(int64(estimator.Weight()))
totalFee := feeRateKWeight.FeeForWeight(estimator.Weight())

log.Infof("Fee %d sats of %d total amount (estimated weight %d)",
totalFee, totalOutputValue, estimator.Weight())
Expand Down
6 changes: 3 additions & 3 deletions cmd/chantools/recoverloopin.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"
"github.com/lightninglabs/chantools/lnd"
"github.com/lightninglabs/loop"
"github.com/lightninglabs/loop/loopdb"
"github.com/lightninglabs/loop/swap"
"github.com/lightninglabs/loop/utils"
"github.com/lightningnetwork/lnd/input"
"github.com/lightningnetwork/lnd/keychain"
"github.com/lightningnetwork/lnd/lnrpc"
Expand Down Expand Up @@ -218,7 +218,7 @@ func (c *recoverLoopInCommand) Execute(_ *cobra.Command, _ []string) error {
}

// Get the swaps htlc.
htlc, err := loop.GetHtlc(
htlc, err := utils.GetHtlc(
loopIn.Hash, &loopIn.Contract.SwapContract, chainParams,
)
if err != nil {
Expand All @@ -243,7 +243,7 @@ func (c *recoverLoopInCommand) Execute(_ *cobra.Command, _ []string) error {
feeRateKWeight := chainfee.SatPerKVByte(
1000 * c.FeeRate,
).FeePerKWeight()
fee := feeRateKWeight.FeeForWeight(int64(estimator.Weight()))
fee := feeRateKWeight.FeeForWeight(estimator.Weight())

txID, err := chainhash.NewHashFromStr(c.TxID)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/chantools/rescuefunding.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func rescueFunding(localKeyDesc *keychain.KeyDescriptor,
// Estimate the transaction weight, so we can do the fee estimation.
estimator.AddWitnessInput(MultiSigWitnessSize)
feeRateKWeight := chainfee.SatPerKVByte(1000 * feeRate).FeePerKWeight()
totalFee := feeRateKWeight.FeeForWeight(int64(estimator.Weight()))
totalFee := feeRateKWeight.FeeForWeight(estimator.Weight())
txOut.Value = utxo.Value - int64(totalFee)

// Let's now create the PSBT as we have everything we need so far.
Expand Down
2 changes: 1 addition & 1 deletion cmd/chantools/sweepremoteclosed.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func sweepRemoteClosed(extendedKey *hdkeychain.ExtendedKey, apiURL,
// Calculate the fee based on the given fee rate and our weight
// estimation.
feeRateKWeight := chainfee.SatPerKVByte(1000 * feeRate).FeePerKWeight()
totalFee := feeRateKWeight.FeeForWeight(int64(estimator.Weight()))
totalFee := feeRateKWeight.FeeForWeight(estimator.Weight())

log.Infof("Fee %d sats of %d total amount (estimated weight %d)",
totalFee, totalOutputValue, estimator.Weight())
Expand Down
2 changes: 1 addition & 1 deletion cmd/chantools/sweeptimelock.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ func sweepTimeLock(extendedKey *hdkeychain.ExtendedKey, apiURL string,
// Calculate the fee based on the given fee rate and our weight
// estimation.
feeRateKWeight := chainfee.SatPerKVByte(1000 * feeRate).FeePerKWeight()
totalFee := feeRateKWeight.FeeForWeight(int64(estimator.Weight()))
totalFee := feeRateKWeight.FeeForWeight(estimator.Weight())

log.Infof("Fee %d sats of %d total amount (estimated weight %d)",
totalFee, totalOutputValue, estimator.Weight())
Expand Down
2 changes: 1 addition & 1 deletion cmd/chantools/sweeptimelockmanual.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ func sweepTimeLockManual(extendedKey *hdkeychain.ExtendedKey, apiURL string,
// estimation.
estimator.AddWitnessInput(input.ToLocalTimeoutWitnessSize)
feeRateKWeight := chainfee.SatPerKVByte(1000 * feeRate).FeePerKWeight()
totalFee := feeRateKWeight.FeeForWeight(int64(estimator.Weight()))
totalFee := feeRateKWeight.FeeForWeight(estimator.Weight())

// Add our sweep destination output.
sweepTx.TxOut = []*wire.TxOut{{
Expand Down
4 changes: 2 additions & 2 deletions cmd/chantools/triggerforceclose.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (c *triggerForceCloseCommand) Execute(_ *cobra.Command, _ []string) error {
}

err = requestForceClose(
c.Peer, c.TorProxy, pubKey, outPoint, identityECDH,
c.Peer, c.TorProxy, pubKey, *outPoint, identityECDH,
)
if err != nil {
return fmt.Errorf("error requesting force close: %w", err)
Expand Down Expand Up @@ -199,7 +199,7 @@ func connectPeer(peerHost, torProxy string, peerPubKey *btcec.PublicKey,
}

func requestForceClose(peerHost, torProxy string, peerPubKey *btcec.PublicKey,
channelPoint *wire.OutPoint, identity keychain.SingleKeyECDH) error {
channelPoint wire.OutPoint, identity keychain.SingleKeyECDH) error {

p, err := connectPeer(
peerHost, torProxy, peerPubKey, identity, dialTimeout,
Expand Down
2 changes: 1 addition & 1 deletion cmd/chantools/zombierecovery_makeoffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ func (c *zombieRecoveryMakeOfferCommand) Execute(_ *cobra.Command,
estimator.AddWitnessInput(input.MultiSigWitnessSize)
}
feeRateKWeight := chainfee.SatPerKVByte(1000 * c.FeeRate).FeePerKWeight()
totalFee := int64(feeRateKWeight.FeeForWeight(int64(estimator.Weight())))
totalFee := int64(feeRateKWeight.FeeForWeight(estimator.Weight()))

fmt.Printf("Current tally (before fees):\n\t"+
"To our address (%s): %d sats\n\t"+
Expand Down
Loading

0 comments on commit 6a93e42

Please sign in to comment.