Repository navigation
Fix uniqueness check for firehose.firstStreamableBlock.id - #261
Merged
YaroShkvorets merged 1 commit intoNov 6, 2026
Merged
Conversation
YaroShkvorets
self-requested a review
November 6, 2026 18:04
YaroShkvorets
approved these changes
Nov 6, 2026
validateUniqueness split each field path on the first dot only, so the three-level path firehose.firstStreamableBlock.id compared the firstStreamableBlock objects instead of their ids. Distinct objects are never equal, so a duplicated genesis block id was never reported. Resolve dotted paths of any depth, descending into arrays at every level.
YaroShkvorets
force-pushed
the
fix-unique-genesis-check
branch
from
November 6, 2026 18:12
46131e9 to
a501a44
Compare
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.
Problem
validateUniquenessinsrc/validate_logic.tsresolves a dotted field withfield.split(".")and only keeps the first two parts. Forfirehose.firstStreamableBlock.idthat readsn.firehose.firstStreamableBlock, the{ id, height }object, not itsid. Duplicates are then found withvalues.indexOf(v) !== i, and two different objects are never equal, so this check never reports anything. TheALLOWED_DUPLICATESlist (avalanche/fuji, the zkSync-stack chains, solana/solana-accounts) holds genesis block ids, which shows the check was meant to compare ids.Reproduction on
main(bf74250):cp -r registry /tmp/reg-dup # give robinhood-sepolia the genesis id of robinhood (0xaad15f3d…305c) bun run ./src/validate_logic.ts /tmp/reg-dupResult: no error, exit code 0. The duplicated genesis id goes through.
Fix
Add a small
valuesAtPathhelper. It resolves a dotted path of any depth and descends into arrays at every level.validateUniquenessnow uses it for every field. Falsy values are still dropped, as before.Validation
bun run ./src/validate_logic.ts /tmp/reg-dupnow fails with exit 1:Duplicate field: "firehose.firstStreamableBlock.id = 0xaad15f3d702aaea00caf3e9bb56395efe9127bc3b31b24921abf1eee3409305c".bun validate:networkson the realregistry/still passes (exit 0, warnings unchanged). The existing allowed duplicates are the only shared genesis ids today.firehose.firstStreamableBlock.id, which now yields 159 id strings instead of 159 objects.bun validate:schema,bun generate:registryandbun validate:registrypass.Notes
The file was not Prettier-clean before this change (it uses tabs), so I did not reformat it. The diff only touches the uniqueness check.