feat(bidding): add pending-bid ledger - #239
Merged
Merged
Conversation
0xernesto
approved these changes
Jul 23, 2026
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.
Why
There's a blind spot between "we bid" and "we won": the auction takes ~15s to settle, but the bidder rebuilds its committed load every 3s from assigned requests only. So for a few passes it completely forgets what it just promised and happily bids again. We hit this for real on sepolia — threw 8 requests at it, and the tail ones got admitted way past capacity and blew their deadlines.
How
The bidder now keeps a little ledger of its outstanding promises (
PendingBidsinspn-bidding, right next toEstimateCachewhich works the same way):min_auction_periodplus 15s of slack for the auctioneer tick and our next poll, capped at 60s. The slack errs on the late side on purpose — expiring early would double-promise an auction we actually won, which is the exact bug we're fixing. Worst case, a lost auction holds some headroom for one auction cycle.