Skip to content

otb: share OO requests across duplicate Polymarket request IDs - #73

Open
chrismaree wants to merge 11 commits into
pablo/reporters-under-root-srcfrom
chrismaree/pm-v2-duplicate-request-aliases
Open

otb: share OO requests across duplicate Polymarket request IDs#73
chrismaree wants to merge 11 commits into
pablo/reporters-under-root-srcfrom
chrismaree/pm-v2-duplicate-request-aliases

Conversation

@chrismaree

@chrismaree chrismaree commented Aug 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Allows the same requester to register up to ten request IDs for the same price identifier, request rules, and liveness range.
  • Reuses one canonical Managed OO lifecycle and exposes its state and outcome through every linked request ID.
  • Emits RequestResolved for every linked ID before attempting callbacks.
  • Attempts report(requestId) for every linked ID at settlement, while keeping Managed OO settlement independent from callback success.
  • Immediately attempts reporting when a duplicate is initialized after the canonical request has already resolved; subsequent initialization calls are no-ops.
  • Preserves existing function signatures and appends one mapping to the ERC-7201 storage namespace.

This PR is stacked on #76, which moves the reporter package into the root source tree.

Why

Polymarket replacement token sets can require new request IDs with the same resolution rules. Reusing the existing Managed OO request avoids duplicate oracle work and prevents linked requests from resolving inconsistently.

Settlement safety

  • Registration caps each Managed OO request at ten linked request IDs, bounding both settlement loops.
  • The first loop emits every linked RequestResolved event before any callbacks, so callback failures cannot create partial event delivery.
  • The callback loop runs in an external self-call wrapped in try/catch, preventing a revert or out-of-gas failure from undoing resolution, resolution events, or Managed OO settlement.
  • Each individual callback also has its own try/catch, allowing later callbacks to continue after an isolated failure.
  • If the complete callback batch reverts, its callback effects roll back and ResolutionCallbacksFailed is emitted; individual permissionless report(requestId) transactions can then be submitted to the requester module.

Review focus

  • Upgradeable storage: the request-ID array mapping is appended after all existing namespaced fields.
  • Canonical routing: lifecycle reads and mutations for duplicate IDs resolve through the existing identifier-and-rules key.
  • Late registration: the first initialization after canonical resolution synchronizes reporting without creating another Managed OO request.
  • Settlement ordering: all bounded resolution events are emitted before the isolated bounded callback batch.

Validation

  • forge test --match-path 'test/reporters/*.t.sol' — 65 passed, 0 failed.
  • Focused formatter check for the modified reporter files — passed.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 851960f159

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pm-v2-oo-reporter/src/OOReporter.sol Outdated
Comment thread src/reporters/OOReporter.sol
Comment thread pm-v2-oo-reporter/src/OOReporter.sol Outdated
Comment thread pm-v2-oo-reporter/src/OOReporter.sol

@md0x md0x left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Overall, the shared-request approach looks good. I only left two non-blocking comments: remove the unnecessary legacy seeding since OOReporter has not been deployed, and reconsider or justify the hard-coded limit of ten linked request IDs. Approving the overall implementation.

Comment thread src/reporters/README.md
@md0x
md0x changed the base branch from unaudited-pm-v2-oo-reporter to pablo/reporters-under-root-src August 28, 2026 16:09
Comment thread src/reporters/OOReporter.sol
Comment thread src/reporters/OOReporter.sol Outdated
Comment thread src/reporters/OOReporter.sol Outdated
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.

2 participants