[{"name":"ETH_RPC_URL","prompt":"0G Chain RPC URL","help":"Default: https://evmrpc-testnet.0g.ai","required_for":"reading onchain state"},{"name":"PRIVATE_KEY","prompt":"Verifier private key","help":"Private key of an authorized verifier node","required_for":"submitting onchain verdicts"}]
Weft Milestone Verification
When to Use
User asks to verify a milestone
User provides a milestone hash (0x...)
User asks to run the verification pipeline
Procedure
1. Check milestone state
cd
ETH_RPC_URL=
WEFT_CONTRACT_ADDRESS=
python3 -c
"$WEFT_ROOT"
export
"https://evmrpc-testnet.0g.ai"
export
"0x9f66158c560ce5c8b40820fdcd2874ff8d852192"
"
import time
from agent.lib.jsonrpc import JsonRpcClient
from agent.lib.weft_milestone_reader import read_milestone
rpc = JsonRpcClient('$ETH_RPC_URL')
m = read_milestone(rpc, '$WEFT_CONTRACT_ADDRESS', '<MILESTONE_HASH>')
now = int(time.time())
if m.finalized:
print('Already finalized. Verified:', m.verified)
elif now < m.deadline:
remaining = m.deadline - now
print(f'Too early. Deadline in {remaining // 60} minutes.')
else:
print('Ready for verification. Deadline passed.')
print(f'Staked: {int(m.totalStaked) / 1e18} ETH')
print(f'Builder: {m.builder}')
print(f'Deadline: {m.deadline}')
print(f'Finalized: {m.finalized}')
print(f'Verified: {m.verified}')
"
2. Run verification (standard path)
The daemon resolves template inputs from the milestone's onchain metadataHash via 0G Storage. Requires 0g-storage-client binary on PATH and a working 0G indexer.
3. Direct fallback (when 0G storage is unavailable)
When the 0G indexer returns 503 or 0g-storage-client is not installed, the daemon can't derive template inputs (contract address, window, threshold) from metadata. Use cast send submitVerdict() directly as an escape hatch.
This bypasses evidence collection and peer consensus, but marks the milestone as verified onchain and populates the evidence root.
On success, the milestone shows verified=true on the status API and frontend immediately. The transaction log includes the didComplete=true flag and evidence root.
4. Report result
After verification, always present the result as a clean report:
Contract address defaults: The WeftMilestone contract on 0G Chain (chain 16602) is 0x9f66158c560ce5c8b40820fdcd2874ff8d852192. Do NOT use the Base Sepolia address (0xcc768d...) which is deployed on a different chain.
Gas price too low: 0G testnet enforces a minimum. Use --legacy --gas-price 3000000000 (3 gwei). --gas-price 2000000000 may be rejected despite matching the minimum.
EIP-1559 mismatch: 0G testnet rejects EIP-1559 transactions where maxPriorityFeePerGas > maxFeePerGas. Always use --legacy flag.
Not an authorized verifier: The address must be registered in VerifierRegistry for the standard daemon path. The cast send fallback does NOT check authorization — any key can submit a verdict if the contract allows it. Verify the contract's access control before using the fallback.
Too early: Can't submit verdict before deadline. Check now < deadline first.
count_unique_callers is slow: Use --unique-caller-threshold 1 for fast demos in the standard path.
0G storage unavailable: If the Turbo indexer at https://indexer-storage-testnet-turbo.0g.ai is temporarily down, or 0g-storage-client is missing, use the direct cast send fallback.
Metadata leaves no fallback path: The daemon's _process_one() exits silently when metadata download fails and no CLI overrides are provided. It logs the error but returns with no onchain action. If you see the daemon exit code 0 with only the startup log line, this is why.
Evidence generation only works when the milestone's contract address is known. The standard daemon path checks deployment (eth_getCode) and usage (count_unique_callers). The cast send fallback skips these checks entirely — it marks the milestone verified without verifying the deliverable. Use the fallback only for demo/emergency scenarios where the evidence was already manually confirmed.
After the verdict lands, the weftEarnedTotal in the ENS passport may still show 0 until the capital is actually released via the release path. The verdict only marks the milestone as verified — separate transactions handle capital movement.