- Rust engine: real bootstrap/wiring preflight (guardrail-agent), execution layer (retry/router/pre-trade/post-trade/reconciliation), guardrail-doctor diagnostics with allowlist-drift guard. - guardrail-cli: extracted pure helpers into util.rs (split in progress). - 6 Track-2 skills + ensemble; python-lab analytics (regime/drawdown/montecarlo/dossier/ensemble/journal/seed); clients (ts/py/go/mcp/langchain/web-lite/proof-verifier); alert relay; scenarios; helm/k8s/compose; docs. - dashboard/vercel.json + docs/VERCEL_DEPLOY.md for Vercel deployment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Voter example
A whitelisted voter participates in ERC-8183's optimistic policy by casting
voteReject on jobs the client has disputed. Voters cannot approve —
silence past the dispute window is implicit approval.
Lifecycle from the voter's point of view
- A client calls
policy.dispute(jobId)withindisputeWindowseconds of submit. watch.pydetects theDisputedevent, downloads theDeliverableManifestfrom IPFS, verifies the on-chain hash, and prints the deliverable content.- Voter reviews and presses
rto reject. voteReject(jobId)is sent on-chain, emitting aVoteCastevent.watch.pydetectsVoteCast. WhenrejectVotes >= voteQuorum, it automatically callsrouter.settle(jobId)— no manual settle step needed.
What's in this directory
| File | Purpose |
|---|---|
watch.py |
Event-driven loop: watches Disputed + VoteCast, reviews IPFS manifests, prompts to vote, settles automatically once rejectVotes >= voteQuorum |
vote_reject.py |
One-shot voteReject on a specific jobId (manual fallback) |
Setup
cp .env.example .env
# Fill in VOTER_PRIVATE_KEY (an EOA whitelisted by the policy admin).
# Set RPC_URL to a reliable endpoint (e.g. NodeReal) to avoid rate limits.
.env fields:
| Variable | Required | Description |
|---|---|---|
VOTER_PRIVATE_KEY |
Yes | Whitelisted voter private key (0x…) |
NETWORK |
No | bsc-testnet (default) |
RPC_URL |
No | Override RPC (recommended — avoids default rate limits) |
STORAGE_GATEWAY_URL |
No | IPFS gateway for downloading manifests (default: Pinata) |
Usage
# Interactive watch loop (recommended)
python watch.py
# One-shot vote (manual fallback)
python vote_reject.py <jobId>
watch.py behaviour
On each poll tick (POLL_INTERVAL = 12s):
Disputedevents — for each new job: fetches theDeliverableManifestfrom IPFS (viaoptParams.deliverable_url), verifies the manifest hash against the on-chaindeliverablebytes32, and prints the response content (up to 2 000 chars). Prompts[r]eject / [s]kip.VoteCastevents — printsrejectVotes/quorumfor every vote. WhenrejectVotes >= quorum, callsrouter.settle(jobId)automatically and prints the result.
Preconditions for a successful voteReject
- Caller is a whitelisted voter (
policy.isVoter(address) == true). - Job was already disputed (
policy.disputed(jobId) == true). - Caller hasn't voted yet (
policy.hasVoted(jobId, address) == false).