Skip to content
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

Add ability to enable/disable APIs via configuration #1969

Merged
merged 4 commits into from
Dec 11, 2024
Merged

Conversation

JamesHinshelwood
Copy link
Contributor

@JamesHinshelwood JamesHinshelwood commented Dec 6, 2024

By default all JSON-RPC API methods are now disabled. API methods must be enabled with the enabled_apis property in configuration. Entire namespaces can be enabled at once with a string (e.g. "eth") or individual methods can be enabled with an object of the form { namespace = "eth", apis = ["blockNumber"] }. For the purposes of this configuration, any method without a namespace (i.e. without an underscore) is assumed to be under the zilliqa namespace.

Nodes are also now able to start the JSON-RPC server on more than one port, each of which can have different configuration.

bzawisto
bzawisto previously approved these changes Dec 9, 2024
Copy link
Contributor

github-actions bot commented Dec 9, 2024

🐰 Bencher Report

Branchapi-config
Testbedself-hosted
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Upper Boundary
nanoseconds (ns)
(Limit %)
process-empty/process-empty📈 view plot
🚷 view threshold
8,521,900.00
(-6.99%)
10,862,816.59
(78.45%)
produce-full/produce-full📈 view plot
🚷 view threshold
2,517,600,000.00
(-1.95%)
2,727,329,359.48
(92.31%)
🐰 View full continuous benchmarking report in Bencher

By default all JSON-RPC API methods are now disabled. API methods
must be enabled with the `enabled_apis` property in configuration.
Entire namespaces can be enabled at once with a string (e.g.
`"eth"`) or individual methods can be enabled with an object of
the form `{ namespace = "eth", apis = ["blockNumber"] }`. For the
purposes of this configuration, any method without a namespace
(i.e. without an underscore) is assumed to be under the `zilliqa`
namespace.

The infrastructure configuration enables all API namespaces except
`admin` for API nodes and only enables `eth_blockNumber` for all
other node types.
@JamesHinshelwood JamesHinshelwood added this pull request to the merge queue Dec 11, 2024
Merged via the queue into main with commit 118905e Dec 11, 2024
6 checks passed
@JamesHinshelwood JamesHinshelwood deleted the api-config branch December 11, 2024 11:43
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.

3 participants