Skip to content

feat: genesis ceremony task handlers and deterministic task IDs#41

Merged
bdchatham merged 3 commits intomainfrom
feat/genesis-task-handlers
Mar 26, 2026
Merged

feat: genesis ceremony task handlers and deterministic task IDs#41
bdchatham merged 3 commits intomainfrom
feat/genesis-task-handlers

Conversation

@bdchatham
Copy link
Contributor

Summary

  • Genesis task handlers: Implements the four sidecar task handlers needed for genesis ceremony orchestration:
    • generate-identity — runs seid init to create validator keys and node identity
    • generate-gentx — three-step pipeline: keys addadd-genesis-accountgentx
    • upload-genesis-artifacts — uploads gentx and identity manifest to S3 per-node
    • assemble-and-upload-genesis — downloads all node gentxs from S3, runs collect-gentxs, uploads assembled genesis.json
  • Deterministic task IDs: Engine now accepts caller-provided UUIDs for idempotent task submission with deduplication. ErrInvalidTaskID sentinel for non-UUID IDs. TaskMeta struct embedded in all 16 client task types for ID propagation.
  • Client ergonomics: Typed Submit*Task convenience methods on SidecarClient for all four new genesis tasks. CommandRunner abstraction for testable seid CLI invocations.

Test plan

  • generate-identity: seid init args, idempotency via marker, missing params, seid failure
  • generate-gentx: full 3-step flow, idempotency, missing params, keys add failure
  • upload-genesis-artifacts: gentx + identity upload, idempotency, missing params, no gentx file
  • assemble-and-upload-genesis: full flow with S3 mock, idempotency, missing params, S3 download failure, collect-gentxs failure
  • Engine: caller-provided ID, invalid ID validation (ErrInvalidTaskID), dedup active/completed/scheduled
  • Server: HTTP-level invalid ID → 400, dedup returns existing ID
  • Full test suite passes (go test ./...)

Implement the four sidecar task handlers needed for genesis ceremony:
- generate-identity: runs seid init to create validator keys
- generate-gentx: keys add + add-genesis-account + gentx pipeline
- upload-genesis-artifacts: uploads gentx and identity manifest to S3
- assemble-and-upload-genesis: downloads all gentxs, collect-gentxs, uploads final genesis

Also adds deterministic caller-provided task IDs with deduplication:
- Engine validates IDs as UUIDs (ErrInvalidTaskID sentinel)
- Idempotent submission when an ID already exists
- TaskMeta embedded in all 16 client task structs for ID propagation
- OpenAPI spec updated with optional id field on TaskRequest

Includes typed Submit* convenience methods on SidecarClient for all
four new task types, CommandRunner abstraction for testable seid
invocations, and comprehensive test coverage across engine, server,
and task handler layers.
@bdchatham bdchatham marked this pull request as ready for review March 26, 2026 13:10
@bdchatham bdchatham merged commit 0cd97d8 into main Mar 26, 2026
2 checks passed
@bdchatham bdchatham deleted the feat/genesis-task-handlers branch March 26, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant