Fix simulate pending block timestamp (#8027)

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
This commit is contained in:
Fabio Di Fabio
2024-12-16 03:26:44 +01:00
committed by GitHub
parent 98780efd15
commit 566583c378

View File

@@ -14,6 +14,7 @@
*/ */
package org.hyperledger.besu.ethereum.transaction; package org.hyperledger.besu.ethereum.transaction;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static org.hyperledger.besu.ethereum.mainnet.feemarket.ExcessBlobGasCalculator.calculateExcessBlobGasForParent; import static org.hyperledger.besu.ethereum.mainnet.feemarket.ExcessBlobGasCalculator.calculateExcessBlobGasForParent;
import org.hyperledger.besu.crypto.SECPSignature; import org.hyperledger.besu.crypto.SECPSignature;
@@ -176,7 +177,7 @@ public class TransactionSimulator {
} }
public ProcessableBlockHeader simulatePendingBlockHeader() { public ProcessableBlockHeader simulatePendingBlockHeader() {
final long timestamp = System.currentTimeMillis(); final long timestamp = MILLISECONDS.toSeconds(System.currentTimeMillis());
final var chainHeadHeader = blockchain.getChainHeadHeader(); final var chainHeadHeader = blockchain.getChainHeadHeader();
final ProtocolSpec protocolSpec = final ProtocolSpec protocolSpec =
protocolSchedule.getForNextBlockHeader(chainHeadHeader, timestamp); protocolSchedule.getForNextBlockHeader(chainHeadHeader, timestamp);