Skip to content

RPC: Add Ignore Tree Endpoints #1554

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

Merged
merged 12 commits into from
Jul 23, 2025

Conversation

ffranr
Copy link
Contributor

@ffranr ffranr commented May 21, 2025

Closes #1534


EDIT: depends on #1655


Sharing early to get early feedback on naming and architecture. Still missing itests and query RPC endpoint.

This PR will not include the verifier, I will add that in a separate PR.

This PR adds RPC endpoints to populate and query from ignore trees.

@ffranr ffranr requested a review from guggero May 21, 2025 15:02
@ffranr ffranr self-assigned this May 21, 2025
@ffranr ffranr changed the title RPC: add ignore tree RPC endpoints RPC: Add Ignore Tree Endpoints May 21, 2025
@coveralls
Copy link

coveralls commented May 21, 2025

Pull Request Test Coverage Report for Build 16472678428

Details

  • 520 of 1426 (36.47%) changed or added relevant lines in 15 files are covered.
  • 40 unchanged lines in 10 files lost coverage.
  • Overall coverage decreased (-0.001%) to 56.47%

Changes Missing Coverage Covered Lines Changed/Added Lines %
asset/asset.go 21 25 84.0%
tapdb/supply_commit.go 26 34 76.47%
rpcutils/marshal.go 20 30 66.67%
universe/ignore_records.go 41 56 73.21%
taprpc/universerpc/universe_grpc.pb.go 55 78 70.51%
taprpc/tapcommon.pb.go 5 49 10.2%
taprpc/universerpc/universe.pb.json.go 0 63 0.0%
cmd/commands/universe.go 0 95 0.0%
rpcserver.go 221 331 66.77%
taprpc/universerpc/universe.pb.gw.go 3 257 1.17%
Files with Coverage Reduction New Missed Lines %
taprpc/universerpc/universe_grpc.pb.go 1 65.11%
taprpc/universerpc/universe.pb.gw.go 1 4.97%
tapdb/multiverse.go 2 81.69%
tapdb/sqlc/universe.sql.go 2 75.88%
tapgarden/custodian.go 2 76.17%
asset/asset.go 4 79.82%
tapdb/assets_store.go 5 79.39%
mssmt/compacted_tree.go 6 79.49%
tapfreighter/chain_porter.go 6 81.19%
tapdb/universe.go 11 81.46%
Totals Coverage Status
Change from base Build 16443362480: -0.001%
Covered Lines: 58643
Relevant Lines: 103848

💛 - Coveralls

asset/asset.go Outdated
@@ -569,6 +606,10 @@ func (id PrevID) Hash() [sha256.Size]byte {
return *(*[sha256.Size]byte)(h.Sum(nil))
}

// OutPoint is a type alias for an asset outpoint. It links the anchor outpoint
// to the asset it secures.
type OutPoint = PrevID
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PrevOut?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or AnchorPoint (to be used as asset.AnchorPoint which reads nicely IMO) to not confuse it with a purely on-chain wire.OutPoint?

Copy link
Member

@guggero guggero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good, did a quick first pass.

asset/asset.go Outdated
@@ -569,6 +606,10 @@ func (id PrevID) Hash() [sha256.Size]byte {
return *(*[sha256.Size]byte)(h.Sum(nil))
}

// OutPoint is a type alias for an asset outpoint. It links the anchor outpoint
// to the asset it secures.
type OutPoint = PrevID
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or AnchorPoint (to be used as asset.AnchorPoint which reads nicely IMO) to not confuse it with a purely on-chain wire.OutPoint?

@levmi levmi moved this from 🆕 New to 🏗 In progress in Taproot-Assets Project Board May 22, 2025
@ffranr ffranr force-pushed the wip/1534-ignore-tree/1534-add-ignoreasset-rpc branch from 661466c to 32da29f Compare May 27, 2025 22:00
@ffranr ffranr changed the base branch from main to supply-commit-machine May 27, 2025 22:01
@ffranr
Copy link
Contributor Author

ffranr commented May 27, 2025

I've rebased on to branch supply-commit-machine.

