Skip to content

fix(staking): epoch-0 stake status, identity signer and wizard operator checks - #429

Merged
dohernandez merged 1 commit into
v0.40-devfrom
fix/epoch0-status-and-wizard-gaps
Oct 20, 2026
Merged

dohernandez merged 1 commit into
v0.40-devfrom
fix/epoch0-status-and-wizard-gaps

Conversation

@dohernandez

Copy link
Copy Markdown
Member

Summary

Fixes problems found while checking the validator join flow against the contracts (genlayer-consensus v0.6-rc-1, f8eb64a) and live Bradbury, which is still in epoch 0.

Epoch-0 stake status (validator-info, validators, stake info)

In epoch 0 the contract writes deposits straight into the active stake record (ValidatorUtils.validatorDepositEpoch0, DelegatorUtils.delegatorJoinEpoch0). The CLI applied its "+2 epochs" rule to them anyway. On Bradbury today, both joined validators showed:

  • their stake as pending, "activatesAtEpoch 2, 2 epochs remaining", although it's already in vStake;
  • "won't become active until its self-stake reaches 0.01 GEN", although they hold 500 GEN and 0.01 GEN.

Now:

  • epoch-0 deposits are never listed as pending (new staking/epochTiming.ts);
  • the epoch-0 note only warns when self-stake is below the minimum;
  • a funded validator at epoch 0 shows pending in validators, because nobody is active until the epoch advances;
  • the validator-deposit and vesting validator deposit minimum-stake checks no longer count epoch-0 deposits twice.

Identity

  • set-identity --account help said "must be validator operator". setIdentity is onlyOwner, so it now says owner.
  • The help also says each call replaces the whole identity: the contract overwrites all 9 fields, so omitted fields are cleared.
  • docs/validator-guide.md:
    • sign with the owner;
    • vesting validators use vesting validator set-identity;
    • the overwrite behaviour;
    • positional validator argument.

Wizard (staking wizard)

  • Operator address check. An entered operator address (prompt or --operator) must be a CLI account, because the CLI signs its proof of possession. This is now checked when the address is entered, not at the join step after every prompt.
  • Browser-wallet owner. It can't be its own operator, because its key is in the wallet and can't sign the proof. The question is skipped and --operator-same is rejected with a clear message.
  • Summary. It prints validator-info <wallet> --network <alias> instead of the deprecated --validator flag, plus the genlayernode account import step and a docs link.
  • Network prompt. It defaults to testnet-bradbury instead of the retired testnet-asimov.
  • Stale docs line. docs/validator-guide.md no longer says an existing geth/foundry operator address can be used directly.

Test plan

  • npx vitest run: 840 passed, with new tests for each fix
  • npx tsc --noEmit: only the existing tests/actions/stakingWizard.test.ts(83,23) TS2352
  • Live Bradbury (read-only), validator-info 0x1404…3A1D: pending deposits None, and the note says the minimum is met
  • Live Bradbury (read-only), validators: both validators pending
  • /run-e2e all

🤖 Generated with Claude Code

…or checks

Epoch 0:
- The contract writes epoch-0 deposits straight into vStake, so validator-info,
  stake-info and validators no longer list them as pending "activates at epoch 2".
- The epoch-0 note only says "won't become active" when self-stake is below the
  minimum.
- A funded validator at epoch 0 shows as pending (nobody is active until the
  epoch advances).
- Deposit pre-checks no longer count epoch-0 deposits twice.

Identity:
- set-identity --account help says owner (the wallet is Ownable), and the help
  notes that each call replaces the whole identity.
- validator-guide: sign with the owner, vesting route, overwrite behaviour, and
  the operator must be a CLI account.

Wizard:
- An entered operator address (prompt or --operator) must be a CLI account and
  is checked at once, not after every prompt.
- A browser-wallet owner can't be its own operator (no key to sign the proof).
- The summary prints validator-info <wallet> --network <alias> and the node
  import command.
- The network prompt defaults to testnet-bradbury.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0fdc33c0-eaa4-4b1f-b5ee-9f676564fa1b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dohernandez

Copy link
Copy Markdown
Member Author

/run-e2e

@ci-core-e2e-runner

Copy link
Copy Markdown
Contributor

E2E status was updated. Follow the current E2E and merge checks on this PR. Detailed diagnostics are available internally.

@dohernandez
dohernandez merged commit 42b2233 into v0.40-dev Oct 20, 2026
12 checks passed
@dohernandez
dohernandez deleted the fix/epoch0-status-and-wizard-gaps branch October 20, 2026 17:28
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