@@ -166,18 +166,18 @@ func (b *Builder) submitBellatrixBlock(block *types.Block, blockValue *big.Int,
166166	if  b .dryRun  {
167167		err  =  b .validator .ValidateBuilderSubmissionV1 (& blockvalidation.BuilderBlockValidationRequest {BuilderSubmitBlockRequest : blockSubmitReq , RegisteredGasLimit : vd .GasLimit })
168168		if  err  !=  nil  {
169- 			log .Error ("could not validate block" , "err" , err )
169+ 			log .Error ("could not validate bellatrix  block" , "err" , err )
170170		}
171171	} else  {
172172		go  b .ds .ConsumeBuiltBlock (block , blockValue , ordersClosedAt , sealedAt , commitedBundles , allBundles , & blockBidMsg )
173173		err  =  b .relay .SubmitBlock (& blockSubmitReq , vd )
174174		if  err  !=  nil  {
175- 			log .Error ("could not submit block" , "err" , err , "#commitedBundles" , len (commitedBundles ))
175+ 			log .Error ("could not submit bellatrix  block" , "err" , err , "#commitedBundles" , len (commitedBundles ))
176176			return  err 
177177		}
178178	}
179179
180- 	log .Info ("submitted block" , "slot" , blockBidMsg .Slot , "value" , blockBidMsg .Value .String (), "parent" , blockBidMsg .ParentHash , "hash" , block .Hash (), "#commitedBundles" , len (commitedBundles ))
180+ 	log .Info ("submitted bellatrix  block" , "slot" , blockBidMsg .Slot , "value" , blockBidMsg .Value .String (), "parent" , blockBidMsg .ParentHash , "hash" , block .Hash (), "#commitedBundles" , len (commitedBundles ))
181181
182182	return  nil 
183183}
@@ -190,10 +190,9 @@ func (b *Builder) submitCapellaBlock(block *types.Block, blockValue *big.Int, or
190190		return  err 
191191	}
192192
193- 	value  :=  new (boostTypes.U256Str )
194- 	err  =  value .FromBig (blockValue )
195- 	if  err  !=  nil  {
196- 		log .Error ("could not set block value" , "err" , err )
193+ 	value , overflow  :=  uint256 .FromBig (blockValue )
194+ 	if  overflow  {
195+ 		log .Error ("could not set block value due to value overflow" )
197196		return  err 
198197	}
199198
@@ -206,10 +205,14 @@ func (b *Builder) submitCapellaBlock(block *types.Block, blockValue *big.Int, or
206205		ProposerFeeRecipient : bellatrix .ExecutionAddress (vd .FeeRecipient ),
207206		GasLimit :             executableData .ExecutionPayload .GasLimit ,
208207		GasUsed :              executableData .ExecutionPayload .GasUsed ,
209- 		Value :                uint256 . NewInt ( value . BigInt (). Uint64 ()) ,
208+ 		Value :                value ,
210209	}
211210
212- 	boostBidTrace  :=  convertBidTrace (blockBidMsg )
211+ 	boostBidTrace , err  :=  convertBidTrace (blockBidMsg )
212+ 	if  err  !=  nil  {
213+ 		log .Error ("could not convert bid trace" , "err" , err )
214+ 		return  err 
215+ 	}
213216
214217	signature , err  :=  boostTypes .SignMessage (& blockBidMsg , b .builderSigningDomain , b .builderSecretKey )
215218	if  err  !=  nil  {
@@ -223,12 +226,21 @@ func (b *Builder) submitCapellaBlock(block *types.Block, blockValue *big.Int, or
223226		ExecutionPayload : payload ,
224227	}
225228
226- 	go  b .ds .ConsumeBuiltBlock (block , blockValue , ordersClosedAt , sealedAt , commitedBundles , allBundles , & boostBidTrace )
227- 	err  =  b .relay .SubmitBlockCapella (& blockSubmitReq , vd )
228- 	if  err  !=  nil  {
229- 		log .Error ("could not submit block" , "err" , err , "#commitedBundles" , len (commitedBundles ))
230- 		return  err 
229+ 	if  b .dryRun  {
230+ 		err  =  b .validator .ValidateBuilderSubmissionV2 (& blockvalidation.BuilderBlockValidationRequestV2 {SubmitBlockRequest : blockSubmitReq , RegisteredGasLimit : vd .GasLimit })
231+ 		if  err  !=  nil  {
232+ 			log .Error ("could not validate block for capella" , "err" , err )
233+ 		}
234+ 	} else  {
235+ 		go  b .ds .ConsumeBuiltBlock (block , blockValue , ordersClosedAt , sealedAt , commitedBundles , allBundles , & boostBidTrace )
236+ 		err  =  b .relay .SubmitBlockCapella (& blockSubmitReq , vd )
237+ 		if  err  !=  nil  {
238+ 			log .Error ("could not submit capella block" , "err" , err , "#commitedBundles" , len (commitedBundles ))
239+ 			return  err 
240+ 		}
231241	}
242+ 
243+ 	log .Info ("submitted capella block" , "slot" , blockBidMsg .Slot , "value" , blockBidMsg .Value .String (), "parent" , blockBidMsg .ParentHash , "hash" , block .Hash (), "#commitedBundles" , len (commitedBundles ))
232244	return  nil 
233245}
234246
@@ -444,7 +456,13 @@ func executableDataToCapellaExecutionPayload(data *engine.ExecutableData) (*cape
444456	}, nil 
445457}
446458
447- func  convertBidTrace (bidTrace  apiv1.BidTrace ) boostTypes.BidTrace  {
459+ func  convertBidTrace (bidTrace  apiv1.BidTrace ) (boostTypes.BidTrace , error ) {
460+ 	value  :=  new (boostTypes.U256Str )
461+ 	err  :=  value .FromBig (bidTrace .Value .ToBig ())
462+ 	if  err  !=  nil  {
463+ 		return  boostTypes.BidTrace {}, err 
464+ 	}
465+ 
448466	return  boostTypes.BidTrace {
449467		Slot :                 bidTrace .Slot ,
450468		ParentHash :           boostTypes .Hash (bidTrace .ParentHash ),
@@ -454,6 +472,6 @@ func convertBidTrace(bidTrace apiv1.BidTrace) boostTypes.BidTrace {
454472		ProposerFeeRecipient : boostTypes .Address (bidTrace .ProposerFeeRecipient ),
455473		GasLimit :             bidTrace .GasLimit ,
456474		GasUsed :              bidTrace .GasUsed ,
457- 		Value :                boostTypes . IntToU256 ( bidTrace . Value . Uint64 ()) ,
458- 	}
475+ 		Value :                * value ,
476+ 	},  nil 
459477}
0 commit comments