PR #1126 in gonka-ai/gonka, merged 2026-05-07 by @pixelplex, restructures the devshardd daemon — the process that drives each devshard's coordination work off-chain — into a standalone build with its own Docker image, a cleaner entry point, and a Postgres-backed payload store. The change touches 71 files (+4,079 / -1,776 lines).
A devshard is a lightweight off-chain coordination unit introduced in v0.2.11. Inference requests get routed to a devshard, which handles peer-to-peer transport, threshold signing, and intermediate state — the chain only steps in for session setup and final settlement. devshardd is the daemon that runs one such unit. Until this PR it was bundled inside the larger decentralized-api image and shared its build path.
What changed
-
Standalone build. A new
devshard/Dockerfilebuildsdevsharddanddevshardctlas their own image, with the musl/CGO setup that the BLS signature libraryblstrequires. The Makefile targetdevshardd-buildnow points at this new Dockerfile, and the binary copy path moves fromdecentralized-api/build/todevshard/build/. Thedecentralized-api/Dockerfileandgo.modlose the unuseddevshardd/devshardctlbuild steps and thedevshardreplace directive — see PR #1126 for the diff. -
Entry-point decomposition. The roughly 350-line
main.gois split intoapp.go(startup wiring with a LIFOcloseStackcleanup helper),config.go(env-var loading), andchain_events.go(a thinchainEventBridgeglue type wiring the listener, bridge, and phase together). The block and escrow event fan-out moves into a newdevshard/cmd/devshardd/eventspackage, replacing a duplicate that previously lived undercommon/chain/events. -
Postgres payload store. A new
local-test-net/docker-compose.devshard-postgres.ymlbrings up apostgres:16-alpineinstance on the sharedchain-publicnetwork. The versiond compose file passesPGHOST,PGDATABASE,PGUSER, andPGPASSWORDthrough to the devshardd child process. The genesis container also exposes gRPC on0.0.0.0:9090so devshardd can reach the chain endpoint from its own container. -
Integration tests. The old
DevshardTestssuite — which exercised the in-process devshard wiring insidedecentralized-api— is removed because that wiring no longer exists. A new end-to-end test,devshardd bridge events and phases settle escrow lifecycle, drives the full escrow path through real chain events rather than direct RPC calls.
Why it matters
Splitting devshardd out of decentralized-api ends a coupling that has been awkward since v0.2.11 shipped: two daemons with different deployment shapes were forced through one Docker build, and changing one binary required rebuilding both. Operators who run devshards now get an image scoped to that workload, with fewer dependencies to track and a faster build path.
The Postgres switch is the larger operational change. The previous payload-store layout did not survive long-running devshard workloads cleanly, and the new design pushes that state into a managed database with its own compose file. For now the wiring is enabled only on the local test-net, and only on the genesis node — join1 and join2 still run without Postgres. Once the new layout stabilises there, the same compose extension becomes the model for production devshards.