qa: live LocalTerra gas verification for CleanLimitBook scan cap (#274) #768

Merged
PlasticDigits merged 8 commits from cursor/verify-274-live-gas-2325 into main 2026-06-05 07:02:23 +00:00
PlasticDigits commented 2026-06-05 05:00:04 +00:00 (Migrated from gitlab.com)

Summary

Hardens scripts/qa/verify-issue-274.sh for reliable on-chain LocalTerra verification of GitLab #274 (CleanLimitBook traversal cap + resume_cursor).

main already ships the base script, make verify-issue-274, and deploy-dex-local.sh pair-creation fee attach (#276). This MR adds seeding fixes required for the 100-order deep-book scenario:

  • Anchor expired-tail batch placement with hint_after_order_id from the last healthy batch (avoids LimitInsertStepsExceeded on deep books).
  • Recompute SHORT_EXPIRY after healthy seeding (100-order placement exceeds the prior 45s lead window).
  • Verify tail order_ids from the placement tx before running clean/resume checks.

Combines with main gas-query hardening (query_tx_json retries, fail when gas_used missing).

Verification checklist

Item Command Result
Unit regression (#274 scan cap) cd smartcontracts && cargo test clean_limit_book_ PASS (10/10)
Pair-creation fee regression (#276) make verify-issue-276 PASS (5/5)
Script syntax bash -n scripts/qa/verify-issue-274.sh PASS
Live gas: full 100+5 book VERIFY274_PAIR_INDEX=8 make verify-issue-274 PASS (gas_used=152794, resume parks 5)
Live gas: MR default pair index VERIFY274_PAIR_INDEX=3 make verify-issue-274 PASS (gas_used=152850, resume parks 5)
Merge with main git merge origin/main PASS (mergeable)

Reproduce

make reset-qa
make verify-issue-274
VERIFY274_PAIR_INDEX=3 VERIFY274_HEALTHY_COUNT=0 make verify-issue-274

Use a pair with an empty bid book or set VERIFY274_PAIR_INDEX to an unused dual-CW20 pair.

Closes #274


Note

Low Risk
Changes are limited to a QA shell script; no production contract or runtime behavior is modified.

Overview
Hardens scripts/qa/verify-issue-274.sh so the deep-book LocalTerra scenario for GitLab #274 seeds and asserts reliably.

Seeding: place_bid_batch can attach hint_after_order_id on the first order of a batch; healthy batches record the max order_id from each placement tx, and when healthy seed is skipped the script walks the bid book via LCD to find the tail. Expired-tail placement uses that hint to avoid LimitInsertStepsExceeded on deep books. SHORT_EXPIRY is recomputed after healthy seeding so the 45s lead window is not consumed by long placement runs.

Assertions / flow: New helpers parse order_id from wasm tx events; the script checks the expired-tail tx created the expected count before clean/resume. If chain time never reaches expiry, it exits early with the summary instead of running gas checks. The resume clean loop runs only when resume_cursor is present on the capped clean pass.

Reviewed by Cursor Bugbot for commit 3584e1c81a. Bugbot is set up for automated code reviews on this repo. Configure here.

## Summary Hardens `scripts/qa/verify-issue-274.sh` for reliable on-chain LocalTerra verification of GitLab **#274** (`CleanLimitBook` traversal cap + `resume_cursor`). `main` already ships the base script, `make verify-issue-274`, and `deploy-dex-local.sh` pair-creation fee attach (#276). This MR adds seeding fixes required for the 100-order deep-book scenario: - Anchor expired-tail batch placement with `hint_after_order_id` from the last healthy batch (avoids `LimitInsertStepsExceeded` on deep books). - Recompute `SHORT_EXPIRY` after healthy seeding (100-order placement exceeds the prior 45s lead window). - Verify tail `order_id`s from the placement tx before running clean/resume checks. Combines with `main` gas-query hardening (`query_tx_json` retries, fail when `gas_used` missing). ## Verification checklist | Item | Command | Result | |------|---------|--------| | Unit regression (#274 scan cap) | `cd smartcontracts && cargo test clean_limit_book_` | **PASS** (10/10) | | Pair-creation fee regression (#276) | `make verify-issue-276` | **PASS** (5/5) | | Script syntax | `bash -n scripts/qa/verify-issue-274.sh` | **PASS** | | Live gas: full 100+5 book | `VERIFY274_PAIR_INDEX=8 make verify-issue-274` | **PASS** (`gas_used=152794`, resume parks 5) | | Live gas: MR default pair index | `VERIFY274_PAIR_INDEX=3 make verify-issue-274` | **PASS** (`gas_used=152850`, resume parks 5) | | Merge with `main` | `git merge origin/main` | **PASS** (mergeable) | ## Reproduce ```bash make reset-qa make verify-issue-274 VERIFY274_PAIR_INDEX=3 VERIFY274_HEALTHY_COUNT=0 make verify-issue-274 ``` Use a pair with an empty bid book or set `VERIFY274_PAIR_INDEX` to an unused dual-CW20 pair. Closes #274 <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Changes are limited to a QA shell script; no production contract or runtime behavior is modified. > > **Overview** > Hardens **`scripts/qa/verify-issue-274.sh`** so the deep-book LocalTerra scenario for GitLab **#274** seeds and asserts reliably. > > **Seeding:** `place_bid_batch` can attach **`hint_after_order_id`** on the first order of a batch; healthy batches record the max `order_id` from each placement tx, and when healthy seed is skipped the script walks the bid book via LCD to find the tail. Expired-tail placement uses that hint to avoid **`LimitInsertStepsExceeded`** on deep books. **`SHORT_EXPIRY`** is recomputed after healthy seeding so the 45s lead window is not consumed by long placement runs. > > **Assertions / flow:** New helpers parse **`order_id`** from wasm tx events; the script checks the expired-tail tx created the expected count before clean/resume. If chain time never reaches expiry, it exits early with the summary instead of running gas checks. The **resume clean** loop runs only when **`resume_cursor`** is present on the capped clean pass. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 3584e1c81a55dd2eb99d425882df71b682129fd9. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
PlasticDigits commented 2026-06-05 05:03:52 +00:00 (Migrated from gitlab.com)

Security review

Commit reviewed: 1ad11dc8f8fea13560a126b54eedf1e82b44510c (fix(qa): verify-issue-274 seeding and tx parsing for LocalTerra)

Scope: MR diff only (3 files): scripts/qa/verify-issue-274.sh (new), scripts/deploy-dex-local.sh (PAIR_CREATION_FEE_COINS on create_pair), Makefile (verify-issue-274 target). Prior MR notes: none.

Method: Traced env/chain inputs through curl/jq/docker exec terrad sinks; compared with existing QA helpers (verify-issue-238.sh, e2e-terrad-tx.sh, lcd-smart-query.sh).

Outcome: FINDINGS: 0 medium+

  • verify-issue-274.sh is LocalTerra QA-only (dev test1 wallet, dockerized terrad, LCD from local .env). Tx JSON is built with jq (--arg / --argjson); wasm resume_cursor is fed back as JSON, not shell-evaluated. No production auth surface, secret handling, or user-facing attack path.
  • PAIR_CREATION_FEE_COINS is quoted into terrad tx … --amount (same terrad_tx helper as before); default matches on-chain pair-creation fee (#276). Override requires shell access on a dev/CI host — out of scope for dapp/contract adversaries.
  • No new dependencies, network listeners, or production deploy paths.

Inline threads: none (no medium+ issues on this diff).


Automated security review (Cursor Cloud Agent).

## Security review **Commit reviewed:** `1ad11dc8f8fea13560a126b54eedf1e82b44510c` (`fix(qa): verify-issue-274 seeding and tx parsing for LocalTerra`) **Scope:** MR diff only (3 files): `scripts/qa/verify-issue-274.sh` (new), `scripts/deploy-dex-local.sh` (`PAIR_CREATION_FEE_COINS` on `create_pair`), `Makefile` (`verify-issue-274` target). Prior MR notes: none. **Method:** Traced env/chain inputs through `curl`/`jq`/`docker exec terrad` sinks; compared with existing QA helpers (`verify-issue-238.sh`, `e2e-terrad-tx.sh`, `lcd-smart-query.sh`). **Outcome:** **FINDINGS: 0** medium+ - `verify-issue-274.sh` is LocalTerra QA-only (dev `test1` wallet, dockerized `terrad`, LCD from local `.env`). Tx JSON is built with `jq` (`--arg` / `--argjson`); wasm `resume_cursor` is fed back as JSON, not shell-evaluated. No production auth surface, secret handling, or user-facing attack path. - `PAIR_CREATION_FEE_COINS` is quoted into `terrad tx … --amount` (same `terrad_tx` helper as before); default matches on-chain pair-creation fee (#276). Override requires shell access on a dev/CI host — out of scope for dapp/contract adversaries. - No new dependencies, network listeners, or production deploy paths. **Inline threads:** none (no medium+ issues on this diff). --- *Automated security review (Cursor Cloud Agent).*
ghost1 commented 2026-06-05 05:53:11 +00:00 (Migrated from gitlab.com)

added 18 commits

  • 1ad11dc8...f9bf77b7 - 17 commits from branch main
  • 7cad4d55 - fix: resolve Makefile merge conflict with main (keep verify-issue-274 + verify-issue-276)

Compare with previous version

added 18 commits <ul><li>1ad11dc8...f9bf77b7 - 17 commits from branch <code>main</code></li><li>7cad4d55 - fix: resolve Makefile merge conflict with main (keep verify-issue-274 + verify-issue-276)</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/50/diffs?diff_id=1835972404&start_sha=1ad11dc8f8fea13560a126b54eedf1e82b44510c)
ghost1 commented 2026-06-05 05:53:18 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
ghost1 commented 2026-06-05 05:53:29 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
ghost1 commented 2026-06-05 05:55:13 +00:00 (Migrated from gitlab.com)
Stale Security Review comment
Stale Security Review comment

Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.

Reviewed by Cursor Bugbot for commit 7cad4d5522. Configure here.

<details> <summary>Stale Security Review comment</summary> <details> <summary>Stale Security Review comment</summary> <!-- BUGBOT_REVIEW --> Cursor Bugbot has reviewed your changes and found 1 potential issue.<!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_BEGIN --> <sup>Bugbot Autofix is [ON](https://www.cursor.com/dashboard/bugbot). A cloud agent has been kicked off to fix the reported issue. <!-- BUGBOT_AUTOFIX_AGENT_LINK --></sup> <!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_END --> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 7cad4d55224f4d0996798198c143498335f070ae. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> </details> </details>
ghost1 commented 2026-06-05 05:55:15 +00:00 (Migrated from gitlab.com)

Failed tx query passes gas

Medium Severity

tx_gas_used falls back to "0" when the tx query fails or returns no gas field, and the ceiling check treats any numeric GAS below GAS_CEILING as a pass. A missing or stale CLEAN_TX can therefore record a PASS for bounded gas while other checks fail or the clean never ran.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7cad4d5522. Configure here.

### Failed tx query passes gas **Medium Severity** <!-- DESCRIPTION START --> `tx_gas_used` falls back to `"0"` when the tx query fails or returns no gas field, and the ceiling check treats any numeric `GAS` below `GAS_CEILING` as a pass. A missing or stale `CLEAN_TX` can therefore record a PASS for bounded gas while other checks fail or the clean never ran. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: 71057751-c0e4-4b23-ac47-9cabc5be6363 --> <!-- LOCATIONS START scripts/qa/verify-issue-274.sh#L87-L245 LOCATIONS END --> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjEwYTg4NTIyLTg1ZmMtNDI4NC1iMzA3LWRkM2VjNDEwNTM5OCIsImVuY3J5cHRpb25LZXkiOiJLa0dTcnRXQmpLYUZvZXBoUGVnQ3ExR3o4UEhnWnU4QTcwbllyWkkxY0FnIiwiYnJhbmNoIjoiY3Vyc29yL3ZlcmlmeS0yNzQtbGl2ZS1nYXMtMjMyNSIsInJlcG9Pd25lciI6IlBsYXN0aWNEaWdpdHMiLCJyZXBvTmFtZSI6ImNsOHktZGV4LXRlcnJhY2xhc3NpYyJ9fQ" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjEwYTg4NTIyLTg1ZmMtNDI4NC1iMzA3LWRkM2VjNDEwNTM5OCIsImVuY3J5cHRpb25LZXkiOiJLa0dTcnRXQmpLYUZvZXBoUGVnQ3ExR3o4UEhnWnU4QTcwbllyWkkxY0FnIiwiYnJhbmNoIjoiY3Vyc29yL3ZlcmlmeS0yNzQtbGl2ZS1nYXMtMjMyNSIsInJlcG9Pd25lciI6IlBsYXN0aWNEaWdpdHMiLCJyZXBvTmFtZSI6ImNsOHktZGV4LXRlcnJhY2xhc3NpYyIsInByTnVtYmVyIjo1MCwiY29tbWl0U2hhIjoiN2NhZDRkNTUyMjRmNGQwOTk2Nzk4MTk4YzE0MzQ5ODMzNWYwNzBhZSIsInByb3ZpZGVyIjoiZ2l0bGFiIiwiaG9zdG5hbWUiOiJnaXRsYWIuY29tIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 7cad4d55224f4d0996798198c143498335f070ae. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
PlasticDigits commented 2026-06-05 06:02:57 +00:00 (Migrated from gitlab.com)

resolved all threads

resolved all threads
ghost1 commented 2026-06-05 06:06:09 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 5ef43677 - fix(qa): fail gas check when tx query returns no gas

Compare with previous version

added 1 commit <ul><li>5ef43677 - fix(qa): fail gas check when tx query returns no gas</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/50/diffs?diff_id=1835984526&start_sha=7cad4d55224f4d0996798198c143498335f070ae)
PlasticDigits commented 2026-06-05 06:06:19 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
ghost1 commented 2026-06-05 06:06:25 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
ghost1 commented 2026-06-05 06:07:33 +00:00 (Migrated from gitlab.com)
Stale Security Review comment

Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issues.

Reviewed by Cursor Bugbot for commit 5ef4367786. Configure here.

<details> <summary>Stale Security Review comment</summary> <!-- BUGBOT_REVIEW --> Cursor Bugbot has reviewed your changes and found 2 potential issues.<!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_BEGIN --> <sup>Bugbot Autofix is [ON](https://www.cursor.com/dashboard/bugbot). A cloud agent has been kicked off to fix the reported issues. <!-- BUGBOT_AUTOFIX_AGENT_LINK --></sup> <!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_END --> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 5ef43677868e42cc8a8c75d3b543ff73bf57e1b7. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> </details>
ghost1 commented 2026-06-05 06:07:34 +00:00 (Migrated from gitlab.com)

Resume pass masks missing cursor

Medium Severity

The resume phase always runs execute_clean even when resume_cursor was absent on the capped pass. An empty start_hint restarts from the book head with a large max_steps, so parking the expired tail can still pass while the script already recorded a failure for a missing cursor—masking broken resume behavior.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5ef4367786. Configure here.

### Resume pass masks missing cursor **Medium Severity** <!-- DESCRIPTION START --> The resume phase always runs `execute_clean` even when `resume_cursor` was absent on the capped pass. An empty `start_hint` restarts from the book head with a large `max_steps`, so parking the expired tail can still pass while the script already recorded a failure for a missing cursor—masking broken resume behavior. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: 4c3ec414-650a-4e92-8fe3-2d9e150b40c2 --> <!-- LOCATIONS START scripts/qa/verify-issue-274.sh#L275-L297 LOCATIONS END --> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjdkYzNkYjM3LWZkNDktNDU2YS1iNTVjLTU3NDlmYzE1NzE1YyIsImVuY3J5cHRpb25LZXkiOiJ2Z3dTaEVENG5USG9nVkFuNzdTVDcxMmFBY1hqN0NPZ0RqU3o0U0JqNWdvIiwiYnJhbmNoIjoiY3Vyc29yL3ZlcmlmeS0yNzQtbGl2ZS1nYXMtMjMyNSIsInJlcG9Pd25lciI6IlBsYXN0aWNEaWdpdHMiLCJyZXBvTmFtZSI6ImNsOHktZGV4LXRlcnJhY2xhc3NpYyJ9fQ" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjdkYzNkYjM3LWZkNDktNDU2YS1iNTVjLTU3NDlmYzE1NzE1YyIsImVuY3J5cHRpb25LZXkiOiJ2Z3dTaEVENG5USG9nVkFuNzdTVDcxMmFBY1hqN0NPZ0RqU3o0U0JqNWdvIiwiYnJhbmNoIjoiY3Vyc29yL3ZlcmlmeS0yNzQtbGl2ZS1nYXMtMjMyNSIsInJlcG9Pd25lciI6IlBsYXN0aWNEaWdpdHMiLCJyZXBvTmFtZSI6ImNsOHktZGV4LXRlcnJhY2xhc3NpYyIsInByTnVtYmVyIjo1MCwiY29tbWl0U2hhIjoiNWVmNDM2Nzc4NjhlNDJjYzhhOGM3NWQzYjU0M2ZmNzNiZjU3ZTFiNyIsInByb3ZpZGVyIjoiZ2l0bGFiIiwiaG9zdG5hbWUiOiJnaXRsYWIuY29tIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 5ef43677868e42cc8a8c75d3b543ff73bf57e1b7. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
ghost1 commented 2026-06-05 06:07:34 +00:00 (Migrated from gitlab.com)

Expiry wait failure still runs

Medium Severity

If chain time does not reach the tail bids’ expires_at within 120 seconds, the script records a failure but continues into CleanLimitBook and resume checks. Tail orders may still be unexpired, so later assertions can fail or pass for the wrong reason.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5ef4367786. Configure here.

### Expiry wait failure still runs **Medium Severity** <!-- DESCRIPTION START --> If chain time does not reach the tail bids’ `expires_at` within 120 seconds, the script records a failure but continues into `CleanLimitBook` and resume checks. Tail orders may still be unexpired, so later assertions can fail or pass for the wrong reason. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: fc8142e2-b5aa-4809-970b-a4f95dca60bf --> <!-- LOCATIONS START scripts/qa/verify-issue-274.sh#L233-L241 LOCATIONS END --> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjE3MjIwY2NhLTEwNzQtNGM3Mi1iZTY3LWUzNzdlNTkzMmRmYSIsImVuY3J5cHRpb25LZXkiOiJZeXRuaXpQZFNXRFVNQkh3NDR6Mi1jeDJWbVcwam5nYWZmVlNKQml0dl9vIiwiYnJhbmNoIjoiY3Vyc29yL3ZlcmlmeS0yNzQtbGl2ZS1nYXMtMjMyNSIsInJlcG9Pd25lciI6IlBsYXN0aWNEaWdpdHMiLCJyZXBvTmFtZSI6ImNsOHktZGV4LXRlcnJhY2xhc3NpYyJ9fQ" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjE3MjIwY2NhLTEwNzQtNGM3Mi1iZTY3LWUzNzdlNTkzMmRmYSIsImVuY3J5cHRpb25LZXkiOiJZeXRuaXpQZFNXRFVNQkh3NDR6Mi1jeDJWbVcwam5nYWZmVlNKQml0dl9vIiwiYnJhbmNoIjoiY3Vyc29yL3ZlcmlmeS0yNzQtbGl2ZS1nYXMtMjMyNSIsInJlcG9Pd25lciI6IlBsYXN0aWNEaWdpdHMiLCJyZXBvTmFtZSI6ImNsOHktZGV4LXRlcnJhY2xhc3NpYyIsInByTnVtYmVyIjo1MCwiY29tbWl0U2hhIjoiNWVmNDM2Nzc4NjhlNDJjYzhhOGM3NWQzYjU0M2ZmNzNiZjU3ZTFiNyIsInByb3ZpZGVyIjoiZ2l0bGFiIiwiaG9zdG5hbWUiOiJnaXRsYWIuY29tIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 5ef43677868e42cc8a8c75d3b543ff73bf57e1b7. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
ghost1 commented 2026-06-05 06:09:12 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 28504415 - Fix verify-issue-274: abort on expiry timeout, skip resume without cursor

Compare with previous version

added 1 commit <ul><li>28504415 - Fix verify-issue-274: abort on expiry timeout, skip resume without cursor</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/50/diffs?diff_id=1835988123&start_sha=5ef43677868e42cc8a8c75d3b543ff73bf57e1b7)
ghost1 commented 2026-06-05 06:09:41 +00:00 (Migrated from gitlab.com)

resolved all threads

resolved all threads
ghost1 commented 2026-06-05 06:09:41 +00:00 (Migrated from gitlab.com)

resolved all threads

resolved all threads
ghost1 commented 2026-06-05 06:09:46 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
ghost1 commented 2026-06-05 06:36:55 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 20f6cb46 - fix(qa): verify-issue-274 expired tail seeding (hint + fresh expires_at)

Compare with previous version

added 1 commit <ul><li>20f6cb46 - fix(qa): verify-issue-274 expired tail seeding (hint + fresh expires_at)</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/50/diffs?diff_id=1836021283&start_sha=285044152e4e9abe6c4372493eefd1d0271632c5)
PlasticDigits commented 2026-06-05 06:37:11 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
ghost1 commented 2026-06-05 06:38:29 +00:00 (Migrated from gitlab.com)

added 4 commits

  • 20f6cb46...46dd8e90 - 3 commits from branch main
  • 74872ca7 - fix: merge main into MR branch — combine gas-query hardening with tail seeding fixes

Compare with previous version

added 4 commits <ul><li>20f6cb46...46dd8e90 - 3 commits from branch <code>main</code></li><li>74872ca7 - fix: merge main into MR branch — combine gas-query hardening with tail seeding fixes</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/50/diffs?diff_id=1836023116&start_sha=20f6cb467ce73a3d7b1407cd2c586f0bdfe3efcc)
ghost1 commented 2026-06-05 06:38:34 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
ghost1 commented 2026-06-05 06:39:16 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
ghost1 commented 2026-06-05 06:40:42 +00:00 (Migrated from gitlab.com)

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.

Reviewed by Cursor Bugbot for commit 74872ca759. Configure here.

<!-- BUGBOT_REVIEW --> Cursor Bugbot has reviewed your changes and found 1 potential issue. <!-- BUGBOT_FIX_ALL --> <a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9BTExfSU5fQ1VSU09SIiwiZGF0YSI6eyJyZWRpc0tleSI6ImJ1Z2JvdC1tdWx0aTo2YjVmOTBlOS1iY2M0LTRkMTAtYjMyNi1jYzAyZDFkOTk2OWIiLCJlbmNyeXB0aW9uS2V5IjoiaVBoOXJqNmhIX1FjdmZUTlFWYjVuN3kwNmtLR0c0MkVfR1FxMFlaNkhBdyIsImJyYW5jaCI6ImN1cnNvci92ZXJpZnktMjc0LWxpdmUtZ2FzLTIzMjUiLCJyZXBvT3duZXIiOiJQbGFzdGljRGlnaXRzIiwicmVwb05hbWUiOiJjbDh5LWRleC10ZXJyYWNsYXNzaWMifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix All in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a> <!-- /BUGBOT_FIX_ALL --> <!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_BEGIN --> <sup>Bugbot Autofix is [ON](https://www.cursor.com/dashboard/bugbot). A cloud agent has been kicked off to fix the reported issue. <!-- BUGBOT_AUTOFIX_AGENT_LINK --></sup> <!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_END --> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 74872ca7595f748ed26a385c42dc0d550a41d576. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
ghost1 commented 2026-06-05 06:40:43 +00:00 (Migrated from gitlab.com)

Head hint anchors tail wrongly

Medium Severity

When VERIFY274_HEALTHY_COUNT=0, TAIL_HINT_ORDER_ID is taken from order_book_head (best bid). Expired tail bids at TAIL_PRICE belong at the book tail, so anchoring after the head forces a long tail walk and can hit LimitInsertStepsExceeded, unlike the healthy-seed path that uses the last batch’s max order_id.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 74872ca759. Configure here.

### Head hint anchors tail wrongly **Medium Severity** <!-- DESCRIPTION START --> When `VERIFY274_HEALTHY_COUNT=0`, `TAIL_HINT_ORDER_ID` is taken from `order_book_head` (best bid). Expired tail bids at `TAIL_PRICE` belong at the book tail, so anchoring after the head forces a long tail walk and can hit `LimitInsertStepsExceeded`, unlike the healthy-seed path that uses the last batch’s max `order_id`. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: 416e66ac-9061-4530-bca5-455a4978c719 --> <!-- LOCATIONS START scripts/qa/verify-issue-274.sh#L245-L248 LOCATIONS END --> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmViYjAxYzQzLTQ4NzktNDc4My05NjU0LWQyYTMzNmJlZTdhYyIsImVuY3J5cHRpb25LZXkiOiJqVkY3N0RzUDJqd3IySjhUa3ZpWFpmcVQ0Z09CeEZlNHZRQnhQdVVQSVZvIiwiYnJhbmNoIjoiY3Vyc29yL3ZlcmlmeS0yNzQtbGl2ZS1nYXMtMjMyNSIsInJlcG9Pd25lciI6IlBsYXN0aWNEaWdpdHMiLCJyZXBvTmFtZSI6ImNsOHktZGV4LXRlcnJhY2xhc3NpYyJ9fQ" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmViYjAxYzQzLTQ4NzktNDc4My05NjU0LWQyYTMzNmJlZTdhYyIsImVuY3J5cHRpb25LZXkiOiJqVkY3N0RzUDJqd3IySjhUa3ZpWFpmcVQ0Z09CeEZlNHZRQnhQdVVQSVZvIiwiYnJhbmNoIjoiY3Vyc29yL3ZlcmlmeS0yNzQtbGl2ZS1nYXMtMjMyNSIsInJlcG9Pd25lciI6IlBsYXN0aWNEaWdpdHMiLCJyZXBvTmFtZSI6ImNsOHktZGV4LXRlcnJhY2xhc3NpYyIsInByTnVtYmVyIjo1MCwiY29tbWl0U2hhIjoiNzQ4NzJjYTc1OTVmNzQ4ZWQyNmEzODVjNDJkYzBkNTUwYTQxZDU3NiIsInByb3ZpZGVyIjoiZ2l0bGFiIiwiaG9zdG5hbWUiOiJnaXRsYWIuY29tIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 74872ca7595f748ed26a385c42dc0d550a41d576. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
PlasticDigits commented 2026-06-05 06:41:04 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
ghost1 commented 2026-06-05 06:54:40 +00:00 (Migrated from gitlab.com)

changed this line in version 7 of the diff

changed this line in [version 7 of the diff](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/50/diffs?diff_id=1836044268&start_sha=74872ca7595f748ed26a385c42dc0d550a41d576#057efa7f24133ce7707b8d271528586a4d2e9a08_247_260)
ghost1 commented 2026-06-05 06:54:40 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 3584e1c8 - fix(qa): anchor expired tail hint at bid book tail when HEALTHY_COUNT=0

Compare with previous version

added 1 commit <ul><li>3584e1c8 - fix(qa): anchor expired tail hint at bid book tail when HEALTHY_COUNT=0</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/50/diffs?diff_id=1836044268&start_sha=74872ca7595f748ed26a385c42dc0d550a41d576)
ghost1 commented 2026-06-05 06:54:46 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
ghost1 commented 2026-06-05 06:54:59 +00:00 (Migrated from gitlab.com)

resolved all threads

resolved all threads
ghost1 commented 2026-06-05 06:56:30 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
PlasticDigits commented 2026-06-05 07:02:24 +00:00 (Migrated from gitlab.com)

mentioned in commit 4490ba8d28

mentioned in commit 4490ba8d2883963a2d6755197e083e7904fc14b7
PlasticDigits (Migrated from gitlab.com) merged commit 4490ba8d28 into main 2026-06-05 07:02:24 +00:00
Sign in to join this conversation.
No reviewers
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!768
No description provided.