#light #io #chain #storage #blockchain #header #client #vapory #block #tetsy

vapcore-light

Tetsy Vapory (VapCore) Light Client Implementation (Block Import IO Service, Blockchain Data Fetching, Light Client Header Chain Storage, Tetsy Light Protocol (PLP) Provider, Light Transaction Queue, CHT Definitions, Light Client Data Cache), Tetsy Light Protocol (PLP) Implementation, P2P Network I/O and Event Context Generalization, Peer Error Handling & Punishment, Request Load Timer & Distribution Manager, Pending Request Set Storage, Request Credit Management, Light Client Request Types, Request Chain Builder Utility, On-demand Chain Request Service over LES (for RPCs), ResponseGuard Implementation)

1 stable release

Uses old Rust 2015

1.12.0 Apr 5, 2021


Used in 3 crates (via vapcore-sync)

GPL-3.0 license

5.5MB
32K SLoC

vapcore-light


lib.rs:

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.

The light client performs a header-only sync, doing verification and pruning historical blocks. Upon pruning, batches of 2048 blocks have a number => (hash, TD) mapping sealed into "canonical hash tries" which can later be used to verify historical block queries from peers.

Dependencies

~22MB
~369K SLoC