Skip to content

inventory: keep genesis chain id within 32-bit range - #188

Open
barnabasbusa wants to merge 1 commit into
masterfrom
fix/chain-id-fit-32bit
Open

inventory: keep genesis chain id within 32-bit range#188
barnabasbusa wants to merge 1 commit into
masterfrom
fix/chain-id-fit-32bit

Conversation

@barnabasbusa

Copy link
Copy Markdown
Contributor

Drops one digit from the random part of ethereum_genesis_chain_id so generated chain ids are 9 digits (701000000709999999) instead of 10 (70100000007099999999).

The 10-digit ids exceed both uint32 max (4,294,967,295) and int32 max (2,147,483,647), which breaks any tooling that stores the chain id as a 32-bit integer. 9 digits with a 70 prefix fits in int32 with headroom.

start is reduced alongside the max so the id stays fixed-length (and so Jinja's random doesn't error on start > end).

Only affects newly generated genesis; existing baked network-configs are unchanged.

https://claude.ai/code/session_01SR2hVqU8pi6v4NZ7RJwcxm

Drop one random digit so chain ids are 9 digits (701,000,000-709,999,999)
instead of 10 (7,010,000,000-7,099,999,999), which exceeds uint32/int32
max and breaks tooling that stores the chain id as a 32-bit integer.

Claude-Session: https://claude.ai/code/session_01SR2hVqU8pi6v4NZ7RJwcxm

@redpandabot redpandabot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reduces the random part of ethereum_genesis_chain_id from an 8-digit to a 7-digit value so generated chain ids are 9 digits (701000000-709999998) and fit in int32/uint32. Verified against the pinned ansible==10.1.0 'random' filter (randrange end-exclusive): the new range produces only 7-digit random parts and start was correctly reduced to keep the id fixed-length and avoid an empty-range ValueError. No committed network-config artifacts exist in this repo to drift out of sync. Change is correct.


Reviewed 1 changed file(s) @ a9c9b668 — no blocking issues found.
"If you can't measure it, you can't improve it." — Peter Drucker

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.

1 participant