AI Classifier & Agents
Fenryx ships an on-chain multi-layer perceptron (MLP) that runs once per block to classify validator behaviour. Its output drives three autonomous agents — FDM, Consensus Agent, and Routing Agent — that influence pool membership, consensus fail-safes, and tx routing in real time.
Architecture
Pools (per-block metrics)
│
▼
x/classifier ──── ONNX MLP ────► confidence score [0, 1]
│
├── FDM (Fenryx Decision Module) ──► PenaltyLevel / BAN MARK SIGN
├── Consensus Agent ──► fail-safe / emergency halt
└── Routing Agent ──► preferred pool for next tx
Classification thresholds
| Constant | Value | Meaning |
|---|---|---|
BAN_CONFIDENCE_MIN | 0.80 | Confidence required to issue a PermanentBan |
HIGH_PENALTY_THRESHOLD | 0.70 | Confidence for a Heavy penalty (below: Moderate) |
SIMILARITY_THRESHOLD | 0.60 | Zenith Pool agreement ratio below which the Consensus Agent activates the fail-safe |
FAILSAFE_HALT_AFTER_BLOCKS | 3 | Consecutive degraded rounds (~15 s at 5 s/slot) before emergency halt |
FDM (Fenryx Decision Module)
The FDM maps each validator's classifier confidence to a penalty level and decides whether to issue a BAN MARK SIGN — an ed25519-signed record broadcast over gossip.
// GET /agents/decisions
[{
"node": "frx1...",
"penalty": "PermanentBan",
"trigger_ban": true,
"reason": "ByzantineVote",
"confidence": 0.91
}]
Ban records are idempotent: re-banning an already-banned node is a no-op.
Consensus Agent
Reads the current Zenith Pool similarity ratio. If it drops below
SIMILARITY_THRESHOLD:
- The round is rolled back (IAVL commit and header construction skipped).
- A consecutive-degraded counter increments.
- After
FAILSAFE_HALT_AFTER_BLOCKSconsecutive degraded rounds the chain issues a persistent emergency halt (meta:chain_halt = true). An operator must manually clear the key and restartfenryxd.
// GET /agents/consensus
{
"similarity_ratio": 0.94,
"failsafe_active": false,
"zenith_size": 21
}
Caveat: state mutations before the fail-safe check (mempool drain, tx dispatch, FDM bans) are not rolled back. Only block finalisation is prevented.
Routing Agent
// GET /agents/routing
{
"target_pool": { "id": 2, "label": "Zenith" },
"estimated_latency_ms": 42,
"load_score": 0.31
}
Submit validator metrics
curl -X POST https://v2.rpc.fenryx.io/agents/metrics \
-H 'Content-Type: application/json' \
-d '{"node":"frx1...","cpu_pct":38.2,"latency_ms":12,"connections":44,"net_contrib":0.87}'
Endpoint reference
| Method | Path | Returns |
|---|---|---|
GET | /classifier/predict/:address | MLP confidence score |
GET | /agents/decisions | FDM decisions from last block |
GET | /agents/consensus | Consensus Agent state |
GET | /agents/routing | Routing Agent recommendation |
POST | /agents/metrics | Submit validator telemetry |