Skip to content

Conversation

@Itodo-S
Copy link

@Itodo-S Itodo-S commented Jan 19, 2026

Motivation

Both functions shared a significant amount of identical code for reconstructing partial tries and fetching block headers. This refactor reduces maintenance burden and improves code readability.

Description

Extracted the duplicated witness generation logic from [generate_witness_for_blocks_with_fee_configs] and [generate_witness_from_account_updates] into a new helper function [construct_execution_witness]

Changes

  • Created [construct_execution_witness] helper function in [crates/blockchain/blockchain.rs]
  • Updated [generate_witness_for_blocks_with_fee_configs] and [generate_witness_from_account_updates] to use the helper.

Verification

  • Ran cargo test -p ethrex-blockchain to ensure no regressions were introduced.
  • All tests passed.

Closes #5708

@Itodo-S Itodo-S requested a review from a team as a code owner January 19, 2026 13:22
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