Skip to content

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

Open
chrismaree wants to merge 4 commits into
unaudited-pm-v2-oo-reporterfrom
chrismaree/pm-v2-duplicate-request-aliases
Open

otb: share OO requests across duplicate Polymarket request IDs#73
chrismaree wants to merge 4 commits into
unaudited-pm-v2-oo-reporterfrom
chrismaree/pm-v2-duplicate-request-aliases

Conversation

@chrismaree

@chrismaree chrismaree commented Aug 25, 2026

Copy link
Copy Markdown
Member

What Changed

  • Allows the same requester to register any number of request IDs for the same price identifier, request rules, and liveness range.
  • Reuses the original Managed OO lifecycle when a linked request ID is initialized.
  • Resolves every linked request ID from the shared outcome and attempts report(requestId) once for each ID at settlement.
  • Runs the unbounded callback fan-out in an external self-call wrapped in try/catch, so a revert or out-of-gas failure cannot undo the stored resolution or Managed OO settlement.
  • If a replacement ID is registered after the shared request resolves, its first initialization immediately attempts report(requestId); later initialization calls are no-ops.
  • Preserves existing function signatures and appends one mapping to the ERC-7201 storage namespace.

Why

Polymarket can need to initialize replacement token sets with new request IDs while keeping identical resolution rules. The reporter should reuse the existing oracle result instead of rejecting the registration or creating duplicate oracle work.

Impact

  • One Managed OO request can serve an unbounded number of Polymarket request IDs.
  • Different requesters or different liveness ranges remain rejected.
  • If the complete callback fan-out fails, including from running out of gas, its callback effects are rolled back while the resolution remains stored. Operators can then call each module permissionlessly with report(requestId) off-chain.

High risk Sections to review with detail

  • Upgradeable storage: the request-ID array mapping is appended after all existing namespaced fields.
  • Canonical lookup: lifecycle reads and mutations resolve duplicate IDs through the existing identifier-and-rules key.
  • Settlement: resolved state is committed before the isolated callback fan-out, and both individual callback failures and complete fan-out failures remain nonblocking.

Validation

  • cd pm-v2-oo-reporter && forge test — 64 passed, 0 failed.
  • Includes an explicit test that exhausts the callback frame gas and verifies the resolution survives.
  • forge fmt --check — 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 pm-v2-oo-reporter/src/OOReporter.sol
Comment thread pm-v2-oo-reporter/src/OOReporter.sol Outdated
Comment thread pm-v2-oo-reporter/src/OOReporter.sol Outdated

@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 pm-v2-oo-reporter/README.md
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