Skip to content

fix(rpc): give WithdrawalAddressBound its own error code 4005 - #488

Merged
samlaf merged 1 commit into
mainfrom
sl/withdrawal-address-bound-4005
Nov 5, 2026
Merged

samlaf merged 1 commit into
mainfrom
sl/withdrawal-address-bound-4005

Conversation

@samlaf

@samlaf samlaf commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

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.

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.
@linear-code

linear-code Bot commented Nov 5, 2026

Copy link
Copy Markdown

SEI-1053

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
samlaf merged commit a8cf8a7 into main Nov 5, 2026
4 checks passed
@samlaf
samlaf deleted the sl/withdrawal-address-bound-4005 branch November 5, 2026 17:39
samlaf added a commit to SeismicSystems/seismic-images that referenced this pull request Nov 5, 2026
…de (#98)

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

Picks up SeismicSystems/summit#488, the only
commit between the two pins. It moves the admin RPC error summit returns
when getDepositSignature names an address other than the bound one from
4004 to 4005: 4004 was also `Forbidden` in summit's `permissioned`
build.

This image builds summit without `permissioned`, so nothing here hit the
collision. The bump is for the attestation service's deposit route
(https://linear.app/seismic-systems/issue/SEI-1056), which tells a bound
address apart by code and now matches 4005; enclave and summit move
together (see this file's header).
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