Skip to content

Add EngineAPI and Txpool changes for Fusaka#15222

Merged
somnergy merged 38 commits into
mainfrom
som/peerdas_txpool
Jun 6, 2025
Merged

Add EngineAPI and Txpool changes for Fusaka#15222
somnergy merged 38 commits into
mainfrom
som/peerdas_txpool

Conversation

@somnergy

Copy link
Copy Markdown
Member

No description provided.

@somnergy somnergy changed the title Fusaka: Add EngineAPI and Txpool changes [WIP] Fusaka: Add EngineAPI and Txpool changes May 23, 2025
@somnergy somnergy force-pushed the som/peerdas_txpool branch from 8cda1ac to 8127da7 Compare May 26, 2025 13:40
@somnergy

Copy link
Copy Markdown
Member Author

Waiting for #15067

@somnergy somnergy force-pushed the som/peerdas_txpool branch from b91a1d1 to 70d3f0e Compare May 29, 2025 14:52
@somnergy somnergy changed the title [WIP] Fusaka: Add EngineAPI and Txpool changes Add EngineAPI and Txpool changes for Fusaka May 29, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

OUTDATED

Comment thread turbo/engineapi/engine_server.go Outdated
Comment thread erigon-lib/types/blob_test_util.go Outdated
Comment thread txnprovider/txpool/pool.go Outdated
@somnergy

somnergy commented Jun 2, 2025

Copy link
Copy Markdown
Member Author

At the moment i have "introduced" go-eth-kzg library side-by-side to go-kzg-4844, will unify the two in a subsequent PR

@somnergy somnergy requested a review from Copilot June 3, 2025 10:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces EngineAPI updates and txpool changes required for the Fusaka upgrade.

  • Updates blob handling in txpool by replacing separate Blobs, Commitments, and Proofs with a composite BlobBundles structure.
  • Revises parsing, validation, and accessor methods (e.g. Blobs(), Commitments(), Proofs()) in TxnSlot and updates related tests and mocks.
  • Adds new fusaka-specific logic such as the isOsaka time-based fork check and supporting configuration changes.

Reviewed Changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
txnprovider/txpool/txpool_grpc_server.go Updated GetBlobs to return BlobBundles and transform them into blobs and proofs.
txnprovider/txpool/senders.go Replaced BlobTxnType field accesses to use BlobBundles instead of old fields.
txnprovider/txpool/pool_txn_parser_test.go Adjusted tests to use new accessor methods reflecting BlobBundles changes.
txnprovider/txpool/pool_txn_parser.go Revised transaction parsing logic to populate BlobBundles and distribute proofs.
txnprovider/txpool/pool.go Refactored blob txn validation and retrieval to use BlobBundles; added isOsaka logic.
txnprovider/txpool/pool_mock.go Updated mocks to support the new GetBlobs signature returning BlobBundles.
Other configuration, workflow, and dependency files Updated dependencies and added fusaka-specific test/workflow targets and EngineAPI features.
Comments suppressed due to low confidence (1)

txnprovider/txpool/pool_txn_parser.go:202

  • [nitpick] Add an inline comment explaining the significance of dataLen==1 (wrapperVersion detection) to improve maintainability.
if _, dataLen, err = rlp.ParseString(payload, p); err == nil && dataLen == 1 {

Comment thread txnprovider/txpool/txpool_grpc_server.go
Comment thread txnprovider/txpool/pool.go
@somnergy somnergy requested review from taratorio and yperbasis June 3, 2025 13:26
Comment thread txnprovider/txpool/pool_txn_parser.go Outdated
@yperbasis

Copy link
Copy Markdown
Member

Please merge the latest main to exclude PR #15419 from the diff

Comment thread txnprovider/txpool/pool_txn_parser.go Outdated
Comment thread erigon-lib/types/blob_tx_wrapper.go Outdated
//fmt.Printf("%s: senderID=%d,nonce=%d,tip=%d,hash=%x\n", prefix, tx.senderID, tx.nonce, tx.tip, tx.IdHash)
}

func (tx *TxnSlot) Blobs() [][]byte {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps it doesn't matter much, but it's probably more efficient to refactor VerifyCellProofBatch to take []PoolBlobBundle so that we don't need these functions with copying.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, makes sense. I just wanted to keep that function independent of pool, and the loops in there are just a placeholder before we settle between one of the gokzg libraries.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's do it in a follow-up PR

versionedHashes, commitments, proofs, blobs := blobTx.GetBlobHashes(), blobTx.Commitments, blobTx.Proofs, blobTx.Blobs
lenCheck := len(versionedHashes)
if lenCheck != len(commitments) || lenCheck != len(proofs) || lenCheck != len(blobs) {
if lenCheck != len(commitments) || (lenCheck != len(proofs) && blobTx.WrapperVersion == 0) || lenCheck != len(blobs) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it not worth it to add the Fusaka checks here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Assuming that Pool wouldn't let in bad txns, and only way to get Fusaka blocks is through getPayloadV5 that has the checks

if blobCount > 0 {
if p.isOsaka() {
proofs := mt.TxnSlot.Proofs()
if len(proofs) != len(mt.TxnSlot.BlobBundles)*int(params.CellsPerExtBlob) { // cell_proofs contains exactly CELLS_PER_EXT_BLOB * len(blobs) cell proofs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems unnecessary here because the check is already done by validateBlobTxn

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No but the pool doesn't immediately remove pre-osaka transactions, and those shouldn't be included post osaka. This is a tricky bit at the transition block.

@somnergy somnergy merged commit 4e439f5 into main Jun 6, 2025
16 of 17 checks passed
@somnergy somnergy deleted the som/peerdas_txpool branch June 6, 2025 11:34
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.

Implement Cell proofs and Networking related changes on Txpool for PeerDAS (EIP-7594)

3 participants