Repository navigation
fix(rpc): give WithdrawalAddressBound its own error code 4005 - #488
Merged
Merged
Conversation
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.
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
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.