5chan directory criteria: gate tree + bucketChainId (re-topics every contest) - #10
Merged
Merged
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe voting defaults now set ChangesVoting Gate Configuration
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Regenerated by scripts/generate-directory-manifest.ts, not hand-edited:
byte-identical to the shared/directory-manifest.json the voting site
ships, which is the property this copy has to hold.
Three document changes that land as ONE cutover, because each of them
re-CIDs every derived criteria document and so re-topics all 64
contests:
- `rule` -> `gate`, the boolean tree over rule refs. The identity
migration is `gate: { rule: <the old rule ref> }`, which is what this
uses: the gate's meaning is unchanged, only its spelling.
- `requires.chains` (a ticker -> chainId map) -> a single top-level
`bucketChainId`. A contest counts in exactly one chain's blocks, and
naming it by numeric id is what the EIP-712 ballot domain already
signs over; a ticker was a label local to the document.
- the rule ref drops its `chain` option. Every rule reads the chain the
contest counts in, so the document no longer says it twice.
Paying for these separately would be three re-topics. Votes on the old
topics are not migrated; they decay on their own expiry.
The generator validates as it writes: all 64 entries derive through
deriveDirectoryCriteria, pass the rule registry, and yield 64 distinct
topics. The pre-change file is now refused outright rather than silently
deriving a different topic, since the criteria schemas are strict.
Rinse12
force-pushed
the
gate-tree-and-bucket-chain-id
branch
from
August 17, 2026 05:26
55decd6 to
2404094
Compare
Rinse12
marked this pull request as ready for review
August 17, 2026 06:21
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.
Draft until the library release lands. Regenerated by
scripts/generate-directory-manifest.ts(in the voting-site repo) against the new schema — not hand-edited — and byte-identical to theshared/directory-manifest.jsonthat repo ships, which is the property this copy has to hold.Blocked on
@bitsocial/pubsub-votingreleasing the schema change (pubsub-voting#35, unreleased). The generator change is ready and lands in the site repo alongside it.What changes
Three document changes, landing as one cutover because each re-CIDs every derived criteria document — and the topic is that CID, so all 64 contests get new topics:
rule: { … }gate: { rule: { … } }all/any); a single rule is the wrapped leaf. Identity migration — the gate's meaning is unchangedrequires.chains: { baseSepolia: { chainId: 84532 } }bucketChainId: 84532rule.chain: "baseSepolia"Paying for these separately would be three re-topics instead of one. Votes on the old topics are not migrated — they decay on their own expiry.
Verification
The generator validates as it writes, through the library's own
deriveDirectoryCriteria+ the rule registry:bucketChainIdacross all of them (84532);bucketChainId: expected number, received undefined) rather than parsing with the key stripped and deriving a different topic — the criteria schemas are strict for exactly this reason.Rollout order
Unchanged from the order the README already spells out, and it matters more than usual here — flipping this file first strands every contest until the seeders catch up:
@bitsocial/pubsub-votingwith the schema change;A seeder on an older library recuses from the new criteria (it cannot even parse
gate), leaving those contests unseeded — correct behaviour, but only if it happens after step 2 rather than before.Summary by CodeRabbit