@@ -181,16 +181,11 @@ func (c *EngineClient) ExecuteTxs(ctx context.Context, txs [][]byte, blockHeight
181181 txsPayload [i ] = "0x" + hex .EncodeToString (tx )
182182 }
183183
184- prevBlockHash , _ , prevGasLimit , prevTimestamp , err := c .getBlockInfo (ctx , blockHeight - 1 )
184+ prevBlockHash , _ , prevGasLimit , _ , err := c .getBlockInfo (ctx , blockHeight - 1 )
185185 if err != nil {
186186 return nil , 0 , fmt .Errorf ("failed to get block info: %w" , err )
187187 }
188188
189- ts := uint64 (timestamp .Unix ())
190- if ts <= prevTimestamp {
191- ts = prevTimestamp + 1 // Subsequent blocks must have a higher timestamp.
192- }
193-
194189 c .mu .Lock ()
195190 args := engine.ForkchoiceStateV1 {
196191 HeadBlockHash : prevBlockHash ,
@@ -205,7 +200,7 @@ func (c *EngineClient) ExecuteTxs(ctx context.Context, txs [][]byte, blockHeight
205200 // Create rollkit-compatible payload attributes with flattened structure
206201 rollkitPayloadAttrs := map [string ]interface {}{
207202 // Standard Ethereum payload attributes (flattened) - using camelCase as expected by JSON
208- "timestamp" : ts ,
203+ "timestamp" : timestamp . Unix () ,
209204 "prevRandao" : c .derivePrevRandao (blockHeight ),
210205 "suggestedFeeRecipient" : c .feeRecipient ,
211206 "withdrawals" : []* types.Withdrawal {},
@@ -300,6 +295,13 @@ func (c *EngineClient) setFinal(ctx context.Context, blockHash common.Hash, isFi
300295
301296// SetFinal marks the block at the given height as finalized
302297func (c * EngineClient ) SetFinal (ctx context.Context , blockHeight uint64 ) error {
298+ fmt .Println ("Setting final block at height:" , blockHeight )
299+ if blockHeight == 1 {
300+ _ , _ , _ , _ , err := c .getBlockInfo (ctx , blockHeight )
301+ if err != nil {
302+ return fmt .Errorf ("failed to get block info for height 0: %w" , err )
303+ }
304+ }
303305 blockHash , _ , _ , _ , err := c .getBlockInfo (ctx , blockHeight )
304306 if err != nil {
305307 return fmt .Errorf ("failed to get block info: %w" , err )
0 commit comments