Skip to content

core, internal, miner, signer: convert legacy sidecar in Osaka fork #32347

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rjl493456442
Copy link
Member

@rjl493456442 rjl493456442 commented Aug 5, 2025

This pull request implements #32235 , constructing blob sidecar in new format (cell proof)
if the Osaka has been activated.

Apart from that, it introduces a pre-conversion step in the blob pool before adding the txs.
This mechanism is essential for handling the remote legacy blob txs from the network.

One thing is still missing and probably is worthy being highlighted here: the blobpool may
contain several legacy blob txs before the Osaka and these txs should be converted once
Osaka is activated. While the GetBlob API in blobpool is capable for generating cell proofs
at the runtime, converting legacy txs at one time is much cheaper overall.

chainHead := api.b.CurrentHeader()
isOsaka := api.b.ChainConfig().IsOsaka(chainHead.Number, chainHead.Time)
if isOsaka {
config.blobSidecarVersion = types.BlobSidecarVersion1
Copy link
Member Author

Choose a reason for hiding this comment

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

Note, the legacy proofs submitted by users will be implicitly converted to cell proofs.

@@ -1603,7 +1630,7 @@ func (api *TransactionAPI) SignTransaction(ctx context.Context, args Transaction
// no longer retains the blobs, only the blob hashes. In this step, we need
// to put back the blob(s).
if args.IsEIP4844() {
signed = signed.WithBlobTxSidecar(types.NewBlobTxSidecar(types.BlobSidecarVersion0, args.Blobs, args.Commitments, args.Proofs))
signed = signed.WithBlobTxSidecar(types.NewBlobTxSidecar(sidecarVersion, args.Blobs, args.Commitments, args.Proofs))
Copy link
Member Author

Choose a reason for hiding this comment

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

Note, the legacy proofs submitted by users will be implicitly converted to cell proofs.

@@ -425,21 +424,6 @@ func (miner *Miner) commitTransactions(env *environment, plainTxs, blobTxs *tran
if !env.txFitsSize(tx) {
break
}

// Make sure all transactions after osaka have cell proofs
if isOsaka {
Copy link
Member Author

Choose a reason for hiding this comment

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

The conversion is unnecessary and useless.

If only affects the referenced transaction object, while the one in the blobpool/datadir won't be changed.

What really matters if the ones in the blobpool, for serving GetBlob APIs at the engine api.

Copy link
Member Author

Choose a reason for hiding this comment

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

Besides, the conversion during block production is very dangerous, as it's time costy.
It's very likely to miss the slot due to the expensive proof generation.

for i, tx := range txs {
if errs[i] != nil {
continue
}
Copy link
Member Author

Choose a reason for hiding this comment

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

One part is still missing:

During the Osaka activation, we should somehow convert the legacy sidecars to new format. It should be done in a following PR.

@jwasinger jwasinger assigned jwasinger and cskiraly and unassigned jwasinger Aug 7, 2025
@fjl fjl added the osaka label Aug 7, 2025
Copy link

@moncefdhk999 moncefdhk999 left a comment

Choose a reason for hiding this comment

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

Quelqu'un utilise mes compte et faites beaucoup des modifications

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, I added a mainly cosmetic commit

@MariusVanDerWijden
Copy link
Member

Ah looks like some test has been failing because of this

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.

6 participants