Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

parity_getBlockHeaderByNumber and LightFetch utility #5383

Merged
merged 5 commits into from
Apr 12, 2017
Merged

Conversation

rphmeier
Copy link
Contributor

@rphmeier rphmeier commented Apr 3, 2017

Hand-off to @jacogr

The motivation behind this method is to lower the strain on nodes being polled for latest block info by the UI. Recent headers and total difficulty are always available on the light client, while recent block bodies are not.

Moves some utilities of the eth RPCs for fetching data either from the local chain or from the network into a LightFetch which can be instantiated from various different RPCs.

Uses LightFetch from the parity RPC implementation to implement parity_getBlockHeaderByNumber.

use ethsync::LightSync;
use util::{Address, Mutex, Uint, U256};

use v1::helpers::{CallRequest as CRequest, errors, dispatch};
Copy link
Contributor

Choose a reason for hiding this comment

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

consider CRequest -> CallRequestHelper to aid readability.

@gavofyork gavofyork added A6-mustntgrumble 💦 Pull request has areas for improvement. The author need not address them before merging. and removed A0-pleasereview 🤓 Pull request needs code review. labels Apr 8, 2017
@gavofyork
Copy link
Contributor

marking inprogress until resolved.

@gavofyork gavofyork added A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. and removed A6-mustntgrumble 💦 Pull request has areas for improvement. The author need not address them before merging. labels Apr 10, 2017
@rphmeier rphmeier added A0-pleasereview 🤓 Pull request needs code review. and removed A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. labels Apr 10, 2017
@gavofyork gavofyork added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Apr 12, 2017
@rphmeier rphmeier merged commit 1363341 into master Apr 12, 2017
@rphmeier rphmeier deleted the block_header_rpc branch April 12, 2017 12:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M6-rpcapi 📣 RPC API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants