Skip to content

Add megapool exit & claim lifecycle UI (follow-up to #154)#159

Open
saju01 wants to merge 6 commits into
dappnode:mainfrom
saju01:ui-megapool-exit-claim-testnet
Open

Add megapool exit & claim lifecycle UI (follow-up to #154)#159
saju01 wants to merge 6 commits into
dappnode:mainfrom
saju01:ui-megapool-exit-claim-testnet

Conversation

@saju01

@saju01 saju01 commented Jun 24, 2026

Copy link
Copy Markdown

Megapool exit & claim lifecycle (follow-up to #154)

This adds the exit + claim/withdraw half of the megapool lifecycle, so node operators can manage validators after deposit — not just create them.

⚠️ Stacked on #154 — review only the last commit

This branch is built on top of #154's deposit branch, so it shares those commits. The only new commit here is b38de52 ("Add megapool exit & claim lifecycle to UI", +409 lines / 8 files). Everything else is #154. Intended sequencing: merge #154 first, then this. Kept separate on purpose so the deposit UI can land independently and operators get both options.

The new commit only adds files/handlers — it does not modify the deposit logic.

What's added

🚪 Exit (state-aware — UI picks the right path per validator state):

  • exit-queue (by validatorIndex) — exit a validator still in the entry queue, before it stakes
  • exit-validator (by validatorId) — beacon voluntary exit for an active validator
  • notify-validator-exit (by validatorId) — notify the protocol of the exit

💰 Claim / withdraw:

  • pending-rewards — surfaces claimable node rewards in the UI
  • distribute — claim accrued megapool ETH/rewards to the node
  • claim-refund — claim the node's bond/refund back
  • read helpers: calculate-rewards, beacon-withdrawal-queue-estimate

How it's wired (mirrors the existing deposit pattern)

  • API (build/api/src/index.ts): 13 new megapool ... action handlers. executeCommand now waits on the txHash for the 4 actions that broadcast a transaction (exit-queue, notify-validator-exit, distribute, claim-refund). exit-validator is a beacon voluntary exit and returns no on-chain tx, so it is correctly not waited on.
  • UI: AppService methods + 4 new response types (CanExit, CanDistribute, CanClaimRefund, MegapoolRewards) + a new MegapoolActions component (Exit + Claim sections, preflight → execute → wait, TxsLinksBox, MUI), rendered in MinipoolDetails.

Validation — exercised live on Hoodi against a real deployed megapool

Built the v1.20.x daemon and ran it in external-client mode against public Hoodi endpoints. Registered a node and deposited a real 4-ETH megapool validator, then exercised every new route against the live megapool:

Both API and UI builds pass (tsc clean; UI production build ~180 kB gzip; only a pre-existing Minipools.tsx eslint warning, untouched here).

saju01 and others added 4 commits June 2, 2026 10:52
- UPSTREAM_VERSION / upstreamVersion v1.19.3 -> v1.20.3 (latest stable
  Smartnode release, 2026-05-21); package version 0.1.8 -> 0.1.9.
- Fix auto_check.yml so future Smartnode releases auto-PR:
  - push trigger watched 'master' but default branch is 'main'
  - no permissions block -> read-only GITHUB_TOKEN could not open the
    bump branch/PR (dappnodesdk bump-upstream needs write)
  - bumped actions/checkout v2 -> v4; added workflow_dispatch
- Add the v1.20.x native-mode Smartnode HTTP API port default (8280) to the generated settings template without exposing it publicly.\n- Add Lodestar's QUIC P2P port default (8001), matching the existing Lighthouse/Prysm entries and upstream v1.20.3 config.\n- Add the explicit IPv6 default (disabled) and align root.version with the bundled Smartnode v1.20.3.
saju01 added 2 commits June 24, 2026 21:08
The settings template rendered network: ${NETWORK} (= hoodi), but the
Smartnode daemon only accepts mainnet|testnet|devnet. "testnet" is Hoodi
internally (chainId 560048, RocketStorage 0x594Fb75D...). With network: hoodi
the daemon cannot resolve the storage address and every on-chain call fails
with "The Rocket Pool storage contract was not found".

Introduce SMARTNODE_NETWORK (mainnet -> mainnet, hoodi/testnet -> testnet),
pass it through envsubst, and use it for the template's network: field. The
dappnode package keeps using NETWORK=hoodi for its own identity (web3signer-hoodi,
globals, urls); only the smartnode setting is remapped.

Verified live on Hoodi: with network: testnet, node register + 4-ETH megapool
deposit succeed and all megapool routes resolve.
Adds the full megapool exit + claim/withdraw actions on top of the
deposit-only UI:

API (build/api/src/index.ts):
- megapool can-exit-queue / exit-queue (validatorIndex)
- megapool can-exit-validator / exit-validator (validatorId)
- megapool can-notify-validator-exit / notify-validator-exit (validatorId)
- megapool pending-rewards, calculate-rewards, beacon-withdrawal-queue-estimate
- megapool can-distribute / distribute
- megapool can-claim-refund / claim-refund
- executeCommand now waits on the txHash for exit-queue / notify-validator-exit
  / distribute / claim-refund (exit-validator is a beacon voluntary exit, no tx)

UI:
- AppService methods for each action (mirrors existing deposit/claim pattern)
- New types: CanExit, CanDistribute, CanClaimRefund, MegapoolRewards
- New MegapoolActions component (Exit + Claim sections, preflight->execute->wait,
  TxsLinksBox, MUI) rendered in MinipoolDetails

All routes verified live against a v1.20.x daemon on Hoodi (external client mode).
Both API and UI builds pass.
@saju01 saju01 force-pushed the ui-megapool-exit-claim-testnet branch from b38de52 to f6da607 Compare June 24, 2026 19:08
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