From 566583c3782eaf412c86e609161a8b190037b586 Mon Sep 17 00:00:00 2001 From: Fabio Di Fabio Date: Mon, 16 Dec 2024 03:26:44 +0100 Subject: [PATCH] Fix simulate pending block timestamp (#8027) Signed-off-by: Fabio Di Fabio --- .../besu/ethereum/transaction/TransactionSimulator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java index c4558ab14dc..57cef89006a 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java @@ -14,6 +14,7 @@ */ package org.hyperledger.besu.ethereum.transaction; +import static java.util.concurrent.TimeUnit.MILLISECONDS; import static org.hyperledger.besu.ethereum.mainnet.feemarket.ExcessBlobGasCalculator.calculateExcessBlobGasForParent; import org.hyperledger.besu.crypto.SECPSignature; @@ -176,7 +177,7 @@ public Optional processOnPending( } public ProcessableBlockHeader simulatePendingBlockHeader() { - final long timestamp = System.currentTimeMillis(); + final long timestamp = MILLISECONDS.toSeconds(System.currentTimeMillis()); final var chainHeadHeader = blockchain.getChainHeadHeader(); final ProtocolSpec protocolSpec = protocolSchedule.getForNextBlockHeader(chainHeadHeader, timestamp);