-
Notifications
You must be signed in to change notification settings - Fork 81
feat: implemented decorator-based RPC method dispatcher and parameter handling system #3581
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
Conversation
Test Results 20 files - 2 298 suites +29 35m 4s ⏱️ - 34m 54s For more details on these failures, see this check. Results for commit edc1a1c. ± Comparison against base commit 7f226e3. ♻️ This comment has been updated with latest results. |
709baa2
to
d26a1ed
Compare
6d47cdc
to
8cc81c4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial round of reviews, thanks for the effort! we are on good track.
packages/relay/src/lib/services/registryService/rpcMethodRegistryService.ts
Show resolved
Hide resolved
33c1e21
to
dbc24de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first sight, it looks good. Thanks for the crazy amount of work you have already done 🚀.
28f241a
to
6b1e1db
Compare
Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
…d as RPC methods. Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
…rror message Signed-off-by: Logan Nguyen <[email protected]>
…Registry Signed-off-by: Logan Nguyen <[email protected]>
…class" This reverts commit 14b47b6. Signed-off-by: Logan Nguyen <[email protected]> fix: Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]> Revert "chore: removed unnecessary index.ts" This reverts commit 28f241a. Reapply "chore: removed unnecessary index.ts" This reverts commit f2e1524e060ce409adced9f350f486ef4de72754. Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
cfe5d1e
to
2791180
Compare
Signed-off-by: Logan Nguyen <[email protected]> Revert "feat: registered getBlockReceipts to rpcMethodRegistry" This reverts commit 2791180. Reapply "feat: registered getBlockReceipts to rpcMethodRegistry" This reverts commit 30a2419.
Signed-off-by: Logan Nguyen <[email protected]>
44abf6c
to
b5af2b7
Compare
Signed-off-by: Logan Nguyen <[email protected]>
Overview
This PR introduces a fully decorator-based API architecture for JSON-RPC method handling. It provides a centralized solution that ensures a clean, type-safe approach to defining, exposing, validating, and dispatching RPC methods across the Relay package.
Key Components
New Single & Centralized API Entry Point
RpcMethodDispatcher
is a centralized and robust class that serves as the sole public API entry point for server packages and all consumers. It provides a structured solution for executing RPC methods by autonomously validating requests and routing them to the appropriate operation handler.Decorator-Based Components
@rpcMethod
annotates methods for RPC exposure and automatic registration.@rpcParamValidationRules
defines validation rules for method parameters, ensuring data integrity.@rpcParamLayoutConfig
manages parameter arrangement and transformation for correct parameters layout.Centralized Method Registry
rpcMethodRegistry
serves as the single source of truth for all RPC method implementations@rpcMethod
@rpcParamValidationRules
for runtime parameter validation@rpcParamLayoutConfig
for correct invocationParameter Handling
traceTransaction
Server Package Simplification
Eliminated Manual Method Registration:
logAndHandleResponse()
anduseRpc()
pattern previously used to register RPC methodsValidator Migration:
@rpcParamValidationRules
decoratorsAdditional Context
Related issue(s): EPIC #3551
Fixes #3553
Fixes #3575
Notes for reviewer:
Acknowledgments
Special kudos to @acuarica for initially proposing this approach and for the excellent work on the POC PR (#3548). His contributions laid the foundation for this implementation and significantly influenced the design of this PR.