Backfill
A backfill loads past data that a pipeline has not read yet, such as every block from a start block up to today. Teams run one when a pipeline starts, when it adds a token or a contract, or when they need old data loaded again. Later runs then add only the new blocks.
In BlockJuice
In BlockJuice a backfill is the run that loads history: events, transfers or traces over a range of blocks. A stream source reads from its START_BLOCK to the finalized head of SQD Portal. Each run resumes after its cursor, so the first runs backfill and later runs add the new blocks.
MAX_BLOCKS_PER_RUN caps how many blocks one run reads, so a long backfill can go in steps. bj coverage prints the block ranges a source has loaded and verified, and the filters that produced them.
Change START_BLOCK or the addresses in addresses.json and the source starts a new generation with its own cursor. It backfills into the same raw table and keeps the rows earlier filters loaded. Raising END_BLOCK continues the same generation. To rebuild an unchanged setup, set a stable SOURCE_BACKFILL_ID in the root .env. None of this drops a raw table or erases a cursor.
bj answer checks that each history source covers the answer’s window of blocks. When one does not, it reports the gap and the check fails.
Example
A capped backfill of ERC-20 transfers. Repeat the run until bj coverage shows the whole window you need.
MAX_BLOCKS_PER_RUN=100000 uv run --project orchestration bj run transfersuv run --project orchestration bj coverage ethereum.erc20_transfers