feat(solana): dynamic pool bids (in-window request updates)#492
Merged
Conversation
LandynDev
approved these changes
Jun 22, 2026
LandynDev
left a comment
Collaborator
There was a problem hiding this comment.
Dynamic pool bids (upsert): correct. Bounds + 1.1x over-collateral re-run on every update; draw is stake-weighted so updates can't game odds; OPEN clears requests (no stale-fee dodge); clean freeze at closes_at. Approving.
… in-window A repeat open_or_request from the same validator while the pool is still open now UPDATES that validator's bid in place instead of being rejected (AlreadyRequested). Frozen once the window closes / the pool resolves. The miner's rate is pinned at open, so refining a bid is against a stable rate; lottery odds are stake-weighted, so updates can't game the draw. - open_or_request JOIN branch: upsert (replace existing request by validator) vs push - reservation fee charged only on a fresh entry; same-validator in-window updates free - ErrorCode::AlreadyRequested left defined (now unused) to avoid IDL churn - tests: validator-can-update, update-reflected-in-reservation, update-is-free, update-after-window-close-fails LiteSVM 68/68, e2e.sh 24/24.
6cc9830 to
78c25bd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #491 → #490. Until those merge, this PR's diff includes their changes too; once they land in
contract-v2it collapses to just this change. Review order: #490 → #491 → this.What
A validator gets one shot per reservation pool today — a second
open_or_requestfrom the same validator while the pool is open is rejected withAlreadyRequested. This lets a validator update its bid in place while the window is still open (upsert), frozen once the pool resolves.Why
The miner's rate is pinned at pool open, so the intended workflow is for a validator to run its user-selection after a pool opens (bidding against a now-stable rate) and refine as better users arrive. Part B of the reservation/initiation evolution.
busy_untilunchanged: set only at OPEN, never extended by an update.Changes (one handler)
open_or_request.rs:Requestin place; a new validator is appended (subject toMAX_VALIDATORS).ErrorCode::AlreadyRequestedleft defined (now unused) to avoid IDL churn.Tests
test_validator_can_update_request(replaces the old dup-reject test),test_update_reflected_in_reservation,test_update_is_free,test_update_after_window_close_fails.e2e.sh24/24 (build + deploy + on-chain).