8000 refactor: remove `PragueFeeMarket` by Gabriel-Trintinalia · Pull Request #8664 · hyperledger/besu · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Conversation

Gabriel-Trintinalia
Copy link
Contributor
@Gabriel-Trintinalia Gabriel-Trintinalia commented May 22, 2025

Description

The PragueFeeMarket is functionally identical to BlobFeeMarket (formerly CancunFeeMarket), with the sole distinction being the baseFeeUpdateFraction parameter, which is determined by the BlobSchedule.

Updates

  • Renamed CancunFeeMarket to BlobFeeMarket.
  • Removed the PragueFeeMarket class, as it is redundant and does not introduce any unique changes.
    • Removed FeeMarket from the PragueDefinition, as it is unnecessary. The builder will pass the correct BlobSchedule to the inherited FeeMarket from the BlobFeeMarket definition.
    • Merged PragueFeeMarketTest and CancunFeeMarketTest into a single test class, BlobFeeMarketTest
  • Removed the overloaded constructor from BlobFeeMarket; it will now always expect a baseFeeUpdateFraction.
    • Introduced a new cancunDefault method in FeeMarket to create Blob fee markets with default Cancun BlobSchedule parameters, primarily for use in test cases.
  • Renamed the implementsDataFee method to implementsBlobFee.

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>
Copy link
@Copilot Copilot AI left a 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 to BlobFeeMarket (always requires a baseFeeUpdateFraction) and removed PragueFeeMarket.
  • Merged the two per-fork fee market tests into one parameterized BlobFeeMarketTest, and updated all other tests to call implementsBlobFee() and FeeMarket.cancunDefault(...).
  • Introduced FeeMarketBuilderFactory.createFeeMarket(...) and refactored MainnetProtocolSpecs 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 is implementsBlobFee(). Renaming it to implementsBlob 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 of BlobFee; consider renaming to implementsBlobFeeShouldReturnFalse to match the API.
public void implementsBlobFeedShouldReturnFalse() {

Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Copy link
@Copilot Copilot AI left a 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) {

Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Copy link
Contributor
@siladu siladu left a 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

Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Copy link
Contributor
@pinges pinges left a 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,
Copy link
Contributor

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?

Copy link
Contributor
@siladu siladu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Gabriel-Trintinalia Gabriel-Trintinalia enabled auto-merge (squash) May 22, 2025 11:41
@Gabriel-Trintinalia Gabriel-Trintinalia merged commit ec9cdfb into hyperledger:main May 22, 2025
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0