-
Notifications
You must be signed in to change notification settings - Fork 20.1k
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
core,miner: add ability to build block with blobs #27875
Conversation
790c229
to
ba83d18
Compare
This is now rebased and waiting on merging #27841 |
2097e28
to
543e90c
Compare
Rebased against master, this is now ready for review. |
543e90c
to
1df3885
Compare
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.
Some minor comments
beacon/engine/types.go
Outdated
for i := range sidecars { | ||
for j := range sidecars[i].Blobs { | ||
blobsBundle.Blobs = append(blobsBundle.Blobs, hexutil.Bytes(sidecars[i].Blobs[j][:])) | ||
blobsBundle.Commitments = append(blobsBundle.Commitments, hexutil.Bytes(sidecars[i].Commitments[j][:])) | ||
blobsBundle.Proofs = append(blobsBundle.Proofs, hexutil.Bytes(sidecars[i].Proofs[j][:])) | ||
} |
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.
for i := range sidecars { | |
for j := range sidecars[i].Blobs { | |
blobsBundle.Blobs = append(blobsBundle.Blobs, hexutil.Bytes(sidecars[i].Blobs[j][:])) | |
blobsBundle.Commitments = append(blobsBundle.Commitments, hexutil.Bytes(sidecars[i].Commitments[j][:])) | |
blobsBundle.Proofs = append(blobsBundle.Proofs, hexutil.Bytes(sidecars[i].Proofs[j][:])) | |
} | |
for _, sidecar := range sidecars { | |
for j, blob := range sidecar.Blobs { | |
bundle.Blobs = append(bundle.Blobs, hexutil.Bytes(sidecar.Blobs[j][:])) | |
bundle.Commitments = append(bundle.Commitments, hexutil.Bytes(sidecar.Commitments[j][:])) | |
bundle.Proofs = append(bundle.Proofs, hexutil.Bytes(sidecar.Proofs[j][:])) | |
} |
make it a bit less dense, and remove the possibility of mixing up i
and j
miner/worker.go
Outdated
// TODO (MariusVanDerWijden): Move this check | ||
if (len(env.sidecars)+len(tx.BlobHashes()))*params.BlobTxBlobGasPerBlob > params.BlobTxMaxBlobGasPerBlock { | ||
return nil, errors.New("max data blobs reached") | ||
} |
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.
Why not move it already? Where do we want it?
839644c
to
a9a7e79
Compare
// isn't really a better place right now. The blob gas limit is checked at block validation time | ||
// and not during execution. This means core.ApplyTransaction will not return an error if the | ||
// tx has too many blobs. So we have to explicitly check it here. | ||
if (env.blobs+len(tx.BlobHashes()))*params.BlobTxBlobGasPerBlob > params.MaxBlobGasPerBlock { |
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.
I think it can be treated as block.GasLeft
.
Block has a gasPool and we can create a blobGasPool for blobTx. The benefit of this approach is: this check can be used in both (1) block generation and (2) block import.
Right now, we check the blob validity in (v *BlockValidator) ValidateBody
when import a new block, and here when generate a new block. They can be in the same place I think.
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.
Me and @lightclient tried making this change yesterday, adding blobGas into core.GasPool. I think it's not worth it right now. There are too many places in the code where we would need to suddenly care about blobGas. It would be better to refactor the state transition first, to remove duplication across the codebase.
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de> Co-authored-by: lightclient <lightclient@protonmail.com>
--------- Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de> Co-authored-by: Felix Lange <fjl@twurst.com>
This reverts commit 2099a80.
This reverts commit 2099a80.
miner: add to build block with EIP-4844 blobs Conflicts: miner/worker.go simple conflict because we added a return param. accepted both changes.
I'm ripping out the changes that allow the miner to build 4844 blocks from #27511.