Skip to content

Conversation

jtobin
Copy link
Member

@jtobin jtobin commented Oct 9, 2025

Too many assets are being requested in at least a couple of areas of the itest suite, here around minting and asserting mints. This really only starts to pose a problem in long-lived testing; per the first commit summary:

AssertAssetsMinted previously listed all confirmed assets known to a client, then checking that any specific assets (to have been minted in a specific transaction) were included in this confirmed asset list. The ListAssets request could time out prematurely if many assets were known to a client, e.g. in load testing.

The changes here limit some requests only to the assets of interest, namely those in either a confirmed or unconfirmed anchoring transaction. edd52b3 should alleviate the timeout problem observed in load testing, and f07ce01 trims logs in the same context tremendously (logging only assets being minted, not all assets ever minted).

jtobin added 2 commits October 9, 2025 13:56
AssertAssetsMinted previously listed all confirmed assets known to a
client, then checking that any specific assets (to have been minted in
a specific transaction) were included in this confirmed asset list. The
ListAssets request could time out prematurely if many assets were known
to a client, e.g. in load testing.

This change limits the confirmed assets requested only to whatever was
included in the 0th output of the supplied minting transaction. Any
supplied asset requests are then checked for inclusion in that set.
Addresses a similar problem as was observed and fixed in the previous
commit. In this case we were again listing all assets known about,
instead of only the unconfirmed ones we're actually interested in.
Copy link

Summary of Changes

Hello @jtobin, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses performance bottlenecks in the integration test suite, specifically concerning the ListAssets RPC calls. By introducing filtering based on the AnchorOutpoint in asset listing requests, the changes ensure that only relevant assets (those tied to a specific minting or anchoring transaction) are queried. This optimization is crucial for preventing timeouts in long-running and load-intensive tests, thereby improving the stability and efficiency of the test environment.

Highlights

  • Performance Optimization for Asset Listing: The ListAssets RPC calls in integration tests are now optimized to prevent timeouts during long-lived and load testing scenarios.
  • Targeted Asset Queries: ListAssets requests are now filtered using AnchorOutpoint to retrieve only assets associated with specific minting or anchoring transactions, rather than listing all known assets.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a valuable optimization to the integration test suite by limiting the scope of asset listing RPC calls. Previously, tests would list all known assets, which could lead to timeouts in long-running test environments. By filtering the ListAssets calls to only include assets from the specific minting anchor transaction, these changes significantly improve test performance and stability.

While the approach is sound, I've identified a potential issue where the filtering relies on the output index of the anchor transaction being 0. If the minting output can be at a different index, this could lead to flaky tests. I've left comments with suggestions to make this filtering more robust.

Comment on lines +2100 to +2102
AnchorOutpoint: &taprpc.OutPoint{
Txid: mintTXID[:],
},

Choose a reason for hiding this comment

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

high

The AnchorOutpoint field is being initialized with only a Txid, which means the OutputIndex will default to 0. If the ListAssets RPC handler performs a strict outpoint match, this will fail to find assets if they are anchored in an output other than index 0. While this might work for current test cases, it could lead to flaky tests in the future if minting transactions start using different output indices. It would be more robust to explicitly specify the output index if it's known, or confirm that the RPC handler correctly interprets a zero-value OutputIndex as a wildcard for any output within the transaction. If the output index is not available here, perhaps the ListAssets RPC should be enhanced to filter by txid directly.

Copy link
Member Author

Choose a reason for hiding this comment

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

I originally included an explicit 0 index, but removed it, deeming it superfluous.

Comment on lines +456 to +458
AnchorOutpoint: &taprpc.OutPoint{
Txid: hashes[0][:],
},

Choose a reason for hiding this comment

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

high

Similar to the change in AssertAssetsMinted, this ListAssets call only specifies the Txid for the AnchorOutpoint, causing OutputIndex to default to 0. This could lead to issues if the asset minting output is not at index 0. To make this more robust, it would be better to retrieve and use the correct output index from the batch finalization response, or ensure the ListAssets RPC can filter by transaction ID alone when OutputIndex is zero.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 18374523805

Details

  • 7 of 7 (100.0%) changed or added relevant lines in 2 files are covered.
  • 25 unchanged lines in 7 files lost coverage.
  • Overall coverage increased (+6.9%) to 56.53%

Files with Coverage Reduction New Missed Lines %
mssmt/compacted_tree.go 2 78.57%
tapdb/mssmt.go 2 90.45%
tapdb/multiverse.go 2 79.79%
universe/supplyverifier/manager.go 2 64.53%
universe/archive.go 3 81.24%
itest/assertions.go 7 87.42%
tapdb/assets_store.go 7 79.61%
Totals Coverage Status
Change from base Build 18359865357: 6.9%
Covered Lines: 63927
Relevant Lines: 113085

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

2 participants