@@ -231,8 +231,14 @@ func NewAuctioneerServer(ctx context.Context, configFetcher AuctioneerServerConf
231231 if err = roundTimingInfo .ValidateResolutionWaitTime (cfg .AuctionResolutionWaitTime ); err != nil {
232232 return nil , err
233233 }
234- if cfg .BidsReceiverBufferSize == 0 {
235- return nil , fmt .Errorf ("bids receiver buffer size must be positive, got %d" , cfg .BidsReceiverBufferSize )
234+
235+ bufferSize := cfg .BidsReceiverBufferSize
236+ if bufferSize == 0 {
237+ bufferSize = 100_000
238+ }
239+
240+ if bufferSize > uint64 (^ uint (0 )>> 1 ) {
241+ return nil , fmt .Errorf ("bids receiver buffer size %d exceeds maximum int value" , bufferSize )
236242 }
237243
238244 // Generate unique ID for this auctioneer instance
@@ -252,7 +258,7 @@ func NewAuctioneerServer(ctx context.Context, configFetcher AuctioneerServerConf
252258 auctionContract : auctionContract ,
253259 auctionContractAddr : auctionContractAddr ,
254260 auctionContractDomainSeparator : domainSeparator ,
255- bidsReceiver : make (chan * JsonValidatedBid , cfg . BidsReceiverBufferSize ),
261+ bidsReceiver : make (chan * JsonValidatedBid , int ( bufferSize ) ),
256262 bidCache : newBidCache (domainSeparator ),
257263 roundTimingInfo : * roundTimingInfo ,
258264 auctionResolutionWaitTime : cfg .AuctionResolutionWaitTime ,
0 commit comments