Remove versionedHashes from EngineNewPayload (#5793)

Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
pull/5803/head
Gabriel-Trintinalia 1 year ago committed by GitHub
parent 059a94c675
commit 139fc121cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 35
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/EnginePayloadParameter.java
  2. 18
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineNewPayloadTest.java
  3. 2
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadEIP6110Test.java
  4. 4
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV2Test.java

@ -25,12 +25,6 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.tuweni.bytes.Bytes32;
/**
* parentHash: DATA, 32 Bytes feeRecipient: DATA, 20 Bytes stateRoot: DATA, 32 Bytes receiptsRoot:
* DATA, 32 Bytes logsBloom: DATA, 256 Bytes prevRandao: DATA, 32 Bytes blockNumber: QUANTITY
* gasLimit: QUANTITY gasUsed: QUANTITY timestamp: QUANTITY baseFeePerGas: QUANTITY blockHash: DATA,
* 32 Bytes transactions: Array of TypedTransaction
*/
public class EnginePayloadParameter {
private final Hash blockHash;
private final Hash parentHash;
@ -49,9 +43,30 @@ public class EnginePayloadParameter {
private final List<WithdrawalParameter> withdrawals;
private final Long blobGasUsed;
private final String excessBlobGas;
private final List<Bytes32> versionedHashes;
private final List<DepositParameter> deposits;
/**
* Creates an instance of EnginePayloadParameter.
*
* @param blockHash DATA, 32 Bytes
* @param parentHash DATA, 32 Bytes
* @param feeRecipient DATA, 20 Bytes
* @param stateRoot DATA, 32 Bytes
* @param blockNumber QUANTITY, 64 Bits
* @param baseFeePerGas QUANTITY, 256 Bits
* @param gasLimit QUANTITY, 64 Bits
* @param gasUsed QUANTITY, 64 Bits
* @param timestamp QUANTITY, 64 Bits
* @param extraData DATA, 0 to 32 Bytes
* @param receiptsRoot DATA, 32 Bytes
* @param logsBloom DATA, 256 Bytes
* @param prevRandao DATA, 32 Bytes
* @param transactions Array of DATA
* @param withdrawals Array of Withdrawal
* @param blobGasUsed QUANTITY, 64 Bits
* @param excessBlobGas QUANTITY, 64 Bits
* @param deposits List of deposit parameters.
*/
@JsonCreator
public EnginePayloadParameter(
@JsonProperty("blockHash") final Hash blockHash,
@ -71,7 +86,6 @@ public class EnginePayloadParameter {
@JsonProperty("withdrawals") final List<WithdrawalParameter> withdrawals,
@JsonProperty("blobGasUsed") final UnsignedLongParameter blobGasUsed,
@JsonProperty("excessBlobGas") final String excessBlobGas,
@JsonProperty("versionedHashes") final List<Bytes32> versionedHashes,
@JsonProperty("deposits") final List<DepositParameter> deposits) {
this.blockHash = blockHash;
this.parentHash = parentHash;
@ -90,7 +104,6 @@ public class EnginePayloadParameter {
this.withdrawals = withdrawals;
this.blobGasUsed = blobGasUsed == null ? null : blobGasUsed.getValue();
this.excessBlobGas = excessBlobGas;
this.versionedHashes = versionedHashes;
this.deposits = deposits;
}
@ -165,8 +178,4 @@ public class EnginePayloadParameter {
public List<DepositParameter> getDeposits() {
return deposits;
}
public List<Bytes32> getVersionedHashes() {
return versionedHashes;
}
}

@ -32,7 +32,6 @@ import org.hyperledger.besu.consensus.merge.MergeContext;
import org.hyperledger.besu.consensus.merge.blockcreation.MergeMiningCoordinator;
import org.hyperledger.besu.datatypes.BlobGas;
import org.hyperledger.besu.datatypes.Hash;
import org.hyperledger.besu.datatypes.VersionedHash;
import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.ethereum.BlockProcessingOutputs;
import org.hyperledger.besu.ethereum.BlockProcessingResult;
@ -401,7 +400,7 @@ public abstract class AbstractEngineNewPayloadTest extends AbstractScheduledApiT
protected EnginePayloadParameter mockEnginePayload(
final BlockHeader header, final List<String> txs) {
return mockEnginePayload(header, txs, null, null, null);
return mockEnginePayload(header, txs, null, null);
}
protected EnginePayloadParameter mockEnginePayload(
@ -409,20 +408,6 @@ public abstract class AbstractEngineNewPayloadTest extends AbstractScheduledApiT
final List<String> txs,
final List<WithdrawalParameter> withdrawals,
final List<DepositParameter> deposits) {
return mockEnginePayload(
header,
txs,
withdrawals,
deposits,
List.of(VersionedHash.DEFAULT_VERSIONED_HASH.toBytes()));
}
protected EnginePayloadParameter mockEnginePayload(
final BlockHeader header,
final List<String> txs,
final List<WithdrawalParameter> withdrawals,
final List<DepositParameter> deposits,
final List<Bytes32> versionedHashes) {
return new EnginePayloadParameter(
header.getHash(),
header.getParentHash(),
@ -441,7 +426,6 @@ public abstract class AbstractEngineNewPayloadTest extends AbstractScheduledApiT
withdrawals,
header.getBlobGasUsed().map(UnsignedLongParameter::new).orElse(null),
header.getExcessBlobGas().map(BlobGas::toHexString).orElse(null),
versionedHashes,
deposits);
}

@ -97,7 +97,7 @@ public class EngineNewPayloadEIP6110Test extends EngineNewPayloadV3Test {
when(mergeCoordinator.getLatestValidAncestor(mockHeader))
.thenReturn(Optional.of(mockHeader.getHash()));
var resp = resp(mockEnginePayload(mockHeader, Collections.emptyList(), null, deposits, null));
var resp = resp(mockEnginePayload(mockHeader, Collections.emptyList(), null, deposits));
assertValidResponse(mockHeader, resp);
}

@ -102,8 +102,7 @@ public class EngineNewPayloadV2Test extends AbstractEngineNewPayloadTest {
lenient()
.when(blockchain.getBlockHeader(mockHeader.getParentHash()))
.thenReturn(Optional.of(mock(BlockHeader.class)));
var resp =
resp(mockEnginePayload(mockHeader, Collections.emptyList(), withdrawals, null, null));
var resp = resp(mockEnginePayload(mockHeader, Collections.emptyList(), withdrawals, null));
assertValidResponse(mockHeader, resp);
}
@ -121,7 +120,6 @@ public class EngineNewPayloadV2Test extends AbstractEngineNewPayloadTest {
createBlockHeader(Optional.of(Collections.emptyList()), Optional.empty()),
Collections.emptyList(),
withdrawals,
null,
null));
final JsonRpcError jsonRpcError = fromErrorResp(resp);

Loading…
Cancel
Save