Make smart contract permissioning features work with london fork (#5727)

* Make smart contract permissioning features work with london fork

Override the transactionSimulator's default TransactionValidationParams with one that allows for exceeding the account balance (which effectively zeros the baseFee).
This mimics the way that eth_estimateGas and eth_call are implemented.
Similar change to #5277

Update ATs to use londonBlock (existing genesis allocs necessitate zeroBaseFee as well)

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>

* changelog
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>

---------

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
pull/5741/head
Simon Dudley 1 year ago committed by GitHub
parent 56768060de
commit e92e5de8f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 3
      acceptance-tests/tests/src/test/resources/permissioning/simple_permissioning_genesis.json
  3. 3
      acceptance-tests/tests/src/test/resources/permissioning/simple_permissioning_ibft_genesis.json
  4. 3
      acceptance-tests/tests/src/test/resources/permissioning/simple_permissioning_v2_genesis.json
  5. 6
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java

@ -7,6 +7,7 @@
### Additions and Improvements
### Bug Fixes
- Make smart contract permissioning features work with london fork [#5727](https://github.com/hyperledger/besu/pull/5727)
### Download Links

@ -1,7 +1,8 @@
{
"config": {
"chainId": 999,
"petersburgBlock": 0,
"londonBlock": 0,
"zeroBaseFee": true,
"ethash": {
"fixeddifficulty": 100
}

@ -1,7 +1,8 @@
{
"config": {
"chainId": 999,
"petersburgBlock": 0,
"londonBlock": 0,
"zeroBaseFee": true,
"ibft2": {
"blockperiodseconds": 5,
"epochlength": 30000,

@ -1,7 +1,8 @@
{
"config": {
"chainId": 999,
"petersburgBlock": 0,
"londonBlock": 0,
"zeroBaseFee": true,
"ethash": {
"fixeddifficulty": 100
}

@ -28,6 +28,7 @@ import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.BlockHeaderBuilder;
import org.hyperledger.besu.ethereum.core.MutableWorldState;
import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.mainnet.ImmutableTransactionValidationParams;
import org.hyperledger.besu.ethereum.mainnet.MainnetTransactionProcessor;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec;
@ -102,7 +103,10 @@ public class TransactionSimulator {
public Optional<TransactionSimulatorResult> processAtHead(final CallParameter callParams) {
return process(
callParams,
TransactionValidationParams.transactionSimulator(),
ImmutableTransactionValidationParams.builder()
.from(TransactionValidationParams.transactionSimulator())
.isAllowExceedingBalance(true)
.build(),
OperationTracer.NO_TRACING,
(mutableWorldState, transactionSimulatorResult) -> transactionSimulatorResult,
blockchain.getChainHeadHeader());

Loading…
Cancel
Save