feat: genesis ceremony client types and /v0/node-id endpoint#40
Merged
feat: genesis ceremony client types and /v0/node-id endpoint#40
Conversation
Add client-side task builder types and server endpoint needed by the sei-k8s-controller genesis ceremony flow. Client types (sidecar/client/tasks.go): - GenerateIdentityTask: creates validator keys and node ID - GenerateGentxTask: creates gentx with self-funded account balance - UploadGenesisArtifactsTask: uploads identity + gentx to S3 - AssembleAndUploadGenesisTask: assembles final genesis from per-node artifacts Server endpoint (sidecar/server/server.go): - GET /v0/node-id: derives Tendermint node ID from node_key.json using CometBFT-compatible SHA256(ed25519_pubkey)[:20] derivation Client method (sidecar/client/client.go): - GetNodeID(): queries /v0/node-id for controller peer collection - Store baseURL and doer on SidecarClient for direct HTTP calls outside the OpenAPI-generated client
- Add exported TaskType constants for genesis ceremony task types (TaskTypeGenerateIdentity, TaskTypeGenerateGentx, TaskTypeUploadGenesisArtifacts, TaskTypeAssembleGenesis) - Use constants from TaskType() methods instead of raw strings - Remove section divider comment (CLAUDE.md: no decoration comments) - Name Ed25519 key size magic numbers in handleNodeID
7b8ef28 to
234f602
Compare
Cover handleNodeID server handler (real Ed25519 key via writeTestNodeKey helper) and GetNodeID client method (OK, server error, empty response).
bdchatham
added a commit
to sei-protocol/sei-k8s-controller
that referenced
this pull request
Mar 25, 2026
Add group-level genesis ceremony support to SeiNodeGroup and per-node genesis configuration to SeiNode/ValidatorSpec. The node controller builds the full Init plan upfront (no deferred steps) and the group controller coordinates assembly, peer collection, and static peer injection. New CRD types: GenesisCeremonyConfig, GenesisCeremonyNodeConfig, GenesisS3Destination, GenesisS3Source. New group status fields: AssemblyPlan, GenesisHash, GenesisS3URI. Depends on seictl genesis ceremony client types (sei-protocol/seictl#40).
6 tasks
bdchatham
added a commit
to sei-protocol/sei-k8s-controller
that referenced
this pull request
Mar 26, 2026
…ner packages (#26) * feat: genesis ceremony controller orchestration Add group-level genesis ceremony support to SeiNodeGroup and per-node genesis configuration to SeiNode/ValidatorSpec. The node controller builds the full Init plan upfront (no deferred steps) and the group controller coordinates assembly, peer collection, and static peer injection. New CRD types: GenesisCeremonyConfig, GenesisCeremonyNodeConfig, GenesisS3Destination, GenesisS3Source. New group status fields: AssemblyPlan, GenesisHash, GenesisS3URI. Depends on seictl genesis ceremony client types (sei-protocol/seictl#40). * chore: regenerate deepcopy for genesis ceremony types * fix: resolve lint issues in genesis ceremony code - Fix gofmt alignment in SeiNodeGroupPhase and genesis constants - Fix goimports grouping (seictl is external, not local) - Replace interface{} with any (modernize) - Remove deprecated result.Requeue usage - Suppress unused params in pollAssemblyTask stub (PR-3) * refactor: simplify group lifecycle and rename AssemblyPlan to InitPlan - Remove GroupPhaseGenesisCeremony — genesis work runs during the existing Initializing phase, keyed off spec.genesis != nil - Rename AssemblyPlan to InitPlan for consistency with node-level naming and to avoid scoping the field to assembly-only workloads - Move design docs from tide/ to .tide/, remove tide/ and docs/ * refactor: remove genesis PreInit, merge all tasks into InitPlan Remove the genesis-specific PreInit Job (sleep infinity + copy-seid), handleGenesisPreInitComplete, and all isGenesisCeremonyNode branches in pre_init.go and job.go. Genesis nodes now skip PreInit entirely. The full genesis InitPlan includes: generate-identity, generate-gentx, upload-genesis-artifacts, await-genesis-assembly (barrier), then the standard configure-genesis, config-apply, discover-peers, config-validate, mark-ready sequence. WIP: executePlan still uses the old submit/poll model. Next step is the TaskExecutionInterface refactor to support the await barrier natively. * refactor: extract task execution into internal/task and internal/planner packages Restructure the task execution architecture to make tasks self-contained with embedded parameters and deterministic IDs, eliminating the need for planners at execution time. Key changes: - Create internal/task/ package with TaskExecution interface, SidecarClient interface, Deserialize factory, and domain-grouped param types (bootstrap, config, genesis) - Create internal/planner/ package with NodePlanner interface, per-mode planners (validator, full, archive, replay), bootstrap plan builders, and stateless Executor - PlannedTask CRD gains ID (deterministic UUID v5) and Params (apiextensionsv1.JSON), drops TaskID and PlannedTaskSubmitted - Executor uses task.Deserialize + Status/Execute pattern with MergeFromWithOptimisticLock for all status patches - Remove sync.Map from SeiNodeReconciler, wire planner.Executor - Delete 7 files from controller/node/, net reduction of ~400 lines * fix: resolve CI failures — bump seictl to v0.0.21, define await-genesis-assembly locally - Upgrade seictl dependency from v0.0.20 to v0.0.21 to pick up genesis ceremony client types (GenerateIdentity, GenerateGentx, etc.) - Define TaskTypeAwaitGenesisAssembly as a local constant since it is a controller-managed task with no sidecar handler - Suppress deprecated GetEventRecorderFor warnings surfaced by transitive dependency update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GenerateIdentityTask,GenerateGentxTask,UploadGenesisArtifactsTask,AssembleAndUploadGenesisTask) implementing theTaskBuilderinterface for controller-side plan constructionGET /v0/node-idserver endpoint that derives the Tendermint node ID fromnode_key.jsonusing CometBFT-compatibleSHA256(ed25519_pubkey)[:20]GetNodeID()client method for the controller to collect node IDs during peer assemblySidecarClientto storebaseURLanddoerfor direct HTTP calls outside the OpenAPI-generated clientThese are the seictl-side prerequisites for the network deployment genesis ceremony feature in sei-k8s-controller. Task handlers (the actual
generate-identity,generate-gentx, etc. implementations) will follow in a subsequent PR.Design decisions
AccountBalanceis a single string (e.g."1000000usei,1000000uusdc"), not a list of address+amount pairs. Each node discovers its own address during identity generation -- no cross-node coordination needed between the identity and gentx steps./v0/node-idis outside the OpenAPI spec since it is a simple read from disk, not a task. The client uses a direct HTTP call rather than the generated client.hex(SHA256(ed25519_pubkey)[:20]), reading the 32-byte public key from the last half of the 64-byte Ed25519 private key innode_key.json.Test plan
NewServercalls to includehomeDir)go build ./...cleanToTaskRequest()output matches expected wire format