@@ -278,24 +278,19 @@ func (c *EngineClient) ExecuteTxs(ctx context.Context, txs [][]byte, blockHeight
278278func (c * EngineClient ) setFinal (ctx context.Context , blockHash common.Hash , isFinal bool ) error {
279279 var args engine.ForkchoiceStateV1
280280
281+ // Update block hashes based on finalization status
281282 if isFinal {
282- // Use the last stored values for head and safe block hashes
283- args = engine.ForkchoiceStateV1 {
284- HeadBlockHash : c .currentHeadBlockHash ,
285- SafeBlockHash : c .currentSafeBlockHash ,
286- FinalizedBlockHash : blockHash ,
287- }
288- // Store the current blockHash as the latest finalized block hash
289283 c .currentFinalizedBlockHash = blockHash
290284 } else {
291- // Store the current blockHash as the latest head and safe block hashes
292285 c .currentHeadBlockHash = blockHash
293286 c .currentSafeBlockHash = blockHash
294- args = engine.ForkchoiceStateV1 {
295- HeadBlockHash : blockHash ,
296- SafeBlockHash : blockHash ,
297- FinalizedBlockHash : c .currentFinalizedBlockHash ,
298- }
287+ }
288+
289+ // Construct forkchoice state
290+ args = engine.ForkchoiceStateV1 {
291+ HeadBlockHash : c .currentHeadBlockHash ,
292+ SafeBlockHash : c .currentSafeBlockHash ,
293+ FinalizedBlockHash : c .currentFinalizedBlockHash ,
299294 }
300295
301296 var forkchoiceResult engine.ForkChoiceResponse
0 commit comments