Skip to content

5chan directory criteria: gate tree + bucketChainId (re-topics every contest) - #10

Merged
Rinse12 merged 1 commit into
masterfrom
gate-tree-and-bucket-chain-id
Aug 17, 2026
Merged

5chan directory criteria: gate tree + bucketChainId (re-topics every contest)#10
Rinse12 merged 1 commit into
masterfrom
gate-tree-and-bucket-chain-id

Conversation

@Rinse12

@Rinse12 Rinse12 commented Aug 17, 2026

Copy link
Copy Markdown
Member

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 the shared/directory-manifest.json that repo ships, which is the property this copy has to hold.

Blocked on @bitsocial/pubsub-voting releasing 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:

before after why
rule: { … } gate: { rule: { … } } the gate is a boolean tree now (all / any); a single rule is the wrapped leaf. Identity migration — the gate's meaning is unchanged
requires.chains: { baseSepolia: { chainId: 84532 } } bucketChainId: 84532 a contest counts in exactly one chain's blocks. The numeric id is what the EIP-712 ballot domain already signs over; a ticker was a label local to the document, and two documents spelling one chain differently would be two topics for one contest
rule.chain: "baseSepolia" (removed) 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 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:

  • 64 entries derive and validate;
  • 64 distinct topics (no accidental collision);
  • one bucketChainId across all of them (84532);
  • the pre-change file is now refused outright (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:

  1. release @bitsocial/pubsub-voting with the schema change;
  2. upgrade and redeploy the seeders to that version;
  3. merge the generator change in the site repo;
  4. merge here together with the client redeploy.

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

  • Bug Fixes
    • Updated voting eligibility defaults to apply the configured blockchain network directly.
    • Refined minimum-balance eligibility settings for improved consistency.
    • Removed an obsolete test-network configuration.

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a1e6f687-8f4c-4696-8d4e-82b4ee00ad49

📥 Commits

Reviewing files that changed from the base of the PR and between edddf18 and 2404094.

📒 Files selected for processing (1)
  • 5chan-directory-criteria.jsonc

📝 Walkthrough

Walkthrough

The voting defaults now set bucketChainId directly. The ERC-5192 minimum-balance rule is nested under gate.rule. The separate requires.chains.baseSepolia mapping is removed.

Changes

Voting Gate Configuration

Layer / File(s) Summary
Update voting criteria schema
5chan-directory-criteria.jsonc
The configuration sets the Base Sepolia chain ID with bucketChainId, nests the ERC-5192 minimum-balance rule under gate.rule, removes the rule’s chain field, and removes the separate requires.chains.baseSepolia mapping.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gate-tree-and-bucket-chain-id

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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
Rinse12 force-pushed the gate-tree-and-bucket-chain-id branch from 55decd6 to 2404094 Compare August 17, 2026 05:26
@Rinse12
Rinse12 marked this pull request as ready for review August 17, 2026 06:21
@Rinse12
Rinse12 merged commit c8fcbb6 into master Aug 17, 2026
1 check was pending
@Rinse12
Rinse12 deleted the gate-tree-and-bucket-chain-id branch August 17, 2026 06:22
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