-
Notifications
You must be signed in to change notification settings - Fork 16
/
mod.rs
35 lines (27 loc) · 1.02 KB
/
mod.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use std::time::Duration;
use ckb_types::core::BlockNumber;
#[macro_use]
mod status;
mod filter;
pub(crate) mod light_client;
mod relayer;
mod synchronizer;
#[cfg(test)]
pub(crate) use filter::GET_BLOCK_FILTERS_TOKEN;
#[cfg(test)]
pub(crate) use light_client::{FetchInfo, LastState, PeerState, ProveRequest, ProveState};
pub(crate) use filter::FilterProtocol;
pub(crate) use light_client::{LightClientProtocol, Peers};
pub(crate) use relayer::{PendingTxs, RelayProtocol};
pub(crate) use status::{Status, StatusCode};
pub(crate) use synchronizer::SyncProtocol;
pub const BAD_MESSAGE_BAN_TIME: Duration = Duration::from_secs(5 * 60);
// Ban a peer if it reach any timeout.
pub const MESSAGE_TIMEOUT: u64 = 60 * 1000;
pub const LAST_N_BLOCKS: BlockNumber = 100;
// Copy from ckb/util/light-client-protocol-server
pub const GET_BLOCKS_PROOF_LIMIT: usize = 1000;
// Copy from ckb/util/light-client-protocol-server
pub const GET_TRANSACTIONS_PROOF_LIMIT: usize = 1000;
// Copy from ckb/sync
pub const CHECK_POINT_INTERVAL: BlockNumber = 2000;