Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
Signed-off-by: Karim Taam <[email protected]>
  • Loading branch information
matkt committed Jan 20, 2025
2 parents 15264b6 + 702ce74 commit 70dc15e
Show file tree
Hide file tree
Showing 335 changed files with 566 additions and 682 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
- Add support for `movePrecompileToAddress` in `StateOverrides` (`eth_call`)[8115](https://github.com/hyperledger/besu/pull/8115)
- Default target-gas-limit to 36M for holesky [#8125](https://github.com/hyperledger/besu/pull/8125)
- Add EIP-7623 - Increase calldata cost [#8093](https://github.com/hyperledger/besu/pull/8093)
- Add nonce to transaction call object [#8139](https://github.com/hyperledger/besu/pull/8139)

### Bug fixes
- Fix serialization of state overrides when `movePrecompileToAddress` is present [#8204](https://github.com/hyperledger/besu/pull/8024)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*/
package org.hyperledger.besu.tests.acceptance.dsl.transaction.eth;

import static org.web3j.protocol.core.DefaultBlockParameterName.LATEST;

import org.hyperledger.besu.tests.acceptance.dsl.transaction.NodeRequests;
import org.hyperledger.besu.tests.acceptance.dsl.transaction.Transaction;

Expand All @@ -36,11 +38,13 @@ public EthEstimateGasTransaction(final String contractAddress, final String func
public EthEstimateGas execute(final NodeRequests node) {
try {

var nonce = node.eth().ethGetTransactionCount(from, LATEST).send().getTransactionCount();

return node.eth()
.ethEstimateGas(
new org.web3j.protocol.core.methods.request.Transaction(
from,
BigInteger.ONE,
nonce,
BigInteger.ZERO,
BigInteger.ZERO,
contractAddress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ private Optional<CallResult> executeCall(final DataFetchingEnvironment environme
maxFeePerGas,
valueParam,
data,
Optional.empty(),
Optional.empty());

return transactionSimulator.process(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ protected CallParameter overrideGasLimit(final CallParameter callParams, final l
callParams.getPayload(),
callParams.getAccessList(),
callParams.getMaxFeePerBlobGas(),
callParams.getBlobVersionedHashes());
callParams.getBlobVersionedHashes(),
callParams.getNonce());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ private CallParameter overrideAccessList(
callParams.getMaxFeePerGas(),
callParams.getValue(),
callParams.getPayload(),
Optional.of(accessListEntries));
Optional.of(accessListEntries),
callParams.getNonce());
}

private record AccessListSimulatorResult(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.hyperledger.besu.datatypes.Address;
import org.hyperledger.besu.datatypes.VersionedHash;
import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.datatypes.parameters.UnsignedLongParameter;
import org.hyperledger.besu.ethereum.core.json.ChainIdDeserializer;
import org.hyperledger.besu.ethereum.core.json.GasDeserializer;
import org.hyperledger.besu.ethereum.core.json.HexStringDeserializer;
Expand Down Expand Up @@ -56,6 +57,7 @@
* .withMaxPriorityFeePerGas(Wei.of(1)) // Optional
* .withMaxFeePerBlobGas(Wei.of(3)) // Optional
* .withBlobVersionedHashes(blobVersionedHashes) // Optional
* .withNonce(new UnsignedLongParameter(1L)) // Optional
* .build();
* }</pre>
*
Expand Down Expand Up @@ -86,7 +88,8 @@ private JsonCallParameter(
final Optional<Boolean> strict,
final Optional<List<AccessListEntry>> accessList,
final Optional<Wei> maxFeePerBlobGas,
final Optional<List<VersionedHash>> blobVersionedHashes) {
final Optional<List<VersionedHash>> blobVersionedHashes,
final Optional<Long> nonce) {

super(
chainId,
Expand All @@ -100,7 +103,8 @@ private JsonCallParameter(
payload,
accessList,
maxFeePerBlobGas,
blobVersionedHashes);
blobVersionedHashes,
nonce);

this.strict = strict;
}
Expand Down Expand Up @@ -133,6 +137,7 @@ public static final class JsonCallParameterBuilder {
private Bytes input;
private Optional<List<AccessListEntry>> accessList = Optional.empty();
private Optional<List<VersionedHash>> blobVersionedHashes = Optional.empty();
private Optional<Long> nonce = Optional.empty();

/** Default constructor. */
public JsonCallParameterBuilder() {}
Expand Down Expand Up @@ -327,6 +332,18 @@ public JsonCallParameterBuilder withBlobVersionedHashes(
return this;
}

/**
* Sets the nonce for the {@link JsonCallParameter}. It is an optional parameter, and if not
* specified, it defaults to an empty {@link Optional}.
*
* @param nonce the nonce, can be {@code null} to indicate no nonce is provided
* @return the {@link JsonCallParameterBuilder} instance for chaining
*/
public JsonCallParameterBuilder withNonce(final UnsignedLongParameter nonce) {
this.nonce = Optional.ofNullable(nonce).map(UnsignedLongParameter::getValue);
return this;
}

/**
* Handles unknown JSON properties during deserialization. This method is invoked when an
* unknown property is encountered in the JSON being deserialized into a {@link
Expand Down Expand Up @@ -376,7 +393,8 @@ public JsonCallParameter build() {
strict,
accessList,
maxFeePerBlobGas,
blobVersionedHashes);
blobVersionedHashes,
nonce);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ private CallParameter modifiedLegacyTransactionCallParameter(final Wei gasPrice)
Optional.empty(),
Wei.ZERO,
Bytes.EMPTY,
Optional.empty(),
Optional.empty());
}

Expand Down Expand Up @@ -613,6 +614,7 @@ private CallParameter modifiedEip1559TransactionCallParameter(final Optional<Wei
Optional.of(Wei.fromHexString("0x10")),
Wei.ZERO,
Bytes.EMPTY,
Optional.empty(),
Optional.empty());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"gasPrice" : "0xef",
"value" : "0x0",
"data" : "0x0000000000000000000000000030000000000000000000000000000000000000f000000000000000000000000000000000000000000000000000000000000001",
"nonce" : "0x0"
"nonce" : "0x1E"
}, "latest",
{
"disableMemory": true, "disableStack": true, "disableStorage": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"gasPrice" : "0xef",
"value" : "0x0",
"data" : "0x0000000000000000000000000030000000000000000000000000000000000000f000000000000000000000000000000000000000000000000000000000000001",
"nonce" : "0x0"
"nonce" : "0x1E"
}, "latest" ],
"id" : 1
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"gasPrice" : "0xef",
"value" : "0x0",
"data" : "0x0000000000000000000000000030000000000000000000000000000000000000f000000000000000000000000000000000000000000000000000000000000001",
"nonce" : "0x0"
"nonce" : "0x1E"
}, "latest",
{
"disableMemory":true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"gasPrice" : "0xef",
"value" : "0x0",
"data" : "0x0000000000000000000000000030000000000000000000000000000000000000f000000000000000000000000000000000000000000000000000000000000001",
"nonce" : "0x0"
"nonce" : "0x1E"
}, "latest",
{
"disableStack": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"gasPrice" : "0xef",
"value" : "0x0",
"data" : "0x0000000000000000000000000030000000000000000000000000000000000000f000000000000000000000000000000000000000000000000000000000000001",
"nonce" : "0x0"
"nonce" : "0x1E"
}, "latest",
{
"disableStorage": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"to" : "0x0000000000000000000000000000000000000999",
"gas" : "0xfffff2",
"gasPrice" : "0xef",
"value" : "0x1",
"nonce" : "0x0"
"value" : "0x1"
}, [ "stateDiff" ], "latest" ],
"id" : 0
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"to" : "0x0000000000000000000000000000000000000999",
"gas" : "0xfffff2",
"gasPrice" : "0xef",
"value" : "0x1",
"nonce" : "0x0"
"value" : "0x1"
}, [ "trace" ], "latest" ],
"id" : 0
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"to" : "0x0000000000000000000000000000000000000999",
"gas" : "0xfffff2",
"gasPrice" : "0xef",
"value" : "0x1",
"nonce" : "0x0"
"value" : "0x1"
}, [ "vmTrace" ], "latest" ],
"id" : 53
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"gas" : "0xfffff2",
"gasPrice" : "0xef",
"value" : "0x0",
"data" : "0x6004600C60003960046000F3600035FF",
"nonce" : "0x0"
"data" : "0x6004600C60003960046000F3600035FF"
}, [ "stateDiff" ], "latest" ],
"id" : 1
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"gas" : "0xfffff2",
"gasPrice" : "0xef",
"value" : "0x0",
"data" : "0x6004600C60003960046000F3600035FF",
"nonce" : "0x0"
"data" : "0x6004600C60003960046000F3600035FF"
}, [ "trace" ], "latest" ],
"id" : 1
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"gas" : "0xfffff2",
"gasPrice" : "0xef",
"value" : "0x0",
"data" : "0x6004600C60003960046000F3600035FF",
"nonce" : "0x0"
"data" : "0x6004600C60003960046000F3600035FF"
}, [ "vmTrace" ], "latest" ],
"id" : 54
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"gas" : "0xfffff2",
"gasPrice" : "0xef",
"value" : "0x0",
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002",
"nonce" : "0x0"
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002"
}, [ "stateDiff" ], "latest" ],
"id" : 2
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"gas" : "0xfffff2",
"gasPrice" : "0xef",
"value" : "0x0",
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002",
"nonce" : "0x0"
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002"
}, [ "trace" ], "latest" ],
"id" : 2
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"gas" : "0xfffff2",
"gasPrice" : "0xef",
"value" : "0x0",
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002",
"nonce" : "0x0"
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002"
}, [ "vmTrace" ], "latest" ],
"id" : 55
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"gas" : "0xfffff2",
"gasPrice" : "0xef",
"value" : "0x0",
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004",
"nonce" : "0x0"
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004"
}, [ "stateDiff" ], "latest" ],
"id" : 3
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"gas" : "0xfffff2",
"gasPrice" : "0xef",
"value" : "0x0",
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004",
"nonce" : "0x0"
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004"
}, [ "trace" ], "latest" ],
"id" : 3
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"gas" : "0xfffff2",
"gasPrice" : "0xef",
"value" : "0x0",
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004",
"nonce" : "0x0"
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004"
}, [ "vmTrace" ], "latest" ],
"id" : 56
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"gas" : "0xfffff2",
"gasPrice" : "0xef",
"value" : "0x0",
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000",
"nonce" : "0x0"
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000"
}, [ "stateDiff" ], "latest" ],
"id" : 4
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"gas" : "0xfffff2",
"gasPrice" : "0xef",
"value" : "0x0",
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000",
"nonce" : "0x0"
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000"
}, [ "trace" ], "latest" ],
"id" : 4
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"gas" : "0xfffff2",
"gasPrice" : "0xef",
"value" : "0x0",
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000",
"nonce" : "0x0"
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000"
}, [ "vmTrace" ], "latest" ],
"id" : 57
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"gas" : "0xfffff2",
"gasPrice" : "0xef",
"value" : "0x0",
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000",
"nonce" : "0x0"
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000"
}, [ "stateDiff" ], "latest" ],
"id" : 5
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"gas" : "0xfffff2",
"gasPrice" : "0xef",
"value" : "0x0",
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000",
"nonce" : "0x0"
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000"
}, [ "trace" ], "latest" ],
"id" : 5
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"gas" : "0xfffff2",
"gasPrice" : "0xef",
"value" : "0x0",
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000",
"nonce" : "0x0"
"data" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000"
}, [ "vmTrace" ], "latest" ],
"id" : 58
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"gas" : "0xfffff2",
"gasPrice" : "0xef",
"value" : "0x0",
"data" : "0x0000000000000000000000000000000000000999",
"nonce" : "0x0"
"data" : "0x0000000000000000000000000000000000000999"
}, [ "stateDiff" ], "latest" ],
"id" : 6
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"gas" : "0xfffff2",
"gasPrice" : "0xef",
"value" : "0x0",
"data" : "0x0000000000000000000000000000000000000999",
"nonce" : "0x0"
"data" : "0x0000000000000000000000000000000000000999"
}, [ "trace" ], "latest" ],
"id" : 6
},
Expand Down
Loading

0 comments on commit 70dc15e

Please sign in to comment.