You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/shadow-testing/README.md
+162Lines changed: 162 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -305,6 +305,60 @@ Proving status values:
305
305
- If you have system PostgreSQL on 5432, use 5433 for shadow DB (already configured).
306
306
- Ensure all configs use the correct port.
307
307
308
+
### Multi-GPU prover cache conflicts
309
+
When running multiple prover instances on the same machine, the shared `.work/galileo` cache directory can cause `File exists (os error 17)` conflicts if two provers write the same temp file simultaneously.
310
+
311
+
**Mitigation**: Ensure each prover has its own work directory, or symlink `.work/galileo` to a shared read-only cache while giving each instance a distinct write directory. Example launch script:
If coordinator is actively assigning chunk/batch tasks but never assigns bundle tasks, the most likely cause is **orphan bundles** — bundle records whose corresponding batch data no longer exists in the shadow DB.
322
+
323
+
**Diagnosis**:
324
+
```sql
325
+
-- Count bundles with no linked batches
326
+
SELECTCOUNT(*) FROM bundle b
327
+
WHERE NOT EXISTS (
328
+
SELECT1FROM batch bat
329
+
WHEREbat.index BETWEEN b.start_batch_indexANDb.end_batch_index
330
+
);
331
+
```
332
+
333
+
**Root cause**: The bundle table often retains historical records from production (e.g., batch 308516+) while the batch table only holds recently imported batches (e.g., 517760+). Coordinator's `GetUnassignedBundle` picks the lowest-index bundle with `batch_proofs_status = 2`, finds it has no batches, and fails silently in a loop.
334
+
335
+
**Fix**:
336
+
```sql
337
+
UPDATE bundle
338
+
SET batch_proofs_status =1
339
+
WHERE index NOT IN (
340
+
SELECT DISTINCTb.index
341
+
FROM bundle b
342
+
JOIN batch bat ONbat.index BETWEEN b.start_batch_indexANDb.end_batch_index
343
+
);
344
+
```
345
+
346
+
### DB data inconsistency after import
347
+
If imported chunks have `proving_status = 2` (assigned) but `proof = NULL`, coordinator may incorrectly set `batch.chunk_proofs_status = 2` and then fail when formatting batch tasks.
348
+
349
+
**Fix**:
350
+
```sql
351
+
UPDATE chunk SET proving_status =1, total_attempts =0, active_attempts =0
**Dry-run gas estimation skip**: Anvil may fail `EstimateGas` on blob transactions or missing functions. A small patch to `rollup/internal/controller/sender/estimategas.go` skips gas estimation in dry-run mode:
1.**L1 messages**: If chunks contain L1 messages, the prover needs `scroll_getL1MessagesInBlock` RPC support. Most public RPCs don't expose this. Workaround: select chunks/blocks with no L1 messages, or use an internal RPC. In non-validium mode, the prover does not call this RPC at all.
@@ -372,6 +497,43 @@ For **full end-to-end** validation (including signature + receipt), use **Anvil*
372
497
373
498
4.**Circuit download**: First prover run downloads ~5-10GB of circuit assets. Ensure good internet.
374
499
500
+
5.**Bundle vs batch count mismatch**: The shadow DB's `bundle` table may contain 10,000+ historical records while `batch` only holds ~500 recent ones. This is expected when importing production data — the bundle table retains full history but batches are truncated. **Crucially**, orphan bundles (those with no matching batches) must have `batch_proofs_status = 1` or coordinator will deadlock trying to prove them. See "Bundle proving never starts" in Troubleshooting.
501
+
502
+
## Common DB Fixes
503
+
504
+
After importing production data or running for extended periods, these SQL fixes resolve common coordinator deadlocks:
505
+
506
+
### 1. Reset proving status after import
507
+
```sql
508
+
UPDATE chunk SET proving_status =1, total_attempts =0, active_attempts =0;
0 commit comments