Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CuttingBoardDutchAuctionV1_1

Git Source

Inherits: CuttingBoardDutchAuction

Title: CuttingBoardDutchAuctionV1_1

Patch upgrade fixing two bugs in CuttingBoardDutchAuction (V1): Bug 1 — InvalidPriceRange revert when keeper raises minimumPrice above an expired auction's basePrice. Root cause: startCuttingBoardAuction unconditionally set lastClosingPrice = prevAuction.basePrice which silently discarded any keeper-set minimumPrice that exceeded that value. The subsequent price-range check then fired because: starting = lastClosingPrice * multiplier (small, reset by expired base) base = max(lastClosingPrice / divisor, minimumPrice) (large, market) starting <= base → InvalidPriceRange revert Fix: clamp lastClosingPrice = max(prevAuction.basePrice, minimumPrice). Bug 2 — isValidatorAvailable returns false for a validator whose last auction expired unclaimed, while startCuttingBoardAuction for the same validator succeeds (inconsistency between view and tx). Root cause: startCuttingBoardAuction clears activeValidatorAuctions[prevValidatorHash] = 0 before checking _isValidatorAvailable, but the public view function did not simulate this clearing, so off-chain keepers relying on the view would never restart a stuck validator. Fix: isValidatorAvailable simulates the same clearing logic before delegating to _isValidatorAvailable.

Functions

startCuttingBoardAuction

Start auction for a specific validator

Overrides V1 to clamp lastClosingPrice >= minimumPrice when an expired unclaimed auction is processed, preventing InvalidPriceRange reverts after the keeper has raised the minimum price above the stale base price.

function startCuttingBoardAuction(bytes calldata validatorPubkey)
    external
    virtual
    override
    onlyKeeper
    whenNotPaused;

isValidatorAvailable

Check if a validator is available for auction

Overrides V1 to simulate the activeValidatorAuctions clearing that startCuttingBoardAuction performs for the globally-last expired unclaimed auction, making this view consistent with the transaction outcome. V1 returned false for a validator whose own last auction had just expired, causing keepers that used this as a pre-flight check to skip it permanently.

function isValidatorAvailable(bytes calldata validatorPubkey)
    external
    view
    virtual
    override
    returns (bool);