Skip to main content

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

ConstantValueMeaning
BAN_CONFIDENCE_MIN0.80Confidence required to issue a PermanentBan
HIGH_PENALTY_THRESHOLD0.70Confidence for a Heavy penalty (below: Moderate)
SIMILARITY_THRESHOLD0.60Zenith Pool agreement ratio below which the Consensus Agent activates the fail-safe
FAILSAFE_HALT_AFTER_BLOCKS3Consecutive 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:

  1. The round is rolled back (IAVL commit and header construction skipped).
  2. A consecutive-degraded counter increments.
  3. After FAILSAFE_HALT_AFTER_BLOCKS consecutive degraded rounds the chain issues a persistent emergency halt (meta:chain_halt = true). An operator must manually clear the key and restart fenryxd.
// 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

MethodPathReturns
GET/classifier/predict/:addressMLP confidence score
GET/agents/decisionsFDM decisions from last block
GET/agents/consensusConsensus Agent state
GET/agents/routingRouting Agent recommendation
POST/agents/metricsSubmit validator telemetry