Skip to main content

Module block

Module block 

Source
Expand description

The --to-block block-identifier port .

Mirrors cli/pool.py::_resolve_to_block and its cli/aave.py twin exactly:

  • a concrete integer is used as-is;
  • a pure tag (latest, safe, …) with no offset resolves to None — the Rust core fetches the chain tip via eth_blockNumber itself;
  • a tag with an offset (latest:-64, safe:128) or a concrete integer resolves to a concrete block number (the tag’s block + the offset).

Parsing is split from resolution so the semantics are unit-testable offline: parse_to_block is pure, resolve_to_block performs the one RPC read a tag+offset needs.

Enums§

BlockTag
A block tag accepted by --to-block.
ToBlockSpec
A parsed --to-block value, before the tag’s block number is read.

Constants§

DEFAULT_CHUNK_SIZE
The --chunk default (10_000), ported from cli/pool.py.
DEFAULT_TO_BLOCK
The --to-block default (latest:-64), ported from cli/pool.py.
DEFAULT_VERIFY_ALL_INTERVAL
The --verify-all-interval default (1_000_000), ported from cli/pool.py.

Functions§

checksum
EIP-55-checksum an address for a DB key / RPC target.
parse_to_block
Parse a --to-block string into a ToBlockSpec.
resolve_chain_selector
Parse a chain selector (base, ethereum, arbitrum, or a numeric id).
resolve_to_block
Resolve a parsed spec to an optional concrete block number.