fix(qa): verify-issue-285 hybrid swap needs slippage floor for #334 guard #835

Merged
Brouie merged 1 commit from qa/337-verify285-slippage-floor into main 2026-06-08 05:29:54 +00:00
Brouie commented 2026-06-08 00:20:34 +00:00 (Migrated from gitlab.com)

The live layer broadcast a pure-book hybrid swap (pool_input:0,
belief_price:null, no min_return), which the #334 guard
BookHybridRequiresSlippageFloor correctly rejects — so the book leg never
filled and the #285 attribution assertion never ran (the script reported
6 passed / 3 failed on the live layer only).

Changes

Add min_return:"1" to the live-layer hybrid swap hook so the book leg fills
(mirrors contract-test Uint128::one() pattern).

Rebase / conflict resolution

Rebased onto latest main (06eb2d8). Dropped accidental doc deletions that were present on the stale branch tip (unrelated #337 cross-links).

Verification checklist

Item Command Result
Shell syntax bash -n scripts/qa/verify-issue-285.sh PASS
min_return present in hook grep min_return scripts/qa/verify-issue-285.sh PASS (both jq branches)
Merge with main git merge main on branch tip PASS (clean)
Full live verification make verify-issue-285 SKIP (LocalTerra not provisioned in agent VM; prior author run: 12 passed / 0 failed)

This is what made the Cloud Agent's REG-00-08 #285 run fail. Relates to #285, #334, #337.

The live layer broadcast a pure-book hybrid swap (`pool_input:0`, `belief_price:null`, no `min_return`), which the #334 guard `BookHybridRequiresSlippageFloor` correctly rejects — so the book leg never filled and the #285 attribution assertion never ran (the script reported 6 passed / 3 failed on the live layer only). ## Changes Add `min_return:"1"` to the live-layer hybrid swap hook so the book leg fills (mirrors contract-test `Uint128::one()` pattern). ## Rebase / conflict resolution Rebased onto latest `main` (06eb2d8). Dropped accidental doc deletions that were present on the stale branch tip (unrelated #337 cross-links). ## Verification checklist | Item | Command | Result | |------|---------|--------| | Shell syntax | `bash -n scripts/qa/verify-issue-285.sh` | **PASS** | | `min_return` present in hook | `grep min_return scripts/qa/verify-issue-285.sh` | **PASS** (both jq branches) | | Merge with `main` | `git merge main` on branch tip | **PASS** (clean) | | Full live verification | `make verify-issue-285` | **SKIP** (LocalTerra not provisioned in agent VM; prior author run: 12 passed / 0 failed) | This is what made the Cloud Agent's **REG-00-08** #285 run fail. Relates to #285, #334, #337.
PlasticDigits commented 2026-06-08 00:21:32 +00:00 (Migrated from gitlab.com)

Security review

Commit reviewed: f695c6da30450a9574a51aae6e611987c3eaa8bd
Scope: scripts/qa/verify-issue-285.sh — adds min_return:"1" to the live-layer hybrid swap hook so the #334 BookHybridRequiresSlippageFloor guard allows the book leg to fill during QA verification.

Outcome: FINDINGS: 0 medium+

Summary

This MR touches only a LocalTerra QA verification script. It does not modify smart contracts, the indexer API, frontend code, CI secrets handling, or deployment configuration.

The added min_return:"1" is a hardcoded slippage floor for a controlled local test swap (default book_input = 1_000_000). It mirrors existing contract-test patterns (Uint128::one()) and satisfies the on-chain guard without weakening production controls — the guard itself is unchanged.

Reviewed attack classes on the diff:

  • Injection / deserialization: jq --arg / --argjson usage unchanged; no new attacker-controlled interpolation.
  • Authn/authz bypass: N/A — script runs locally against LocalTerra with dev wallet provisioning.
  • Secret leakage / insecure logging: No new secrets or sensitive output.
  • SSRF / request forgery: Pre-existing localhost LCD/indexer calls only; unchanged.
  • Supply chain: No dependency changes.

No inline threads — nothing to flag on specific diff lines.

## Security review **Commit reviewed:** `f695c6da30450a9574a51aae6e611987c3eaa8bd` **Scope:** `scripts/qa/verify-issue-285.sh` — adds `min_return:"1"` to the live-layer hybrid swap hook so the #334 `BookHybridRequiresSlippageFloor` guard allows the book leg to fill during QA verification. **Outcome:** `FINDINGS: 0` medium+ ### Summary This MR touches only a LocalTerra QA verification script. It does not modify smart contracts, the indexer API, frontend code, CI secrets handling, or deployment configuration. The added `min_return:"1"` is a hardcoded slippage floor for a controlled local test swap (default `book_input` = 1_000_000). It mirrors existing contract-test patterns (`Uint128::one()`) and satisfies the on-chain guard without weakening production controls — the guard itself is unchanged. Reviewed attack classes on the diff: - **Injection / deserialization:** `jq --arg` / `--argjson` usage unchanged; no new attacker-controlled interpolation. - **Authn/authz bypass:** N/A — script runs locally against LocalTerra with dev wallet provisioning. - **Secret leakage / insecure logging:** No new secrets or sensitive output. - **SSRF / request forgery:** Pre-existing localhost LCD/indexer calls only; unchanged. - **Supply chain:** No dependency changes. No inline threads — nothing to flag on specific diff lines.
Brouie commented 2026-06-08 00:32:39 +00:00 (Migrated from gitlab.com)

mentioned in issue #337

mentioned in issue #337
PlasticDigits commented 2026-06-08 05:26:20 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
PlasticDigits commented 2026-06-08 05:27:51 +00:00 (Migrated from gitlab.com)

added 4 commits

  • f695c6da...9d3bf713 - 3 commits from branch PlasticDigits:main
  • 06eb2d8b - fix(qa): verify-issue-285 live hybrid swap needs a slippage floor for the #334 guard

Compare with previous version

added 4 commits <ul><li>f695c6da...9d3bf713 - 3 commits from branch <code>PlasticDigits:main</code></li><li>06eb2d8b - fix(qa): verify-issue-285 live hybrid swap needs a slippage floor for the #334 guard</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/117/diffs?diff_id=1838908379&start_sha=f695c6da30450a9574a51aae6e611987c3eaa8bd)
PlasticDigits (Migrated from gitlab.com) merged commit 737f47e0cc into main 2026-06-08 05:29:54 +00:00
PlasticDigits commented 2026-06-08 05:29:55 +00:00 (Migrated from gitlab.com)

mentioned in commit 737f47e0cc

mentioned in commit 737f47e0cc5db17172fa33ee94297c654f6694bf
PlasticDigits commented 2026-06-08 05:31:24 +00:00 (Migrated from gitlab.com)

Security review

Commit reviewed: 06eb2d8bb5bd7a30fa9d33e87c5d319082f06e1f
Scope: scripts/qa/verify-issue-285.sh — adds hardcoded min_return:"1" to the live-layer hybrid swap hook so the #334 BookHybridRequiresSlippageFloor guard allows the book leg to fill during LocalTerra QA verification.

Outcome: FINDINGS: 0 medium+

Summary

This MR modifies only a LocalTerra QA verification script. It does not change smart contracts, the indexer API, frontend code, CI secrets handling, or deployment configuration.

The added min_return:"1" is a fixed slippage floor for a controlled local test swap (default book_input = 1_000_000). It mirrors existing contract-test patterns (Uint128::one() in limit_order_tests.rs) and satisfies the on-chain guard without weakening production controls — the BookHybridRequiresSlippageFloor check in dex-common / pair execute is unchanged.

Reviewed attack classes on the diff:

  • Injection / deserialization: jq --arg / --argjson usage unchanged; min_return is a literal, not interpolated from untrusted input.
  • Authn/authz bypass: N/A — script runs locally against LocalTerra with dev wallet provisioning.
  • Secret leakage / insecure logging: No new secrets or sensitive output.
  • SSRF / request forgery: Pre-existing localhost LCD/indexer calls only; unchanged.
  • Supply chain: No dependency changes.

No inline threads — nothing to flag on specific diff lines.

## Security review **Commit reviewed:** `06eb2d8bb5bd7a30fa9d33e87c5d319082f06e1f` **Scope:** `scripts/qa/verify-issue-285.sh` — adds hardcoded `min_return:"1"` to the live-layer hybrid swap hook so the #334 `BookHybridRequiresSlippageFloor` guard allows the book leg to fill during LocalTerra QA verification. **Outcome:** `FINDINGS: 0` medium+ ### Summary This MR modifies only a LocalTerra QA verification script. It does not change smart contracts, the indexer API, frontend code, CI secrets handling, or deployment configuration. The added `min_return:"1"` is a fixed slippage floor for a controlled local test swap (default `book_input` = 1_000_000). It mirrors existing contract-test patterns (`Uint128::one()` in `limit_order_tests.rs`) and satisfies the on-chain guard without weakening production controls — the `BookHybridRequiresSlippageFloor` check in `dex-common` / pair execute is unchanged. Reviewed attack classes on the diff: - **Injection / deserialization:** `jq --arg` / `--argjson` usage unchanged; `min_return` is a literal, not interpolated from untrusted input. - **Authn/authz bypass:** N/A — script runs locally against LocalTerra with dev wallet provisioning. - **Secret leakage / insecure logging:** No new secrets or sensitive output. - **SSRF / request forgery:** Pre-existing localhost LCD/indexer calls only; unchanged. - **Supply chain:** No dependency changes. No inline threads — nothing to flag on specific diff lines.
PlasticDigits commented 2026-06-08 08:43:13 +00:00 (Migrated from gitlab.com)

mentioned in commit ff12f65dbf

mentioned in commit ff12f65dbf64bdfcbd8540bab6e3e48427a41f5e
PlasticDigits commented 2026-06-08 13:42:29 +00:00 (Migrated from gitlab.com)

mentioned in commit e6e71f29e7

mentioned in commit e6e71f29e7db6a520ee4da25b84f9c1bbcc736d1
Brouie commented 2026-06-09 02:14:35 +00:00 (Migrated from gitlab.com)

mentioned in merge request !842

mentioned in merge request !842
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!835
No description provided.