Troubleshooting
Common issues and solutions when developing with AutoLoop.
Contract Not Being Executed
Symptom: Your contract is registered but workers aren't calling progressLoop().
Check these in order:
- Is
shouldProgressLoop()returningtrue?
cast call $YOUR_CONTRACT "shouldProgressLoop()" --rpc-url $RPC_URLIf it returns false, your readiness condition isn't met yet (e.g., not enough time has passed, game state not ready).
- Is your contract funded?
Workers skip contracts with insufficient balance. Check your balance on the dashboard or directly:
cast call $REGISTRY "getBalance(address)" $YOUR_CONTRACT --rpc-url $RPC_URLDeposit more ETH if needed. A good starting balance is 0.01–0.1 ETH depending on tick frequency.
- Is the contract registered?
cast call $REGISTRY "isRegistered(address)" $YOUR_CONTRACT --rpc-url $RPC_URL- Are workers running?
Check the status page to see active workers. If no workers are online, loops won't execute.
VRF Proofs Failing
Symptom: VRF or Hybrid VRF contract reverts with proof verification errors.
Causes:
-
Controller public key not registered. Each worker's secp256k1 public key (pkX, pkY) must be registered on the VRF contract before it can submit proofs. See Testing Guide for key derivation.
-
Wrong key registered. The pkX/pkY must correspond to the private key the worker is actually using. If you rotated keys, re-register.
-
Contract expects different VRF interface. Make sure your contract inherits the correct base:
AutoLoopVRFCompatiblefor every-tick VRFAutoLoopHybridVRFCompatiblefor selective VRF
Transaction Reverts
Symptom: Worker logs show reverted transactions.
Common causes:
| Revert Reason | Fix |
|---|---|
Insufficient balance | Deposit more ETH via dashboard or registrar.deposit() |
Not registered | Register your contract via registrar.registerAutoLoop() |
Not authorized | The calling worker isn't a registered controller |
Loop not ready | shouldProgressLoop() returned false — this is normal |
Gas limit exceeded | Your progressLoop() uses more gas than MAX_GAS (1M default). Optimize your logic or request a higher limit. |
Hybrid VRF: needsVRF Not Working
Symptom: Your Hybrid contract always gets VRF (or never gets VRF).
Check:
-
Make sure you're setting the
needsVRFflag correctly in your contract logic — workers read this flag before each tick. -
The flag must be set before the worker calls
shouldProgressLoop(). If you set it insideprogressLoop(), it's too late for the current tick.
// Correct: set flag in your game state update
function _updateGameState() internal {
turnCount++;
// Request VRF for every 10th turn
needsVRF = (turnCount % 10 == 0);
}Local Anvil Issues
Anvil won't start
Make sure no other process is using port 8545:
lsof -i :8545 # macOS/Linux
netstat -ano | findstr 8545 # WindowsWorker can't connect to Anvil
Ensure your .env points to the correct URL:
RPC_URL=http://127.0.0.1:8545
NETWORK=anvilContract deploys but worker ignores it
The worker only monitors contracts registered in the AutoLoopRegistry. Make sure you:
- Deployed the registry and registrar
- Registered your contract via the registrar
- The worker's
NETWORKenv var matches your Anvil config
Dashboard Can't Find My Contract
Symptom: Dashboard shows no contracts or can't detect your contract.
- Make sure your wallet is connected to the correct network (Mainnet or Sepolia)
- Your contract must be registered through the Registrar — the dashboard reads from the Registry
- If you just registered, wait a few seconds for the next block and refresh
Gas Costs Higher Than Expected
AutoLoop adds overhead on top of your contract's progressLoop() gas:
- Gas buffer: 94,293 gas for protocol overhead (fee calculation, access checks, event emissions)
- Base fee: 70% of total gas cost, split between protocol and controller
If your progressLoop() uses 50,000 gas, the total transaction will use approximately:
50,000 (your logic) + 94,293 (buffer) = ~144,293 gas
Total cost to contract = gas cost × 1.7 (gas + 70% base fee)To reduce costs:
- Minimize storage writes in
progressLoop() - Use events instead of storage where possible
- Consider Hybrid VRF instead of Full VRF if you don't need randomness every tick
Getting Help
- Check the status page for network health
- Review the API reference for contract interfaces
- File an issue on GitHub