Skip to content

BM-2012: Per-requestor and per-selector min_mcycle_price pricing overrides#1663

Merged
capossele merged 12 commits intomainfrom
angelo/bm-2012-per-requestor-pricing
Feb 24, 2026
Merged

BM-2012: Per-requestor and per-selector min_mcycle_price pricing overrides#1663
capossele merged 12 commits intomainfrom
angelo/bm-2012-per-requestor-pricing

Conversation

@capossele
Copy link
Copy Markdown
Contributor

@capossele capossele commented Feb 18, 2026

Adds support for configuring min_mcycle_price overrides per requestor address, per selector, or per requestor+selector combo via the broker.toml file (market.pricing-overrides section). This allows operators to price specific requestors or proof types (e.g. Groth16) differently without changing the global default.

@linear
Copy link
Copy Markdown

linear Bot commented Feb 18, 2026

@github-actions github-actions Bot changed the title Per-requestor and per-selector min_mcycle_price pricing overrides BM-2012: Per-requestor and per-selector min_mcycle_price pricing overrides Feb 18, 2026
Comment thread broker-template.toml Outdated
Comment on lines +28 to +47
# Optional path to a JSON file with per-requestor and per-selector pricing overrides.
# When set, the broker checks the file for a matching override before falling back to
# the global min_mcycle_price above. See the example file format:
#
# {
# "by_requestor": {
# "0xAbC...123": { "min_mcycle_price": "0.0001 USD" }
# },
# "by_selector": {
# "0x12345678": { "min_mcycle_price": "0.0005 USD" }
# },
# "by_requestor_selector": {
# "0xAbC...123:0x12345678": { "min_mcycle_price": "0.001 USD" }
# }
# }
#
# Resolution priority: requestor+selector > selector > requestor > global default.
# The file is automatically hot-reloaded every 60 seconds; no broker restart needed.
# Copy pricing-overrides.template.json to pricing-overrides.json to get started.
pricing_overrides_path = "pricing-overrides.json"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why have it as another file that is being watched instead of just handling it as toml within this config?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It felt more natural to use a JSON for this particular data structure; and the idea was to keep this file clean.

But ultimately I'm fine with anything, don't have a strong opinion either way

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed

Copy link
Copy Markdown
Contributor

@willpote willpote left a comment

Choose a reason for hiding this comment

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

Overall this looks good, I'm think we should name it "proof type" instead of "selector", as proof type is what we use in the docs + SDK

Comment on lines +519 to +525
/// Per-requestor and per-selector `min_mcycle_price` overrides.
///
/// When the broker evaluates an order, it resolves the effective `min_mcycle_price`
/// with priority: `by_requestor_selector` > `by_selector` > `by_requestor` > global default.
/// Changes to this section are picked up automatically when the broker reloads `broker.toml`.
#[serde(default)]
pub pricing_overrides: PricingOverrides,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall this looks good, I'm think we should name it "proof type" instead of "selector", as proof type is what we use in the docs + SDK

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 346f7e8

@capossele capossele merged commit e119fb1 into main Feb 24, 2026
25 checks passed
@capossele capossele deleted the angelo/bm-2012-per-requestor-pricing branch February 24, 2026 17:59
willpote pushed a commit that referenced this pull request Feb 25, 2026
…errides (#1663)

Adds support for configuring `min_mcycle_price` overrides per requestor
address, per selector, or per requestor+selector combo via the
broker.toml file (`market.pricing-overrides` section). This allows
operators to price specific requestors or proof types (e.g. Groth16)
differently without changing the global default.
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.

3 participants