Skip to content

consensus: Add CalcBlobFeeWithConfig to eip4844 package#638

Merged
bragaigor merged 4 commits intomasterfrom
braga/dyn-parent-config-eip7910
Mar 27, 2026
Merged

consensus: Add CalcBlobFeeWithConfig to eip4844 package#638
bragaigor merged 4 commits intomasterfrom
braga/dyn-parent-config-eip7910

Conversation

@bragaigor
Copy link
Copy Markdown
Contributor

@bragaigor bragaigor commented Mar 16, 2026

Adds a new helper function CalcBlobFeeWithConfig that calculates the blob base fee from a params.BlobConfig directly, without requiring a full params.ChainConfig.

The existing CalcBlobFee function requires a *params.ChainConfig and a *types.Header, then internally resolves the active blob schedule via latestBlobConfig(config, header.Time). This works well when the caller has a complete chain config, but Nitro's ParentChain component now fetches the blob schedule dynamically from the parent chain's eth_config RPC (EIP-7910), yielding a standalone *params.BlobConfig rather than a full chain config.

Without this helper, the caller would need to either:

  • Reconstruct a full ChainConfig just to call CalcBlobFee (wasteful and error-prone)
  • Duplicate the blobBaseFee calculation logic outside of geth (breaks encapsulation)

pulled in by OffchainLabs/nitro#4511
part of NIT-4354

Adds a new helper function CalcBlobFeeWithConfig that
calculates the blob base fee from a params.BlobConfig
directly, without requiring a full params.ChainConfig.

Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
@bragaigor bragaigor changed the title Add CalcBlobFeeWithConfig to eip4844 package consensus: Add CalcBlobFeeWithConfig to eip4844 package Mar 16, 2026
@bragaigor bragaigor changed the title consensus: Add CalcBlobFeeWithConfig to eip4844 package (consensus): Add CalcBlobFeeWithConfig to eip4844 package Mar 16, 2026
@bragaigor bragaigor changed the title (consensus): Add CalcBlobFeeWithConfig to eip4844 package consensus: Add CalcBlobFeeWithConfig to eip4844 package Mar 16, 2026
@bragaigor bragaigor marked this pull request as ready for review March 20, 2026 16:07
@bragaigor bragaigor requested review from eljobe and gligneul March 20, 2026 16:08
Comment thread consensus/misc/eip4844/eip4844.go
Copy link
Copy Markdown
Contributor

@gligneul gligneul left a comment

Choose a reason for hiding this comment

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

Looks good. Just a minor question.

@gligneul gligneul assigned bragaigor and unassigned gligneul Mar 24, 2026
@bragaigor bragaigor requested a review from gligneul March 25, 2026 15:51
@bragaigor bragaigor removed their assignment Mar 25, 2026
@gligneul gligneul assigned eljobe and unassigned gligneul Mar 25, 2026
@bragaigor bragaigor enabled auto-merge March 27, 2026 11:45
@bragaigor bragaigor merged commit 461e517 into master Mar 27, 2026
16 checks passed
@bragaigor bragaigor deleted the braga/dyn-parent-config-eip7910 branch March 27, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants