feat: add --block-number-pad-width to fix filename overflow on high-block chains#261
Open
tholcman wants to merge 1 commit into
Open
feat: add --block-number-pad-width to fix filename overflow on high-block chains#261tholcman wants to merge 1 commit into
tholcman wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Closes #260.
NumberChunk::format_itemhardcodes{: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>(default8, fully backward-compatible). The value threads from the CLI arg throughFileOutput.block_number_pad_width→Partition::label()→ChunkData::stub()→NumberChunk::format_item. All otherChunkDataimplementors (BinaryChunkand its type aliases) acceptpad_widthand 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_widthexposed inCryoCliArgstype stub and both adapter functions with default8.PR Checklist