fix(router): fit funded reverse quotes within 3M LCD query budgets #1422

Closed
opened 2026-10-06 02:39:06 +00:00 by PlasticDigits · 1 comment
Owner

Observed during the integrated merge sanity run for #1407/#1410 (issues #1389/#1390).

With the repository's pinned SDK53 LocalTerra image and its default [wasm] query_gas_limit = 3000000, scripts/qa/localterra-route-tax-1381.py rejected the first funded reverse quote: gasWanted: 3000000, gasUsed: 3043317. The forward quote had succeeded. Pair 1.20.0/router 1.3.0 were freshly compiled with the pinned optimizer; the source operation bound does not by itself establish compatibility with a provider's gas limit.

Raising only the isolated test node to a finite 15,000,000 query limit allowed all six funded route/rollback scenarios to pass. This is a test configuration result; production provider query limits and acceptance remain unknown. No production RPC configuration, signing or broadcast was changed.

Required source/release work:

  • Preserve a reproducible regression at a 3M node limit for the fixture's ordinary→ALPHA→BETA→USTR funded reverse path.
  • Reduce redundant reverse/tax work or implement an explicit compatible quote path so supported funded quotes fit the configured provider budget while retaining gross funding, fresh forward sufficiency, original trader guards, work bounds and signing protections.
  • Keep provider-limit failures observable and deterministic; reconcile exact-output client behavior and the #1386/#1384 rollout plans with the supported query envelope. Record actual gas receipts and tested limits; a larger isolated node limit is not proof that current production providers support the route.

The implementation issues for the merged security controls may close; this remains a concrete quote-availability repair, not an issue held only for verification. Related deployment coordination: #1421.

Observed during the integrated merge sanity run for #1407/#1410 (issues #1389/#1390). With the repository's pinned SDK53 LocalTerra image and its default `[wasm] query_gas_limit = 3000000`, `scripts/qa/localterra-route-tax-1381.py` rejected the first funded reverse quote: `gasWanted: 3000000, gasUsed: 3043317`. The forward quote had succeeded. Pair 1.20.0/router 1.3.0 were freshly compiled with the pinned optimizer; the source operation bound does not by itself establish compatibility with a provider's gas limit. Raising only the isolated test node to a finite 15,000,000 query limit allowed all six funded route/rollback scenarios to pass. This is a test configuration result; production provider query limits and acceptance remain unknown. No production RPC configuration, signing or broadcast was changed. Required source/release work: - Preserve a reproducible regression at a 3M node limit for the fixture's ordinary→ALPHA→BETA→USTR funded reverse path. - Reduce redundant reverse/tax work or implement an explicit compatible quote path so supported funded quotes fit the configured provider budget while retaining gross funding, fresh forward sufficiency, original trader guards, work bounds and signing protections. - Keep provider-limit failures observable and deterministic; reconcile exact-output client behavior and the #1386/#1384 rollout plans with the supported query envelope. Record actual gas receipts and tested limits; a larger isolated node limit is not proof that current production providers support the route. The implementation issues for the merged security controls may close; this remains a concrete quote-availability repair, not an issue held only for verification. Related deployment coordination: #1421.
Author
Owner

Merged PR #1427 and the final sanity receipt. Preserved query-local immutable discovery reuse and fresh amount/trader-specific tax previews/sufficiency while retaining #1398 net floors. Integrated targets are router 1.4.0 / pair 1.21.0 / factory 1.12.0. Fixed Makefile/version conflicts, scoped evidence migration instructions, contaminated dotenv fixtures and the PostgreSQL readiness race; rebuilt and attested final artifacts.

Both fresh fixtures pass all six accounting scenarios and all 18 actual smart queries at unchanged 3,000,000 gas. Frozen old-artifact reverse failure reproduced twice. Multiple-tax reverse probe is 2,139,981 gas including wrapper/transaction overhead. Source/client/API verifier groups pass twice; funding verifier is 13 PASS/0 FAIL/2 explicit skips and launch guards 15 PASS/0 FAIL/1 production skip.

Historical populated four-hop greedy FAIL is preserved and separated into implementation/support issue #1428; production provider/deployment acceptance remains #1384/#1386/#1421. Receipt hooks initially flagged public artifact/transaction hashes; explicit hash entries and canonical lowercase tx IDs resolved those false positives without changing scanner rules. Ordinary hooks pass. Public Venus scanner-policy false positives and broader legacy formatting drift remain documented release maintenance in #1421.

All four source PRs #1424–#1427 are merged; final receipt published through #1430. Local main is reconciled with both remotes, with no stashes. Hosted CI was skipped by explicit operator instruction; no fake PASS status was posted. Original merge protection is restored. Integrated evidence. Source closure does not claim production deployment.

Merged PR #1427 and the final sanity receipt. Preserved query-local immutable discovery reuse and fresh amount/trader-specific tax previews/sufficiency while retaining #1398 net floors. Integrated targets are router 1.4.0 / pair 1.21.0 / factory 1.12.0. Fixed Makefile/version conflicts, scoped evidence migration instructions, contaminated dotenv fixtures and the PostgreSQL readiness race; rebuilt and attested final artifacts. Both fresh fixtures pass all six accounting scenarios and all 18 actual smart queries at unchanged 3,000,000 gas. Frozen old-artifact reverse failure reproduced twice. Multiple-tax reverse probe is 2,139,981 gas including wrapper/transaction overhead. Source/client/API verifier groups pass twice; funding verifier is 13 PASS/0 FAIL/2 explicit skips and launch guards 15 PASS/0 FAIL/1 production skip. Historical populated four-hop greedy FAIL is preserved and separated into implementation/support issue #1428; production provider/deployment acceptance remains #1384/#1386/#1421. Receipt hooks initially flagged public artifact/transaction hashes; explicit hash entries and canonical lowercase tx IDs resolved those false positives without changing scanner rules. Ordinary hooks pass. Public Venus scanner-policy false positives and broader legacy formatting drift remain documented release maintenance in #1421. All four source PRs #1424–#1427 are merged; final receipt published through #1430. Local main is reconciled with both remotes, with no stashes. Hosted CI was skipped by explicit operator instruction; no fake PASS status was posted. Original merge protection is restored. [Integrated evidence](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/branch/main/docs/qa/merge-2026-10-06-final/README.md). Source closure does not claim production deployment.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
code/cl8y-dex-terraclassic#1422
No description provided.