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

rpc/client: Propagate rpc_methods method to reported methods #1713

Merged
merged 2 commits into from
Sep 28, 2023

Conversation

lexnv
Copy link
Contributor

@lexnv lexnv commented Sep 26, 2023

The PR exposes the rpc_methods name in the rpc_methods response.
This feature is useful for servers that only forward requests to methods that are reported by the rpc_methods.

Jsonrpsee exposes the available methods registered so far. Registering the rpc_methods requires a closure that already stores the result. As such, the rpc_methods method name is manually added to the available methods.

Closes: #1627

Testing Done

$> curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "rpc_methods", "params":[]}' http://localhost:9944

{"jsonrpc":"2.0","result":{"methods":["account_nextIndex",... "rpc_methods",..."unsubscribe_newHead"]},"id":1}⏎

@paritytech/subxt-team

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@lexnv lexnv added A1-insubstantial Pull request requires no code review (e.g., a sub-repository hash update). R0-silent Changes should not be mentioned in any release notes I2-bug The node fails to follow expected behavior. D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. labels Sep 26, 2023
@lexnv lexnv requested review from jsdw and bkchr September 26, 2023 11:20
@lexnv lexnv self-assigned this Sep 26, 2023
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@lexnv lexnv merged commit b5a0708 into master Sep 28, 2023
108 of 109 checks passed
@lexnv lexnv deleted the lexnv/fix-rpc-methods branch September 28, 2023 17:19
ordian added a commit that referenced this pull request Oct 3, 2023
* master: (24 commits)
  Init System Parachain storage versions and add migration check jobs to CI (#1344)
  no-bound derives: Use absolute path for `core` (#1763)
  migrate alliance, fast-unstake and bags list to use derive-impl (#1636)
  Tvl pool staking (#1322)
  improve service error (#1734)
  frame-support: `RuntimeDebug\Eq\PartialEq` impls for `Imbalance` (#1717)
  Point documentation links to monorepo (#1741)
  [NPoS] Fix for Reward Deficit in the pool (#1255)
  Move import queue from `ChainSync` to `SyncingEngine` (#1736)
  Enable mocking contracts (#1331)
  Revert "fix(review-bot): pull secrets from `master` environment" (#1748)
  Remove kusama and polkadot runtime crates (#1731)
  Use `Extensions` to register offchain worker custom extensions (#1719)
  [RPC-Spec-V2] chainHead: use integer for block index and adjust RuntimeVersion JSON format (#1666)
  fix(review-bot): pull secrets from `master` environment (#1745)
  Fix `subkey inspect` output text padding (#1744)
  archive: Implement height, hashByHeight and call (#1582)
  rpc/client: Propagate `rpc_methods` method to reported methods (#1713)
  rococo-runtime: `RococoGenesisExt` removed (#1490)
  PVF: more filesystem sandboxing (#1373)
  ...
ordian added a commit that referenced this pull request Oct 10, 2023
* tsv-disabling-node-side: (24 commits)
  Init System Parachain storage versions and add migration check jobs to CI (#1344)
  no-bound derives: Use absolute path for `core` (#1763)
  migrate alliance, fast-unstake and bags list to use derive-impl (#1636)
  Tvl pool staking (#1322)
  improve service error (#1734)
  frame-support: `RuntimeDebug\Eq\PartialEq` impls for `Imbalance` (#1717)
  Point documentation links to monorepo (#1741)
  [NPoS] Fix for Reward Deficit in the pool (#1255)
  Move import queue from `ChainSync` to `SyncingEngine` (#1736)
  Enable mocking contracts (#1331)
  Revert "fix(review-bot): pull secrets from `master` environment" (#1748)
  Remove kusama and polkadot runtime crates (#1731)
  Use `Extensions` to register offchain worker custom extensions (#1719)
  [RPC-Spec-V2] chainHead: use integer for block index and adjust RuntimeVersion JSON format (#1666)
  fix(review-bot): pull secrets from `master` environment (#1745)
  Fix `subkey inspect` output text padding (#1744)
  archive: Implement height, hashByHeight and call (#1582)
  rpc/client: Propagate `rpc_methods` method to reported methods (#1713)
  rococo-runtime: `RococoGenesisExt` removed (#1490)
  PVF: more filesystem sandboxing (#1373)
  ...
bgallois pushed a commit to duniter/duniter-polkadot-sdk that referenced this pull request Mar 25, 2024
…ytech#1713)

The PR exposes the `rpc_methods` name in the `rpc_methods` response.
This feature is useful for servers that only forward requests to methods
that are reported by the `rpc_methods`.

Jsonrpsee exposes the available methods registered so far. Registering
the `rpc_methods` requires a closure that already stores the result. As
such, the `rpc_methods` method name is manually added to the available
methods.

Closes: paritytech#1627

### Testing Done

```
$> curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "rpc_methods", "params":[]}' http://localhost:9944

{"jsonrpc":"2.0","result":{"methods":["account_nextIndex",... "rpc_methods",..."unsubscribe_newHead"]},"id":1}⏎
```

@paritytech/subxt-team

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Mar 26, 2024
* Remove WeightToFee

* Remove leftover
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Mar 27, 2024
* Remove WeightToFee

* Remove leftover
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
* Remove WeightToFee

* Remove leftover
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
* Remove WeightToFee

* Remove leftover
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
* Remove WeightToFee

* Remove leftover
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
* Remove WeightToFee

* Remove leftover
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
* Remove WeightToFee

* Remove leftover
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* Remove WeightToFee

* Remove leftover
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* Remove WeightToFee

* Remove leftover
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* Remove WeightToFee

* Remove leftover
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* Remove WeightToFee

* Remove leftover
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* Remove WeightToFee

* Remove leftover
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* Remove WeightToFee

* Remove leftover
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 10, 2024
* Remove WeightToFee

* Remove leftover
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 10, 2024
* Remove WeightToFee

* Remove leftover
bkchr pushed a commit that referenced this pull request Apr 10, 2024
* Remove WeightToFee

* Remove leftover
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A1-insubstantial Pull request requires no code review (e.g., a sub-repository hash update). D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. I2-bug The node fails to follow expected behavior. R0-silent Changes should not be mentioned in any release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rpc_methods did not include rpc_methods
3 participants