Skip to content

state: Dedup the recipient lookup in execute_message#1607

Merged
chfast merged 1 commit into
masterfrom
state/dedup-call-lookup
Jul 21, 2026
Merged

state: Dedup the recipient lookup in execute_message#1607
chfast merged 1 commit into
masterfrom
state/dedup-call-lookup

Conversation

@chfast

@chfast chfast commented Jul 21, 2026

Copy link
Copy Markdown
Member

A value-transferring CALL looked the recipient up twice. Clean up this piece of code and lookup the account once.

A value-transferring CALL looked the recipient up twice.
Clean up this piece of code and lookup the account once.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors Host::execute_message() in the state-test host to avoid looking up the CALL recipient account twice in the value-transfer path, reducing redundant state map probing while preserving existing semantics.

Changes:

  • Cache the CALL recipient account pointer once and reuse it for the non-zero value transfer branch.
  • Replace get_or_insert() with a conditional insert() only when the recipient truly does not exist.
  • Add TODO notes highlighting remaining double-probe opportunities in related account-creation logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.40%. Comparing base (846cabf) to head (2161016).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1607   +/-   ##
=======================================
  Coverage   97.40%   97.40%           
=======================================
  Files         164      164           
  Lines       14693    14693           
  Branches     3389     3389           
=======================================
  Hits        14312    14312           
  Misses        280      280           
  Partials      101      101           
Flag Coverage Δ
eest-develop 89.47% <100.00%> (ø)
eest-develop-gmp 26.02% <100.00%> (ø)
eest-legacy 17.48% <100.00%> (ø)
eest-libsecp256k1 27.65% <100.00%> (ø)
eest-stable 89.44% <100.00%> (ø)
evmone-unittests 92.67% <71.42%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
core 95.94% <100.00%> (ø)
tooling 90.35% <ø> (ø)
tests 99.80% <ø> (ø)
Files with missing lines Coverage Δ
test/state/host.cpp 99.53% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chfast
chfast merged commit 9ac3023 into master Jul 21, 2026
24 checks passed
@chfast
chfast deleted the state/dedup-call-lookup branch July 21, 2026 21:06
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