#polkadot #ancestor #blockchain #substrate #numbers #cumulative

polkadot-node-core-chain-api

The Chain API subsystem provides access to chain related utility functions like block number to hash conversions

20 major breaking releases

new 22.0.0 Apr 4, 2025
21.0.0 Jan 29, 2025
20.0.0 Jan 14, 2025
18.0.0 Oct 1, 2024
0.0.0 Nov 21, 2022

#306 in Magic Beans

Download history 1406/week @ 2024-12-17 901/week @ 2024-12-24 911/week @ 2024-12-31 1219/week @ 2025-01-07 1286/week @ 2025-01-14 1069/week @ 2025-01-21 1212/week @ 2025-01-28 1251/week @ 2025-02-04 1249/week @ 2025-02-11 1064/week @ 2025-02-18 1198/week @ 2025-02-25 974/week @ 2025-03-04 1511/week @ 2025-03-11 1277/week @ 2025-03-18 1533/week @ 2025-03-25 1106/week @ 2025-04-01

5,558 downloads per month
Used in 4 crates (2 directly)

GPL-3.0-only

430KB
8K SLoC

Implements the Chain API Subsystem

Provides access to the chain data. Every request may return an error. At the moment, the implementation requires Client to implement HeaderBackend, we may add more bounds in the future if we will need e.g. block bodies.

Supported requests:

  • Block hash to number
  • Block hash to header
  • Block weight (cumulative)
  • Finalized block number to hash
  • Last finalized block number
  • Ancestors

Dependencies

~95–135MB
~2.5M SLoC