2019-01-07 11:33:07 +01:00
|
|
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
|
|
|
// This file is part of Parity Ethereum.
|
2016-10-27 15:09:17 +02:00
|
|
|
|
2019-01-07 11:33:07 +01:00
|
|
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
2016-10-27 15:09:17 +02:00
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
2019-01-07 11:33:07 +01:00
|
|
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
2016-10-27 15:09:17 +02:00
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
2019-01-07 11:33:07 +01:00
|
|
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
2016-10-27 15:09:17 +02:00
|
|
|
|
2016-09-19 11:29:50 +02:00
|
|
|
//! Light client logic and implementation.
|
|
|
|
//!
|
|
|
|
//! A "light" client stores very little chain-related data locally
|
|
|
|
//! unlike a full node, which stores all blocks, headers, receipts, and more.
|
|
|
|
//!
|
|
|
|
//! This enables the client to have a much lower resource footprint in
|
|
|
|
//! exchange for the cost of having to ask the network for state data
|
|
|
|
//! while responding to queries. This makes a light client unsuitable for
|
|
|
|
//! low-latency applications, but perfectly suitable for simple everyday
|
|
|
|
//! use-cases like sending transactions from a personal account.
|
|
|
|
//!
|
2016-12-13 20:13:16 +01:00
|
|
|
//! The light client performs a header-only sync, doing verification and pruning
|
2017-03-06 12:21:06 +01:00
|
|
|
//! historical blocks. Upon pruning, batches of 2048 blocks have a number => (hash, TD)
|
2016-12-13 20:13:16 +01:00
|
|
|
//! mapping sealed into "canonical hash tries" which can later be used to verify
|
|
|
|
//! historical block queries from peers.
|
2016-09-19 11:29:50 +02:00
|
|
|
|
2016-12-11 15:40:31 +01:00
|
|
|
#![deny(missing_docs)]
|
2016-11-09 18:05:56 +01:00
|
|
|
|
2016-11-04 19:40:11 +01:00
|
|
|
pub mod client;
|
2017-01-16 16:55:23 +01:00
|
|
|
pub mod cht;
|
2016-11-04 19:40:11 +01:00
|
|
|
pub mod net;
|
2017-03-16 20:23:59 +01:00
|
|
|
pub mod on_demand;
|
2017-02-08 19:21:12 +01:00
|
|
|
pub mod transaction_queue;
|
2017-02-16 18:07:28 +01:00
|
|
|
pub mod cache;
|
2016-11-04 19:40:11 +01:00
|
|
|
pub mod provider;
|
2016-09-19 11:29:50 +02:00
|
|
|
|
2016-12-05 16:55:33 +01:00
|
|
|
mod types;
|
|
|
|
|
2017-03-22 21:09:43 +01:00
|
|
|
pub use self::cache::Cache;
|
2018-08-25 23:06:01 +02:00
|
|
|
pub use self::provider::{Provider, MAX_HEADERS_PER_REQUEST};
|
2017-02-09 19:17:37 +01:00
|
|
|
pub use self::transaction_queue::TransactionQueue;
|
2017-03-03 19:25:29 +01:00
|
|
|
pub use types::request as request;
|
2016-12-05 16:55:33 +01:00
|
|
|
|
2017-05-23 12:31:09 +02:00
|
|
|
#[macro_use]
|
|
|
|
extern crate serde_derive;
|
|
|
|
|
2016-12-05 16:55:33 +01:00
|
|
|
#[macro_use]
|
|
|
|
extern crate log;
|
|
|
|
|
2017-05-23 12:31:09 +02:00
|
|
|
extern crate bincode;
|
2019-08-13 12:33:34 +02:00
|
|
|
extern crate client_traits;
|
2019-01-04 14:05:46 +01:00
|
|
|
extern crate common_types;
|
2019-08-15 17:59:22 +02:00
|
|
|
extern crate engine;
|
2019-01-04 14:05:46 +01:00
|
|
|
extern crate ethcore_blockchain;
|
|
|
|
extern crate ethcore_db;
|
2016-12-05 16:55:33 +01:00
|
|
|
extern crate ethcore_io as io;
|
2017-05-23 12:31:09 +02:00
|
|
|
extern crate ethcore_network as network;
|
2019-08-22 18:25:49 +02:00
|
|
|
extern crate executive_state;
|
Delete crates from parity-ethereum and fetch them from parity-common instead (#9083)
Use crates from parity-common: hashdb, keccak-hash, kvdb, kvdb-memorydb, kvdb-rocksdb, memorydb, parity-bytes, parity-crypto, path, patricia_trie, plain_hasher, rlp, target, test-support, trie-standardmap, triehash
2018-07-10 14:59:19 +02:00
|
|
|
extern crate parity_bytes as bytes;
|
2018-01-10 13:35:18 +01:00
|
|
|
extern crate ethereum_types;
|
2019-04-12 13:36:49 +02:00
|
|
|
extern crate ethcore_miner as miner;
|
2019-02-20 19:09:34 +01:00
|
|
|
extern crate hash_db;
|
2019-06-19 13:54:05 +02:00
|
|
|
extern crate parity_util_mem;
|
|
|
|
extern crate parity_util_mem as malloc_size_of;
|
2018-12-05 10:36:53 +01:00
|
|
|
extern crate failsafe;
|
2016-12-27 16:43:28 +01:00
|
|
|
extern crate futures;
|
2018-07-02 18:50:05 +02:00
|
|
|
extern crate keccak_hasher;
|
2019-08-13 12:33:34 +02:00
|
|
|
extern crate machine;
|
2019-02-20 19:09:34 +01:00
|
|
|
extern crate memory_db;
|
|
|
|
extern crate trie_db as trie;
|
2018-07-02 18:50:05 +02:00
|
|
|
extern crate patricia_trie_ethereum as ethtrie;
|
2018-08-09 09:51:48 +02:00
|
|
|
extern crate fastmap;
|
2017-05-23 12:31:09 +02:00
|
|
|
extern crate rand;
|
|
|
|
extern crate rlp;
|
2017-09-02 20:09:13 +02:00
|
|
|
extern crate parking_lot;
|
2017-08-20 06:01:46 +02:00
|
|
|
#[macro_use]
|
|
|
|
extern crate rlp_derive;
|
2017-05-23 12:31:09 +02:00
|
|
|
extern crate serde;
|
2019-08-23 15:32:58 +02:00
|
|
|
extern crate spec;
|
2017-05-23 12:31:09 +02:00
|
|
|
extern crate smallvec;
|
2017-02-17 17:08:46 +01:00
|
|
|
extern crate stats;
|
2017-08-01 12:37:57 +02:00
|
|
|
extern crate vm;
|
2017-11-10 19:04:55 +01:00
|
|
|
extern crate keccak_hash as hash;
|
Delete crates from parity-ethereum and fetch them from parity-common instead (#9083)
Use crates from parity-common: hashdb, keccak-hash, kvdb, kvdb-memorydb, kvdb-rocksdb, memorydb, parity-bytes, parity-crypto, path, patricia_trie, plain_hasher, rlp, target, test-support, trie-standardmap, triehash
2018-07-10 14:59:19 +02:00
|
|
|
extern crate triehash_ethereum as triehash;
|
2017-10-10 20:01:27 +02:00
|
|
|
extern crate kvdb;
|
2017-10-15 13:40:00 +02:00
|
|
|
extern crate memory_cache;
|
2019-06-17 08:44:59 +02:00
|
|
|
extern crate derive_more;
|
2019-08-28 10:09:42 +02:00
|
|
|
extern crate verification;
|
2016-12-08 13:44:17 +01:00
|
|
|
|
2019-08-28 10:09:42 +02:00
|
|
|
#[cfg(test)]
|
|
|
|
extern crate ethcore;
|
2018-03-01 19:53:15 +01:00
|
|
|
#[cfg(test)]
|
|
|
|
extern crate kvdb_memorydb;
|
2017-03-21 20:57:13 +01:00
|
|
|
#[cfg(test)]
|
2017-11-14 17:47:41 +01:00
|
|
|
extern crate tempdir;
|
2019-02-20 19:09:34 +01:00
|
|
|
extern crate journaldb;
|