Repository navigation
test(plutus): speed up PlutusV3 builtins tests - #3741
Merged
Merged
Conversation
`test_plutusv3_builtins_new_cost` is the longest test (220 min in CI). It was picked up only 86 min into the run, finishing an hour after all other tests. Mark it with `order(5)` so it starts in the first wave.
Fund the token issuer for up to 30 scripts in a single transaction, instead of one funding transaction per script. This saves one tx and one wait for a block per script. Tests with old cost model, where mints fail already at build time, spent nearly all their time on funding (33 and 101 min in CI). Fund the payment address once per test, for all chunks, and cache the addresses per variant, so tests running in parallel on the same cluster instance don't share them. Check the outputs of the funding tx instead of the issuer address balance.
Submit the minting transactions without waiting for them to appear on chain, and confirm all minting transactions of a chunk together. This replaces a wait for blocks per script with a single wait per chunk. Transactions that didn't make it to the chain are resubmitted, but only after a round where none got confirmed, as not all of them fit into one block. Only such rounds count against the attempts limit. Each submitted mint is checked in its own `_minted` subtest. Tx file names now include the script index, so scripts with the same file stem (e.g. V1 and V2 `anyone-can-mint`) don't overwrite each other's pending transactions.
mkoura
requested
a balanced review from Copilot
and removed request for
saratomaz
October 6, 2026 11:59
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The batching and confirmation logic is consistent with existing test infrastructure and no blocking issues were found.
Review effort: Balanced
Findings: None
What changed in this PR
Optimizes PlutusV3 builtin tests to reduce Leios test-run duration.
Changes:
- Batches issuer funding and mint confirmation.
- Uses variant-specific cached addresses and unique transaction names.
- Schedules the longest test earlier.
| File | Description |
|---|---|
cardano_node_tests/tests/tests_plutus_v3/test_mint_build.py |
Adds batched funding, asynchronous mint confirmation, and early scheduling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test_plutusv3_builtins_new_costwas the longest test in the Leios testrun (220 min). It was also picked up only 86 min into the run, so it finished an hour after all other tests, with 19 of 20 workers idle. The builtins tests ran one script at a time, and each script waited for its own funding tx and its own mint tx.Schedule
new_costfirstMark
test_plutusv3_builtins_new_costwithorder(5), so it starts in the first wave of long tests instead of near the end.Fund the token issuer in batches
Confirm mints per chunk
_mintedsubtest.Results (Leios testrun, 20 workers, 9 cluster instances)
new_costpicked up / finishednew_costold[batch5]old[batch6]The run is now evenly packed: all workers are busy until the end, and there is no single-test tail.