Skip to content

Commit 9e3a66b

Browse files
committed
fix(7-3): filter URL format, cargo audit sync, restore Sprint-4 AC13 section
- Fix filter query param format: `?filter=data.field_gt=value` → `?data.field_gt=value` in README (5 places) and demo.sh step 6. The old `filter=` prefix was treated as an unknown IDL field, returning 400 INVALID_FILTER on every filter query. Integration tests confirm the direct-param format (`?slot_gt=...`). - Sync cargo audit --ignore list with deny.toml: add 7 missing RUSTSEC IDs (RUSTSEC-2021-0139, -2024-0375, -2021-0145, -2025-0141, -2024-0388, -2024-0436, -2025-0134) that were already acknowledged in deny.toml but absent from ci.yml, preventing spurious security-job failures on advisory-db refresh. - Restore Sprint-4 institutional-learning section to README §8 (AC13): three critical bugs found during e2e testing (IDL PDA derivation, idl_json persistence, BIGINT filter cast) with commit references and regression test names.
1 parent 23120ef commit 9e3a66b

3 files changed

Lines changed: 30 additions & 11 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,14 @@ jobs:
222222
cargo audit \
223223
--ignore RUSTSEC-2024-0344 \
224224
--ignore RUSTSEC-2022-0093 \
225-
--ignore RUSTSEC-2023-0071
225+
--ignore RUSTSEC-2023-0071 \
226+
--ignore RUSTSEC-2021-0139 \
227+
--ignore RUSTSEC-2024-0375 \
228+
--ignore RUSTSEC-2021-0145 \
229+
--ignore RUSTSEC-2025-0141 \
230+
--ignore RUSTSEC-2024-0388 \
231+
--ignore RUSTSEC-2024-0436 \
232+
--ignore RUSTSEC-2025-0134
226233
- name: cargo deny check (advisories + bans + sources — licenses is fail-soft per ADR-0002 D5)
227234
run: cargo deny check advisories bans sources
228235
- name: gitleaks

README.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ For the full architecture deep-dive, see [docs/architecture.md](docs/architectur
232232
curl -s "http://localhost:3000/api/programs/LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo/instructions/swap?limit=5" | jq
233233

234234
# Filter: swaps where amount_in > 0.001 SOL (1,000,000 lamports)
235-
curl -s "http://localhost:3000/api/programs/LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo/instructions/swap?filter=data.amount_in_gt=1000000&limit=10" | jq
235+
curl -s "http://localhost:3000/api/programs/LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo/instructions/swap?data.amount_in_gt=1000000&limit=10" | jq
236236

237237
# Time-series swap count by hour
238238
curl -s "http://localhost:3000/api/programs/LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo/instructions/swap/count?interval=hour" | jq
@@ -338,7 +338,7 @@ curl -s http://localhost:3000/api/programs/LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9Yu
338338
curl -s "http://localhost:3000/api/programs/LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo/instructions/swap?limit=5" | jq
339339

340340
# Filter: swaps with amount_in > 0.001 SOL
341-
curl -s "http://localhost:3000/api/programs/LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo/instructions/swap?filter=data.amount_in_gt=1000000&limit=10" | jq
341+
curl -s "http://localhost:3000/api/programs/LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo/instructions/swap?data.amount_in_gt=1000000&limit=10" | jq
342342

343343
# Time-series count by hour
344344
curl -s "http://localhost:3000/api/programs/LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo/instructions/swap/count?interval=hour" | jq
@@ -378,19 +378,19 @@ curl -s http://localhost:3000/metrics | grep "^solarix_"
378378

379379
### Filter Syntax
380380

381-
Append `?filter=` to any instruction or account query endpoint:
381+
Filters are appended as query parameters directly to any instruction or account query endpoint:
382382

383383
```bash
384-
?filter=data.amount_gt=1000000 # JSONB field, greater than
385-
?filter=data.authority_eq=So11111111111111111111111111111111111111112 # equals (full address)
386-
?filter=data.is_active_eq=true # boolean
387-
?filter=slot_gt=300000000 # promoted BIGINT column (no "data." prefix)
384+
?data.amount_gt=1000000 # JSONB field, greater than
385+
?data.authority_eq=So11111111111111111111111111111111111111112 # equals (full address)
386+
?data.is_active_eq=true # boolean
387+
?slot_gt=300000000 # promoted BIGINT column (no "data." prefix)
388388
```
389389

390390
Combine multiple filters with `&`:
391391

392392
```bash
393-
?filter=data.amount_in_gt=1000000&filter=data.min_amount_out_lt=5000000000
393+
?data.amount_in_gt=1000000&data.min_amount_out_lt=5000000000
394394
```
395395

396396
| Operator | Meaning |
@@ -416,7 +416,7 @@ Combine multiple filters with `&`:
416416
All errors return structured JSON:
417417

418418
```bash
419-
curl -s "http://localhost:3000/api/programs/LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo/instructions/swap?filter=nonexistent_gt=1" | jq
419+
curl -s "http://localhost:3000/api/programs/LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo/instructions/swap?nonexistent_gt=1" | jq
420420
```
421421

422422
```json
@@ -568,6 +568,18 @@ _Why:_ `governor` is fully async (no blocking), precise, and handles the ~10 RPS
568568

569569
---
570570

571+
**Sprint-4 integration testing fixed three critical bugs**
572+
573+
Real end-to-end testing against mainnet surfaced issues that 257 unit tests had not caught:
574+
575+
- **IDL PDA derivation** used `find_program_address` — Anchor v0.30 uses `create_with_seed` from a program signer. Fixed in commit `99567f2`. Regression test: `test_idl_address_derivation_matches_anchor_v030`.
576+
- **`programs.idl_json` not persisted** — the IDL was stored in memory but not written to the database, so the pipeline never auto-restarted after a container restart. Fixed in commit `797bf74`. Regression test: `test_idl_json_persisted_and_loaded_on_restart`.
577+
- **BIGINT filter cast** — promoted-column SQL filters were bound as TEXT. PostgreSQL rejected `bigint > text` at runtime. Fixed in commit `243a0de`. Regression test: `test_slot_gt_filter_uses_bigint_cast`.
578+
579+
All three have regression tests in `tests/regression_e2e_sprint4.rs` and run on every CI push.
580+
581+
---
582+
571583
## Testing
572584

573585
**Unit + Property Tests**

demo.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ run curl -sf \
138138

139139
header 6 "Filter: swaps with amount_in > 0.001 SOL (1,000,000 lamports)"
140140
run curl -sf \
141-
"$BASE_URL/api/programs/$PROGRAM_ID/instructions/$INSTRUCTION_NAME?filter=data.amount_in_gt=1000000&limit=5" | jq .
141+
"$BASE_URL/api/programs/$PROGRAM_ID/instructions/$INSTRUCTION_NAME?data.amount_in_gt=1000000&limit=5" | jq .
142142

143143
header 7 "List account types in IDL"
144144
run curl -sf "$BASE_URL/api/programs/$PROGRAM_ID/accounts" | jq .

0 commit comments

Comments
 (0)