Skip to content

Use bonsai code cache in ExtCodeSizeOperation#9634

Closed
daniellehrner wants to merge 4 commits intobesu-eth:mainfrom
daniellehrner:feat/extcodesize_use_bonsai_cache
Closed

Use bonsai code cache in ExtCodeSizeOperation#9634
daniellehrner wants to merge 4 commits intobesu-eth:mainfrom
daniellehrner:feat/extcodesize_use_bonsai_cache

Conversation

@daniellehrner
Copy link
Copy Markdown
Contributor

PR description

Fixed Issue(s)

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required.
  • Considered the changelog and included an update if required.
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Locally, you can run these tests to catch failures early:

  • spotless: ./gradlew spotlessApply
  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests
  • hive tests: Engine or other RPCs modified?

Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
}
// Any other account can only use the code bytes directly
else {
codeSize = Words.intBytes(account.getCode().size());
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I am currently unsure if Forest accounts would benefit from evm.getOrCreateCachedJumpDest(). The old logic is a bit confusing, as we first get the code bytes from the state before checking the cache

@daniellehrner
Copy link
Copy Markdown
Contributor Author

It seems the code size is already cached because the byte instance has the size already calculated when the object is created

@daniellehrner daniellehrner deleted the feat/extcodesize_use_bonsai_cache branch January 18, 2026 16:36
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.

1 participant