Skip to content

feat: replace seid os/exec with direct sei-cosmos SDK calls#42

Merged
bdchatham merged 2 commits intomainfrom
feat/sdk-genesis-ceremony
Mar 26, 2026
Merged

feat: replace seid os/exec with direct sei-cosmos SDK calls#42
bdchatham merged 2 commits intomainfrom
feat/sdk-genesis-ceremony

Conversation

@bdchatham
Copy link
Copy Markdown
Contributor

@bdchatham bdchatham commented Mar 26, 2026

Summary

  • Refactors genesis ceremony task handlers (generate-identity, generate-gentx, assemble-genesis) to call the same internal sei-cosmos SDK functions that seid CLI commands use, instead of shelling out via os/exec
  • Adds sei-chain as a dependency (with inherited replace directives) so the sidecar can call genutil, keyring, authtypes, banktypes, stakingcli, and authclient directly
  • EVM address association implemented via raw JSON manipulation to avoid importing x/evm (which transitively pulls in wasmvm and breaks CGO_ENABLED=0)
  • Unblocks removing the seid binary copy from the controller's init container

SDK function parity

Operation seid CLI path seictl now calls
Identity genutil.InitializeNodeValidatorFilesFromMnemonic Same
Keys keyring.NewMnemonic Same
Add account authtypes.UnpackAccountsSanitizeGenesisAccountsPackAccounts Same
Gentx stakingcli.BuildCreateValidatorMsgauthclient.SignTx Same
Collect genutil.GenAppStateFromConfig Same

Test plan

  • go build ./... passes
  • CGO_ENABLED=0 go build passes
  • go test ./... — all 8 packages pass
  • Deploy to staging and run a genesis ceremony end-to-end
  • Compare genesis.json output between old (os/exec) and new (SDK) paths
  • Verify validators can produce blocks with the assembled genesis

…is ceremony

Refactor the three genesis ceremony task handlers to call the same
internal sei-cosmos functions that seid uses, eliminating the need to
shell out to the seid binary via os/exec.

- generate-identity: calls genutil.InitializeNodeValidatorFilesFromMnemonic
  and tmcfg.WriteConfigFile directly (replaces seid init)
- generate-gentx: calls keyring.NewMnemonic, authtypes.SanitizeGenesisAccounts,
  stakingcli.BuildCreateValidatorMsg, and authclient.SignTx directly
  (replaces seid keys add + seid add-genesis-account + seid gentx)
- assemble-genesis: calls genutil.GenAppStateFromConfig directly
  (replaces seid collect-gentxs)

Adds sei-chain as a dependency with inherited replace directives for
forked transitive deps. EVM address association is handled via raw JSON
to avoid importing x/evm (which pulls in wasmvm and breaks CGO_ENABLED=0).

This unblocks removing the seid binary copy from the controller's init
container and the PATH override from the sidecar container spec.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bdchatham bdchatham marked this pull request as ready for review March 26, 2026 21:14
The Docker build requires a complete go.sum with all indirect
dependencies resolved. Also fixes gofmt formatting in generate_gentx.go.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bdchatham added a commit to sei-protocol/sei-k8s-controller that referenced this pull request Mar 26, 2026
The seictl sidecar no longer shells out to seid for genesis ceremony
operations (sei-protocol/seictl#42). Remove the init container binary
copy and the PATH env var override that existed solely to make seid
accessible from the sidecar's filesystem.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bdchatham bdchatham merged commit 9361029 into main Mar 26, 2026
2 checks passed
@bdchatham bdchatham deleted the feat/sdk-genesis-ceremony branch March 26, 2026 21:21
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