In #5708, generate_witness_from_account_updates was introduced, and it has a significant amount of duplicated code with generate_witness_for_blocks_with_fee_configs. This approach was chosen for simplicity and to speed up the merge of the PR, since both functions are long and difficult to follow. We should extract the duplicated logic into a helper function and use it in both places.