Skip to content

fix(vm): rollback builder state on failed Osaka blob tx (Fixes issue #4271)#4290

Open
rame3519 wants to merge 1 commit into
ethereumjs:masterfrom
rame3519:fix/osaka-builder-rollback
Open

fix(vm): rollback builder state on failed Osaka blob tx (Fixes issue #4271)#4290
rame3519 wants to merge 1 commit into
ethereumjs:masterfrom
rame3519:fix/osaka-builder-rollback

Conversation

@rame3519
Copy link
Copy Markdown

Summary:

Fixes a non-atomic failure path in BlockBuilder.addTransaction() where malformed Osaka blob transactions could partially mutate builder state before post-run validation failed.

Problem:

A Prague-created blob tx wrapped as an EIP-7594 network wrapper could:

  • execute successfully via runTx()
  • mutate VM state
  • increment blobGasUsed
  • later fail Osaka validation during createMinimal4844TxFromNetworkWrapper()

This left the builder in a poisoned state despite the transaction being rejected.

Fix:

  • moved Osaka blob validation before runTx()
  • added rollback protection for builder accounting/state
  • restored transaction arrays and gas accounting on failure
  • added regression coverage proving rollback correctness

Validation:

Added regression test:

ethjs-osaka-builder-state-poison.spec.ts

Before fix:

  • invalid block stateRoot
  • poisoned blobGasUsed
  • replay failure

After fix:

  • clean rollback
  • blobGasUsed remains zero
  • block replay succeeds

@holgerd77
Copy link
Copy Markdown
Member

Hi there, thanks for the PR. What is your motivation to fix this?

@rame3519
Copy link
Copy Markdown
Author

Hi there, thanks for the PR. What is your motivation to fix this?

Hello! Thanks for reaching out to me. This fix was for my Blockchains & Cryptocurrencies group project which required us to fix a related git project issue.

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.

2 participants