Skip to content

feat: support timed_ prefix for RPC method aliases#86

Merged
krabat-l merged 1 commit intomainfrom
krabat/feat/support_timed_prefix
Feb 9, 2026
Merged

feat: support timed_ prefix for RPC method aliases#86
krabat-l merged 1 commit intomainfrom
krabat/feat/support_timed_prefix

Conversation

@krabat-l
Copy link
Collaborator

@krabat-l krabat-l commented Feb 9, 2026

Summary

Add support for timed_ prefixed RPC method names. When a request uses a method like timed_debug_traceBlockByNumber, the server strips the prefix and routes it
to the same handler as debug_traceBlockByNumber.

Changes

  • metrics.rs: Add TIMED_PREFIX, timed method name constants, TIMED_METHOD_ALIASES mapping, and strip_timed_prefix() helper. Updated
    record_rpc_request/record_rpc_error to strip the prefix so timed calls share the same metrics counters.
  • rpc_service.rs: Register timed_ aliases via module.register_alias() in into_rpc_module().

Supported aliases

Alias Routes to
timed_debug_traceBlockByNumber debug_traceBlockByNumber
timed_debug_traceBlockByHash debug_traceBlockByHash
timed_debug_traceTransaction debug_traceTransaction
timed_debug_getCacheStatus debug_getCacheStatus
timed_trace_block trace_block
timed_trace_transaction trace_transaction

Tests

Added 8 unit tests covering prefix stripping, alias consistency, alias registration on RpcModule, and duplicate rejection.

@krabat-l krabat-l requested a review from Troublor February 9, 2026 15:19
@krabat-l krabat-l merged commit 7f78d02 into main Feb 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments