Skip to content

[Chore] Missing Revealed event on tholos-v2's auto-reveal path #156

Description

@collinsezedike

Summary

open_reveal_phase (contracts/tholos-v2/src/lib.rs:1322-1364) auto-reveals the asserter's and disputer's fixed positions the moment Reveal opens: it marks each position.revealed = true, sets position.agrees_with_outcome, and tallies their weight into resolution.agree_weight/disagree_weight (lib.rs:1340-1357). It publishes RevealOpened for the phase transition itself, but never a Revealed event for either of the two positions it just revealed.

By contrast, an external voter's explicit reveal() call does publish Revealed { id, voter, choice } (lib.rs:1562). An off-chain indexer or keeper reconstructing per-voter reveal state purely from Revealed events would silently miss the asserter's and disputer's votes, the two that are guaranteed to exist on every disputed assertion, even though the on-chain state itself is fully consistent.

Scope

  • Emit a Revealed event (or equivalent) for each of the asserter's and disputer's fixed positions inside open_reveal_phase, alongside the existing RevealOpened event, so indexers see a complete set of reveals without needing to separately special-case the two protocol-fixed positions.
  • No behavior change to phase transition or weight tallying logic itself.
  • Add a test asserting both events are published when Reveal opens.

Proposed approach

Reuse the existing Revealed event struct, publishing one for assertion.asserter and one for disputer right after their Position writes in open_reveal_phase's loop, using each one's already-known agrees_with_asserter value as choice.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignchoreDependency bumps, CI/tooling tweaks, docs-only changes, and cleanup that isn't a new capabilityeasySmall, low-risk change

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions