diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nExecutor.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nExecutor.java index bba32511005..9a767d6f0f1 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nExecutor.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nExecutor.java @@ -135,9 +135,9 @@ protected static List extractTransactions( if (txNode.has("to")) { builder.to(Address.fromHexString(txNode.get("to").textValue())); } - - if (transactionType.requiresChainId() - || (txNode.has("protected") && txNode.get("protected").asBoolean(false))) { + BigInteger v = + Bytes.fromHexStringLenient(txNode.get("v").textValue()).toUnsignedBigInteger(); + if (transactionType.requiresChainId() || (v.compareTo(REPLAY_PROTECTED_V_MIN) > 0)) { // chainid if protected builder.chainId(chainId); } @@ -191,14 +191,11 @@ protected static List extractTransactions( transactions.add(builder.signAndBuild(keys)); } else { - BigInteger v = - Bytes.fromHexStringLenient(txNode.get("v").textValue()).toUnsignedBigInteger(); if (transactionType == TransactionType.FRONTIER) { if (v.compareTo(REPLAY_PROTECTED_V_MIN) > 0) { v = v.subtract(REPLAY_PROTECTED_V_BASE) .subtract(chainId.multiply(BigInteger.TWO)); - builder.chainId(chainId); } else { v = v.subtract(REPLAY_UNPROTECTED_V_BASE); }