Skip to content

Commit 6e17906

Browse files
tac0turtletac0turtle
andauthored
chore: remove timestamp hack (#2471)
<!-- Please read and fill out this form before submitting your PR. Please make sure you have reviewed our contributors guide before submitting your first PR. NOTE: PR titles should follow semantic commits: https://www.conventionalcommits.org/en/v1.0.0/ --> ## Overview This pr removes the +1 timestamp in order to avoid clock drift between lumen and rollkit. closes #2464 based off of work from evstack/ev-reth#19 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Simplified block timestamp handling to use the current block's timestamp directly, removing previous logic that enforced strictly increasing timestamps between blocks. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: tac0turtle <you@example.com>
1 parent eadacf1 commit 6e17906

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

execution/evm/execution.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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
args := engine.ForkchoiceStateV1{
195190
HeadBlockHash: prevBlockHash,
196191
SafeBlockHash: prevBlockHash,
@@ -203,7 +198,7 @@ func (c *EngineClient) ExecuteTxs(ctx context.Context, txs [][]byte, blockHeight
203198
// Create rollkit-compatible payload attributes with flattened structure
204199
rollkitPayloadAttrs := map[string]interface{}{
205200
// Standard Ethereum payload attributes (flattened) - using camelCase as expected by JSON
206-
"timestamp": ts,
201+
"timestamp": timestamp.Unix(),
207202
"prevRandao": c.derivePrevRandao(blockHeight),
208203
"suggestedFeeRecipient": c.feeRecipient,
209204
"withdrawals": []*types.Withdrawal{},

0 commit comments

Comments
 (0)