From b22645c7ed4ba3671a058e1abdaab03bf21b49e8 Mon Sep 17 00:00:00 2001 From: Jason Frame Date: Thu, 30 Mar 2023 14:25:44 +1000 Subject: [PATCH] Fix BFT creating invalid blocks on London when zero base fee is used (#5276) Signed-off-by: Jason Frame --- CHANGELOG.md | 1 + .../ethereum/mainnet/feemarket/ZeroBaseFeeMarket.java | 5 ----- .../mainnet/feemarket/ZeroBaseFeeMarketTest.java | 11 +++++++++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31afabe2e1c..ceb3914a1b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - Upgrade RocksDB version from 7.7.3 to 8.0.0. Besu Team [contributed](https://github.com/facebook/rocksdb/pull/11099) to this release to make disabling checksum verification work. ### Bug Fixes +- Fix QBFT and IBFT unable to propose blocks on London when zeroBaseFee is used [#5276](https://github.com/hyperledger/besu/pull/5276) ### Download Links diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/feemarket/ZeroBaseFeeMarket.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/feemarket/ZeroBaseFeeMarket.java index 85d55ef429d..c2f406cad04 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/feemarket/ZeroBaseFeeMarket.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/feemarket/ZeroBaseFeeMarket.java @@ -38,9 +38,4 @@ public Wei computeBaseFee( public ValidationMode baseFeeValidationMode(final long blockNumber) { return ValidationMode.NONE; } - - @Override - public boolean implementsDataFee() { - return true; - } } diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/ZeroBaseFeeMarketTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/ZeroBaseFeeMarketTest.java index 20d389d4700..dbe35d19890 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/ZeroBaseFeeMarketTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/ZeroBaseFeeMarketTest.java @@ -18,6 +18,7 @@ import org.hyperledger.besu.crypto.KeyPair; import org.hyperledger.besu.crypto.SignatureAlgorithmFactory; +import org.hyperledger.besu.datatypes.DataGas; import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.ethereum.core.Transaction; import org.hyperledger.besu.ethereum.core.TransactionTestFixture; @@ -138,4 +139,14 @@ public void isBeforeForkBlockShouldBeFalse() { assertThat(zeroBaseFeeMarket.isBeforeForkBlock(10)).isFalse(); assertThat(zeroBaseFeeMarket.isBeforeForkBlock(11)).isFalse(); } + + @Test + public void implementsDataFeedShouldReturnFalse() { + assertThat(zeroBaseFeeMarket.implementsDataFee()).isFalse(); + } + + @Test + public void dataPriceShouldReturnsZero() { + assertThat(zeroBaseFeeMarket.dataPrice(DataGas.ONE)).isEqualTo(Wei.ZERO); + } }