feat(bot-oo): add include/exclude proposal lists to OOv2 settler#4952
feat(bot-oo): add include/exclude proposal lists to OOv2 settler#4952md0x wants to merge 1 commit into
Conversation
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.
There was a problem hiding this comment.
💡 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".
| if (!Array.isArray(parsed) || parsed.length === 0) { | ||
| throw new Error(`${envName} must be a non-empty JSON array of "<txHash>:<logIndex>" strings`); |
There was a problem hiding this comment.
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 👍 / 👎.
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 existingOG_WHITELIST/ASSERTION_BLACKLISTconvention):SETTLE_INCLUDE_LIST— settle only these proposals. Takes precedence over the exclude list.SETTLE_EXCLUDE_LIST— skip 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
ProposePriceevent — 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) intoSets onMonitoringParams.SettleOOv2Requests.ts:filterByIncludeExcludeapplied 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).