Request construction
from_block and to_block are inclusive. With both bounds, get_logs reads the range in chunks: the first spans 2000 blocks (or the CLIENT's max_block_range when smaller), and a chunk with fewer than 5000 logs doubles the next, up to max_block_range. A provider's range limit fixes the chunk for the rest of the read. After a sparse chunk the next ten go as one JSON-RPC batch.
first := n or last := n keeps the n earliest or latest logs by (block_number, log_index), reading from that end up to the n-th; ORDER BY block_number[, log_index] LIMIT n directly over the call does too.
A statement makes at most determica_max_log_requests (200) eth_getLogs requests: a range that needs more raises before reading, a read that reaches it raises; never partial rows.
A NULL from_block or to_block raises; it never reads without bounds. from_block after to_block raises.
Without from_block, a live read takes its bounds from the query: block_number BETWEEN a AND b (or >= and <=, or =) in a WHERE or a join condition, with constants or columns of a joined relation, as in h JOIN get_logs(...) AS l ON l.block_number BETWEEN h.lo AND h.hi. A live read with no lower and upper bound raises before any request and says why the WHERE did not bound it.
block_timestamp comes with each log from the provider, so a log's time needs no header read; a log without it (or with 0x0) takes its block header's, one batched read per such block.
- RPC ADDRESS[] values are split into requests of at most 50 addresses.
- Pinned clients require both from_block and to_block. Retained execution clients reject either bound.