feat(rpc): add lock-free cache for gas oracle tip suggestions#80
Closed
init4samwise wants to merge 1 commit intofeat/rpc-storage-scaffoldingfrom
Closed
feat(rpc): add lock-free cache for gas oracle tip suggestions#80init4samwise wants to merge 1 commit intofeat/rpc-storage-scaffoldingfrom
init4samwise wants to merge 1 commit intofeat/rpc-storage-scaffoldingfrom
Conversation
Add GasOracleCache struct that uses atomics to cache the tip cap value per block. This avoids redundant cold storage reads when multiple requests for gas price or max priority fee come in for the same block. - Add GasOracleCache struct in config/mod.rs with atomic block/tip fields - Add gas_cache field to StorageRpcCtxInner and accessor to StorageRpcCtx - Modify suggest_tip_cap to accept cache parameter and check/update it - Pass ctx.gas_cache() to suggest_tip_cap calls in endpoints Closes ENG-1898
Member
|
[Claude Code] Merged manually into |
prestwich
added a commit
that referenced
this pull request
Feb 16, 2026
… merge gas cache - Bump signet-sdk crates from 0.16.0-rc.8 to 0.16.0-rc.11 - Migrate to new block primitives (Sealed<Header>, SealedBlock<T>) - Replace ChainSpec with EthereumHardfork bitflags in block processor - Restructure processor to be instantiated per-block instead of held - Merge build_executed_block into run_evm, change map_err to wrap_err - Fix changed flag: on_host_revert/process_committed_chain return bool - DRY reader/last_block/drop pattern into last_rollup_block() helper - Remove blank line between imports in gas_oracle.rs - Merge PR #80: add lock-free GasOracleCache for tip suggestions Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Member
|
now included in #75 |
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 lock-free cache for the gas oracle tip cap value to avoid redundant cold storage reads when multiple requests come in for the same block.
Changes
crates/rpc/src/config/mod.rs): UsesAtomicU64for both block number and tip value. Automatically invalidates when the block number changes.gas_cachefieldgas_cache()accessor methodgas_oracle.rs): Now accepts a cache parameter, checks cache first on call, and stores result before returninggas_priceandmax_priority_fee_per_gasto pass the cache tosuggest_tip_capImplementation Notes
AtomicU64withAcquire/Releaseordering)u64::MAXare clamped (reasonable for gas prices)Testing
cargo clippy -p signet-rpc --all-featurespasses with no warningscargo test -p signet-rpc- all 35 tests + 2 doctests passCloses ENG-1898
Linear: https://linear.app/init4/issue/ENG-1898