feat: add authenticated getStorageAt endpoint#351
Open
matthias-wright wants to merge 15 commits intoseismicfrom
Open
feat: add authenticated getStorageAt endpoint#351matthias-wright wants to merge 15 commits intoseismicfrom
matthias-wright wants to merge 15 commits intoseismicfrom
Conversation
…r for authentication
Contributor
|
Adds signature-authenticated RPC server with ops endpoints for governance-controlled storage access bypass and whitelist management. Phase 2
LGTM. The implementation follows security best practices with EIP-712 signatures, nonce-based replay protection, and proper governance address verification from on-chain storage. The seismic genesis changes correctly add a test contract and update the genesis hash. The storage access bypass is appropriately restricted to whitelisted addresses with governance controls. |
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.
This adds an authorized endpoint that behaves like
eth_getStorageAt.The governance key (security council multisig) can temporary whitelist a key (Ethereum address) that can access this endpoint. Whitelisted keys can be revoked by the governance key.
The governance key is read from the first slow of the protocol params contract:
A new RPC server is added for this because the auth RPC server only supports JWT authentication and cannot be easily extended to support additional authentication methods.
This new RPC server uses the
opsnamespace (short for operations). Theadminnamespace is already used.The new ops RPC server is deactivated by default and can be activated via the
--ops.enableCLI flag. The address defaults to127.0.0.1and can be set via--ops.addrand the port defaults to8552and can be set via--ops.port.These are all the added endpoints:
ops_whitelistKey
Request format:
{"jsonrpc":"2.0","method":"ops_whitelistKey","params":["0x<target>",<expires_at_unix_seconds>],"id":1}Authorized by raw Ethereum transaction, signed by the governance key, stored in the
X-Signed-TxHTTP header.Transaction requirements:
Note: this endpoint doesn't need a nonce because the
expires_at_unix_secondsparameter makes replays pointless.ops_revokeKey
Request format:
{"jsonrpc":"2.0","method":"ops_revokeKey","params":["0x<target>"],"id":1}Authorized by raw Ethereum transaction, signed by the governance key, stored in the
X-Signed-TxHTTP header.Transaction requirements:
ops_getStorageAt
Request format:
{"jsonrpc":"2.0","method":"ops_getStorageAt","params":["0x<address>","0x<slot>","latest"],"id":1}Authorized by a signature from a whitelisted key. The signature must be EIP-712-structured over the request body and nonce. Signature and nonce are stored in the
X-SignatureandX-NonceHTTP headers, respectively.ops_getNonce
Request format:
{"jsonrpc":"2.0","method":"ops_getNonce","params":["0x<signer_address>"],"id":1}Authorized by a signature from a whitelisted key. The signature must be EIP-712-structured over the request body and nonce (nonce is set to the empty string). Signature is stored in the
X-SignatureHTTP header.