-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add signet-rpc-storage crate with ETH RPC endpoints #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 16 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
b2dff1b
feat: add signet-rpc-storage crate scaffolding
prestwich 802824b
feat: implement ETH RPC endpoints for signet-rpc-storage
prestwich 477a732
test: add integration tests for ETH RPC endpoints
prestwich a435afa
fix: resolve review issues in endpoints and helpers
prestwich 601c156
fix: correct log ordering comments in rpc test
prestwich 35ed5cb
refactor: DRY up EVM setup, fix glob import, remove dead code
prestwich 49ffbb6
refactor: move block resolution to StorageRpcCtx methods, drop RoTx b…
prestwich e7a543b
feat: add StorageRpcConfig and integrate RPC configuration values
prestwich fed52a0
feat: port missing RPC endpoints and add integration tests
prestwich 291ab9f
chore: use signet-storage 0.3.0 from crates.io, remove patch overrides
prestwich 2163d98
refactor: adapt rpc-storage to signet-storage 0.3.0 API
prestwich d6114f8
chore: bump signet-storage crates to 0.4.0
prestwich 2963621
refactor: use hot storage for block resolution and header lookups
prestwich 0c08f2f
refactor: align rpc-storage data shapes with canonical rpc crate
prestwich 9ce7840
refactor: align filter, subscription, and tx submission behavior
prestwich 40f5734
fix: synthesize pending header in resolve_evm_block and bump storage …
prestwich d90d2b7
feat: add uncle and access lists
prestwich 4d9c6db
refactor: address PR review comments across rpc-storage crate
prestwich b40411e
feat: bump ajj to 0.5.0 with lazy serialization and API migration
prestwich 9be14ce
fix: migrate signet-rpc crate to ajj 0.5.0 API
prestwich 2dcab79
refactor: replace json! macro with typed subscription notification st…
prestwich 0d17805
chore: bump ajj to 0.6.0
prestwich 4eb1b0a
fix: suppress dead_code warning in test harness and fix doc link
prestwich a819a3f
feat: use cold storage log streaming for eth_getLogs and eth_getFilte…
prestwich 4e9c249
chore: remove future-evaluation
prestwich f5b91b0
refactor: extract type definitions from endpoint files into type modules
prestwich afdff5a
feat: restore permit-based subscription notification batching
prestwich a98f49e
refactor: move orphaned types to signet-node and remove journal hash …
prestwich f105e1b
refactor: address PR review — fix bugs, unify types, and clean up
prestwich 0acb382
refactor: rewrite block processor and node to use signet-storage (#79)
prestwich 61043ac
refactor: address remaining PR #75 review threads
prestwich 4c851c0
fix: derive genesis hardforks from chain config instead of hardcoding…
prestwich acc0aea
refactor: address PR #75 review — ChainNotifier, storage consistency,…
prestwich 0e79104
fix: load genesis into cold storage during prebuild
prestwich 65904bd
refactor: bump SDK to rc.11, per-block processor, address PR review +…
prestwich 6b515c2
refactor: address PR #75 review — spec_id fix, move serve.rs, load RP…
prestwich f6d923a
chore: remove FUTURE_WORK.md
prestwich 4d34e47
fix: correct rustdoc, off-by-one getLogs range, pending block gas limit
prestwich 4a05a0f
fix: reward percentile off-by-one, remove dead code, use async spawn
prestwich 049c584
feat: add StorageConfig, bump signet-storage to 0.6.4, remove dead db…
prestwich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| [package] | ||
| name = "signet-rpc-storage" | ||
| version.workspace = true | ||
| edition.workspace = true | ||
| rust-version.workspace = true | ||
| authors.workspace = true | ||
| license.workspace = true | ||
| homepage.workspace = true | ||
| repository.workspace = true | ||
| description = "Ethereum JSON-RPC server backed by signet-storage" | ||
|
|
||
| [dependencies] | ||
| signet-storage.workspace = true | ||
| signet-cold.workspace = true | ||
| signet-hot.workspace = true | ||
| signet-storage-types.workspace = true | ||
| signet-evm.workspace = true | ||
| trevm = { workspace = true, features = ["call", "estimate_gas"] } | ||
| signet-types.workspace = true | ||
| signet-tx-cache.workspace = true | ||
| signet-bundle.workspace = true | ||
| alloy.workspace = true | ||
| ajj.workspace = true | ||
| tokio.workspace = true | ||
| tokio-util = "0.7" | ||
| tracing.workspace = true | ||
| thiserror.workspace = true | ||
| serde.workspace = true | ||
| dashmap = "6.1.0" | ||
| reth-rpc-eth-api.workspace = true | ||
| revm-inspectors.workspace = true | ||
| itertools.workspace = true | ||
|
|
||
| [dev-dependencies] | ||
| tokio = { workspace = true, features = ["macros", "rt-multi-thread"] } | ||
| tokio-util = "0.7" | ||
| signet-cold = { workspace = true, features = ["test-utils"] } | ||
| signet-hot = { workspace = true, features = ["test-utils"] } | ||
| signet-storage.workspace = true | ||
| signet-storage-types.workspace = true | ||
| signet-constants.workspace = true | ||
| alloy.workspace = true | ||
| serde_json.workspace = true | ||
| axum = "0.8" | ||
| tower = { version = "0.5", features = ["util"] } | ||
| http = "1" | ||
| trevm.workspace = true | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # signet-rpc-storage | ||
|
|
||
| Ethereum JSON-RPC server backed by `signet-storage`'s unified storage backend. | ||
|
|
||
| This crate provides a standalone ETH RPC implementation that uses hot storage | ||
| for state queries and cold storage for block, transaction, and receipt data. | ||
| Unlike `signet-rpc`, it does not depend on reth's `FullNodeComponents`. | ||
|
|
||
| ## Supported Methods | ||
|
|
||
| - Block queries: `eth_blockNumber`, `eth_getBlockByHash`, `eth_getBlockByNumber`, etc. | ||
|
prestwich marked this conversation as resolved.
Outdated
|
||
| - Transaction queries: `eth_getTransactionByHash`, `eth_getTransactionReceipt`, etc. | ||
| - Account state: `eth_getBalance`, `eth_getStorageAt`, `eth_getCode`, `eth_getTransactionCount` | ||
| - EVM execution: `eth_call`, `eth_estimateGas` | ||
| - Logs: `eth_getLogs` | ||
| - Transaction submission: `eth_sendRawTransaction` (optional, via `TxCache`) | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| //! Configuration for the storage-backed RPC server. | ||
|
|
||
| use std::time::Duration; | ||
|
|
||
| /// Configuration for the storage-backed ETH RPC server. | ||
| /// | ||
| /// Mirrors the subset of reth's `EthConfig` that applies to | ||
| /// storage-backed RPC. | ||
| /// | ||
| /// # Example | ||
| /// | ||
| /// ``` | ||
| /// use signet_rpc_storage::StorageRpcConfig; | ||
| /// | ||
| /// // Use defaults (matches reth defaults). | ||
| /// let config = StorageRpcConfig::default(); | ||
| /// assert_eq!(config.rpc_gas_cap, 30_000_000); | ||
| /// ``` | ||
| #[derive(Debug, Clone, Copy)] | ||
| pub struct StorageRpcConfig { | ||
| /// Maximum gas for `eth_call` and `eth_estimateGas`. | ||
| /// | ||
| /// Default: `30_000_000` (30M gas). | ||
| pub rpc_gas_cap: u64, | ||
|
|
||
| /// Maximum block range per `eth_getLogs` query. | ||
| /// | ||
| /// Default: `10_000`. | ||
| pub max_blocks_per_filter: u64, | ||
|
|
||
| /// Maximum number of logs returned per `eth_getLogs` response. | ||
| /// Set to `0` to disable the limit. | ||
| /// | ||
| /// Default: `20_000`. | ||
| pub max_logs_per_response: usize, | ||
|
|
||
| /// Maximum concurrent tracing/debug requests. | ||
| /// | ||
| /// Controls the size of the semaphore that gates debug | ||
| /// namespace calls. | ||
| /// | ||
| /// Default: `25`. | ||
| pub max_tracing_requests: usize, | ||
|
|
||
| /// Time-to-live for stale filters and subscriptions. | ||
| /// | ||
| /// Default: `5 minutes`. | ||
| pub stale_filter_ttl: Duration, | ||
|
|
||
| /// Number of recent blocks to consider for gas price suggestions. | ||
| /// | ||
| /// Default: `20`. | ||
| pub gas_oracle_block_count: u64, | ||
|
|
||
| /// Percentile of effective tips to use as the gas price suggestion. | ||
| /// | ||
| /// Default: `60.0`. | ||
| pub gas_oracle_percentile: f64, | ||
|
|
||
| /// Maximum header history for `eth_feeHistory` without percentiles. | ||
| /// | ||
| /// Default: `1024`. | ||
| pub max_header_history: u64, | ||
|
|
||
| /// Maximum block history for `eth_feeHistory` with percentiles. | ||
| /// | ||
| /// Default: `1024`. | ||
| pub max_block_history: u64, | ||
| } | ||
|
|
||
| impl Default for StorageRpcConfig { | ||
| fn default() -> Self { | ||
| Self { | ||
| rpc_gas_cap: 30_000_000, | ||
| max_blocks_per_filter: 10_000, | ||
| max_logs_per_response: 20_000, | ||
| max_tracing_requests: 25, | ||
| stale_filter_ttl: Duration::from_secs(5 * 60), | ||
| gas_oracle_block_count: 20, | ||
| gas_oracle_percentile: 60.0, | ||
| max_header_history: 1024, | ||
| max_block_history: 1024, | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.