Skip to content

Hide competition until deadline passes#4330

Merged
fafk merged 14 commits intomainfrom
hide-competition
Apr 15, 2026
Merged

Hide competition until deadline passes#4330
fafk merged 14 commits intomainfrom
hide-competition

Conversation

@fafk
Copy link
Copy Markdown
Contributor

@fafk fafk commented Apr 14, 2026

Description

Hides solver competition API data until the auction's submission deadline block has passed. Feature-gated via hide-competition-before-deadline (default off) to avoid breaking external solver monitoring that depends on these endpoints.

Changes

  • Added hide-competition-before-deadline bool to orderbook config (default false)
  • Wired CurrentBlockWatcher into AppState so handlers can check the current block
  • Return 404 while deadline hasn't passed
  • E2E test updated to exercise both the 404 and the post-deadline visibility

How to test

cargo test -p e2e 'solver_competition::local_node_solver_competition' -- --exact --ignored 

@fafk fafk requested a review from a team as a code owner April 14, 2026 06:45
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a hide_competition_before_deadline configuration to restrict solver competition data visibility until the auction deadline is reached. Feedback identifies a performance issue in the V1 API implementation where an additional database query is executed per request, suggesting a join or DTO update instead. Additionally, a correction was suggested for error handling consistency when acquiring database connections in the new get_auction_deadline method.

Comment thread crates/orderbook/src/api/get_solver_competition.rs Outdated
Comment thread crates/orderbook/src/database/solver_competition_v2.rs Outdated
Comment thread crates/orderbook/src/api/get_solver_competition.rs Outdated
Comment thread crates/orderbook/src/api/get_solver_competition.rs Outdated
Comment thread crates/orderbook/src/api/get_solver_competition.rs Outdated
Comment thread crates/database/src/solver_competition_v2.rs Outdated
Comment thread crates/orderbook/src/database/solver_competition.rs Outdated
@fafk fafk force-pushed the hide-competition branch from 7afc406 to 39e4f02 Compare April 14, 2026 10:56
Copy link
Copy Markdown
Contributor

@MartinquaXD MartinquaXD left a comment

Choose a reason for hiding this comment

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

LGTM.
Last nit: I think we should use <= block since the observed block already happened and revealing the information now can no longer affect the auction in question.

Comment thread crates/database/src/solver_competition.rs Outdated
Comment thread crates/database/src/solver_competition.rs Outdated
Comment thread crates/database/src/solver_competition.rs Outdated
Comment thread crates/database/src/solver_competition_v2.rs Outdated
Comment thread crates/database/src/solver_competition_v2.rs Outdated
@fhenneke
Copy link
Copy Markdown

What is the plan for supporting the use case of the circuit breaker? The circuit breaker (ideally) needs to be able to check transactions right when they appear on chain. Waiting for the deadline or waiting for the autopilot to index a settlement correctly would be problematic at the moment.

fafk and others added 14 commits April 15, 2026 13:23
Co-authored-by: Martin Magnus <martin.beckmann@protonmail.com>
Co-authored-by: Martin Magnus <martin.beckmann@protonmail.com>
Co-authored-by: Martin Magnus <martin.beckmann@protonmail.com>
Co-authored-by: Martin Magnus <martin.beckmann@protonmail.com>
Co-authored-by: Martin Magnus <martin.beckmann@protonmail.com>
@fafk fafk force-pushed the hide-competition branch from 312fd3c to 9491cae Compare April 15, 2026 11:23
@fafk
Copy link
Copy Markdown
Contributor Author

fafk commented Apr 15, 2026

What is the plan for supporting the use case of the circuit breaker? The circuit breaker (ideally) needs to be able to check transactions right when they appear on chain. Waiting for the deadline or waiting for the autopilot to index a settlement correctly would be problematic at the moment.

We can expose the data under a new endpoint protected by an API key.

@fafk fafk enabled auto-merge April 15, 2026 11:24
@fafk fafk added this pull request to the merge queue Apr 15, 2026
Merged via the queue into main with commit 689cce1 Apr 15, 2026
18 of 19 checks passed
@fafk fafk deleted the hide-competition branch April 15, 2026 11:43
@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants