feat(rpc): add signet_networkStatus endpoint (ENG-479)#78
Open
init4samwise wants to merge 1 commit intomainfrom
Open
feat(rpc): add signet_networkStatus endpoint (ENG-479)#78init4samwise wants to merge 1 commit intomainfrom
init4samwise wants to merge 1 commit intomainfrom
Conversation
Adds a new signet_networkStatus RPC endpoint that returns Signet-specific network information: - chain_id: The Signet rollup chain ID - genesis: The genesis block hash (block 0) - head: The current head block hash - headNumber: The current head block number This addresses the TODOs from the original SignetNoopNetwork implementation which returned Default::default() for these values. The new endpoint exposes the actual Signet network state rather than delegating to the host network. The endpoint is exposed as signet_networkStatus and returns a JSON object with camelCase field names. Closes ENG-479
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.
Summary
Adds a new
signet_networkStatusRPC endpoint that returns Signet-specific network information.Background
The original
SignetNoopNetworkimplementation (now removed) had TODOs for exposing proper values for:genesis: The genesis block hashconfig: The chain configurationhead: The current head block hashThese were previously returning
Default::default()values. Since Signet is a rollup, it should expose its OWN network status rather than delegating to the host (L1) network.Changes
Added a new
signet_networkStatusendpoint incrates/rpc/src/signet/endpoints.rsthat returns:{ "chainId": 12345, "genesis": "0x...", "head": "0x...", "headNumber": 123456 }constants.ru_chain_id())Implementation Notes
SignetCtxprovider to retrieve block informationSignetNetworkStatusstruct is exported for use by consumersTesting
Will be tested by CI. Manually verified changes compile with
cargo check.Closes ENG-479