-
Notifications
You must be signed in to change notification settings - Fork 927
refactor: remove PragueFeeMarket
#8664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: remove PragueFeeMarket
#8664
Conversation
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes the now-redundant PragueFeeMarket
, unifies it under the new BlobFeeMarket
, and updates all related factories, interfaces, and tests.
- Renamed
CancunFeeMarket
toBlobFeeMarket
(always requires abaseFeeUpdateFraction
) and removedPragueFeeMarket
. - Merged the two per-fork fee market tests into one parameterized
BlobFeeMarketTest
, and updated all other tests to callimplementsBlobFee()
andFeeMarket.cancunDefault(...)
. - Introduced
FeeMarketBuilderFactory.createFeeMarket(...)
and refactoredMainnetProtocolSpecs
to use it.
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
.../ZeroBaseFeeMarketTest.java | Renamed test to implementsBlobFeedShouldReturnFalse |
.../FixedBaseFeeMarketTest.java | Same rename for fixed base fee market test |
.../BlobFeeMarketTest.java | Added new parameterized test over BlobSchedule |
.../FeeMarket.java | Replaced implementsDataFee() with implementsBlobFee() , added new static constructors |
.../FeeMarketBuilderFactory.java | New factory class for fee market builders |
.../MainnetProtocolSpecs.java | Refactored to use createFeeMarket instead of inline builders |
Comments suppressed due to low confidence (2)
ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/ZeroBaseFeeMarketTest.java:144
- [nitpick] The test method name says
implementsBlobFeed
but the interface method isimplementsBlobFee()
. Renaming it toimplementsBlob 8000 FeeShouldReturnFalse
will keep it consistent.
public void implementsBlobFeedShouldReturnFalse() {
ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/FixedBaseFeeMarketTest.java:144
- [nitpick] The test name uses
BlobFeed
instead ofBlobFee
; consider renaming toimplementsBlobFeeShouldReturnFalse
to match the API.
public void implementsBlobFeedShouldReturnFalse() {
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java
Outdated
Show resolved
Hide resolved
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java
Outdated
Show resolved
Hide resolved
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/feemarket/FeeMarket.java
Show resolved
Hide resolved
...um/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/feemarket/BlobFeeMarketTest.java
Show resolved
Hide resolved
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request refactors the fee market implementation by removing the redundant PragueFeeMarket class and unifying fee market behavior under the BlobFeeMarket. It also updates associated tests and protocol specification builders to use the new BlobFeeMarket and the cancunDefault factory method.
- Removed PragueFeeMarket and its tests.
- Renamed methods from implementsDataFee to implementsBlobFee.
- Updated fee market provisioning in protocol specs and tests via FeeMarketBuilderFactory using cancunDefault.
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
ZeroBaseFeeMarketTest.java | Renamed test method to check implementsBlobFee. |
PragueFeeMarketTest.java | Entire file removed as PragueFeeMarket is no longer needed. |
FixedBaseFeeMarketTest.java | Renamed test method to check implementsBlobFee. |
CancunFeeMarketTest.java | Removed as part of consolidation with BlobFeeMarket. |
BlobFeeMarketTest.java | Updated tests to parameterize fee market by BlobSchedule. |
PragueTargetingGasLimitCalculatorTest.java | Updated fee market creation to include BlobSchedule.PRAGUE_DEFAULT. |
MainnetTransactionValidatorTest.java, CancunTargetingGasLimitCalculatorTest.java, Eth* tests | Updated fee market instantiation from cancun() to cancunDefault(). |
FeeMarket.java | Updated fee market factory methods and documentation to reflect new BlobFeeMarket usage. |
BlobFeeMarket.java | Renamed class and methods updated per new BlobFeeMarket logic. |
MainnetProtocolSpecs.java | Refactored fee market builder composition using FeeMarketBuilderFactory and cancunDefault. |
AbstractBlockCreator.java | Updated fee market method reference from implementsDataFee to implementsBlobFee. |
BlobSchedule.java | Added toString() override for BlobSchedule instances. |
Comments suppressed due to low confidence (1)
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/feemarket/FeeMarket.java:83
- The Javadoc for this overloaded method mentions that the BlobSchedule parameter is ignored; consider clarifying why it is included to avoid confusion for future maintainers.
static BaseFeeMarket london(final long londonForkBlockNumber, final Optional<Wei> baseFeePerGasOverride, final BlobSchedule ignored) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice refactor 👍
Just a naming/location nit
...e/src/main/java/org/hyperledger/besu/ethereum/mainnet/feemarket/FeeMarketBuilderFactory.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a comment about passing in the london block number into the london() method.
static BaseFeeMarket london( | ||
final long londonForkBlockNumber, final Optional<Wei> baseFeePerGasOverride) { | ||
return new LondonFeeMarket(londonForkBlockNumber, baseFeePerGasOverride); | ||
final long londonForkBlockNumber, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we get the london fork block number from the genesis?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
The
PragueFeeMarket
is functionally identical toBlobFeeMarket
(formerlyCancunFeeMarket
), with the sole distinction being thebaseFeeUpdateFraction
parameter, which is determined by theBlobSchedule
.Updates
CancunFeeMarket
toBlobFeeMarket
.PragueFeeMarket
class, as it is redundant and does not introduce any unique changes.FeeMarket
from thePragueDefinition
, as it is unnecessary. The builder will pass the correctBlobSchedule
to the inheritedFeeMarket
from theBlobFeeMarket
definition.PragueFeeMarketTest
andCancunFeeMarketTest
into a single test class,BlobFeeMarketTest
BlobFeeMarket
; it will now always expect abaseFeeUpdateFraction
.cancunDefault
method inFeeMarket
to create Blob fee markets with default CancunBlobSchedule
parameters, primarily for use in test cases.implementsDataFee
method toimplementsBlobFee
.