consensus: Add CalcBlobFeeWithConfig to eip4844 package#638
Merged
consensus: Add CalcBlobFeeWithConfig to eip4844 package#638
Conversation
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>
gligneul
reviewed
Mar 24, 2026
gligneul
approved these changes
Mar 24, 2026
Contributor
gligneul
left a comment
There was a problem hiding this comment.
Looks good. Just a minor question.
gligneul
approved these changes
Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.ChainConfigand a*types.Header, then internally resolves the active blob schedule vialatestBlobConfig(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'seth_configRPC (EIP-7910), yielding a standalone*params.BlobConfigrather than a full chain config.Without this helper, the caller would need to either:
ChainConfigjust to callCalcBlobFee(wasteful and error-prone)blobBaseFeecalculation logic outside of geth (breaks encapsulation)pulled in by OffchainLabs/nitro#4511
part of NIT-4354