-
Notifications
You must be signed in to change notification settings - Fork 138
itest: limit asset lists when minting and asserting mints #1842
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
base: main
Are you sure you want to change the base?
Conversation
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.
Summary of ChangesHello @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 Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this 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.
AnchorOutpoint: &taprpc.OutPoint{ | ||
Txid: mintTXID[:], | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
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.
AnchorOutpoint: &taprpc.OutPoint{ | ||
Txid: hashes[0][:], | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Pull Request Test Coverage Report for Build 18374523805Details
💛 - Coveralls |
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:
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).