Skip to content

feat: add --block-number-pad-width to fix filename overflow on high-block chains#261

Open
tholcman wants to merge 1 commit into
paradigmxyz:mainfrom
tholcman:feat/block-number-pad-width
Open

feat: add --block-number-pad-width to fix filename overflow on high-block chains#261
tholcman wants to merge 1 commit into
paradigmxyz:mainfrom
tholcman:feat/block-number-pad-width

Conversation

@tholcman
Copy link
Copy Markdown

Motivation

Closes #260.

NumberChunk::format_item hardcodes {:0>8}. At block 100,000,000 the padding silently overflows to 9 digits, breaking lexicographic sort of output files. BSC crossed this threshold in May 2026.

Solution

Add --block-number-pad-width <N> (default 8, fully backward-compatible). The value threads from the CLI arg through FileOutput.block_number_pad_widthPartition::label()ChunkData::stub()NumberChunk::format_item. All other ChunkData implementors (BinaryChunk and its type aliases) accept pad_width and ignore it.

Operators on high-block chains pass --block-number-pad-width 16, which covers any realistic block number without requiring future migrations.

Python bindings: block_number_pad_width exposed in CryoCliArgs type stub and both adapter functions with default 8.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes — none at default

…lock chains

NumberChunk::format_item hardcodes {:0>8}, which silently overflows to 9+
digits at block 100_000_000, breaking lexicographic sort of output files.
BSC crossed this threshold in May 2026; Polygon is approaching ~70M blocks.

Add --block-number-pad-width <N> (default 8, backward-compatible). The value
threads from CLI arg -> FileOutput.block_number_pad_width -> Partition::label()
-> ChunkData::stub() -> NumberChunk::format_item. All other ChunkData
implementors (BinaryChunk and its aliases) accept pad_width and ignore it.

Operators on high-block chains pass --block-number-pad-width 16, which covers
any realistic block number without requiring future migrations.

Python bindings: block_number_pad_width exposed in CryoCliArgs type stub and
both adapter functions with default 8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Block number padding overflows at 9 digits (BSC already affected, Polygon next)

1 participant