Skip to content

homi: add a flag to deploy validators with public delegation - #1038

Open
hyunsooda wants to merge 1 commit into
kaiachain:devfrom
hyunsooda:feat/homi-public-delegation
Open

homi: add a flag to deploy validators with public delegation#1038
hyunsooda wants to merge 1 commit into
kaiachain:devfrom
hyunsooda:feat/homi-public-delegation

Conversation

@hyunsooda

@hyunsooda hyunsooda commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Proposed changes

The permissionless genesis always deploys each validator's CnStaking without a PublicDelegation, and one cannot be attached later, so testing PD-dependent behaviour meant off-boarding and re-onboarding a validator. --public-delegation builds the genesis with a PD on every validator; without the flag the output is unchanged. The PD path routes the initial stake through the PD and sets the node's reward address to the PD, both of which the contracts require.

Types of changes

  • 🐛 Bug fix
  • ✨ Non-hardfork changes (node upgrade not required)
  • 💥 Hardfork / consensus-breaking changes
  • 🧪 Test improvements
  • 🧰 CI / build tool
  • ♻️ Chore / Refactor / Non-functional changes

Checklist

  • 📖 I have read the CONTRIBUTING GUIDELINES doc
  • 📝 I have signed in the PR comment I have read the CLA Document and I hereby sign the CLA in first time contribute after having read CLA
  • 🟢 Lint and unit tests pass locally with my changes ($ make test)

Related issues

Further comments

The permissionless genesis always deploys each validator's CnStaking without
a PublicDelegation, and attaching one afterwards is not possible: CnStakingV4
binds its PD at initialize time with no setter, ABv2 cannot update a node's
StakingContract, and deleteNode only accepts a Registered node. Testing any
PD-dependent behaviour therefore required off-boarding and re-onboarding a
validator. Add --public-delegation so the genesis can be built with a PD on
every validator instead; without the flag nothing changes.

The PD path differs in two ways the contracts enforce. Staking has to go
through the PD because delegate() is PD-only once a PD is set, and the node's
reward address has to be the PD itself because registerNodeGenesis rejects any
other value for a PD-backed node.

Constraint: CnStakingV4Factory burns INITIAL_LOCKUP as dead shares, so the
  manager needs that much on top of its stake
Rejected: Take the lockup out of StakeAmts | would leave the stake just under
  the configured amount and shift the minStake boundary
Rejected: Per-node PD switch | no caller needs mixed fixtures yet
Confidence: high
Scope-risk: narrow
Not-tested: withdraw and claim through the PD unstaking lockup

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@hyunsooda hyunsooda self-assigned this Aug 13, 2026
@hyunsooda hyunsooda added the do not merge Do not merge just yet label Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge Do not merge just yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant