Skip to content

feat: add GET /config route #3559

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

Merged
merged 29 commits into from
Mar 25, 2025
Merged

feat: add GET /config route #3559

merged 29 commits into from
Mar 25, 2025

Conversation

natanasow
Copy link
Contributor

@natanasow natanasow commented Mar 18, 2025

Description:

To provide more transparency and operational insight to developers using the JSON RPC relay, it would be beneficial to expose configuration and deployment block information. Such information could aid in troubleshooting and understanding the context in which the relay is running. However, it's crucial to maintain conformity with the Ethereum JSON RPC API specification, so altering existing endpoints is not desirable.

Solution:
Introduce a new RPC method /config. This method could provide the necessary configuration data.

Related issue(s):

Fixes #1298

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@natanasow natanasow self-assigned this Mar 18, 2025
@natanasow natanasow added the enhancement New feature or request label Mar 18, 2025
@natanasow natanasow added this to the 0.70.0 milestone Mar 18, 2025
Signed-off-by: nikolay <[email protected]>
Copy link

github-actions bot commented Mar 18, 2025

Test Results

 18 files   -   3  236 suites   - 66   33m 15s ⏱️ - 15m 32s
618 tests  -   1  614 ✅ +  1  4 💤 ±0  0 ❌  - 2 
634 runs   - 189  630 ✅  - 185  4 💤 ±0  0 ❌  - 4 

Results for commit 4413339. ± Comparison against base commit aac3b28.

This pull request removes 1 test.
"after all" hook for "@release should return the code through a websocket" ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-2 eth_getCode "after all" hook for "@release should return the code through a websocket"

♻️ This comment has been updated with latest results.

@natanasow natanasow marked this pull request as ready for review March 18, 2025 15:45
@natanasow natanasow requested review from Nana-EC and a team as code owners March 18, 2025 15:45
Signed-off-by: nikolay <[email protected]>
Signed-off-by: nikolay <[email protected]>
@natanasow natanasow requested a review from acuarica March 19, 2025 08:13
@natanasow natanasow changed the title feat: add /config endpoint feat: add hedera_config RPC method Mar 19, 2025
Signed-off-by: nikolay <[email protected]>
Copy link

codecov bot commented Mar 21, 2025

Codecov Report

Attention: Patch coverage is 86.95652% with 6 lines in your changes missing coverage. Please review.

Project coverage is 85.78%. Comparing base (7955dae) to head (1f0c08d).

Files with missing lines Patch % Lines
packages/relay/src/lib/hedera.ts 92.00% 1 Missing and 1 partial ⚠️
packages/server/src/routes/hederaRoutes.ts 66.66% 2 Missing ⚠️
packages/server/src/utils.ts 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3559      +/-   ##
==========================================
+ Coverage   85.73%   85.78%   +0.05%     
==========================================
  Files          75       77       +2     
  Lines        4836     4882      +46     
  Branches      998     1000       +2     
==========================================
+ Hits         4146     4188      +42     
- Misses        402      405       +3     
- Partials      288      289       +1     
Flag Coverage Δ
config-service 94.04% <100.00%> (+0.45%) ⬆️
relay 79.38% <93.10%> (+0.10%) ⬆️
server 85.04% <75.00%> (-0.12%) ⬇️
ws-server 36.31% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ckages/config-service/src/services/globalConfig.ts 100.00% <ø> (ø)
packages/config-service/src/services/index.ts 94.11% <100.00%> (+1.26%) ⬆️
packages/relay/src/index.ts 100.00% <ø> (ø)
packages/relay/src/lib/constants.ts 100.00% <100.00%> (ø)
packages/relay/src/lib/relay.ts 94.20% <100.00%> (+0.26%) ⬆️
...s/server/src/koaJsonRpc/lib/methodConfiguration.ts 100.00% <ø> (ø)
packages/server/src/server.ts 73.46% <100.00%> (+0.55%) ⬆️
packages/relay/src/lib/hedera.ts 92.00% <92.00%> (ø)
packages/server/src/routes/hederaRoutes.ts 66.66% <66.66%> (ø)
packages/server/src/utils.ts 78.12% <33.33%> (-4.64%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@natanasow natanasow requested review from a team as code owners March 24, 2025 09:08
Signed-off-by: nikolay <[email protected]>
Signed-off-by: nikolay <[email protected]>
# Conflicts:
#	packages/relay/src/index.ts
#	packages/relay/src/lib/relay.ts
Signed-off-by: nikolay <[email protected]>
@natanasow natanasow changed the title feat: add hedera_config RPC method feat: add /config RPC method Mar 24, 2025
Signed-off-by: nikolay <[email protected]>
Copy link
Contributor

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work but left some Qs

Signed-off-by: nikolay <[email protected]>
Signed-off-by: nikolay <[email protected]>
Signed-off-by: nikolay <[email protected]>
Copy link

@Ferparishuertas Ferparishuertas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfecto! LGTM Great work as always!

@quiet-node
Copy link
Contributor

@natanasow we should update the PR title though it's misleading.

@natanasow natanasow changed the title feat: add /config RPC method feat: add GET /config route Mar 25, 2025
@natanasow
Copy link
Contributor Author

@natanasow we should update the PR title though it's misleading.

Fixed 🫡.

@natanasow natanasow merged commit d983199 into main Mar 25, 2025
38 of 40 checks passed
@natanasow natanasow deleted the 1298-add-config-endpoint branch March 25, 2025 20:04
@acuarica acuarica modified the milestones: 0.70.0, 0.67.0 Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Addition of a /config endpoint
4 participants