Crate ckb_sync[][src]

The Sync module

Sync module implement ckb sync protocol as specified here: https://github.com/nervosnetwork/rfcs/tree/master/rfcs/0000-block-sync-protocol

Macros

attempt

Similar to ?, attempt! is used for propagating Status.

Structs

NetTimeProtocol

Collect time offset samples from network peers and send notify to user if offset is too large

Relayer

Relayer protocol handle

Status

Process message status

SyncShared

Sync state shared between sync and relayer protocol

Synchronizer

Sync protocol handle

Enums

StatusCode

StatusCodes indicate whether a specific operation has been successfully completed. The StatusCode element is a 3-digit integer.

Constants

BAD_MESSAGE_BAN_TIME

Default ban time for message

BLOCK_DOWNLOAD_TIMEOUT

Block download timeout

BLOCK_DOWNLOAD_WINDOW

Block download window size

CHAIN_SYNC_TIMEOUT

Chain sync timout

CHECK_POINT_WINDOW

The point at which the scheduler adjusts the number of tasks, by default one adjustment per 512 blocks.

EVICTION_HEADERS_RESPONSE_TIME

Eviction response time

HEADERS_DOWNLOAD_HEADERS_PER_SECOND

Global Average Speed

HEADERS_DOWNLOAD_INSPECT_WINDOW

Inspect the headers downloading every 2 minutes

HEADERS_DOWNLOAD_TOLERABLE_BIAS_FOR_SINGLE_SAMPLE

Acceptable Lowest Instantaneous Speed: 75.0 KiB/second (300/4)

INIT_BLOCKS_IN_TRANSIT_PER_PEER

The default number of download blocks that can be requested at one time

MAX_BLOCKS_IN_TRANSIT_PER_PEER

Maximum number of download blocks that can be requested at one time

MAX_HEADERS_LEN

Default max get header response length, if it is greater than this value, the message will be ignored

MAX_LOCATOR_SIZE

The maximum number of entries in a locator

MAX_OUTBOUND_PEERS_TO_PROTECT_FROM_DISCONNECT

Protect at least this many outbound peers from disconnection due to slow behind headers chain.

MAX_TIP_AGE

The default init download block interval is 24 hours If the time of the local highest block is within this range, exit the ibd state

POW_INTERVAL

Pow interval

RETRY_ASK_TX_TIMEOUT_INCREASE

Interval between repeated inquiry transactions

SUSPEND_SYNC_TIME

Suspend sync time

SYNC_USELESS_BAN_TIME

Default ban time for sync useless