Implement PIP messages, request builder, and handlers (#4945)

* return errors on database corruption

* fix tests, json tests

* fix remainder of build

* buffer flow -> request credits

* proving state backend

* generate transaction proofs from provider

* network messages for transaction proof

* transaction proof test

* test for transaction proof message

* fix call bug

* request transaction proofs from on_demand

* most of proved_execution rpc

* proved execution future

* initial request definitions

* RLP encoding and decoding for requests

* proofs of non-existance in ProvingBlockChainClient

* new requests in provider.

* encode and decode responses

* complete initial request changes

* handle request packet in LightProtocol

* handle response packets

* implement requesting from

* re-do cost table

* get tests compiling

* fix cost table RLP encoding

* roundtrip tests for request types

* request builder tests

* move request_builder -> request::builder

* get network tests working

* return only complete headers responses

* request builder improvements

* New version of jsonrpc.

* split request filling into fill,complete

* Better invalid encoding messages

* Fixing deprecated methods of tokio_core

* use PIP messages in on_demand, old API

* migrate oneshot::complete to send in on_demand

* get on_demand tests to compile

* port ethsync to PIP messages

* adjust to minor on_demand API changes in RPC

* Using dedicated branch for jsonrpc

* Bump
This commit is contained in:
Robert Habermeier
2017-03-23 13:17:05 +01:00
committed by Gav Wood
parent b931a225ba
commit 64cec5ff7d
28 changed files with 2800 additions and 2095 deletions

View File

@@ -28,6 +28,7 @@ use io::IoChannel;
use light::client::Client as LightClient;
use light::net::{LightProtocol, IoContext, Capabilities, Params as LightParams};
use light::net::request_credits::FlowParams;
use light::provider::LightProvider;
use network::{NodeId, PeerId};
use util::RwLock;
@@ -71,7 +72,7 @@ enum PeerData {
}
// test peer type.
// Either a full peer or a LES peer.
// Either a full peer or a light peer.
pub struct Peer {
proto: LightProtocol,
queue: RwLock<VecDeque<TestPacket>>,
@@ -115,7 +116,8 @@ impl Peer {
},
};
let mut proto = LightProtocol::new(chain.clone(), params);
let provider = LightProvider::new(chain.clone(), Arc::new(RwLock::new(Default::default())));
let mut proto = LightProtocol::new(Arc::new(provider), params);
proto.add_handler(sync.clone());
Peer {
proto: proto,