Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
4094e8f
taprpc: simplify MacaroonWhitelist func code
ffranr Sep 29, 2025
cea2725
taprpc: separate universe proof courier permissions in MacaroonWhitelist
ffranr Oct 8, 2025
a7d6ebd
proof+taprpc: inline default macaroon whitelist logic
ffranr Oct 8, 2025
fe70d4f
proof: update stale universe proof courier comment
ffranr Oct 8, 2025
99c30a5
taprpc: add default permissions for MailboxInfo and Universe/Info
ffranr Oct 8, 2025
9f2fe58
tapgarden: refactor fee rate calculation from fundGenesisPsbt
ffranr Mar 3, 2025
687b851
tapgarden: refactor fundGenesisPsbt to pass wallet funding as closure
ffranr Mar 3, 2025
affedad
tapgarden: refactor fundGenesisPsbt to pass in pending batch
ffranr Mar 3, 2025
f61140d
tapgarden: remove batch key argument from fundGenesisPsbt
ffranr Mar 3, 2025
3164451
tapgarden: mock helper FundGenesisTx returns change output index
ffranr Oct 9, 2025
2b04c29
tapgarden: add batch funding support to RandMintingBatch
ffranr Oct 9, 2025
1fc3ea5
tapdb: use new funded mint batch in TestUpsertMintSupplyPreCommit
ffranr Oct 9, 2025
10b3fb4
tapdb+tapgarden: replace RandSeedlingMintingBatch with RandMintingBatch
ffranr Oct 9, 2025
9b16515
docs: add release note
ffranr Oct 10, 2025
c0845a7
tapdb: add pagination and ordering to QueryAddrEvents
darioAnongba Sep 30, 2025
9a786ad
taprpc: add pagination and sorting to AddrReceivesRequest
darioAnongba Sep 30, 2025
1e085a3
rpc: add pagination and sorting to AddrReceives endpoint
darioAnongba Sep 30, 2025
aece748
cmd: add pagination and sorting to tapcli addr receives
darioAnongba Sep 30, 2025
12dccdd
docs: release notes for addrs receives pagination
darioAnongba Sep 30, 2025
60fbb90
itest: add test for address receives pagination
darioAnongba Sep 30, 2025
b7d65fa
chain_bridge: refactor GetBlockTimestamp to use GetBlockHeaderByHeight
ffranr Oct 10, 2025
8c6af45
lndservices: add block header cache
ffranr Oct 10, 2025
8f6b510
Merge pull request #1841 from lightninglabs/wip/refactor-rpc-macaroon…
jtobin Oct 13, 2025
9853145
lndservices+tapcfg: use block header cache in LndRpcChainBridge
ffranr Oct 13, 2025
57984a4
Merge pull request #1418 from lightninglabs/unit-tests-mint-pre-commit
GeorgeTsagk Oct 15, 2025
83a4116
Merge pull request #1849 from lightninglabs/wip/add-block-header-cache
ffranr Oct 16, 2025
1f42525
tapfreighter: burn by group key
darioAnongba Oct 13, 2025
9d8f087
taprpc: AssetSpecifier in BurnAssetRequest
darioAnongba Oct 13, 2025
56e571c
rpc: burn by group key
darioAnongba Oct 13, 2025
6755ddd
cmd: add group_key flag to tapcli assets burn
darioAnongba Oct 13, 2025
5e2bbcd
itest: burn by group key
darioAnongba Oct 13, 2025
5b69361
docs: add release notes
darioAnongba Oct 13, 2025
80083ec
Merge pull request #1812 from lightninglabs/feat/burn-group-key
ffranr Oct 28, 2025
cea1652
ci: run CI on main and *-staging branches
ffranr Oct 17, 2025
2b3ac4f
Merge pull request #1855 from lightninglabs/wip/enable-ci-for-staging…
ffranr Oct 30, 2025
1e08f56
tapdb: improve cache related log messages
ffranr Nov 4, 2025
a9ae68d
fn: add LowerBoundByteSize function and associated unit tests
ffranr Nov 7, 2025
e4236ad
universe: fix receiver name
ffranr Nov 7, 2025
03024f2
universe: add `LowerBoundByteSize` method to `Proof` struct
ffranr Nov 7, 2025
40568fa
tapdb: improve proof cache key handling and size estimation
ffranr Nov 7, 2025
b3e819f
tapdb: add support for error return from NewMultiverseStore
ffranr Nov 7, 2025
7e26748
tapdb: replace confg arg proof count cache limit with size-based limit
ffranr Nov 7, 2025
60c9b4e
docs: add release notes
ffranr Nov 7, 2025
b2a58b5
go.mod: bump neutrino/cache to v1.1.3
ffranr Nov 11, 2025
c4c9bc2
tapdb: extend newCacheLogger with func option for size callback
ffranr Nov 11, 2025
362970f
tapdb: add TestUniverseProofCache unit tests
ffranr Nov 11, 2025
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
2 changes: 2 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ on:
push:
branches:
- 'main'
- '*-staging'
pull_request:
branches:
- '*'
merge_group:
branches:
- 'main'
- '*-staging'

defaults:
run:
Expand Down
38 changes: 38 additions & 0 deletions address/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,33 @@ const (
StatusCompleted Status = 3
)

// SortDirection is an enum used to specify the order of returned events.
type SortDirection uint8

const (
// UndefinedSortDirection indicates that the sort direction
// is not specified.
UndefinedSortDirection SortDirection = iota

// DescSortDirection indicates that the sort should be in
// descending order.
DescSortDirection

// AscSortDirection indicates that the sort should be in
// ascending order.
AscSortDirection
)

const (
// DefaultEventQueryLimit is the number of events returned
// when no limit is provided.
DefaultEventQueryLimit = 512

// MaxEventQueryLimit is the maximum number of events that can be
// returned in a single query.
MaxEventQueryLimit = 16384
)

// EventQueryParams holds the set of query params for address events.
type EventQueryParams struct {
// AddrTaprootOutputKey is the optional 32-byte x-only serialized
Expand All @@ -65,6 +92,17 @@ type EventQueryParams struct {
// (inclusive). Can be set to nil to return events of all creation
// times.
CreationTimeTo *time.Time

// Offset is the offset into the result set to start returning events.
Offset int32

// Limit is the max number of events that should be returned. If zero,
// then DefaultEventQueryLimit will be used.
Limit int32

// SortDirection is the sort direction to use when returning the
// events. The default zero value sorts the events in ascending order.
SortDirection SortDirection
}

// AssetOutput holds the information about a single asset output that was sent
Expand Down
24 changes: 24 additions & 0 deletions cmd/commands/addrs.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ const (
limitName = "limit"

offsetName = "offset"

directionName = "direction"
)

var queryAddrsCommand = cli.Command{
Expand Down Expand Up @@ -293,6 +295,20 @@ var receivesAddrCommand = cli.Command{
Usage: "filter transfers created before this + " +
"unix timestamp (seconds)",
},
cli.Int64Flag{
Name: limitName,
Usage: "the max number of events returned",
},
cli.Int64Flag{
Name: offsetName,
Usage: "the number of events to skip",
},
cli.StringFlag{
Name: directionName,
Usage: "the sort direction for events (asc or desc). " +
"Defaults to desc.",
Value: "desc",
},
},
Action: addrReceives,
}
Expand All @@ -311,10 +327,18 @@ func addrReceives(ctx *cli.Context) error {
addr = ctx.Args().First()
}

direction := taprpc.SortDirection_SORT_DIRECTION_DESC
if ctx.String(directionName) == "asc" {
direction = taprpc.SortDirection_SORT_DIRECTION_ASC
}

