Skip to content

feat(network-primitives): add blob_versioned_hashes to TransactionBuilder4844#3730

Closed
figtracer wants to merge 6 commits intoalloy-rs:mainfrom
figtracer:feat/tx-builder-4844-blob-versioned-hashes
Closed

feat(network-primitives): add blob_versioned_hashes to TransactionBuilder4844#3730
figtracer wants to merge 6 commits intoalloy-rs:mainfrom
figtracer:feat/tx-builder-4844-blob-versioned-hashes

Conversation

@figtracer
Copy link
Copy Markdown
Contributor

Summary

Adds blob_versioned_hashes getter/setter/builder methods to the TransactionBuilder4844 trait.

TransactionRequest already stores blob_versioned_hashes as a field and uses it extensively
for EIP-4844 type detection, validation, and tx building. However, the TransactionBuilder4844
trait only exposes max_fee_per_blob_gas and blob_sidecar — there is no way for generic code
(T: TransactionBuilder4844) to read or write blob versioned hashes.

This is needed by downstream consumers (e.g. Foundry) that have functions generic over
T: TransactionBuilder4844 and need to populate EVM TxEnv.blob_hashes from the transaction
request.

Changes

  • Add blob_versioned_hashes(&self) -> Option<&[B256]> (default: None)
  • Add set_blob_versioned_hashes(&mut self, Vec<B256>) (default: no-op)
  • Add with_blob_versioned_hashes(self, Vec<B256>) -> Self (builder pattern)
  • Add WithOtherFields<T> delegation for the new methods
  • Implement on TransactionRequest backed by the existing blob_versioned_hashes field

All defaults are no-ops so existing trait implementations are unaffected.

mablr added 4 commits January 26, 2026 17:50
- Renamed methods for setting and getting blob sidecars to specify EIP-4844 and EIP-7594 format variants.
- Merged the TransactionBuilder7594 trait into TransactionBuilder4844.
- Updated tests and transaction request implementations to reflect the new method names and structure.
@figtracer figtracer force-pushed the feat/tx-builder-4844-blob-versioned-hashes branch from 96c0217 to 3ae9e01 Compare February 21, 2026 22:06
@figtracer figtracer marked this pull request as ready for review February 21, 2026 22:08
Copy link
Copy Markdown
Contributor

@mablr mablr left a comment

Choose a reason for hiding this comment

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

For more context: this is not anymore on the Foundry Cast refactor hotpath. See foundry-rs/foundry#13512.

But I still think it's a nice a "nice-to-have" feat, to add not before Alloy 2.0 and its TransactionBuilder4844 unification #3600

@figtracer
Copy link
Copy Markdown
Contributor Author

For more context: this is not anymore on the Foundry Cast refactor hotpath. See foundry-rs/foundry#13512.

But I still think it's a nice a "nice-to-have" feat, to add not before Alloy 2.0 and its TransactionBuilder4844 unification #3600

will note this down since we might have more cases after release

@figtracer figtracer closed this Apr 20, 2026
@github-project-automation github-project-automation Bot moved this to Done in Alloy Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants