Skip to content

Comments

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

Open
capossele wants to merge 10 commits intomainfrom
angelo/bm-2012-per-requestor-pricing
Open

BM-2012: Per-requestor and per-selector min_mcycle_price pricing overrides#1663
capossele wants to merge 10 commits intomainfrom
angelo/bm-2012-per-requestor-pricing

Conversation

@capossele
Copy link
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

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 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
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
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
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
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
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
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

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