Skip to content

Commit

Permalink
Reorder express lane tx validation
Browse files Browse the repository at this point in the history
Put round check first. This fixes a test and it makes sense to let the
caller know they were sending submissions for the wrong round, before
telling them there was no controller for the current round.
  • Loading branch information
Tristan-Wilson committed Nov 8, 2024
1 parent fa93c2c commit 7f9e5b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions execution/gethexec/express_lane_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,13 @@ func (es *expressLaneService) validateExpressLaneTx(msg *timeboost.ExpressLaneSu
if msg.AuctionContractAddress != es.auctionContractAddr {
return errors.Wrapf(timeboost.ErrWrongAuctionContract, "msg auction contract address %s does not match sequencer auction contract address %s", msg.AuctionContractAddress, es.auctionContractAddr)
}
if !es.currentRoundHasController() {
return timeboost.ErrNoOnchainController
}
currentRound := timeboost.CurrentRound(es.initialTimestamp, es.roundDuration)
if msg.Round != currentRound {
return errors.Wrapf(timeboost.ErrBadRoundNumber, "express lane tx round %d does not match current round %d", msg.Round, currentRound)
}
if !es.currentRoundHasController() {
return timeboost.ErrNoOnchainController
}
// Reconstruct the message being signed over and recover the sender address.
signingMessage, err := msg.ToMessageBytes()
if err != nil {
Expand Down

0 comments on commit 7f9e5b6

Please sign in to comment.