Skip to content

feat(bot-oo): add include/exclude proposal lists to OOv2 settler#4952

Open
md0x wants to merge 1 commit into
masterfrom
pablo/oo-settle-include-exclude
Open

feat(bot-oo): add include/exclude proposal lists to OOv2 settler#4952
md0x wants to merge 1 commit into
masterfrom
pablo/oo-settle-include-exclude

Conversation

@md0x
Copy link
Copy Markdown
Contributor

@md0x md0x commented Jun 1, 2026

Summary

Adds optional include/exclude proposal lists to the unified OO settlement bot, scoped to OptimisticOracleV2. This lets operators settle a specific subset of markets (or skip specific ones, e.g. sports games) without rebuilding infra.

Two new env vars (JSON arrays of "<txHash>:<logIndex>", matching the existing OG_WHITELIST/ASSERTION_BLACKLIST convention):

  • SETTLE_INCLUDE_LIST — settle only these proposals. Takes precedence over the exclude list.
  • SETTLE_EXCLUDE_LISTskip these proposals. Ignored when an include list is set.

Both unset preserves current behavior (settle everything). Proposals are identified by the transaction hash and log index of their ProposePrice event — data the bot already has, so no extra RPC calls.

Changes

  • requestKey.ts: proposalEventId(txHash, logIndex) helper, normalized to lowercase.
  • common.ts: parsing + validation of the two env vars (invalid format throws a clear error) into Sets on MonitoringParams.
  • SettleOOv2Requests.ts: filterByIncludeExclude applied after dropping already-settled requests; emits a debug log with kept/skipped counts and ids.
  • README.md: documents both vars.

Test plan

  • yarn hardhat test ./test/OptimisticOracleV2Bot.ts — 10 passing, including new cases for exclude-list skip and exclusive include-list (absent proposal → not settled, present → settled).

Adds SETTLE_INCLUDE_LIST and SETTLE_EXCLUDE_LIST env vars to the unified
OO settlement bot, scoped to OptimisticOracleV2. Proposals are matched by
their ProposePrice event identifier (<txHash>:<logIndex>). When an include
list is set the bot settles only those proposals (takes precedence over the
exclude list); otherwise proposals in the exclude list are skipped.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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: 85fc0e047a

ℹ️ 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 on lines +31 to +32
if (!Array.isArray(parsed) || parsed.length === 0) {
throw new Error(`${envName} must be a non-empty JSON array of "<txHash>:<logIndex>" strings`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Accept empty settlement lists

When SETTLE_INCLUDE_LIST or SETTLE_EXCLUDE_LIST is explicitly configured as [], the bot now throws during startup even though the README documents these vars as JSON arrays and empty arrays are a common no-op/default value for list env vars. This is especially surprising for SETTLE_EXCLUDE_LIST=[], which should behave the same as unset, and for SETTLE_INCLUDE_LIST=[], which can naturally mean settle no listed proposals; rejecting it can break deployments that template optional lists as empty arrays.

Useful? React with 👍 / 👎.

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