feat(genesis): add Vesting field to SeiNetwork's GenesisAccount - #496
Conversation
Adds an optional Vesting field (amount, end-time, delayed) to spec.genesis.accounts[] so a genesis-time account can be seeded under a vesting schedule instead of as a plain account; nil (the default) is unchanged. Threads through the SDK's plain GenesisAccount mirror, the k8s-provider render step, and the planner's mapping into the sidecar's assemble-and-upload-genesis task params. Restores a coverage path lost when sei-chain#3714 deprecated live MsgCreateVestingAccount: constructing the vesting account directly at genesis-assembly time sidesteps that deprecation entirely, since it never goes through the msg-server tx path. Depends on sei-protocol/seictl#<vesting-genesis-accounts PR>, which adds the matching GenesisAccountVesting wire type and the actual account-construction logic. This PR is code-complete and fully tested locally against that branch (via a temporary go.mod replace, not committed), but go.mod still pins seictl v0.0.64 — bumping it to a version containing the new field is a required follow-up once that PR merges and tags, not before. CI on this PR is expected red until then.
…names Addresses xreview idiom finding (S1): the GenesisAccount.Vesting field doc becomes operator-facing via kubectl explain and the rendered CRD description, but named internal sei-chain implementation symbols (ContinuousVestingAccount, DelayedVestingAccount, MsgCreateVestingAccount) that no other field doc in GenesisCeremonyConfig references. Rewritten to describe what the operator gets (locked coins that count toward balance, can be staked, unlock linearly or all-at-once at EndTime); the type-mapping provenance stays at the seictl construction site where it belongs. Regenerated CRD manifests. No schema/deepcopy change.
xreview findings (5 independent reviewers: kubernetes-specialist [dissenter], solidity-developer, systems-engineer, security-specialist, idiomatic-reviewer)Ledger verdict: RESOLVED — every correctness-grade finding fixed or explicitly accepted. Fixes pushed to both PRs. Summary of what changed and what's deliberately deferred: Fixed in code (seictl#238 @ 51396b5, this PR @ 42bf5d2)
Deliberately accepted / deferred (with rationale)
Full ledger committed at |
…type v0.0.68 ships seictl#238's GenesisAccountVesting field that this branch's planner mapping and SDK depend on. Unblocks the previously-red CI (the draft was pinned to v0.0.64, which lacked the field). Verified locally: the seictl/sidecar/client-consuming packages build and the vesting propagation tests (TestBuildPlan_PropagatesVesting, TestRenderNetwork_PropagatesVesting) pass against the real v0.0.68.
CI's golangci-lint (--new-from-patch) flagged two goconst issues my new tests introduced: reuse the existing testAccountBalance const for the vesting amount in group_accounts_test.go, and add a shared testGenesisAddr const for the repeated "sei1abc" fixture in render_test.go. Verified with golangci-lint locally (the tool I'd skipped — ran go vet/gofmt only).
PR SummaryMedium Risk Overview The field is wired through the CRD/API ( New tests assert vesting propagates in planner and render paths and that accounts without vesting stay Reviewed by Cursor Bugbot for commit e2c3239. Bugbot is set up for automated code reviews on this repo. Configure here. |
Summary
Vestingfield (nestedGenesisAccountVesting:amount,endTime,delayed) toSeiNetwork.spec.genesis.accounts[].nil/absent is unchanged behavior — every existing caller (e.g. admin/alice/bob funding via the qa-testing nightly harness) is unaffected.api/v1alpha1/seinetwork_types.go, regenerated deepcopy + CRD YAML viamake generate manifests), the plain Go SDK type (sdk/sei/spec.go), the k8s-provider render step (sdk/sei/provider/k8s/render.go), and the planner's mapping into the sidecar task request (internal/planner/group.go).MsgCreateVestingAccount: constructing the vesting account directly at genesis-assembly time sidesteps that deprecation entirely (see companion PR below).This PR is code-complete and fully tested locally (built + tested against seictl's branch via a temporary, uncommitted
go.mod replacepointing at a local checkout — never pushed), butgo.modstill pinsgithub.com/sei-protocol/seictl v0.0.64, which doesn't have the newGenesisAccountVestingwire type /Vestingfield that seictl#238 adds. CI on this PR is expected to fail to build until that dependency is bumped.Attempted to pre-pin to seictl#238's exact commit via a pseudo-version (
go get github.com/sei-protocol/seictl@<sha>) so this PR could build standalone, but that surfaced an unrelated, pre-existinggogo/protobuf@v1.3.3module-resolution error (unknown revision v1.3.3) once MVS re-resolved transitive versions — not something introduced by this change, and not worth fixing as a side quest here.Next step once seictl#238 merges and cuts a tagged release:
go get github.com/sei-protocol/seictl@v0.0.6X && go mod tidy, confirm clean, then this PR is ready for real review/merge.Test plan
go build ./...clean (with local seictl replace)go vet ./...,gofmt -l .cleango test ./...(excluding e2e) passes, including two new tests:TestBuildPlan_PropagatesVesting(planner → sidecar task JSON round-trip) andTestRenderNetwork_PropagatesVesting(SDK spec → CRD render), both also asserting anil-Vesting sibling account stays nil, not zero-valuedmake test-integration(full envtest suite against a live API server, validating the actual generated CRD schema) passes🤖 Generated with Claude Code