Skip to content

Comments

perf: avoid loading bytecode in extcodehash#3261

Merged
rakita merged 1 commit intobluealloy:mainfrom
MoNyAvA:perf/extcodehash-no-bytecode-load
Dec 30, 2025
Merged

perf: avoid loading bytecode in extcodehash#3261
rakita merged 1 commit intobluealloy:mainfrom
MoNyAvA:perf/extcodehash-no-bytecode-load

Conversation

@MoNyAvA
Copy link
Contributor

@MoNyAvA MoNyAvA commented Dec 29, 2025

EXTCODEHASH only needs the account’s emptiness status and code_hash, not the full bytecode. Previously we were calling
load_account_info_skip_cold_load and berlin_load_account! with load_code = true, which forced bytecode loading from the database even though extcodehash only reads is_empty() and code_hash. This change switches both branches to use load_code = false, so we no longer pull code blobs into memory. The cold/warm account accounting and gas behaviour are unchanged, and the implementation remains consistent with EIP-1052/EIP-161 semantics while reducing unnecessary IO and allocations.

Copy link
Member

@rakita rakita left a comment

Choose a reason for hiding this comment

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

good find! Merging it after CI

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 30, 2025

CodSpeed Performance Report

Merging #3261 will not alter performance

Comparing MoNyAvA:perf/extcodehash-no-bytecode-load (dd378e3) with main (d510c46)

Summary

✅ 173 untouched

@rakita rakita merged commit 2c1153b into bluealloy:main Dec 30, 2025
31 checks passed
@github-actions github-actions bot mentioned this pull request Dec 29, 2025
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