What Is PR #813?
Pull Request #813 is the upgrade proposal for Gonka v0.2.11. Submitted by developer patimen on February 27, 2026, it bundles 15+ changes into a single on-chain software upgrade. The PR is currently open for community review before an on-chain governance vote.
Unlike a typical patch release, v0.2.11 introduces a fundamental architectural shift: Inference Shards (subnets) — a new off-chain inference protocol that moves the network closer to a scalable Layer 2 model for AI compute.
The Core Problem: On-Chain Bottleneck
Every AI inference on Gonka currently requires on-chain transactions. The mainnet caps out at roughly 277 inferences per second — a hard ceiling imposed by block space and state growth. Batching helps, but each request still adds computation and storage load. For a network aiming to handle hundreds of thousands of inferences, this architecture hits a wall.
The Solution: Inference Shards (Subnets)
The headline feature, introduced via PR #877, redesigns the inference flow entirely. Instead of one transaction per inference, the chain now handles only two transactions per session:
- MsgCreateSubnetEscrow — the user locks GNK tokens in escrow. The chain assigns a subgroup of 16 hosts via weighted random sampling.
- MsgSettleSubnetEscrow — at session end, the user submits a final state signed by a supermajority (2/3+ slot-weighted) of hosts. Hosts get paid proportionally, the user gets the remainder back.
Everything in between — the actual inference requests — happens off-chain, directly between the user and the subnet hosts over HTTP.
How It Works Step by Step
The user acts as the sequencer: ordering transactions, propagating state to hosts, and initiating settlement. This is not altruistic — unresolved inferences lock escrow balance, and unrecorded host work reduces the user's refund.
The subnet module (/subnet/) runs as a standalone package with no Cosmos SDK dependencies. It implements:
- A state machine tracking each inference through 7 states: pending, started, finished, challenged, validated, invalidated, timed_out
- 8 off-chain message types: MsgStartInference, MsgConfirmStart, MsgFinishInference, MsgTimeoutInference, MsgValidation, MsgValidationVote, MsgRevealSeed, MsgFinalizeRound
- SQLite WAL storage for append-only diff logs
- Gossip protocol with K-fanout nonce propagation for state sync between hosts
- secp256k1 signatures via go-ethereum/crypto for all operations
- Deterministic proto serialization for verifiable state roots
Escrow Accounting
Each inference is individually tracked. When an inference starts, the system reserves (input_length + max_tokens) * token_price from the escrow. When it finishes, actual cost is computed from real token counts and the surplus is released. Timeouts release the full reservation.
Probabilistic Validation
Not every inference is validated — that would defeat the purpose of moving off-chain. Instead, each host derives a deterministic seed by signing the escrow ID, and a ShouldValidate function computes per-inference probability from this seed. Seeds are revealed during a mandatory finalizing round before settlement, making compliance verifiable after the fact.
Settlement Proof
The state root is SHA256(host_stats_hash || rest_hash || phase_byte), where rest_hash covers balance, inference hashes, and warm key bindings. Settlement requires 2/3+1 slot-weighted secp256k1 signatures. The chain recomputes the hash, verifies signatures, and distributes payments.
Performance Improvements
Beyond subnets, v0.2.11 includes significant on-chain optimizations:
- PR #812 — Reduces unnecessary state writes in StartInference and FinishInference, cutting per-block execution overhead
- PR #779 — Eliminates redundant signature verification in the inference message path
- PR #874 — Adds transient caching for MsgValidation and MsgClaimRewards hot paths, plus state pruning support
These are not cosmetic changes. Together with subnets, they address the block execution stability issues that emerged as network load increased.
Security and Collateral Fixes
- PR #822 — Applies CertiK audit fixes to the BLS module, addressing threshold-validation and duplicate-slot handling in distributed key generation
- PR #868 — Reworks slashing to base penalties on required collateral rather than total deposited amount. Hosts who over-deposit are no longer disproportionately punished
- PR #888 — Fixes reward calculation for undercollateralized miners
- PR #775 — Redirects slashed coins to governance-controlled destinations instead of burning
- PR #675 — Updates CometBFT to v0.38.21, patching security advisory CSA-2026-001
New Capabilities
- PR #814 — IBC Trade Support: governance-controlled trading of approved IBC-denominated assets, with updated community sale and liquidity pool contracts
- PR #760 — Unified Permissions: consolidates message-permission checks across the inference module, removing duplicated authorization logic
- PR #835 — Batch Transfer With Vesting support
- PR #867 — Fixes the application.db bloat issue that affected many participants
Migration Details
The on-chain migration:
- Disables ClaimValidationEnabled in ValidationParams
- Rebuilds active participant caches for current and previous epochs
- Migrates epoch-group validations to a new entry-based format
- Runs community-sale CosmWasm contract migration
Existing hosts are not required to upgrade their API and node containers immediately. Updated versions target new hosts joining after the on-chain upgrade completes.
Conservative Rollout
Inference Shards launch with strict guardrails:
- Allowlist-only access via AllowedCreatorAddresses parameter
- Group size: 16 slots per escrow
- Escrow bounds: 5-10 GNK
- Maximum 100 escrows per epoch
- Unsettled escrows pruned after 2 epochs
The team plans to test on mainnet, resolve issues, and remove restrictions in v0.2.12 or v0.2.13.
Open Questions
The PR description explicitly lists unresolved items: - Subnet host_stats do not yet feed into the PoC reputation system or block rewards - Adversarial edge cases (user-host collusion, strategic timeout abuse) need formal analysis - Timeout flows need end-to-end integration testing under real network conditions - Token pricing is flat per session — dynamic pricing is planned - BLS signature aggregation would reduce settlement transaction size
Bug Bounties
The PR proposes 80,250 GNK in bounties across 18 contributions, including security reports (vLLM 502 exploit, dust transaction vulnerability, Remote DoS, State Bloat DoS, bridge address parsing), bug fixes, and release management. Notable payouts: 12,000 GNK for vLLM 0.15.1 integration, 7,500 GNK for application.db bloat fix.
Why It Matters
v0.2.11 is not an incremental update. The subnet architecture transforms Gonka from a single-chain inference network into a sharded system where the main chain handles consensus and economics while lightweight sub-chains handle the actual AI workload. Combined with CertiK audit fixes, performance optimizations, and IBC trading support, this release prepares the network for significantly higher throughput — and positions Gonka's architecture closer to the "many shards, one settlement layer" model that has proven effective in other blockchain ecosystems.