Skip to content

glamsterdam devnet 6#4371

Merged
jangko merged 50 commits into
masterfrom
glamsterdam-devnet-6
Jul 8, 2026
Merged

glamsterdam devnet 6#4371
jangko merged 50 commits into
masterfrom
glamsterdam-devnet-6

Conversation

@jangko

@jangko jangko commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread execution_chain/transaction/call_common.nim Outdated
Comment thread tests/eest/eest_stateless_execution_test.nim Outdated
jangko and others added 3 commits July 2, 2026 09:24
* - tx_packer.nim — the packer now tracks the running encoded block size (seeded with a 1 KiB header/list-prefix allowance plus the exact withdrawals size) and skips any transaction that wouldn't fit before executing it, gated on Osaka+ to match the validator. Header, receipts, gas counters, and BAL now stay consistent with the body by construction.
  - tx_pool.nim — the truncation loop is gone; assembleBlock instead returns an error in the (now unreachable) case an oversized block is assembled, so an inconsistent block can never be shipped.

* consider gas
* fix(txpool): reset vmState before every assembleBlock

forkchoiceUpdated rebuilds the payload for the same slot (same timestamp)
arbitrarily many times. assembleBlock only refreshed the packing vmState
when the timestamp changed, so every rebuild after the first reused the
previous pack's persisted ledger (tx nonces already bumped) and its stale
per-block accumulators (blobGasUsed, gas counters) which vmExecInit never
resets. On the rebuild every pooled tx failed the nonce check, leaving an
empty body while the header still committed to the first pack's blobGasUsed
— yielding a block every other client rejects as
'blob gas used mismatch (header N, calculated 0)'.

Always reset the transaction environment at the start of assembleBlock.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(txpool): rebuilding a payload at the same timestamp stays consistent

Regression test for the blob-gas mismatch: assembleBlock called twice at the
same timestamp must produce a block whose header blobGasUsed matches the body
and that survives re-execution, instead of an empty body with a stale header.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jangko and others added 16 commits July 3, 2026 23:03
…es (#4409)

* fix(engine): preserve withdrawals for V4 (Amsterdam) payload attributes

setWithdrawals only copied withdrawals for PayloadAttributes V2/V3 and
emptied them for every other version via an else branch. From Amsterdam, the
CL drives block building via engine_forkchoiceUpdatedV4 (PayloadAttributesV4,
version V4), which fell into that else and discarded the entire withdrawals
list. The built payload then had an empty withdrawals root and was rejected
by consensus clients as a withdrawals-root mismatch.

Observed on glamsterdam-devnet-6: every block built by a nimbus-el proposer
carrying a (builder-payment) withdrawal was rejected network-wide, stalling
finality. Regular validator withdrawals would be affected identically.

Handle the withdrawal-bearing versions explicitly with no else branch, so the
case stays exhaustive and any future Version must be handled deliberately
(the else is what allowed V4 to be dropped silently).

🤖 Generated with AI assistance

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(engine): tighten setWithdrawals range to V2..V4

Use Version.V2 .. Version.V4 instead of V2..V6 so Nim's case-exhaustiveness
check catches any future Version additions explicitly rather than silently
folding them into the withdrawal-copy branch.

🤖 Generated with AI assistance

* fix(engine): add explicit raiseAssert arm for unreachable V5/V6 PayloadAttributes

V5/V6 do not exist as PayloadAttributes variants but the Nim compiler
requires exhaustive case coverage. Add an explicit raiseAssert arm so
the exhaustiveness check is satisfied while making the impossibility
visible to future readers.

🤖 Generated with AI assistance

* test(engine): regression test for V4 payload attributes preserving withdrawals

Covers the setWithdrawals fix: a PayloadAttributes with targetGasLimit
(Version.V4) must keep its withdrawals through payload assembly rather than
dropping them via the old `else` branch. Builds a V4 attributes value with a
non-empty withdrawals list, runs it through generateExecutionBundle, and asserts
the assembled payload still carries the withdrawals.

🤖 Generated with AI assistance

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(test): build txpool from env.chain for V4 withdrawals regression test

TestEnv has no txPool field — setupEnv creates the pool locally and only
stores com/server/client/chain. Construct BeaconEngineRef from a
TxPoolRef built on env.chain (mirroring setupEnv) so tests/all_tests.nim
compiles. Fixes CI: undeclared field 'txPool' for type TestEnv.

🤖 Generated with AI assistance

---------

Co-authored-by: lodekeeper <lodekeeper@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@jangko jangko marked this pull request as ready for review July 7, 2026 06:02
advaita-saha and others added 3 commits July 7, 2026 17:46
* builds MUST start on forkchoiceState.headBlockHash

* make passing the parentHash mandatory for block building & update tests
@jangko

jangko commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@bhartnett do you have any idea why parallelEnabled=true make eest_engine_test fail but eest_blockchain_test not fail?
This happen when I try to merge master into this branch.

The difference is in evmState.blockStateGasUsed, I'm still try to figure out where to look into.

@bhartnett

Copy link
Copy Markdown
Contributor

@bhartnett do you have any idea why parallelEnabled=true make eest_engine_test fail but eest_blockchain_test not fail? This happen when I try to merge master into this branch.

Probably because the full BAL is passed in for all engine tests but the blockchain tests only supply the BAL for some. Parallel execution only runs when the BAL is supplied.

The difference is in evmState.blockStateGasUsed, I'm still try to figure out where to look into.

I'll have a look.

@jangko

jangko commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Parallel execution only runs when the BAL is supplied.

I see.

Okay. I will merge this branch, and we can continue development and bugfix on master branch.
we can ignore kurtosis and the linter fail for now.

@jangko jangko merged commit 3513fc3 into master Jul 8, 2026
28 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants