fix: NTT over-limit mint locks down the asset instead of reverting - #1514
Merged
Conversation
|
Crate versions that have been updated:
Runtime version has been increased. |
enthusiastmartin
approved these changes
Aug 13, 2026
mrq1911
force-pushed
the
fix/ntt-mint-over-limit-lockdown
branch
from
August 13, 2026 12:43
4c96f7b to
3c983a6
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes NTT over-limit mint behavior in the EVM currencies precompile so that exceeding the per-period mint budget triggers the circuit breaker’s reserve-and-lockdown mechanism (matching the XCM deposit path) instead of reverting and leaving funds stranded on the source chain.
Changes:
- Removed the redundant
IssuanceIncreaseFuse::can_mintpre-check from the NTTmintprecompile entrypoint so the actualPostDeposithook can reserve excess and lock down the asset. - Updated NTT precompile integration tests to assert successful mint + correct reserved/free balances and lockdown state, rather than expecting a
MintLimitReached()revert. - Reframed the burn test to validate the fuse’s net-issuance accounting within a period.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| runtime/hydradx/src/evm/precompiles/multicurrency.rs | Drops the pre-check that caused over-limit mints to revert before the circuit breaker could reserve/lock down. |
| integration-tests/src/evm.rs | Updates currency_precompile_ntt tests to cover reserve + lockdown semantics and net-budget behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Quick benchmark at commit 37d539a has been executed successfully. |
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.
Fixes #1511.
An over-limit NTT
minton the currencies precompile now takes the same reserve-and-lockdown path as an over-limit XCM deposit, instead of revertingMintLimitReached()and stranding source-chain funds until the window rolls.Root cause → the precompile did a read-only
IssuanceIncreaseFuse::can_mintpre-check and reverted over the limit. But the deposit it performs already routes throughorml_tokens, whosePostDeposithook is the circuit breaker (CurrencyHooks::PostDeposit = IssuanceIncreaseFuse,runtime/hydradx/src/assets.rs:130;orml_tokensfires it indo_deposit). So the pre-check was a redundant guard that short-circuited before the breaker's own reserve-and-lockdown could engage.Fix → drop the
can_mintpre-check (+ its now-dead import) frommint. Thedepositthen behaves exactly like the XCM path:LockdownStatus::Locked(until)andAssetLockdownis emitted;LockdownActive);The VAA is consumed (no replay), the recipient's excess is reserved rather than stuck on the source chain, and the safety mechanism the limit exists for actually engages.
Tests (
integration-tests/src/evm.rs,currency_precompile_ntt) — updated the three that asserted the old revert:mint_over_the_limit_should_reserve_excess_and_lock_down_the_asset— 600 clean, then 500 over the 1,000 budget → 1,100 minted, 100 reserved, assetLocked.mint_into_a_locked_down_asset_reserves_the_full_amount— mint into a locked asset succeeds but fully reserves.burn_should_refill_mint_budget_within_period— reframed to net accounting (600 mint, burn 400, 700 stays within 1,000, no lockdown).cargo test -p runtime-integration-tests currency_precompile_ntt→ 14 passed / 0 failed;cargo fmt --checkclean.Runtime
spec_versionbumped 438 → 439 (andhydradx-runtimecrate to 439.0.0).