@ffranr ffranr force-pushed the wip/1534-ignore-tree/1534-add-ignoreasset-rpc branch from 32da29f to 6fbc382 Compare June 3, 2025 19:07
@Roasbeef Roasbeef force-pushed the supply-commit-machine branch 5 times, most recently from d7efd50 to c2c394f Compare June 12, 2025 01:35
@Roasbeef Roasbeef force-pushed the supply-commit-machine branch 11 times, most recently from 37bdcfa to b5a6c5e Compare June 25, 2025 00:27
@Roasbeef Roasbeef force-pushed the supply-commit-machine branch from b5a6c5e to c59b408 Compare June 25, 2025 02:00
@levmi levmi added this to the v0.7 milestone Jul 21, 2025
@levmi levmi added the P0 label Jul 21, 2025
Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Comments mostly related to extra validation or error reporting we can do at the RPC call site.


// Fetch the full delegation key locator.
delegationKey, err := r.cfg.TapAddrBook.FetchInternalKeyLocator(
ctx, &delegationPubKey,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this'll reliably fail if we weren't the ones that actually issued the asset right? Or will signing fail below?

Either way, we should amke thsi check and the related failure explicit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made the endpoint's error message more explicit and extended the integration test to include a case where a non-owner node attempts to create a signed ignore tuple and correctly fails.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you forget to push this up maybe? I don't see the addition to the itests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}

require.True(t.t, foundCommitTxOut)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah the syncer/verifier isn't hooked up yet.

@ffranr ffranr force-pushed the wip/1534-ignore-tree/1534-add-ignoreasset-rpc branch from 543c669 to 8654ab9 Compare July 22, 2025 00:19
@ffranr ffranr changed the base branch from wip/supplycommit/bugfix-state-machine to main July 22, 2025 00:19
@ffranr ffranr requested a review from guggero July 22, 2025 00:24
ffranr added 3 commits July 22, 2025 14:10
Adds a method to generate a Schnorr signature over the TLV serialization
of an IgnoreTuple.
This functionality will be used in the next commit which adds the
IgnoreAssetOutPoint RPC endpoint.
@ffranr ffranr force-pushed the wip/1534-ignore-tree/1534-add-ignoreasset-rpc branch 2 times, most recently from ff1e6db to 2994e96 Compare July 22, 2025 18:51
@ffranr ffranr force-pushed the wip/1534-ignore-tree/1534-add-ignoreasset-rpc branch from 2994e96 to 786df50 Compare July 22, 2025 20:54
@ffranr ffranr requested review from guggero and Roasbeef July 22, 2025 21:47
Copy link
Member

@guggero guggero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, LGTM 🎉

ffranr added 9 commits July 23, 2025 14:43
Introduce a new RPC endpoint to add an asset outpoint to the asset's
ignore tree. This allows asset issuers to explicitly exclude certain
asset outpoints.
Introduce the UpdateSupplyCommit endpoint to trigger the creation and
broadcast of a new on-chain supply commitment transaction for a given
asset group. This allows clients to manually update supply commitments
as needed.
Modified FetchSupplyCommit to include metadata from the mined Bitcoin
block containing the supply commit transaction.
Updated the RootCommitment struct to include metadata from the mined
Bitcoin block.
Add FetchSupplyCommit endpoint to retrieve the on-chain supply
commitment for a specific asset group. The response includes optional
inclusion proofs for any provided leaf keys.
Add CLI commands to:
- Ignore an asset outpoint in the supply commitment,
- Trigger a manual on-chain update of the supply commitment,
- Fetch the current supply commitment state.
Replaced usages of the LeafNode concrete type with the more general
Node interface in function signatures where applicable. This adds
flexibility which will become useful in a future itest.
Update the sendAssetAndAssert integration test helper to return the
RPC response from the SendAsset call. This allows callers to access
the full response data for further assertions or processing.
Add integration test to ensure universe supply commitments properly
handle ignored asset outpoints. The test confirms that once an outpoint
is marked as ignored, it is correctly placed in the ignore subtree of
the supply commitment, and that this state is reflected in the mined
commitment transaction.
@ffranr ffranr force-pushed the wip/1534-ignore-tree/1534-add-ignoreasset-rpc branch from 786df50 to 1fdd9da Compare July 23, 2025 13:54
Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐈‍⬛

@Roasbeef Roasbeef merged commit b33cb3c into main Jul 23, 2025
17 of 18 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Taproot-Assets Project Board Jul 23, 2025
@guggero guggero deleted the wip/1534-ignore-tree/1534-add-ignoreasset-rpc branch July 24, 2025 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Add IgnoreAsset RPC endpoint
6 participants