resp, err := client.AddrReceives(ctxc, &taprpc.AddrReceivesRequest{
FilterAddr: addr,
StartTimestamp: ctx.Uint64("start_timestamp"),
EndTimestamp: ctx.Uint64("end_timestamp"),
Limit: int32(ctx.Int64(limitName)),
Offset: int32(ctx.Int64(offsetName)),
Direction: direction,
})
if err != nil {
return fmt.Errorf("unable to query addr receives: %w", err)
Expand Down
143 changes: 120 additions & 23 deletions cmd/commands/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ import (
"strconv"
"strings"

"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/wire"
taprootassets "github.com/lightninglabs/taproot-assets"
"github.com/lightninglabs/taproot-assets/address"
"github.com/lightninglabs/taproot-assets/asset"
"github.com/lightninglabs/taproot-assets/tapcfg"
"github.com/lightninglabs/taproot-assets/taprpc"
wrpc "github.com/lightninglabs/taproot-assets/taprpc/assetwalletrpc"
Expand Down Expand Up @@ -1092,6 +1094,10 @@ var burnAssetsCommand = cli.Command{
Name: assetIDName,
Usage: "the asset ID to burn units from",
},
cli.StringFlag{
Name: assetGroupKeyName,
Usage: "the group key to burn units from",
},
cli.Uint64Flag{
Name: assetAmountName,
Usage: "the amount of units to burn/destroy",
Expand All @@ -1106,15 +1112,66 @@ var burnAssetsCommand = cli.Command{
Action: burnAssets,
}

// buildAssetSpecifier validates and constructs an asset.Specifier from
// CLI context
func buildAssetSpecifier(ctx *cli.Context) (*asset.Specifier, error) {
assetIDHex := ctx.String(assetIDName)
groupKeyHex := ctx.String(assetGroupKeyName)

// At least one of asset ID or group key must be provided.
if assetIDHex == "" && groupKeyHex == "" {
return nil, fmt.Errorf("either asset ID or " +
"group key must be specified")
}

var (
assetID *asset.ID
groupKey *btcec.PublicKey
err error
)

// Parse asset ID if provided.
if assetIDHex != "" {
assetIDBytes, err := hex.DecodeString(assetIDHex)
if err != nil {
return nil, fmt.Errorf("invalid asset ID: %w", err)
}

var id asset.ID
copy(id[:], assetIDBytes)
assetID = &id
}

// Parse group key if provided.
if groupKeyHex != "" {
groupKeyBytes, err := hex.DecodeString(groupKeyHex)
if err != nil {
return nil, fmt.Errorf("invalid group key: %w", err)
}

groupKey, err = btcec.ParsePubKey(groupKeyBytes)
if err != nil {
return nil, fmt.Errorf("invalid group key: %w", err)
}
}

// Construct the asset specifier.
assetSpecifier, err := asset.NewSpecifier(assetID, groupKey, nil, true)
if err != nil {
return nil, fmt.Errorf("invalid asset specifier: %w", err)
}

return &assetSpecifier, nil
}

func burnAssets(ctx *cli.Context) error {
if ctx.NArg() != 0 || ctx.NumFlags() == 0 {
return cli.ShowSubcommandHelp(ctx)
}

assetIDHex := ctx.String(assetIDName)
assetIDBytes, err := hex.DecodeString(assetIDHex)
assetSpecifier, err := buildAssetSpecifier(ctx)
if err != nil {
return fmt.Errorf("invalid asset ID")
return fmt.Errorf("invalid asset specifier: %w", err)
}

burnAmount := ctx.Uint64(assetAmountName)
Expand All @@ -1126,42 +1183,82 @@ func burnAssets(ctx *cli.Context) error {
client, cleanUp := getClient(ctx)
defer cleanUp()

assetIDBytes, groupKeyBytes := assetSpecifier.AsBytes()

if !ctx.Bool(burnOverrideConfirmationName) {
balance, err := client.ListBalances(
ctxc, &taprpc.ListBalancesRequest{
GroupBy: &taprpc.ListBalancesRequest_AssetId{
AssetId: true,
var currBalance uint64

// When both asset ID and group key are provided,
// prioritize asset ID for balance checking since
// it's more specific.
switch {
case len(assetIDBytes) > 0:
// nolint: lll
balance, err := client.ListBalances(ctxc,
&taprpc.ListBalancesRequest{
GroupBy: &taprpc.ListBalancesRequest_AssetId{
AssetId: true,
},
AssetFilter: assetIDBytes,
},
AssetFilter: assetIDBytes,
},
)
if err != nil {
return fmt.Errorf("unable to list current asset "+
"balances: %w", err)
}
)
if err != nil {
return fmt.Errorf("unable to list current "+
"asset balances: %w", err)
}

idHex := hex.EncodeToString(assetIDBytes)
assetBalance, ok := balance.AssetBalances[idHex]
if !ok {
return fmt.Errorf("couldn't fetch balance for "+
"asset ID %x", assetIDBytes)
}

currBalance = assetBalance.Balance

case len(groupKeyBytes) > 0:
// nolint: lll
balance, err := client.ListBalances(ctxc,
&taprpc.ListBalancesRequest{
GroupBy: &taprpc.ListBalancesRequest_GroupKey{
GroupKey: true,
},
AssetFilter: groupKeyBytes,
},
)
if err != nil {
return fmt.Errorf("unable to list current "+
"asset balances: %w", err)
}

assetBalance, ok := balance.AssetBalances[assetIDHex]
if !ok {
return fmt.Errorf("couldn't fetch balance for asset %x",
assetIDBytes)
gkHex := hex.EncodeToString(groupKeyBytes)
groupBalance, ok := balance.AssetGroupBalances[gkHex]
if !ok {
return fmt.Errorf("couldn't fetch balance for "+
"group key %x", groupKeyBytes)
}

currBalance = groupBalance.Balance
}

msg := fmt.Sprintf("Please confirm destructive action.\n"+
"Asset ID: %x\nCurrent available balance: %d\n"+
"%s\nCurrent available balance: %d\n"+
"Amount to burn: %d\n Are you sure you want to "+
"irreversibly burn (destroy, remove from circulation) "+
"the specified amount of assets?\nPlease answer 'yes' "+
"or 'no' and press enter: ", assetIDBytes,
assetBalance.Balance, burnAmount)
"or 'no' and press enter: ",
assetSpecifier.String(), currBalance, burnAmount,
)

if !promptForConfirmation(msg) {
return nil
}
}

resp, err := client.BurnAsset(ctxc, &taprpc.BurnAssetRequest{
Asset: &taprpc.BurnAssetRequest_AssetId{
AssetId: assetIDBytes,
AssetSpecifier: &taprpc.AssetSpecifier{
Id: assetIDBytes,
GroupKey: groupKeyBytes,
},
AmountToBurn: burnAmount,
ConfirmationText: taprootassets.AssetBurnConfirmationText,
Expand Down
6 changes: 6 additions & 0 deletions docs/release-notes/release-notes-0.7.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@
information directly from the RPC response without performing separate
blockchain queries.

- The `AddrReceives` RPC has new fields `limit`, `offset` and `direction` that
allows pagination and sorting. [See PR](https://github.com/lightninglabs/taproot-assets/pull/1813).

## tapcli Additions

- [Rename](https://github.com/lightninglabs/taproot-assets/pull/1682) the mint
Expand All @@ -239,6 +242,9 @@
- The `tapcli addrs receives` command now supports
[new `--start_timestamp` and `--end_timestamp` flags](https://github.com/lightninglabs/taproot-assets/pull/1794).

- The `tapcli addrs receives` command now has new flags `--limit`, `--offset` and
`--direction` that allows pagination and sorting. [See PR](https://github.com/lightninglabs/taproot-assets/pull/1813).

- The `fetchsupplycommit` command [now supports](https://github.com/lightninglabs/taproot-assets/pull/1823)
a `--first` flag to fetch the very first supply commitment; if no flag is
provided, it defaults to fetching the latest. Only one of `--first`,
Expand Down
Loading
Loading