Skip to content
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

params,core: add max and target value to chain config #31002

Merged
merged 11 commits into from
Feb 4, 2025

Conversation

lightclient
Copy link
Member

@lightclient lightclient commented Jan 7, 2025

Implements EIP-7840 and EIP-7691.

Copy link

@Majid6561 Majid6561 left a comment

Choose a reason for hiding this comment

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

app

@lightclient
Copy link
Member Author

Made the updates from your review, Marius. Thanks!

@@ -26,7 +26,7 @@ import (
"github.com/holiman/uint256"
)

var rand = mrand.New(mrand.NewSource(1))
var rnd = mrand.New(mrand.NewSource(1))
Copy link
Member Author

Choose a reason for hiding this comment

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

I renamed this because it was playing havoc with my LSP for some reason.

Copy link
Member

Choose a reason for hiding this comment

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

then rename mrand to rand if you can

@lightclient lightclient force-pushed the eip-7840 branch 4 times, most recently from 5df556c to c3daabe Compare January 14, 2025 04:32
Copy link
Member

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

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

nitpicks, need to head out for today, will take a deeper look tomorrow!

// Most of the blob gas logic here is agnostic as to if the chain supports
// blobs or not, however the max check panics when called on a chain without
// a defined schedule, so we need to verify it's safe to call.
if miner.chainConfig.IsCancun(env.header.Number, env.header.Time) {
Copy link
Member

Choose a reason for hiding this comment

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

By moving this logic after the resolve, we will pull up all blob transactions if the block is not full, but full enough of blob transactions afaik. So we're doing a lot of unnecessary work

Copy link
Member Author

Choose a reason for hiding this comment

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

Right good point. I meant to move this above again and forgot.

Copy link
Member

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

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

LGTM

fjl added 3 commits February 4, 2025 13:28
{Latest,}MaxBlobsPerBlock returns a length, which is traditionally an int in Go. When
comparing with blob gas (uint64) a conversion is required, but I think it's actually
helpful. Kind of makes it clearer that you're working with different units.
When comparing against a slice length, no conversion is needed.

I'm also adding MaxBlobGasPerBlock to simplify the most common expression involving
MaxBlobsPerBlock.
fjl
fjl previously approved these changes Feb 4, 2025
Copy link
Contributor

@fjl fjl left a comment

Choose a reason for hiding this comment

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

made some style edits

@@ -26,7 +26,7 @@ import (
"github.com/holiman/uint256"
)

var rand = mrand.New(mrand.NewSource(1))
var rnd = mrand.New(mrand.NewSource(1))
Copy link
Member

Choose a reason for hiding this comment

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

then rename mrand to rand if you can

Comment on lines +1128 to +1129
{common.Hash{0x07}, types.BlobTxType, params.BlobTxBlobGasPerBlob * 10},
{common.Hash{0x08}, types.BlobTxType, params.BlobTxBlobGasPerBlob * 10},
Copy link
Member

Choose a reason for hiding this comment

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

What if the maximum is increased in the future? These numbers won't be accurate, and unless someone remembers to change that here, it won't be representative of what the max could be. I would suggest keeping some max value in params, that is used in the Prague config, and here as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's just a simple data-passing test. The same value is sent a few lines up in doTxNotify.

@MariusVanDerWijden MariusVanDerWijden merged commit e6f3ce7 into ethereum:master Feb 4, 2025
3 of 4 checks passed
Copy link

@Majid6561 Majid6561 left a comment

Choose a reason for hiding this comment

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

majed

@Majid6561
Copy link

Sadeqi&6323

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants