Skip to content

feat(rpc): opt-in write-once withdrawal address binding for getDepositSignature - #474

Merged
samlaf merged 3 commits into
mainfrom
sl/sei-1053-featsummit-opt-in-write-once-withdrawal-address-binding-on
Nov 5, 2026
Merged

samlaf merged 3 commits into
mainfrom
sl/sei-1053-featsummit-opt-in-write-once-withdrawal-address-binding-on

Conversation

@samlaf

@samlaf samlaf commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Part of SEI-1053 (summit side; the seismic-images change follows a release).

Found this to be the smallest API change that would work to allow this feature inside TEEs. The change is actually quite small, and most of the new LoCs are just tests. I personally think this feature is valid/useful in pre-TEE world anyways. Opted to not add it to the summit deposit-rpc subcommand (since its not needed in TEEs) and only add it to summit run, but if you think this is useful we can add it to deposit-rpc as well.

LLM Summary

summit run --withdrawal-address-path <file> restricts the admin RPC's getDepositSignature to one withdrawal address, bound once and never changed:

  • A genesis validator is bound to its genesis withdrawal address at startup.
  • Any other node is bound by its first getDepositSignature, which must carry an EIP-55 checksummed address.
  • Later requests for any other address are refused with 4004, which names the bound address, and nothing is signed.

Without the flag, summit behaves as before, and deposit-rpc is unchanged. This is for TEE nodes: with it, no in-guest process that can reach 127.0.0.1:3031 can get a signature for another address.

Changes

  • WithdrawalAddress: strict parse (exact EIP-55 checksummed form, non-zero). Rejections return 3008 with the reason in data.
  • WithdrawalAddressFile: write-once storage, published with link(2) so an existing file is never replaced. A missing directory or a malformed file fails startup instead of meaning "unbound".
  • New admin method getWithdrawalAddress: the bound address, or null.
  • docs/staking-and-participating.md: new "Topping Up" and "Binding the Withdrawal Address" sections.

…tSignature

Part of SEI-1053 (summit side; the seismic-images change follows a release).

`summit run --withdrawal-address-path <file>` restricts the admin RPC's
`getDepositSignature` to one withdrawal address, bound once and never changed:

- A genesis validator is bound to its genesis withdrawal address at startup.
- Any other node is bound by its first `getDepositSignature`, which must carry
  an EIP-55 checksummed address.
- Later requests for any other address are refused with 4004, which names the
  bound address, and nothing is signed.

Without the flag, summit behaves as before, and `deposit-rpc` is unchanged.
This is for TEE nodes: with it, no in-guest process that can reach
`127.0.0.1:3031` can get a signature for another address.

## Changes
- `WithdrawalAddress`: strict parse (exact EIP-55 checksummed form, non-zero).
  Rejections return 3008 with the reason in `data`.
- `WithdrawalAddressFile`: write-once storage, published with link(2) so an
  existing file is never replaced. A missing directory or a malformed file
  fails startup instead of meaning "unbound".
- New admin method `getWithdrawalAddress`: the bound address, or null.
- docs/staking-and-participating.md: new "Topping Up" and "Binding the
  Withdrawal Address" sections.
@samlaf
samlaf force-pushed the sl/sei-1053-featsummit-opt-in-write-once-withdrawal-address-binding-on branch from d489f83 to de0d84c Compare October 27, 2026 22:05
…eeded

Clarify that the node binds an address, not a withdrawal key, and why
network restrictions alone don't suffice on a TEE node. Drop low-level
details already covered by the flag's help text and RPC doc comments.
@samlaf
samlaf merged commit 21fe598 into main Nov 5, 2026
4 checks passed
@samlaf
samlaf deleted the sl/sei-1053-featsummit-opt-in-write-once-withdrawal-address-binding-on branch November 5, 2026 15:14
samlaf added a commit to SeismicSystems/seismic-images that referenced this pull request Nov 5, 2026
Run summit with --withdrawal-address-path, so its admin RPC's
getDepositSignature signs deposits for one withdrawal address only. A
founder is bound to its genesis entry's address at startup. Any other
node is bound by its first deposit request. Requests for another address
are refused, and changing it means resetting the node.

The operator will ask for deposit data from outside the guest, through
the attestation service's :7879 (SEI-1056). Without the binding, anyone
who can reach the node could get deposit data for their own address and
make the validator's first deposit before the operator, taking its
withdrawals for good.

- tmpfiles-persistent.conf: add /persistent/summit/withdrawal, its own
dir so summit never needs write access to its keystore in keys/.
- seismic-summit.service: pass the flag, and add the dir to
ReadWritePaths=.
- readme: add the dir to the Directories and Sandboxing tables.
- sources.yaml: bump summit to the merge of
SeismicSystems/summit#474, which adds the flag.
This also brings in summit v0.1.0 to v0.1.4.

Closes https://linear.app/seismic-systems/issue/SEI-1053

## Note

Noticed that the error code in summit has a conflict with another one..
so will need a rebump of summit once
SeismicSystems/summit#488 merges.
samlaf added a commit that referenced this pull request Nov 5, 2026
Refs https://linear.app/seismic-systems/issue/SEI-1053

#474 gave
WithdrawalAddressBound code 4004, which Forbidden already had from
#475. Release builds enable
permissioned, so both are live there, and a client can't tell "this node
is bound to another withdrawal address" from "signer not authorized" by
code. Move WithdrawalAddressBound to 4005. Forbidden keeps 4004, since
it has been released since v0.1.2 and WithdrawalAddressBound hasn't been
released yet.

To stop this from happening again, each RpcError code is now its
variant's discriminant, under #[repr(i32)], so the compiler rejects a
duplicate code (E0081). RpcError::code() reads it back, and the From
impl uses that instead of repeating each number. The variants are listed
in code order.

## Possible follow-up: ungate the permissioned variants

The duplicate check only covers variants compiled into the build. With
the four permissioned variants behind #[cfg(feature = "permissioned")],
a clash with one of them only fails an all-features build. CI runs one,
so it's still caught, but a plain cargo check isn't enough.

They're gated because RpcError is private to the crate, so without the
feature they'd never be constructed and -D warnings would fail on
dead_code. Ungating them with
#[cfg_attr(not(feature = "permissioned"), allow(dead_code))] would make
every build check every code, and would remove the cfgs from the From
match. Left out to keep this change scoped.
furkan3152 added a commit to furkan3152/summit that referenced this pull request Nov 6, 2026
SeismicSystems#474 added code that reads the genesis validator's
withdrawal_credentials; this branch renames that field, so the merged
tree did not compile.
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