Skip to content

Conversation

@holgerd77
Copy link
Member

This adds the PeerDAS blob per tx limit from here fixing the remaining failing Osaka state tests.

PR also fixes a false positive test for the former max blob per tx case (test cases tx blobs were at 3 and so the catch block was simply not reached and so test was passing for the wrong reason (we should rework the test setup here)).

Ready for review/merge.

@codecov
Copy link

codecov bot commented Sep 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.69%. Comparing base (28a7455) to head (659d080).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block 84.33% <ø> (ø)
blockchain 89.32% <ø> (ø)
client 67.60% <ø> (?)
common 97.52% <ø> (ø)
evm 72.79% <ø> (ø)
mpt 89.74% <ø> (ø)
statemanager 69.06% <ø> (ø)
static 99.77% <ø> (ø)
tx 90.04% <100.00%> (+0.16%) ⬆️
util 88.73% <ø> (ø)
vm 55.31% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@holgerd77
Copy link
Member Author

Ok, this is failing in the VM block builder still, so at least within the context of the eip-4844-blobs.spec.ts test when await blockBuilder.build() is called in line 85, and then when the block is created in VM buildBlock.ts, so in line 404 on the createBlock() call ("Error: invalid header. requestsHash should be provided").

No imminent idea how this is related to the changes made here, but also need to stop for now.

Happy to be picked up if someone has time! 🙂

Copy link
Member

@jochem-brouwer jochem-brouwer left a comment

Choose a reason for hiding this comment

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

One minor comment regarding an error message. Logic itself looks correct 😄 👍

const msg = Legacy.errorMsg(this, `tx can contain at most ${limitBlobsPerTx} blobs`)
const msg = Legacy.errorMsg(
this,
`tx can contain at most ${limitBlobsPerTx} blobs (maxBlobGasPerBlock/blobGasPerBlob)`,
Copy link
Member

Choose a reason for hiding this comment

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

This error message does not look completely correct, because maxBlobGasPerBlock/blobGasPerBlob could be 9 (osaka config: target 6 but max 9), while tx limit is 6

Copy link
Member Author

Choose a reason for hiding this comment

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

That's the "old way" of doing it, look at the code, this is just reflecting the implementation three lines above. So this will be superseded by the 6 from Osaka then, currently this code is the active one.

Let me know if my understanding is wrong somewhere here.

@jochem-brouwer
Copy link
Member

jochem-brouwer commented Sep 25, 2025

Ah ok, CI fails also (already mentioned by Holger above), will TAL when I got some more bandwidth 😄

@holgerd77
Copy link
Member Author

Ok, so the VM test failures in the block builder were some side effects since I added (a bit on the sideline) new fork timestamps in the eip4844GethGenesis.ts genesis file in testdata. Not fully sure what happened (it was just an intuition-remove), this should not happen and maybe we should examine this (so if one adds pragueTime: 0, osakaTime: 0,, the VM API tests fail.

Nevertheless unrelated to here, so this is no blocker to move forward with this specific PR (still tests failing though at time of writing).

@holgerd77
Copy link
Member Author

Another geth genesis related side effect. One should really not do side edits altogether! 🤯

Anyhow, all passing now, ready for review! 🙂

Comment on lines +190 to -193
// EIP-7594 PeerDAS: Limit of 6 blobs per transaction
if (this.common.isActivatedEIP(7594)) {
const maxBlobsPerTx = this.common.param('maxBlobsPerTx')
if (this.blobVersionedHashes.length > maxBlobsPerTx) {
const msg = Legacy.errorMsg(
this,
`tx can contain at most ${maxBlobsPerTx} blobs (EIP-7594)`,
)
throw EthereumJSErrorWithoutCode(msg)
}
}

// "Old" limit (superseded by EIP-7594 starting with Osaka)
const limitBlobsPerTx =
this.common.param('maxBlobGasPerBlock') / this.common.param('blobGasPerBlob')
if (this.blobVersionedHashes.length > limitBlobsPerTx) {
const msg = Legacy.errorMsg(this, `tx can contain at most ${limitBlobsPerTx} blobs`)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should't this be if/else? Currently if 7594 is active we will run both the 7594 limit and the old limit

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 am not fully sure, I think theoretically this "old" limit would technically be still intact, it just is fully superseded by the other one "by the values". So I haven't read that this is dismissed, but if someone can prove with a link happy to add if/else. Practical relevance limited though I guess.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah maybe my understanding was incorrect then, I assumed it would've been overwritten and not just superseded.

@holgerd77
Copy link
Member Author

Will take this in, all adressed.

@holgerd77 holgerd77 merged commit 6b68eb5 into master Sep 29, 2025
32 of 33 checks passed
@holgerd77 holgerd77 deleted the peerdas-fixes branch September 29, 2025 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants