Skip to content

refactor: reuse bound tx and remove redundant context.tx() calls#3176

Closed
Bashmunta wants to merge 1 commit intobluealloy:mainfrom
Bashmunta:refactor/validation-reuse-tx-binding
Closed

refactor: reuse bound tx and remove redundant context.tx() calls#3176
Bashmunta wants to merge 1 commit intobluealloy:mainfrom
Bashmunta:refactor/validation-reuse-tx-binding

Conversation

@Bashmunta
Copy link
Copy Markdown
Contributor

his refactor binds the transaction once in validate_tx_env() and derives tx_type from the bound reference, eliminating redundant calls to context.tx(). It also reuses the bound tx for the EIP-3860 initcode size check instead of calling context.tx() again. The change improves clarity and marginally reduces method calls without changing semantics or borrow behavior. Repeated immutable borrows from ContextTr::tx() are cheap, but centralizing on a single borrow makes intent clearer and avoids unnecessary lookups via all().

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Nov 14, 2025

CodSpeed Performance Report

Merging #3176 will not alter performance

Comparing Bashmunta:refactor/validation-reuse-tx-binding (97dab10) with main (47d1ae2)

Summary

✅ 173 untouched

@rakita rakita added the ai-bot label Nov 17, 2025
@rakita
Copy link
Copy Markdown
Member

rakita commented Nov 17, 2025

Will be merged later

@rakita rakita closed this Nov 17, 2025
rakita added a commit that referenced this pull request Jan 9, 2026
This commit consolidates improvements from 8 community PRs with the ai-bot label:

- fix: correct debug log for blob gas fields in blockchaintest (#3291)
  Split blob_excess_gas_and_price into separate debug outputs for clarity

- perf(state): remove redundant clones in account_info.rs (#3287)
  Eliminate unnecessary clone operations in test code

- docs: fix duplicate word in MIGRATION_GUIDE.md (#3209)
  Remove duplicate "allows" in PrecompileError documentation

- fix: return G2NotInSubgroup for G2 subgroup check failure (#3179)
  Correct error type from G1NotInSubgroup to G2NotInSubgroup in BLS12-381

- refactor: reuse bound tx and remove redundant context.tx() calls (#3176)
  Optimize validation by reusing transaction binding

- docs: fix incorrect reth references in blockchain.rs comments (#3169)
  Update comments to use correct terminology instead of "reth"

- perf: use lazy defaults for env vars in burntpix benchmark (#3071)
  Replace unwrap_or with unwrap_or_else to avoid unnecessary allocations

All changes have been tested with cargo check and cargo test.
@rakita rakita removed the ai-bot label Jan 9, 2026
rakita added a commit that referenced this pull request Jan 9, 2026
* chore: apply improvements from ai-bot labeled PRs

This commit consolidates improvements from 8 community PRs with the ai-bot label:

- fix: correct debug log for blob gas fields in blockchaintest (#3291)
  Split blob_excess_gas_and_price into separate debug outputs for clarity

- perf(state): remove redundant clones in account_info.rs (#3287)
  Eliminate unnecessary clone operations in test code

- docs: fix duplicate word in MIGRATION_GUIDE.md (#3209)
  Remove duplicate "allows" in PrecompileError documentation

- fix: return G2NotInSubgroup for G2 subgroup check failure (#3179)
  Correct error type from G1NotInSubgroup to G2NotInSubgroup in BLS12-381

- refactor: reuse bound tx and remove redundant context.tx() calls (#3176)
  Optimize validation by reusing transaction binding

- docs: fix incorrect reth references in blockchain.rs comments (#3169)
  Update comments to use correct terminology instead of "reth"

- perf: use lazy defaults for env vars in burntpix benchmark (#3071)
  Replace unwrap_or with unwrap_or_else to avoid unnecessary allocations

All changes have been tested with cargo check and cargo test.

* fmt
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