Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

rpc: Add config options limiting getConfirmedBlock response data #15970

Merged
merged 6 commits into from
Mar 18, 2021

Conversation

CriesofCarrots
Copy link
Contributor

Problem

The getConfirmedBlock RPC response can be quite massive when considering transaction details and metadata as well as a ton of reward information for blocks on the epoch boundary. Not all consumers will need this information but currently everyone has to pay the cost of bandwidth and response time.

Summary of Changes

  • Extend RpcConfirmedBlockConfig to support different levels of transaction details: all, signatures, or none
  • Extend RpcConfirmedBlockConfig to allow suppressing reward info
  • Add RpcClient method, and use in cli when fetching epoch rewards. Client methods returning EncodedConfirmedBlock are still supported.

Fixes #15817

mvines
mvines previously approved these changes Mar 18, 2021
Copy link
Contributor

@mvines mvines left a comment

Choose a reason for hiding this comment

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

lgtm, just some nits on the API

docs/src/developing/clients/jsonrpc-api.md Outdated Show resolved Hide resolved
docs/src/developing/clients/jsonrpc-api.md Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Mar 18, 2021

Codecov Report

Merging #15970 (3b10f62) into master (7f500d6) will decrease coverage by 0.0%.
The diff coverage is 64.3%.

@@            Coverage Diff            @@
##           master   #15970     +/-   ##
=========================================
- Coverage    79.9%    79.9%   -0.1%     
=========================================
  Files         409      409             
  Lines      107203   107299     +96     
=========================================
+ Hits        85698    85752     +54     
- Misses      21505    21547     +42     

Copy link
Contributor

@jstarry jstarry left a comment

Choose a reason for hiding this comment

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

lgtm, agree with @mvines' name changes

@mergify mergify bot dismissed mvines’s stale review March 18, 2021 06:17

Pull request has been modified.

@CriesofCarrots CriesofCarrots added the automerge Merge this Pull Request automatically once CI passes label Mar 18, 2021
@mergify mergify bot merged commit aa54c46 into solana-labs:master Mar 18, 2021
mergify bot pushed a commit that referenced this pull request Mar 18, 2021
)

* Add new confirmed block struct

* Add RpcConfirmedBlockConfig options

* Configure block response based on new options

* Add client api, use in cli fetch_epoch_rewards

* Update docs

* Apply review suggestions

(cherry picked from commit aa54c46)

# Conflicts:
#	core/src/rpc.rs
mergify bot pushed a commit that referenced this pull request Mar 18, 2021
)

* Add new confirmed block struct

* Add RpcConfirmedBlockConfig options

* Configure block response based on new options

* Add client api, use in cli fetch_epoch_rewards

* Update docs

* Apply review suggestions

(cherry picked from commit aa54c46)
mergify bot added a commit that referenced this pull request Mar 18, 2021
) (#15995)

* Add new confirmed block struct

* Add RpcConfirmedBlockConfig options

* Configure block response based on new options

* Add client api, use in cli fetch_epoch_rewards

* Update docs

* Apply review suggestions

(cherry picked from commit aa54c46)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
mergify bot added a commit that referenced this pull request Mar 18, 2021
…15970) (#15994)

* rpc: Add config options limiting getConfirmedBlock response data (#15970)

* Add new confirmed block struct

* Add RpcConfirmedBlockConfig options

* Configure block response based on new options

* Add client api, use in cli fetch_epoch_rewards

* Update docs

* Apply review suggestions

(cherry picked from commit aa54c46)

# Conflicts:
#	core/src/rpc.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
@CriesofCarrots CriesofCarrots deleted the gcb-options branch March 30, 2021 16:28
@brooksprumo brooksprumo mentioned this pull request Aug 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rpc: Add options for limiting getConfirmedBlock response data
3 participants