fix(swarm): LP workers + bootstrap for swap quote QA (#293) #783

Merged
PlasticDigits merged 8 commits from cursor/gitlab-issue-workflow-0c8f into main 2026-06-05 11:03:49 +00:00
PlasticDigits commented 2026-06-05 09:53:58 +00:00 (Migrated from gitlab.com)

Summary

Addresses https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/work_items/293 — swap-only bot volume drained LocalTerra test pools, so the indexer route solver picked lopsided multi-hop paths in one direction and direct pools in the other. Quotes looked wildly non-inverse even though UI decimal math is correct (per Brouie's analysis).

Changes:

  • Python QA swarm (scripts/bots/): provide_liquidity workers (--worker lp N), one-shot bootstrap-swarm-liquidity before launch-swarm.sh, reserve-floor skip on swap bots, shared sizing in swarm_liquidity.py.
  • TypeScript swarm (packages/localnet-trading-swarm): raised add_liquidity / lowered remove_liquidity profile weights.
  • Docs/Makefile: make test-swarm-liquidity, make swarm-bootstrap-liquidity; cross-links in docs/testing.md, AGENTS_LOCALNET_TRADING_SWARM.md, swarm README.

Merge with main (2026-06-05): Resolved Makefile .PHONY conflict — union of MR targets (test-swarm-liquidity, swarm-bootstrap-liquidity) with main (verify-issue-309/313/295, setup-cloud-localterra). MR is mergeable (no remaining conflicts).

Acceptance checklist

Criterion Command Result
Python swarm provides liquidity (not swap-only) launch-swarm.sh starts 3 lp workers PASS (code review)
Bootstrap tops thin / hub pairs before workers bootstrap-swarm-liquidity.py wired in launch PASS (code review)
TS swarm biases add over remove liquidity cd packages/localnet-trading-swarm && npm ci && npm run test:run PASS (14 tests)
Unit tests for liquidity sizing helpers make test-swarm-liquidity PASS (5 tests)
OE-1 pairs near-inverse after swarm Swap page 1-unit quotes both directions ~2% SKIP (no LocalTerra in agent VM)

Verification for third parties

make test-swarm-liquidity
cd packages/localnet-trading-swarm && npm ci && npm run test:run
make start && make wait-healthy && make deploy-local
make swarm-bootstrap-liquidity && make swarm-launch
# Swap: EMBER↔CORAL, TOPAZ↔ONYX, ONYX↔CORAL — 1-unit quotes both ways
make swarm-stop

Issue #293 stays open until on-chain OE-1 verification on a QA host.

## Summary Addresses https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/work_items/293 — swap-only bot volume drained LocalTerra test pools, so the indexer route solver picked lopsided multi-hop paths in one direction and direct pools in the other. Quotes looked wildly non-inverse even though UI decimal math is correct (per Brouie's analysis). **Changes:** - **Python QA swarm** (`scripts/bots/`): `provide_liquidity` workers (`--worker lp N`), one-shot `bootstrap-swarm-liquidity` before `launch-swarm.sh`, reserve-floor skip on swap bots, shared sizing in `swarm_liquidity.py`. - **TypeScript swarm** (`packages/localnet-trading-swarm`): raised `add_liquidity` / lowered `remove_liquidity` profile weights. - **Docs/Makefile**: `make test-swarm-liquidity`, `make swarm-bootstrap-liquidity`; cross-links in `docs/testing.md`, `AGENTS_LOCALNET_TRADING_SWARM.md`, swarm README. **Merge with `main` (2026-06-05):** Resolved `Makefile` `.PHONY` conflict — union of MR targets (`test-swarm-liquidity`, `swarm-bootstrap-liquidity`) with `main` (`verify-issue-309/313/295`, `setup-cloud-localterra`). MR is **mergeable** (no remaining conflicts). ## Acceptance checklist | Criterion | Command | Result | |-----------|---------|--------| | Python swarm provides liquidity (not swap-only) | `launch-swarm.sh` starts 3 `lp` workers | PASS (code review) | | Bootstrap tops thin / hub pairs before workers | `bootstrap-swarm-liquidity.py` wired in launch | PASS (code review) | | TS swarm biases add over remove liquidity | `cd packages/localnet-trading-swarm && npm ci && npm run test:run` | **PASS** (14 tests) | | Unit tests for liquidity sizing helpers | `make test-swarm-liquidity` | **PASS** (5 tests) | | OE-1 pairs near-inverse after swarm | Swap page 1-unit quotes both directions ~2% | **SKIP** (no LocalTerra in agent VM) | ## Verification for third parties ```bash make test-swarm-liquidity cd packages/localnet-trading-swarm && npm ci && npm run test:run make start && make wait-healthy && make deploy-local make swarm-bootstrap-liquidity && make swarm-launch # Swap: EMBER↔CORAL, TOPAZ↔ONYX, ONYX↔CORAL — 1-unit quotes both ways make swarm-stop ``` Issue **#293 stays open** until on-chain OE-1 verification on a QA host.
ghost1 commented 2026-06-05 09:54:04 +00:00 (Migrated from gitlab.com)

changed the description

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

changed the description

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

mentioned in issue #293

mentioned in issue #293
ghost1 commented 2026-06-05 09:54:13 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
ghost1 commented 2026-06-05 09:55:20 +00:00 (Migrated from gitlab.com)
Stale Security Review comment
Stale Security Review comment
Stale Security Review comment
Stale Security Review comment
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 fc62c1fc1d. Configure here.

<details> <summary>Stale Security Review comment</summary> <details> <summary>Stale Security Review comment</summary> <details> <summary>Stale Security Review comment</summary> <details> <summary>Stale Security Review comment</summary> <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 fc62c1fc1d8ed0e674dc0416c0a38864c6b4911a. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> </details> </details> </details> </details> </details>
ghost1 commented 2026-06-05 09:55:21 +00:00 (Migrated from gitlab.com)

LP workers ignore reserve env override

Medium Severity

Swap workers honor BOTS_MIN_RESERVE_PER_SIDE via _min_reserve_per_side(), but LP workers call pick_scaled_provide_amounts, which always requires the hardcoded MIN_RESERVE_PER_SIDE_FOR_SWAP (10M). Lowering the env lets swaps run on pools LP workers will never replenish, so depth can erode without the intended LP backstop.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fc62c1fc1d. Configure here.

### LP workers ignore reserve env override **Medium Severity** <!-- DESCRIPTION START --> Swap workers honor `BOTS_MIN_RESERVE_PER_SIDE` via `_min_reserve_per_side()`, but LP workers call `pick_scaled_provide_amounts`, which always requires the hardcoded `MIN_RESERVE_PER_SIDE_FOR_SWAP` (10M). Lowering the env lets swaps run on pools LP workers will never replenish, so depth can erode without the intended LP backstop. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: 1bcbd399-bad3-4bfb-9768-46e92a57f83c --> <!-- LOCATIONS START scripts/bots/swarm.py#L500-L503 scripts/bots/swarm_liquidity.py#L17-L23 LOCATIONS END --> <details> <summary>Additional Locations (1)</summary> - [`scripts/bots/swarm_liquidity.py#L17-L23`](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-//blob/fc62c1fc1d8ed0e674dc0416c0a38864c6b4911a/scripts/bots/swarm_liquidity.py#L17-L23) </details> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjAzODkyZjdlLWI4ODctNGNjOS04MWU2LWM3ZWZhYjlhN2YxNCIsImVuY3J5cHRpb25LZXkiOiJMTWNYYjRqY3MtSHJ6ZzFJV2taVVFuTnctM2tvR2ZFQ3RVcHZnakZTYW9ZIiwiYnJhbmNoIjoiY3Vyc29yL2dpdGxhYi1pc3N1ZS13b3JrZmxvdy0wYzhmIiwicmVwb093bmVyIjoiUGxhc3RpY0RpZ2l0cyIsInJlcG9OYW1lIjoiY2w4eS1kZXgtdGVycmFjbGFzc2ljIn19" 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=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjAzODkyZjdlLWI4ODctNGNjOS04MWU2LWM3ZWZhYjlhN2YxNCIsImVuY3J5cHRpb25LZXkiOiJMTWNYYjRqY3MtSHJ6ZzFJV2taVVFuTnctM2tvR2ZFQ3RVcHZnakZTYW9ZIiwiYnJhbmNoIjoiY3Vyc29yL2dpdGxhYi1pc3N1ZS13b3JrZmxvdy0wYzhmIiwicmVwb093bmVyIjoiUGxhc3RpY0RpZ2l0cyIsInJlcG9OYW1lIjoiY2w4eS1kZXgtdGVycmFjbGFzc2ljIiwicHJOdW1iZXIiOjY1LCJjb21taXRTaGEiOiJmYzYyYzFmYzFkOGVkMGU2NzRkYzA0MTZjMGEzODg2NGM2YjQ5MTFhIiwicHJvdmlkZXIiOiJnaXRsYWIiLCJob3N0bmFtZSI6ImdpdGxhYi5jb20ifX0" 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 fc62c1fc1d8ed0e674dc0416c0a38864c6b4911a. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
ghost1 commented 2026-06-05 09:55:21 +00:00 (Migrated from gitlab.com)

Stale reserves bypass thin-pool guard

Medium Severity

Swap workers refresh pool reserves before applying BOTS_MIN_RESERVE_PER_SIDE, but when _load_pair_meta fails they keep the startup snapshot and still swap. The new floor check can pass on outdated deep reserves while the pool is already drained, defeating the guard this change adds.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fc62c1fc1d. Configure here.

### Stale reserves bypass thin-pool guard **Medium Severity** <!-- DESCRIPTION START --> Swap workers refresh pool reserves before applying `BOTS_MIN_RESERVE_PER_SIDE`, but when `_load_pair_meta` fails they keep the startup snapshot and still swap. The new floor check can pass on outdated deep reserves while the pool is already drained, defeating the guard this change adds. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: 795eaf29-c536-4412-83d8-723408bbde65 --> <!-- LOCATIONS START scripts/bots/swarm.py#L554-L560 LOCATIONS END --> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmQxMWNjYzYwLTE2YWItNGE2MS1hYzgxLWUzY2VlMDg1ZjliYSIsImVuY3J5cHRpb25LZXkiOiJidmx2bzRWSC1kbVN3dV9HQmRSU3d1ZTlpdXJ4NUVSbnNTdW1uU0VYOGQwIiwiYnJhbmNoIjoiY3Vyc29yL2dpdGxhYi1pc3N1ZS13b3JrZmxvdy0wYzhmIiwicmVwb093bmVyIjoiUGxhc3RpY0RpZ2l0cyIsInJlcG9OYW1lIjoiY2w4eS1kZXgtdGVycmFjbGFzc2ljIn19" 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=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmQxMWNjYzYwLTE2YWItNGE2MS1hYzgxLWUzY2VlMDg1ZjliYSIsImVuY3J5cHRpb25LZXkiOiJidmx2bzRWSC1kbVN3dV9HQmRSU3d1ZTlpdXJ4NUVSbnNTdW1uU0VYOGQwIiwiYnJhbmNoIjoiY3Vyc29yL2dpdGxhYi1pc3N1ZS13b3JrZmxvdy0wYzhmIiwicmVwb093bmVyIjoiUGxhc3RpY0RpZ2l0cyIsInJlcG9OYW1lIjoiY2w4eS1kZXgtdGVycmFjbGFzc2ljIiwicHJOdW1iZXIiOjY1LCJjb21taXRTaGEiOiJmYzYyYzFmYzFkOGVkMGU2NzRkYzA0MTZjMGEzODg2NGM2YjQ5MTFhIiwicHJvdmlkZXIiOiJnaXRsYWIiLCJob3N0bmFtZSI6ImdpdGxhYi5jb20ifX0" 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 fc62c1fc1d8ed0e674dc0416c0a38864c6b4911a. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
PlasticDigits commented 2026-06-05 09:55:26 +00:00 (Migrated from gitlab.com)

Security review (automated)

Commit reviewed: fc62c1fc1d8ed0e674dc0416c0a38864c6b4911a
Scope: Full MR diff vs main (531d00e → fc62c1fc): LocalTerra QA swarm LP/bootstrap (#293), indexer rate-limit hardening (#282) + CG/CMC LCD-heavy governor test (#278), limit-fill swap_index linkage (#316), factory pair-creation fee/refund path (#276/#318), bounded SetLpAdminAll/SetLpAdminBatch (#277), limit clamp(1,MAX) regression tests (#317), frontend broadcast-phase UX (#305), Cloud Agent Keplr/Chrome setup scripts, and related docs/tests.

Outcome: FINDINGS: 0 medium+

Inline threads: None (no exploitable issues on added/modified paths).

Summary

Reviewed attacker-controlled inputs on changed surfaces (indexer HTTP query params, LCD proxy routes, factory/pair execute paths, Python swarm env/LCD metadata, frontend tx-hash display). Existing controls hold:

  • Indexer: IPv6 rate-limit bucketing by /64 uses socket ConnectInfo only (no spoofable forwarded headers); get_pair_resting_book SQL interpolation is limited to fixed ASC/DESC after "bid"/"ask" branch (internal callers only); new tests reinforce LCD-heavy 429 on CG/CMC orderbook mirrors.
  • Contracts: SetLpAdmin* and SetPairPaused remain governance-gated; pair SetLpAdmin still factory-only; pair-creation fee now rejects stray denoms and refunds overpay when fee is zero — reduces stuck-funds risk, not a new bypass.
  • Bots/scripts: terrad via create_subprocess_exec (no shell); defaults target LocalTerra test1; Keplr install pins default CWS extension id with CRX validation (dev VM tooling only).

No injection, authz bypass, secret leakage, SSRF/XSS, or unsafe deserialization introduced on production-facing paths in this diff.

## Security review (automated) **Commit reviewed:** `fc62c1fc1d8ed0e674dc0416c0a38864c6b4911a` **Scope:** Full MR diff vs `main` (`531d00e` → `fc62c1fc`): LocalTerra QA swarm LP/bootstrap (#293), indexer rate-limit hardening (#282) + CG/CMC LCD-heavy governor test (#278), limit-fill `swap_index` linkage (#316), factory pair-creation fee/refund path (#276/#318), bounded `SetLpAdminAll`/`SetLpAdminBatch` (#277), limit `clamp(1,MAX)` regression tests (#317), frontend broadcast-phase UX (#305), Cloud Agent Keplr/Chrome setup scripts, and related docs/tests. **Outcome:** `FINDINGS: 0` medium+ **Inline threads:** None (no exploitable issues on added/modified paths). ### Summary Reviewed attacker-controlled inputs on changed surfaces (indexer HTTP query params, LCD proxy routes, factory/pair execute paths, Python swarm env/LCD metadata, frontend tx-hash display). Existing controls hold: - Indexer: IPv6 rate-limit bucketing by `/64` uses socket `ConnectInfo` only (no spoofable forwarded headers); `get_pair_resting_book` SQL interpolation is limited to fixed `ASC`/`DESC` after `"bid"`/`"ask"` branch (internal callers only); new tests reinforce LCD-heavy 429 on CG/CMC orderbook mirrors. - Contracts: `SetLpAdmin*` and `SetPairPaused` remain governance-gated; pair `SetLpAdmin` still factory-only; pair-creation fee now rejects stray denoms and refunds overpay when fee is zero — reduces stuck-funds risk, not a new bypass. - Bots/scripts: `terrad` via `create_subprocess_exec` (no shell); defaults target LocalTerra `test1`; Keplr install pins default CWS extension id with CRX validation (dev VM tooling only). No injection, authz bypass, secret leakage, SSRF/XSS, or unsafe deserialization introduced on production-facing paths in this diff.
ghost1 commented 2026-06-05 09:56:39 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 3527ae79 - Fix swarm thin-pool guards: require fresh reserves and align LP floor with env

Compare with previous version

added 1 commit <ul><li>3527ae79 - Fix swarm thin-pool guards: require fresh reserves and align LP floor with env</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/65/diffs?diff_id=1836386669&start_sha=fc62c1fc1d8ed0e674dc0416c0a38864c6b4911a)
ghost1 commented 2026-06-05 09:57:01 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
ghost1 commented 2026-06-05 09:58:50 +00:00 (Migrated from gitlab.com)
Stale Security Review comment
Stale Security Review comment
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 3527ae79b4. Configure here.

<details> <summary>Stale Security Review comment</summary> <details> <summary>Stale Security Review comment</summary> <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 3527ae79b4390fc79c5c309c646ed36d84119129. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> </details> </details> </details> </details>
ghost1 commented 2026-06-05 09:58:51 +00:00 (Migrated from gitlab.com)

Thin pools never recover automatically

Medium Severity

When either pool reserve drops below BOTS_MIN_RESERVE_PER_SIDE, swap workers skip the pair and lp_worker_loop only calls pick_scaled_provide_amounts, which also requires both sides above that floor. bootstrap_top_up_amounts runs only at launch, so asymmetric draining can leave hub pairs stuck with no ongoing recovery during the swarm.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3527ae79b4. Configure here.

### Thin pools never recover automatically **Medium Severity** <!-- DESCRIPTION START --> When either pool reserve drops below `BOTS_MIN_RESERVE_PER_SIDE`, swap workers skip the pair and `lp_worker_loop` only calls `pick_scaled_provide_amounts`, which also requires both sides above that floor. `bootstrap_top_up_amounts` runs only at launch, so asymmetric draining can leave hub pairs stuck with no ongoing recovery during the swarm. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: 278d43a6-4c9d-46d4-b2f8-5fe18556cb9d --> <!-- LOCATIONS START scripts/bots/swarm.py#L500-L505 scripts/bots/swarm.py#L560-L563 LOCATIONS END --> <details> <summary>Additional Locations (1)</summary> - [`scripts/bots/swarm.py#L560-L563`](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-//blob/3527ae79b4390fc79c5c309c646ed36d84119129/scripts/bots/swarm.py#L560-L563) </details> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjgxYWM3YjIyLWIyMjYtNDk5Zi05NWM3LWVjNGNlODNlZTU1NCIsImVuY3J5cHRpb25LZXkiOiI2LXFfQTVfNEpvcDZkdUlIVnlKMHlCZm0zRnpwdzIwOEdVNWMzbmVZeTJFIiwiYnJhbmNoIjoiY3Vyc29yL2dpdGxhYi1pc3N1ZS13b3JrZmxvdy0wYzhmIiwicmVwb093bmVyIjoiUGxhc3RpY0RpZ2l0cyIsInJlcG9OYW1lIjoiY2w4eS1kZXgtdGVycmFjbGFzc2ljIn19" 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=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjgxYWM3YjIyLWIyMjYtNDk5Zi05NWM3LWVjNGNlODNlZTU1NCIsImVuY3J5cHRpb25LZXkiOiI2LXFfQTVfNEpvcDZkdUlIVnlKMHlCZm0zRnpwdzIwOEdVNWMzbmVZeTJFIiwiYnJhbmNoIjoiY3Vyc29yL2dpdGxhYi1pc3N1ZS13b3JrZmxvdy0wYzhmIiwicmVwb093bmVyIjoiUGxhc3RpY0RpZ2l0cyIsInJlcG9OYW1lIjoiY2w4eS1kZXgtdGVycmFjbGFzc2ljIiwicHJOdW1iZXIiOjY1LCJjb21taXRTaGEiOiIzNTI3YWU3OWI0MzkwZmM3OWM1YzMwOWM2NDZlZDM2ZDg0MTE5MTI5IiwicHJvdmlkZXIiOiJnaXRsYWIiLCJob3N0bmFtZSI6ImdpdGxhYi5jb20ifX0" 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 3527ae79b4390fc79c5c309c646ed36d84119129. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
ghost1 commented 2026-06-05 10:01:18 +00:00 (Migrated from gitlab.com)

changed this line in version 3 of the diff

changed this line in [version 3 of the diff](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/65/diffs?diff_id=1836395562&start_sha=3527ae79b4390fc79c5c309c646ed36d84119129#d50bbe6de5a12489e389d89e2e7c29258c294a92_505_507)
ghost1 commented 2026-06-05 10:01:19 +00:00 (Migrated from gitlab.com)

changed this line in version 3 of the diff

changed this line in [version 3 of the diff](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/65/diffs?diff_id=1836395562&start_sha=3527ae79b4390fc79c5c309c646ed36d84119129#d50bbe6de5a12489e389d89e2e7c29258c294a92_505_507)
ghost1 commented 2026-06-05 10:01:19 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 499beaa1 - fix(swarm): recover thin pools in LP worker via bootstrap top-up

Compare with previous version

added 1 commit <ul><li>499beaa1 - fix(swarm): recover thin pools in LP worker via bootstrap top-up</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/65/diffs?diff_id=1836395562&start_sha=3527ae79b4390fc79c5c309c646ed36d84119129)
ghost1 commented 2026-06-05 10:01:31 +00:00 (Migrated from gitlab.com)

changed the description

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

Security review (automated)

Commit reviewed: 499beaa1bea175f2870d99e398f4ce9b1dbde97f
Scope: MR !783 diff vs main (531d00e → 499beaa1): LocalTerra QA swarm LP workers + bootstrap (scripts/bots/swarm.py, swarm_liquidity.py, bootstrap-swarm-liquidity.*, launch-swarm.sh), Makefile targets, docs, and @cl8y-dex/localnet-trading-swarm profiles.json weight rebalance (#293).

Outcome: FINDINGS: 0 medium+

Inline threads: None (no exploitable issues on added/modified paths).

Summary

Re-read prior automated review on fc62c1fc and Bugbot diff threads (LP env floor, stale reserves, thin-pool recovery). Those items are functional QA / correctness for local pool depth, not auth or injection bugs; the latest commit (499beaa1) addresses thin-pool recovery in lp_worker_loop via bootstrap_top_up_amounts fallback.

Reviewed attacker-controlled inputs on changed surfaces:

Surface Input Sink Verdict
Python swarm TERRA_LCD_URL / DEX_TERRA_LCD_PORT urllib.request.urlopen LCD queries Operator-local dev tooling; pre-existing trust model unchanged. No new SSRF surface beyond existing swap/limit paths.
Python swarm LCD JSON (reserves, token/pair addrs) terrad tx wasm execute via create_subprocess_exec (no shell) Pair list filtered to terra1…; amounts are computed ints serialized to JSON. Malicious LCD requires operator misconfiguration, not a remote attack path.
Python swarm BOTS_* env vars sizing / skip thresholds Affects local bot behavior only; hardcoded --from test1, --chain-id localterra, LocalTerra docker exec.
provide_liquidity_pair computed amounts CW20 increase_allowance + pair provide_liquidity Standard localnet LP flow; spender is on-chain pair addr from factory/LCD, not user-supplied CLI text.
TS swarm profiles.json weights local scheduler action selection Localnet-only package with validateLocalnet chain-id guard; no production auth or HTTP exposure.

No injection, authn/authz bypass, secret leakage, unsafe deserialization, or production-facing boundary mistakes introduced by this diff.

Security review: no medium+ findings on this diff.

## Security review (automated) **Commit reviewed:** `499beaa1bea175f2870d99e398f4ce9b1dbde97f` **Scope:** MR !783 diff vs `main` (`531d00e` → `499beaa1`): LocalTerra QA swarm LP workers + bootstrap (`scripts/bots/swarm.py`, `swarm_liquidity.py`, `bootstrap-swarm-liquidity.*`, `launch-swarm.sh`), Makefile targets, docs, and `@cl8y-dex/localnet-trading-swarm` `profiles.json` weight rebalance (#293). **Outcome:** `FINDINGS: 0` medium+ **Inline threads:** None (no exploitable issues on added/modified paths). ### Summary Re-read prior automated review on `fc62c1fc` and Bugbot diff threads (LP env floor, stale reserves, thin-pool recovery). Those items are **functional QA / correctness** for local pool depth, not auth or injection bugs; the latest commit (`499beaa1`) addresses thin-pool recovery in `lp_worker_loop` via `bootstrap_top_up_amounts` fallback. Reviewed attacker-controlled inputs on changed surfaces: | Surface | Input | Sink | Verdict | |---------|-------|------|---------| | Python swarm | `TERRA_LCD_URL` / `DEX_TERRA_LCD_PORT` | `urllib.request.urlopen` LCD queries | Operator-local dev tooling; pre-existing trust model unchanged. No new SSRF surface beyond existing swap/limit paths. | | Python swarm | LCD JSON (reserves, token/pair addrs) | `terrad tx wasm execute` via `create_subprocess_exec` (no shell) | Pair list filtered to `terra1…`; amounts are computed ints serialized to JSON. Malicious LCD requires operator misconfiguration, not a remote attack path. | | Python swarm | `BOTS_*` env vars | sizing / skip thresholds | Affects local bot behavior only; hardcoded `--from test1`, `--chain-id localterra`, LocalTerra docker exec. | | `provide_liquidity_pair` | computed amounts | CW20 `increase_allowance` + pair `provide_liquidity` | Standard localnet LP flow; spender is on-chain pair addr from factory/LCD, not user-supplied CLI text. | | TS swarm | `profiles.json` weights | local scheduler action selection | Localnet-only package with `validateLocalnet` chain-id guard; no production auth or HTTP exposure. | No injection, authn/authz bypass, secret leakage, unsafe deserialization, or production-facing boundary mistakes introduced by this diff. Security review: **no medium+ findings** on this diff.
ghost1 commented 2026-06-05 10:03:55 +00:00 (Migrated from gitlab.com)
Stale Security Review comment
Stale Security Review comment
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 499beaa1be. Configure here.

<details> <summary>Stale Security Review comment</summary> <details> <summary>Stale Security Review comment</summary> <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 499beaa1bea175f2870d99e398f4ce9b1dbde97f. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> </details> </details> </details>
ghost1 commented 2026-06-05 10:03:56 +00:00 (Migrated from gitlab.com)

LP worker idle mid reserves

Medium Severity

When pick_scaled_provide_amounts returns None because 0.3% legs fall below MIN_PROVIDE_LIQUIDITY_LEG, the LP worker only tries bootstrap_top_up_amounts with target_per_side=floor + MIN_PROVIDE_LIQUIDITY_LEG. That helper exits immediately if both sides are already at or above BOTS_MIN_RESERVE_PER_SIDE, so pools between the swap floor (~10M) and ~1.67B per side get no LP while swap bots still trade them, allowing the same drain/skew #293 targets.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 499beaa1be. Configure here.

### LP worker idle mid reserves **Medium Severity** <!-- DESCRIPTION START --> When `pick_scaled_provide_amounts` returns `None` because 0.3% legs fall below `MIN_PROVIDE_LIQUIDITY_LEG`, the LP worker only tries `bootstrap_top_up_amounts` with `target_per_side=floor + MIN_PROVIDE_LIQUIDITY_LEG`. That helper exits immediately if both sides are already at or above `BOTS_MIN_RESERVE_PER_SIDE`, so pools between the swap floor (~10M) and ~1.67B per side get no LP while swap bots still trade them, allowing the same drain/skew #293 targets. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: 96e82786-e5e2-4160-8784-cb2c952b7a35 --> <!-- LOCATIONS START scripts/bots/swarm.py#L503-L517 LOCATIONS END --> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmFkMzZlMzJmLWUwZDYtNGI4YS04M2IzLWE5NWNiMzE1ODNjMSIsImVuY3J5cHRpb25LZXkiOiJOLTNMZ0NRLURlV0FwQ1d5MUFTUXh3RlE2OXNfa3d3d3RqWEVxUy13QzhnIiwiYnJhbmNoIjoiY3Vyc29yL2dpdGxhYi1pc3N1ZS13b3JrZmxvdy0wYzhmIiwicmVwb093bmVyIjoiUGxhc3RpY0RpZ2l0cyIsInJlcG9OYW1lIjoiY2w4eS1kZXgtdGVycmFjbGFzc2ljIn19" 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=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmFkMzZlMzJmLWUwZDYtNGI4YS04M2IzLWE5NWNiMzE1ODNjMSIsImVuY3J5cHRpb25LZXkiOiJOLTNMZ0NRLURlV0FwQ1d5MUFTUXh3RlE2OXNfa3d3d3RqWEVxUy13QzhnIiwiYnJhbmNoIjoiY3Vyc29yL2dpdGxhYi1pc3N1ZS13b3JrZmxvdy0wYzhmIiwicmVwb093bmVyIjoiUGxhc3RpY0RpZ2l0cyIsInJlcG9OYW1lIjoiY2w4eS1kZXgtdGVycmFjbGFzc2ljIiwicHJOdW1iZXIiOjY1LCJjb21taXRTaGEiOiI0OTliZWFhMWJlYTE3NWYyODcwZDk5ZTM5OGY0Y2U5YjFkYmRlOTdmIiwicHJvdmlkZXIiOiJnaXRsYWIiLCJob3N0bmFtZSI6ImdpdGxhYi5jb20ifX0" 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 499beaa1bea175f2870d99e398f4ce9b1dbde97f. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
ghost1 commented 2026-06-05 10:03:56 +00:00 (Migrated from gitlab.com)

LP txs lack inclusion wait

High Severity

New provide_liquidity_pair sends three separate terrad executes (two increase_allowance, then provide_liquidity) back-to-back with only sync broadcast and no inclusion wait. Unlike the TypeScript swarm’s single multi-message tx and scripts/deploy-dex-local.sh’s sleep between steps, this can hit sequence mismatches or provide_liquidity before allowances land, so bootstrap and LP workers may silently fail while only logging warnings.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 499beaa1be. Configure here.

### LP txs lack inclusion wait **High Severity** <!-- DESCRIPTION START --> New `provide_liquidity_pair` sends three separate `terrad` executes (two `increase_allowance`, then `provide_liquidity`) back-to-back with only `sync` broadcast and no inclusion wait. Unlike the TypeScript swarm’s single multi-message tx and `scripts/deploy-dex-local.sh`’s `sleep` between steps, this can hit sequence mismatches or `provide_liquidity` before allowances land, so bootstrap and LP workers may silently fail while only logging warnings. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: e1bbb5fe-c33f-4497-b242-b98e3eb01573 --> <!-- LOCATIONS START scripts/bots/swarm.py#L305-L308 LOCATIONS END --> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjM5NjU1YzBmLWEyY2ItNDQyNy1iNmI4LWNmNmFiODgwNGZjZiIsImVuY3J5cHRpb25LZXkiOiJwUHV3MGF2MmxrOUJOSS1MNDVHUEhWVndjNkxVblZrOFk2eERxWjNsV01zIiwiYnJhbmNoIjoiY3Vyc29yL2dpdGxhYi1pc3N1ZS13b3JrZmxvdy0wYzhmIiwicmVwb093bmVyIjoiUGxhc3RpY0RpZ2l0cyIsInJlcG9OYW1lIjoiY2w4eS1kZXgtdGVycmFjbGFzc2ljIn19" 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=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjM5NjU1YzBmLWEyY2ItNDQyNy1iNmI4LWNmNmFiODgwNGZjZiIsImVuY3J5cHRpb25LZXkiOiJwUHV3MGF2MmxrOUJOSS1MNDVHUEhWVndjNkxVblZrOFk2eERxWjNsV01zIiwiYnJhbmNoIjoiY3Vyc29yL2dpdGxhYi1pc3N1ZS13b3JrZmxvdy0wYzhmIiwicmVwb093bmVyIjoiUGxhc3RpY0RpZ2l0cyIsInJlcG9OYW1lIjoiY2w4eS1kZXgtdGVycmFjbGFzc2ljIiwicHJOdW1iZXIiOjY1LCJjb21taXRTaGEiOiI0OTliZWFhMWJlYTE3NWYyODcwZDk5ZTM5OGY0Y2U5YjFkYmRlOTdmIiwicHJvdmlkZXIiOiJnaXRsYWIiLCJob3N0bmFtZSI6ImdpdGxhYi5jb20ifX0" 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 499beaa1bea175f2870d99e398f4ce9b1dbde97f. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
ghost1 commented 2026-06-05 10:05:50 +00:00 (Migrated from gitlab.com)

changed this line in version 4 of the diff

changed this line in [version 4 of the diff](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/65/diffs?diff_id=1836404582&start_sha=499beaa1bea175f2870d99e398f4ce9b1dbde97f#d50bbe6de5a12489e389d89e2e7c29258c294a92_517_570)
ghost1 commented 2026-06-05 10:05:50 +00:00 (Migrated from gitlab.com)

changed this line in version 4 of the diff

changed this line in [version 4 of the diff](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/65/diffs?diff_id=1836404582&start_sha=499beaa1bea175f2870d99e398f4ce9b1dbde97f#d50bbe6de5a12489e389d89e2e7c29258c294a92_308_355)
ghost1 commented 2026-06-05 10:05:50 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 3eeb4ca4 - Fix LP swarm tx sequencing and mid-reserve idle gap

Compare with previous version

added 1 commit <ul><li>3eeb4ca4 - Fix LP swarm tx sequencing and mid-reserve idle gap</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/65/diffs?diff_id=1836404582&start_sha=499beaa1bea175f2870d99e398f4ce9b1dbde97f)
ghost1 commented 2026-06-05 10:06:02 +00:00 (Migrated from gitlab.com)

changed the description

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

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

Reviewed by Cursor Bugbot for commit 3eeb4ca495. 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 3 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 3eeb4ca495f069fd24df8cb7d82d3da91717f338. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> </details> </details>
ghost1 commented 2026-06-05 10:08:02 +00:00 (Migrated from gitlab.com)

Malformed tx query treated success

Medium Severity

In _poll_tx_inclusion, a JSONDecodeError while parsing the terrad query tx output returns True, so inclusion waiting is treated as successful when the response cannot be parsed.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3eeb4ca495. Configure here.

### Malformed tx query treated success **Medium Severity** <!-- DESCRIPTION START --> In `_poll_tx_inclusion`, a `JSONDecodeError` while parsing the `terrad query tx` output returns `True`, so inclusion waiting is treated as successful when the response cannot be parsed. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: 88b67071-2427-4468-b6a8-264b0ecd1baa --> <!-- LOCATIONS START scripts/bots/swarm.py#L263-L267 LOCATIONS END --> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjJlMzZlNDEwLWYwNTAtNDJkZi1hZjEzLTA3Nzk0ZjMxOGRlMSIsImVuY3J5cHRpb25LZXkiOiItUlM5ZS1PcTdEX2VhWXV1LWRSbGRndEs0cGxkYUtqc2RWaFNWVWtfQlMwIiwiYnJhbmNoIjoiY3Vyc29yL2dpdGxhYi1pc3N1ZS13b3JrZmxvdy0wYzhmIiwicmVwb093bmVyIjoiUGxhc3RpY0RpZ2l0cyIsInJlcG9OYW1lIjoiY2w4eS1kZXgtdGVycmFjbGFzc2ljIn19" 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=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjJlMzZlNDEwLWYwNTAtNDJkZi1hZjEzLTA3Nzk0ZjMxOGRlMSIsImVuY3J5cHRpb25LZXkiOiItUlM5ZS1PcTdEX2VhWXV1LWRSbGRndEs0cGxkYUtqc2RWaFNWVWtfQlMwIiwiYnJhbmNoIjoiY3Vyc29yL2dpdGxhYi1pc3N1ZS13b3JrZmxvdy0wYzhmIiwicmVwb093bmVyIjoiUGxhc3RpY0RpZ2l0cyIsInJlcG9OYW1lIjoiY2w4eS1kZXgtdGVycmFjbGFzc2ljIiwicHJOdW1iZXIiOjY1LCJjb21taXRTaGEiOiIzZWViNGNhNDk1ZjA2OWZkMjRkZjhjYjdkODJkM2RhOTE3MTdmMzM4IiwicHJvdmlkZXIiOiJnaXRsYWIiLCJob3N0bmFtZSI6ImdpdGxhYi5jb20ifX0" 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 3eeb4ca495f069fd24df8cb7d82d3da91717f338. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
ghost1 commented 2026-06-05 10:08:03 +00:00 (Migrated from gitlab.com)

Tx poll ignores nested failure

High Severity

_poll_tx_inclusion treats a queried transaction as successful when only the top-level JSON code is zero. Cosmos GetTx responses usually put the execution result under tx_response.code, so failed on-chain increase_allowance or provide_liquidity txs can be read as success and the multi-step LP flow continues anyway.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3eeb4ca495. Configure here.

### Tx poll ignores nested failure **High Severity** <!-- DESCRIPTION START --> `_poll_tx_inclusion` treats a queried transaction as successful when only the top-level JSON `code` is zero. Cosmos `GetTx` responses usually put the execution result under `tx_response.code`, so failed on-chain `increase_allowance` or `provide_liquidity` txs can be read as success and the multi-step LP flow continues anyway. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: 2ac458f4-5d02-4ac0-a970-1d6d12ece9e5 --> <!-- LOCATIONS START scripts/bots/swarm.py#L262-L272 LOCATIONS END --> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjQwN2JmNjk2LWU4OGItNDAwYi04MDY5LWMzNjk2YjVjNjQyOSIsImVuY3J5cHRpb25LZXkiOiJHNnZrSi1yejJFS1VpaU1CTG1jeUZZY1o1OVlOZHZ6aTJOclFIXy1GOEQ0IiwiYnJhbmNoIjoiY3Vyc29yL2dpdGxhYi1pc3N1ZS13b3JrZmxvdy0wYzhmIiwicmVwb093bmVyIjoiUGxhc3RpY0RpZ2l0cyIsInJlcG9OYW1lIjoiY2w4eS1kZXgtdGVycmFjbGFzc2ljIn19" 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=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjQwN2JmNjk2LWU4OGItNDAwYi04MDY5LWMzNjk2YjVjNjQyOSIsImVuY3J5cHRpb25LZXkiOiJHNnZrSi1yejJFS1VpaU1CTG1jeUZZY1o1OVlOZHZ6aTJOclFIXy1GOEQ0IiwiYnJhbmNoIjoiY3Vyc29yL2dpdGxhYi1pc3N1ZS13b3JrZmxvdy0wYzhmIiwicmVwb093bmVyIjoiUGxhc3RpY0RpZ2l0cyIsInJlcG9OYW1lIjoiY2w4eS1kZXgtdGVycmFjbGFzc2ljIiwicHJOdW1iZXIiOjY1LCJjb21taXRTaGEiOiIzZWViNGNhNDk1ZjA2OWZkMjRkZjhjYjdkODJkM2RhOTE3MTdmMzM4IiwicHJvdmlkZXIiOiJnaXRsYWIiLCJob3N0bmFtZSI6ImdpdGxhYi5jb20ifX0" 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 3eeb4ca495f069fd24df8cb7d82d3da91717f338. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
ghost1 commented 2026-06-05 10:08:03 +00:00 (Migrated from gitlab.com)

LP worker logs false success

Medium Severity

The LP worker always prints a successful provide_liquidity line after provide_liquidity_pair returns, even when inner _wasm_execute calls failed and the pair was not topped up.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3eeb4ca495. Configure here.

### LP worker logs false success **Medium Severity** <!-- DESCRIPTION START --> The LP worker always prints a successful `provide_liquidity` line after `provide_liquidity_pair` returns, even when inner `_wasm_execute` calls failed and the pair was not topped up. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: c5817cc1-f8f7-44b8-83a2-679525ab6f4e --> <!-- LOCATIONS START scripts/bots/swarm.py#L581-L590 LOCATIONS END --> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjhmYWI1OThlLTcyYzAtNDBjMC05YjcwLTY3YWRjNjcyMTAxOSIsImVuY3J5cHRpb25LZXkiOiJYUVRYNWN4UUQwX2JIT25OV1RmVnRlY3ljYkdDVFhrd2FLOERrbmxTWXl3IiwiYnJhbmNoIjoiY3Vyc29yL2dpdGxhYi1pc3N1ZS13b3JrZmxvdy0wYzhmIiwicmVwb093bmVyIjoiUGxhc3RpY0RpZ2l0cyIsInJlcG9OYW1lIjoiY2w4eS1kZXgtdGVycmFjbGFzc2ljIn19" 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=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjhmYWI1OThlLTcyYzAtNDBjMC05YjcwLTY3YWRjNjcyMTAxOSIsImVuY3J5cHRpb25LZXkiOiJYUVRYNWN4UUQwX2JIT25OV1RmVnRlY3ljYkdDVFhrd2FLOERrbmxTWXl3IiwiYnJhbmNoIjoiY3Vyc29yL2dpdGxhYi1pc3N1ZS13b3JrZmxvdy0wYzhmIiwicmVwb093bmVyIjoiUGxhc3RpY0RpZ2l0cyIsInJlcG9OYW1lIjoiY2w4eS1kZXgtdGVycmFjbGFzc2ljIiwicHJOdW1iZXIiOjY1LCJjb21taXRTaGEiOiIzZWViNGNhNDk1ZjA2OWZkMjRkZjhjYjdkODJkM2RhOTE3MTdmMzM4IiwicHJvdmlkZXIiOiJnaXRsYWIiLCJob3N0bmFtZSI6ImdpdGxhYi5jb20ifX0" 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 3eeb4ca495f069fd24df8cb7d82d3da91717f338. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
ghost1 commented 2026-06-05 10:09:20 +00:00 (Migrated from gitlab.com)

changed this line in version 5 of the diff

changed this line in [version 5 of the diff](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/65/diffs?diff_id=1836411906&start_sha=3eeb4ca495f069fd24df8cb7d82d3da91717f338#d50bbe6de5a12489e389d89e2e7c29258c294a92_267_277)
ghost1 commented 2026-06-05 10:09:20 +00:00 (Migrated from gitlab.com)

changed this line in version 5 of the diff

changed this line in [version 5 of the diff](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/65/diffs?diff_id=1836411906&start_sha=3eeb4ca495f069fd24df8cb7d82d3da91717f338#d50bbe6de5a12489e389d89e2e7c29258c294a92_590_597)
ghost1 commented 2026-06-05 10:09:20 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 31a5143b - fix(swarm): treat tx query failures and LP success correctly

Compare with previous version

added 1 commit <ul><li>31a5143b - fix(swarm): treat tx query failures and LP success correctly</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/65/diffs?diff_id=1836411906&start_sha=3eeb4ca495f069fd24df8cb7d82d3da91717f338)
ghost1 commented 2026-06-05 10:09:33 +00:00 (Migrated from gitlab.com)

changed the description

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

Security review (automated)

Commit reviewed: 31a5143bd13096b3090a674e33d22f34683e1206
Scope: MR !783 diff vs main (531d00e → 31a5143): LocalTerra QA swarm LP workers + bootstrap (scripts/bots/swarm.py, swarm_liquidity.py, bootstrap-swarm-liquidity.*, launch-swarm.sh), Makefile targets, docs, and @cl8y-dex/localnet-trading-swarm profiles.json weight rebalance (#293).

Outcome: FINDINGS: 0 medium+

Inline threads: None (no exploitable issues on added/modified paths).

Summary

Re-read prior automated reviews (fc62c1fc, 499beaa1) and Bugbot diff threads (LP env floor, stale reserves, thin-pool recovery, tx polling, false-success logging). Those items are functional QA / correctness for local pool depth and bot observability, not authn/authz or injection bugs. Commit 31a5143 hardens _poll_tx_inclusion (retry on malformed JSON, check tx_response.code) and gates LP success logging on provide_liquidity_pair returning true — reduces false-positive QA signals; no new attacker-controlled sink.

Surface Input Sink Verdict
Python swarm TERRA_LCD_URL / DEX_TERRA_LCD_PORT urllib.request.urlopen LCD queries Operator-local dev tooling; pre-existing trust model unchanged.
Python swarm LCD JSON (reserves, token/pair addrs) terrad tx wasm execute via create_subprocess_exec (no shell) Factory pair list filtered to terra1…; amounts are computed ints in JSON. Malicious LCD requires operator misconfiguration, not a remote attack path.
Python swarm BOTS_* env vars sizing / skip thresholds Affects local bot behavior only; hardcoded --from test1, --chain-id localterra, LocalTerra docker exec.
provide_liquidity_pair computed amounts CW20 increase_allowance + pair provide_liquidity Standard localnet LP flow; spender is on-chain pair addr from factory/LCD.
TS swarm profiles.json weights local scheduler action selection Localnet-only package; no production auth or HTTP exposure.

No injection, authn/authz bypass, secret leakage, unsafe deserialization, or production-facing boundary mistakes introduced by this diff.

Security review: no medium+ findings on this diff.

## Security review (automated) **Commit reviewed:** `31a5143bd13096b3090a674e33d22f34683e1206` **Scope:** MR !783 diff vs `main` (`531d00e` → `31a5143`): LocalTerra QA swarm LP workers + bootstrap (`scripts/bots/swarm.py`, `swarm_liquidity.py`, `bootstrap-swarm-liquidity.*`, `launch-swarm.sh`), Makefile targets, docs, and `@cl8y-dex/localnet-trading-swarm` `profiles.json` weight rebalance (#293). **Outcome:** `FINDINGS: 0` medium+ **Inline threads:** None (no exploitable issues on added/modified paths). ### Summary Re-read prior automated reviews (`fc62c1fc`, `499beaa1`) and Bugbot diff threads (LP env floor, stale reserves, thin-pool recovery, tx polling, false-success logging). Those items are **functional QA / correctness** for local pool depth and bot observability, not authn/authz or injection bugs. Commit `31a5143` hardens `_poll_tx_inclusion` (retry on malformed JSON, check `tx_response.code`) and gates LP success logging on `provide_liquidity_pair` returning true — reduces false-positive QA signals; no new attacker-controlled sink. | Surface | Input | Sink | Verdict | |---------|-------|------|---------| | Python swarm | `TERRA_LCD_URL` / `DEX_TERRA_LCD_PORT` | `urllib.request.urlopen` LCD queries | Operator-local dev tooling; pre-existing trust model unchanged. | | Python swarm | LCD JSON (reserves, token/pair addrs) | `terrad tx wasm execute` via `create_subprocess_exec` (no shell) | Factory pair list filtered to `terra1…`; amounts are computed ints in JSON. Malicious LCD requires operator misconfiguration, not a remote attack path. | | Python swarm | `BOTS_*` env vars | sizing / skip thresholds | Affects local bot behavior only; hardcoded `--from test1`, `--chain-id localterra`, LocalTerra docker exec. | | `provide_liquidity_pair` | computed amounts | CW20 `increase_allowance` + pair `provide_liquidity` | Standard localnet LP flow; spender is on-chain pair addr from factory/LCD. | | TS swarm | `profiles.json` weights | local scheduler action selection | Localnet-only package; no production auth or HTTP exposure. | No injection, authn/authz bypass, secret leakage, unsafe deserialization, or production-facing boundary mistakes introduced by this diff. Security review: **no medium+ findings** on this diff.
ghost1 commented 2026-06-05 10:11:17 +00:00 (Migrated from gitlab.com)
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 31a5143bd1. Configure here.

<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 31a5143bd13096b3090a674e33d22f34683e1206. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> </details>
ghost1 commented 2026-06-05 10:11:18 +00:00 (Migrated from gitlab.com)

Bootstrap ignores provide liquidity failures

Medium Severity

_bootstrap_pair always returns a success note and increments the action counter after calling provide_liquidity_pair, even when that helper returns False (terrad error, missing txhash, on-chain failure, or inclusion timeout). main_async then exits 0, so launch-swarm.sh still starts swap workers while logs imply pools were topped up.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 31a5143bd1. Configure here.

### Bootstrap ignores provide liquidity failures **Medium Severity** <!-- DESCRIPTION START --> `_bootstrap_pair` always returns a success note and increments the action counter after calling `provide_liquidity_pair`, even when that helper returns `False` (terrad error, missing txhash, on-chain failure, or inclusion timeout). `main_async` then exits 0, so `launch-swarm.sh` still starts swap workers while logs imply pools were topped up. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: c4d716bb-6d6b-4c4e-b808-2a03eccc78ca --> <!-- LOCATIONS START scripts/bots/bootstrap-swarm-liquidity.py#L77-L91 LOCATIONS END --> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmNmYjlhNTc3LTczMjQtNDc1My1hYzIyLWQ2YTRlYzEyYzdhNCIsImVuY3J5cHRpb25LZXkiOiIwemkwdXhYSWN5N3JtM0ZXRTVvMmpGSE9GbUlvbUJLR3h0MzNfRmh6aTRrIiwiYnJhbmNoIjoiY3Vyc29yL2dpdGxhYi1pc3N1ZS13b3JrZmxvdy0wYzhmIiwicmVwb093bmVyIjoiUGxhc3RpY0RpZ2l0cyIsInJlcG9OYW1lIjoiY2w4eS1kZXgtdGVycmFjbGFzc2ljIn19" 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=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmNmYjlhNTc3LTczMjQtNDc1My1hYzIyLWQ2YTRlYzEyYzdhNCIsImVuY3J5cHRpb25LZXkiOiIwemkwdXhYSWN5N3JtM0ZXRTVvMmpGSE9GbUlvbUJLR3h0MzNfRmh6aTRrIiwiYnJhbmNoIjoiY3Vyc29yL2dpdGxhYi1pc3N1ZS13b3JrZmxvdy0wYzhmIiwicmVwb093bmVyIjoiUGxhc3RpY0RpZ2l0cyIsInJlcG9OYW1lIjoiY2w4eS1kZXgtdGVycmFjbGFzc2ljIiwicHJOdW1iZXIiOjY1LCJjb21taXRTaGEiOiIzMWE1MTQzYmQxMzA5NmIzMDkwYTY3NGUzM2QyMmYzNDY4M2UxMjA2IiwicHJvdmlkZXIiOiJnaXRsYWIiLCJob3N0bmFtZSI6ImdpdGxhYi5jb20ifX0" 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 31a5143bd13096b3090a674e33d22f34683e1206. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
PlasticDigits commented 2026-06-05 10:13:19 +00:00 (Migrated from gitlab.com)

Security review (automated)

Commit reviewed: 31a5143bd13096b3090a674e33d22f34683e1206 (MR head; webhook referenced 3eeb4ca — delta is LP tx-polling / success-logging hardening in scripts/bots/swarm.py only)
Scope: MR !783 diff vs main: LocalTerra QA swarm LP workers + bootstrap (scripts/bots/swarm.py, swarm_liquidity.py, bootstrap-swarm-liquidity.*, launch-swarm.sh), Makefile targets, @cl8y-dex/localnet-trading-swarm profiles.json, plus co-merged indexer rate-limit (#282), limit-fill swap_index (#316), factory pair-creation refund / bounded SetLpAdmin* (#276/#277/#318), frontend broadcast-phase UX (#305), and related tests/docs.

Outcome: FINDINGS: 0 medium+

Inline threads: None (no exploitable issues on added/modified paths).

Summary

Re-read prior automated reviews (fc62c1fc, 499beaa1, 3eeb4ca) and Bugbot diff threads (LP env floor, stale reserves, thin-pool recovery, tx polling). Those are functional QA / correctness for local pool depth and bot observability, not authn/authz or injection bugs. Commit 31a5143 retries malformed tx-query JSON, checks tx_response.code, and gates LP success logging on provide_liquidity_pair returning true — reduces false-positive QA signals; no new attacker-controlled sink.

Surface Input Sink Verdict
Python swarm TERRA_LCD_URL / DEX_TERRA_LCD_PORT urllib.request.urlopen LCD queries Operator-local dev tooling; pre-existing trust model unchanged.
Python swarm LCD JSON (reserves, token/pair addrs) terrad tx wasm execute via create_subprocess_exec (no shell) Factory pair list filtered to terra1…; amounts are computed ints in JSON. Malicious LCD requires operator misconfiguration, not a remote attack path.
Python swarm BOTS_* env vars sizing / skip thresholds Affects local bot behavior only; hardcoded --from test1, --chain-id localterra, LocalTerra docker exec.
provide_liquidity_pair computed amounts CW20 increase_allowance + pair provide_liquidity Standard localnet LP flow; spender is on-chain pair addr from factory/LCD.
TS swarm profiles.json weights local scheduler action selection Localnet-only package with validateLocalnet; no production auth surface.
Indexer API socket peer IP tower_governor buckets (/64 for IPv6) Uses ConnectInfo only — no spoofable forwarded headers; security hardening.
Indexer DB "bid" / "ask" (internal) ORDER BY price {ASC|DESC} in get_pair_resting_book Fixed branch only; not HTTP-exposed in this diff.
Factory / pair governance msgs SetLpAdmin* / pair-creation fee ensure_governance + pair::SetLpAdmin factory-only; fee stray-denom reject + refund when fee=0.
Frontend chain-returned txHash explorer href + truncated label Hash from broadcast response; React text nodes; no new XSS sink.

Security review: no medium+ findings on this diff.

## Security review (automated) **Commit reviewed:** `31a5143bd13096b3090a674e33d22f34683e1206` (MR head; webhook referenced `3eeb4ca` — delta is LP tx-polling / success-logging hardening in `scripts/bots/swarm.py` only) **Scope:** MR !783 diff vs `main`: LocalTerra QA swarm LP workers + bootstrap (`scripts/bots/swarm.py`, `swarm_liquidity.py`, `bootstrap-swarm-liquidity.*`, `launch-swarm.sh`), Makefile targets, `@cl8y-dex/localnet-trading-swarm` `profiles.json`, plus co-merged indexer rate-limit (#282), limit-fill `swap_index` (#316), factory pair-creation refund / bounded `SetLpAdmin*` (#276/#277/#318), frontend broadcast-phase UX (#305), and related tests/docs. **Outcome:** `FINDINGS: 0` medium+ **Inline threads:** None (no exploitable issues on added/modified paths). ### Summary Re-read prior automated reviews (`fc62c1fc`, `499beaa1`, `3eeb4ca`) and Bugbot diff threads (LP env floor, stale reserves, thin-pool recovery, tx polling). Those are **functional QA / correctness** for local pool depth and bot observability, not authn/authz or injection bugs. Commit `31a5143` retries malformed tx-query JSON, checks `tx_response.code`, and gates LP success logging on `provide_liquidity_pair` returning true — reduces false-positive QA signals; no new attacker-controlled sink. | Surface | Input | Sink | Verdict | |---------|-------|------|---------| | Python swarm | `TERRA_LCD_URL` / `DEX_TERRA_LCD_PORT` | `urllib.request.urlopen` LCD queries | Operator-local dev tooling; pre-existing trust model unchanged. | | Python swarm | LCD JSON (reserves, token/pair addrs) | `terrad tx wasm execute` via `create_subprocess_exec` (no shell) | Factory pair list filtered to `terra1…`; amounts are computed ints in JSON. Malicious LCD requires operator misconfiguration, not a remote attack path. | | Python swarm | `BOTS_*` env vars | sizing / skip thresholds | Affects local bot behavior only; hardcoded `--from test1`, `--chain-id localterra`, LocalTerra docker exec. | | `provide_liquidity_pair` | computed amounts | CW20 `increase_allowance` + pair `provide_liquidity` | Standard localnet LP flow; spender is on-chain pair addr from factory/LCD. | | TS swarm | `profiles.json` weights | local scheduler action selection | Localnet-only package with `validateLocalnet`; no production auth surface. | | Indexer API | socket peer IP | `tower_governor` buckets (`/64` for IPv6) | Uses `ConnectInfo` only — no spoofable forwarded headers; security hardening. | | Indexer DB | `"bid"` / `"ask"` (internal) | `ORDER BY price {ASC\|DESC}` in `get_pair_resting_book` | Fixed branch only; not HTTP-exposed in this diff. | | Factory / pair | governance msgs | `SetLpAdmin*` / pair-creation fee | `ensure_governance` + `pair::SetLpAdmin` factory-only; fee stray-denom reject + refund when fee=0. | | Frontend | chain-returned `txHash` | explorer `href` + truncated label | Hash from broadcast response; React text nodes; no new XSS sink. | Security review: no medium+ findings on this diff.
ghost1 commented 2026-06-05 10:23:23 +00:00 (Migrated from gitlab.com)

changed this line in version 6 of the diff

changed this line in [version 6 of the diff](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/65/diffs?diff_id=1836439906&start_sha=31a5143bd13096b3090a674e33d22f34683e1206#9b86243e9b31a465d908078cf3f1d54651b6f16d_91_93)
ghost1 commented 2026-06-05 10:23:24 +00:00 (Migrated from gitlab.com)

added 1 commit

  • d70ef866 - fix(bots): fail bootstrap when provide_liquidity returns false

Compare with previous version

added 1 commit <ul><li>d70ef866 - fix(bots): fail bootstrap when provide_liquidity returns false</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/65/diffs?diff_id=1836439906&start_sha=31a5143bd13096b3090a674e33d22f34683e1206)
ghost1 commented 2026-06-05 10:23:38 +00:00 (Migrated from gitlab.com)

changed the description

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

Security review (automated)

Commit reviewed: d70ef866016a015fea2c42c0bd910889b885193a
Scope: MR !783 diff vs main (531d00e → d70ef866): LocalTerra QA swarm LP workers + bootstrap (scripts/bots/swarm.py, swarm_liquidity.py, bootstrap-swarm-liquidity.*, launch-swarm.sh), Makefile targets, docs, and @cl8y-dex/localnet-trading-swarm profiles.json weight rebalance (#293).

Outcome: FINDINGS: 0 medium+

Inline threads: None (no exploitable issues on added/modified paths).

Summary

Re-read prior automated reviews (fc62c1fc, 499beaa1, 31a5143) and Bugbot diff threads (LP env floor, stale reserves, thin-pool recovery, tx polling, bootstrap/LP false-success logging). Those items are functional QA / correctness for local pool depth and bot observability, not authn/authz or injection bugs. Commit d70ef866 gates bootstrap success notes and exit code on provide_liquidity_pair returning true, so failed top-ups no longer allow launch-swarm.sh to proceed silently.

Surface Input Sink Verdict
Python swarm TERRA_LCD_URL / DEX_TERRA_LCD_PORT urllib.request.urlopen LCD queries Operator-local dev tooling; pre-existing trust model unchanged. No new remote SSRF surface.
Python swarm LCD JSON (reserves, token/pair addrs) terrad tx wasm execute via create_subprocess_exec (no shell) Factory pair list filtered to terra1…; amounts are computed ints serialized with json.dumps. Malicious LCD requires operator misconfiguration, not a remote attack path.
Python swarm terrad tx JSON (txhash) _poll_tx_inclusion → terrad query tx argv list Malformed JSON retries instead of treating success; tx_response.code checked. txhash passed as a single argv element (no shell injection).
Bootstrap / LP On-chain tx failure main_async exit / worker logging Failures propagate as stderr + exit 1 / skipped success logs — QA observability only.
TS swarm profiles.json weights Localnet action picker Config-only rebalance; no new network or secret handling.

Security review: no medium+ findings on this diff.

## Security review (automated) **Commit reviewed:** `d70ef866016a015fea2c42c0bd910889b885193a` **Scope:** MR !783 diff vs `main` (`531d00e` → `d70ef866`): LocalTerra QA swarm LP workers + bootstrap (`scripts/bots/swarm.py`, `swarm_liquidity.py`, `bootstrap-swarm-liquidity.*`, `launch-swarm.sh`), Makefile targets, docs, and `@cl8y-dex/localnet-trading-swarm` `profiles.json` weight rebalance (#293). **Outcome:** `FINDINGS: 0` medium+ **Inline threads:** None (no exploitable issues on added/modified paths). ### Summary Re-read prior automated reviews (`fc62c1fc`, `499beaa1`, `31a5143`) and Bugbot diff threads (LP env floor, stale reserves, thin-pool recovery, tx polling, bootstrap/LP false-success logging). Those items are **functional QA / correctness** for local pool depth and bot observability, not authn/authz or injection bugs. Commit `d70ef866` gates bootstrap success notes and exit code on `provide_liquidity_pair` returning true, so failed top-ups no longer allow `launch-swarm.sh` to proceed silently. | Surface | Input | Sink | Verdict | |---------|-------|------|---------| | Python swarm | `TERRA_LCD_URL` / `DEX_TERRA_LCD_PORT` | `urllib.request.urlopen` LCD queries | Operator-local dev tooling; pre-existing trust model unchanged. No new remote SSRF surface. | | Python swarm | LCD JSON (reserves, token/pair addrs) | `terrad tx wasm execute` via `create_subprocess_exec` (no shell) | Factory pair list filtered to `terra1…`; amounts are computed ints serialized with `json.dumps`. Malicious LCD requires operator misconfiguration, not a remote attack path. | | Python swarm | `terrad` tx JSON (`txhash`) | `_poll_tx_inclusion` → `terrad query tx` argv list | Malformed JSON retries instead of treating success; `tx_response.code` checked. `txhash` passed as a single argv element (no shell injection). | | Bootstrap / LP | On-chain tx failure | `main_async` exit / worker logging | Failures propagate as stderr + exit 1 / skipped success logs — QA observability only. | | TS swarm | `profiles.json` weights | Localnet action picker | Config-only rebalance; no new network or secret handling. | **Security review: no medium+ findings on this diff.**
ghost1 commented 2026-06-05 10:25:07 +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 d70ef86601. 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=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9BTExfSU5fQ1VSU09SIiwiZGF0YSI6eyJyZWRpc0tleSI6ImJ1Z2JvdC1tdWx0aTpkNWUwNmM4Zi03ODJmLTQxMTYtYjg5NS0zMmQwZjU0Y2JiMTQiLCJlbmNyeXB0aW9uS2V5IjoiaWJwc1V1UU1mOWp0bndWdW1tcEtvS3cyZkVIdVppYlNDVGdzRmp1bW10QSIsImJyYW5jaCI6ImN1cnNvci9naXRsYWItaXNzdWUtd29ya2Zsb3ctMGM4ZiIsInJlcG9Pd25lciI6IlBsYXN0aWNEaWdpdHMiLCJyZXBvTmFtZSI6ImNsOHktZGV4LXRlcnJhY2xhc3NpYyJ9fQ" 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 d70ef866016a015fea2c42c0bd910889b885193a. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
ghost1 commented 2026-06-05 10:25:08 +00:00 (Migrated from gitlab.com)

Bootstrap top-up breaks swarm launch

High Severity

bootstrap_top_up_amounts scales both pool legs by the same factor to lift the thinner side toward target_per_side. On factory pairs seeded with a very skewed ratio (several deploy-dex-local configs, including OE-1 hub ONYX/CORAL), that forces a huge deposit on the already-large leg. provide_liquidity then fails for lack of balance, bootstrap exits non-zero, and launch-swarm.sh aborts before any workers start.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d70ef86601. Configure here.

### Bootstrap top-up breaks swarm launch **High Severity** <!-- DESCRIPTION START --> `bootstrap_top_up_amounts` scales both pool legs by the same factor to lift the thinner side toward `target_per_side`. On factory pairs seeded with a very skewed ratio (several `deploy-dex-local` configs, including OE-1 hub **ONYX/CORAL**), that forces a huge deposit on the already-large leg. `provide_liquidity` then fails for lack of balance, bootstrap exits non-zero, and `launch-swarm.sh` aborts before any workers start. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: 8726b160-e231-435d-bdc3-a8ae2f9b47e8 --> <!-- LOCATIONS START scripts/bots/swarm_liquidity.py#L64-L87 scripts/bots/bootstrap-swarm-liquidity.py#L71-L84 scripts/bots/launch-swarm.sh#L33-L37 LOCATIONS END --> <details> <summary>Additional Locations (2)</summary> - [`scripts/bots/bootstrap-swarm-liquidity.py#L71-L84`](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-//blob/d70ef866016a015fea2c42c0bd910889b885193a/scripts/bots/bootstrap-swarm-liquidity.py#L71-L84) - [`scripts/bots/launch-swarm.sh#L33-L37`](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-//blob/d70ef866016a015fea2c42c0bd910889b885193a/scripts/bots/launch-swarm.sh#L33-L37) </details> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmI5MTdmMjdlLWRmNzktNGJiOC05OGE0LTY2ZTMxODRkODE1YSIsImVuY3J5cHRpb25LZXkiOiJQQlYzYV9tT1NzOWgwVHhYeFBuaHRyb0VlY0NHVk9aanJoV19HRWk5eUd3IiwiYnJhbmNoIjoiY3Vyc29yL2dpdGxhYi1pc3N1ZS13b3JrZmxvdy0wYzhmIiwicmVwb093bmVyIjoiUGxhc3RpY0RpZ2l0cyIsInJlcG9OYW1lIjoiY2w4eS1kZXgtdGVycmFjbGFzc2ljIn19" 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=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmI5MTdmMjdlLWRmNzktNGJiOC05OGE0LTY2ZTMxODRkODE1YSIsImVuY3J5cHRpb25LZXkiOiJQQlYzYV9tT1NzOWgwVHhYeFBuaHRyb0VlY0NHVk9aanJoV19HRWk5eUd3IiwiYnJhbmNoIjoiY3Vyc29yL2dpdGxhYi1pc3N1ZS13b3JrZmxvdy0wYzhmIiwicmVwb093bmVyIjoiUGxhc3RpY0RpZ2l0cyIsInJlcG9OYW1lIjoiY2w4eS1kZXgtdGVycmFjbGFzc2ljIiwicHJOdW1iZXIiOjY1LCJjb21taXRTaGEiOiJkNzBlZjg2NjAxNmEwMTVmZWEyYzQyYzBiZDkxMDg4OWI4ODUxOTNhIiwicHJvdmlkZXIiOiJnaXRsYWIiLCJob3N0bmFtZSI6ImdpdGxhYi5jb20ifX0" 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 d70ef866016a015fea2c42c0bd910889b885193a. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
ghost1 commented 2026-06-05 10:34:23 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 0acc4920 - fix(bots): skip skewed bootstrap top-up when only one leg is below floor

Compare with previous version

added 1 commit <ul><li>0acc4920 - fix(bots): skip skewed bootstrap top-up when only one leg is below floor</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/65/diffs?diff_id=1836465734&start_sha=d70ef866016a015fea2c42c0bd910889b885193a)
ghost1 commented 2026-06-05 10:34:36 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
PlasticDigits commented 2026-06-05 10:35:40 +00:00 (Migrated from gitlab.com)

Security review (automated)

Commit reviewed: 0acc492055504d2fee51e29a38225f513fa1a0c8
Scope: MR !783 diff vs main (531d00e → 0acc492): LocalTerra QA swarm LP workers + bootstrap (scripts/bots/swarm.py, swarm_liquidity.py, bootstrap-swarm-liquidity.*, launch-swarm.sh), Makefile targets, docs, and @cl8y-dex/localnet-trading-swarm profiles.json weight rebalance (#293).

Outcome: FINDINGS: 0 medium+

Inline threads: None (no exploitable issues on added/modified paths).

Summary

Re-read prior automated reviews (fc62c1fc, 499beaa1, 31a5143, d70ef866) and Bugbot diff threads (LP env floor, stale reserves, thin-pool recovery, tx polling, bootstrap/LP false-success logging, skewed-pair top-up). Those items are functional QA / correctness for local pool depth and bot observability, not authn/authz or injection bugs.

Commit 0acc492 skips proportional bootstrap top-up when only one pool leg is below the floor (skewed factory pairs like ONYX/CORAL). This avoids provide_liquidity balance failures and launch-swarm.sh aborts — a launch reliability fix with no new attacker-controlled sink.

Surface Input Sink Verdict
Python swarm TERRA_LCD_URL / DEX_TERRA_LCD_PORT urllib.request.urlopen LCD queries Operator-local dev tooling; pre-existing trust model unchanged. No new remote SSRF surface.
Python swarm LCD JSON (reserves, token/pair addrs) terrad tx wasm execute via create_subprocess_exec (no shell) Factory pair list filtered to terra1…; amounts are computed ints serialized with json.dumps. Malicious LCD requires operator misconfiguration, not a remote attack path.
Python swarm terrad tx JSON (txhash) _poll_tx_inclusion → terrad query tx argv list Malformed JSON retries instead of treating success; tx_response.code checked. txhash passed as a single argv element (no shell injection).
provide_liquidity_pair computed amounts CW20 increase_allowance (spender = on-chain pair addr) + pair provide_liquidity Standard localnet LP flow; hardcoded --from test1, --chain-id localterra, LocalTerra docker exec.
Bootstrap / LP On-chain tx failure main_async exit / worker logging Failures propagate as stderr + exit 1 / skipped success logs — QA observability only.
TS swarm profiles.json weights Localnet action picker Config-only rebalance; no new network or secret handling.

Security review: no medium+ findings on this diff.

## Security review (automated) **Commit reviewed:** `0acc492055504d2fee51e29a38225f513fa1a0c8` **Scope:** MR !783 diff vs `main` (`531d00e` → `0acc492`): LocalTerra QA swarm LP workers + bootstrap (`scripts/bots/swarm.py`, `swarm_liquidity.py`, `bootstrap-swarm-liquidity.*`, `launch-swarm.sh`), Makefile targets, docs, and `@cl8y-dex/localnet-trading-swarm` `profiles.json` weight rebalance (#293). **Outcome:** `FINDINGS: 0` medium+ **Inline threads:** None (no exploitable issues on added/modified paths). ### Summary Re-read prior automated reviews (`fc62c1fc`, `499beaa1`, `31a5143`, `d70ef866`) and Bugbot diff threads (LP env floor, stale reserves, thin-pool recovery, tx polling, bootstrap/LP false-success logging, skewed-pair top-up). Those items are **functional QA / correctness** for local pool depth and bot observability, not authn/authz or injection bugs. Commit `0acc492` skips proportional bootstrap top-up when only one pool leg is below the floor (skewed factory pairs like ONYX/CORAL). This avoids `provide_liquidity` balance failures and `launch-swarm.sh` aborts — a launch reliability fix with no new attacker-controlled sink. | Surface | Input | Sink | Verdict | |---------|-------|------|---------| | Python swarm | `TERRA_LCD_URL` / `DEX_TERRA_LCD_PORT` | `urllib.request.urlopen` LCD queries | Operator-local dev tooling; pre-existing trust model unchanged. No new remote SSRF surface. | | Python swarm | LCD JSON (reserves, token/pair addrs) | `terrad tx wasm execute` via `create_subprocess_exec` (no shell) | Factory pair list filtered to `terra1…`; amounts are computed ints serialized with `json.dumps`. Malicious LCD requires operator misconfiguration, not a remote attack path. | | Python swarm | `terrad` tx JSON (`txhash`) | `_poll_tx_inclusion` → `terrad query tx` argv list | Malformed JSON retries instead of treating success; `tx_response.code` checked. `txhash` passed as a single argv element (no shell injection). | | `provide_liquidity_pair` | computed amounts | CW20 `increase_allowance` (spender = on-chain pair addr) + pair `provide_liquidity` | Standard localnet LP flow; hardcoded `--from test1`, `--chain-id localterra`, LocalTerra docker exec. | | Bootstrap / LP | On-chain tx failure | `main_async` exit / worker logging | Failures propagate as stderr + exit 1 / skipped success logs — QA observability only. | | TS swarm | `profiles.json` weights | Localnet action picker | Config-only rebalance; no new network or secret handling. | **Security review: no medium+ findings on this diff.**
ghost1 commented 2026-06-05 10:58:07 +00:00 (Migrated from gitlab.com)

mentioned in commit 69ef728323

mentioned in commit 69ef72832393b14fa01540fc9d90b6e36252fc10
ghost1 commented 2026-06-05 10:58:08 +00:00 (Migrated from gitlab.com)

added 60 commits

  • 0acc4920...c0d8ad6c - 59 commits from branch main
  • 69ef7283 - Merge origin/main into cursor/gitlab-issue-workflow-0c8f

Compare with previous version

added 60 commits <ul><li>0acc4920...c0d8ad6c - 59 commits from branch <code>main</code></li><li>69ef7283 - Merge origin/main into cursor/gitlab-issue-workflow-0c8f</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/65/diffs?diff_id=1836507308&start_sha=0acc492055504d2fee51e29a38225f513fa1a0c8)
ghost1 commented 2026-06-05 10:58:24 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
PlasticDigits commented 2026-06-05 10:59:29 +00:00 (Migrated from gitlab.com)

Security review (automated)

Commit reviewed: 69ef72832393b14fa01540fc9d90b6e36252fc10
Scope: MR !783 diff vs main (c0d8ad6 → 69ef728): LocalTerra QA swarm LP workers + bootstrap (scripts/bots/swarm.py, swarm_liquidity.py, bootstrap-swarm-liquidity.*, launch-swarm.sh), Makefile targets, docs, @cl8y-dex/localnet-trading-swarm profiles.json weight rebalance (#293), and incidental formatting-only edits in PoolPage.tsx / blacklist.ts.

Outcome: FINDINGS: 0 medium+

Inline threads: None (no exploitable issues on added/modified paths).

Summary

Re-read prior automated reviews on this MR (fc62c1fc, 499beaa1, 31a5143, d70ef866, 0acc492) and Bugbot diff threads (LP env floor, stale reserves, thin-pool recovery, tx polling, bootstrap false-success, skewed-pair top-up). Those items are functional QA / correctness for local pool depth and bot observability, not authn/authz or injection bugs.

Latest head (69ef728) is a merge of origin/main into the feature branch (Makefile .PHONY conflict resolution); no new security-relevant logic beyond prior swarm LP commits.

Surface Input Sink Verdict
Python swarm TERRA_LCD_URL / DEX_TERRA_LCD_PORT urllib.request.urlopen LCD queries Operator-local dev tooling; pre-existing trust model unchanged. No new remote SSRF surface.
Python swarm LCD JSON (reserves, token/pair addrs) terrad tx wasm execute via create_subprocess_exec (no shell) Factory pair list filtered to terra1…; amounts are computed ints serialized with json.dumps. Malicious LCD requires operator misconfiguration, not a remote attack path.
Python swarm terrad tx JSON (txhash) _poll_tx_inclusion → terrad query tx argv list Malformed JSON retries instead of treating success; tx_response.code checked. txhash passed as a single argv element (no shell injection).
provide_liquidity_pair computed amounts CW20 increase_allowance (spender = on-chain pair addr) + pair provide_liquidity Standard localnet LP flow; hardcoded --from test1, --chain-id localterra, LocalTerra docker exec.
Bootstrap / LP On-chain tx failure main_async exit / worker logging Failures propagate as stderr + exit 1 / skipped success logs — QA observability only.
TS swarm profiles.json weights Localnet action picker Config-only rebalance; no new network or secret handling.
Frontend (incidental) — PoolPage.tsx, blacklist.ts Formatting-only diff; no behavior change.

Security review: no medium+ findings on this diff.

## Security review (automated) **Commit reviewed:** `69ef72832393b14fa01540fc9d90b6e36252fc10` **Scope:** MR !783 diff vs `main` (`c0d8ad6` → `69ef728`): LocalTerra QA swarm LP workers + bootstrap (`scripts/bots/swarm.py`, `swarm_liquidity.py`, `bootstrap-swarm-liquidity.*`, `launch-swarm.sh`), Makefile targets, docs, `@cl8y-dex/localnet-trading-swarm` `profiles.json` weight rebalance (#293), and incidental formatting-only edits in `PoolPage.tsx` / `blacklist.ts`. **Outcome:** `FINDINGS: 0` medium+ **Inline threads:** None (no exploitable issues on added/modified paths). ### Summary Re-read prior automated reviews on this MR (`fc62c1fc`, `499beaa1`, `31a5143`, `d70ef866`, `0acc492`) and Bugbot diff threads (LP env floor, stale reserves, thin-pool recovery, tx polling, bootstrap false-success, skewed-pair top-up). Those items are **functional QA / correctness** for local pool depth and bot observability, not authn/authz or injection bugs. Latest head (`69ef728`) is a merge of `origin/main` into the feature branch (Makefile `.PHONY` conflict resolution); no new security-relevant logic beyond prior swarm LP commits. | Surface | Input | Sink | Verdict | |---------|-------|------|---------| | Python swarm | `TERRA_LCD_URL` / `DEX_TERRA_LCD_PORT` | `urllib.request.urlopen` LCD queries | Operator-local dev tooling; pre-existing trust model unchanged. No new remote SSRF surface. | | Python swarm | LCD JSON (reserves, token/pair addrs) | `terrad tx wasm execute` via `create_subprocess_exec` (no shell) | Factory pair list filtered to `terra1…`; amounts are computed ints serialized with `json.dumps`. Malicious LCD requires operator misconfiguration, not a remote attack path. | | Python swarm | `terrad` tx JSON (`txhash`) | `_poll_tx_inclusion` → `terrad query tx` argv list | Malformed JSON retries instead of treating success; `tx_response.code` checked. `txhash` passed as a single argv element (no shell injection). | | `provide_liquidity_pair` | computed amounts | CW20 `increase_allowance` (spender = on-chain pair addr) + pair `provide_liquidity` | Standard localnet LP flow; hardcoded `--from test1`, `--chain-id localterra`, LocalTerra docker exec. | | Bootstrap / LP | On-chain tx failure | `main_async` exit / worker logging | Failures propagate as stderr + exit 1 / skipped success logs — QA observability only. | | TS swarm | `profiles.json` weights | Localnet action picker | Config-only rebalance; no new network or secret handling. | | Frontend (incidental) | — | `PoolPage.tsx`, `blacklist.ts` | Formatting-only diff; no behavior change. | **Security review: no medium+ findings on this diff.**
PlasticDigits commented 2026-06-05 11:01:51 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
PlasticDigits (Migrated from gitlab.com) merged commit 681cdfc9f9 into main 2026-06-05 11:03:49 +00:00
PlasticDigits commented 2026-06-05 11:03:50 +00:00 (Migrated from gitlab.com)

mentioned in commit 681cdfc9f9

mentioned in commit 681cdfc9f9f4c78639ba97361be00a37f102bb01
PlasticDigits commented 2026-06-05 13:09:06 +00:00 (Migrated from gitlab.com)

mentioned in merge request !807

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