core/vm: add configurable jumpdest analysis cache#32143
Merged
Conversation
- renamed `bitvec` to `BitVec` - `BitVec` needs to be exported to support thirdparty `JumpDests` implementations
fjl
reviewed
Jul 17, 2025
| chainConfig: chainConfig, | ||
| chainRules: chainConfig.Rules(blockCtx.BlockNumber, blockCtx.Random != nil, blockCtx.Time), | ||
| jumpDests: make(map[common.Hash]bitvec), | ||
| jumpDests: nil, |
Contributor
There was a problem hiding this comment.
Please put this back, i.e. put make(mapJumpDests) here and remove the lazy init. Yes, there will be an extra allocation in case it's not used, but I feel it's preferable to having to init everywhere.
Contributor
Author
There was a problem hiding this comment.
Okay, updated the PR.
rjl493456442
approved these changes
Aug 1, 2025
JumpDests type to abstract jumpdest analysis caching
howjmay
pushed a commit
to iotaledger/go-ethereum
that referenced
this pull request
Aug 27, 2025
This adds a method on vm.EVM to set the jumpdest cache implementation. It can be used to maintain an analysis cache across VM invocations, to improve performance by skipping the analysis for already known contracts. --------- Co-authored-by: lmittmann <lmittmann@users.noreply.github.com> Co-authored-by: Felix Lange <fjl@twurst.com>
gballet
pushed a commit
to gballet/go-ethereum
that referenced
this pull request
Sep 11, 2025
This adds a method on vm.EVM to set the jumpdest cache implementation. It can be used to maintain an analysis cache across VM invocations, to improve performance by skipping the analysis for already known contracts. --------- Co-authored-by: lmittmann <lmittmann@users.noreply.github.com> Co-authored-by: Felix Lange <fjl@twurst.com>
gzliudan
added a commit
to gzliudan/XDPoSChain
that referenced
this pull request
Apr 20, 2026
25 tasks
AnilChinchawale
pushed a commit
to XinFinOrg/XDPoSChain
that referenced
this pull request
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolves #32137
This PR replaces
jumpDests map[common.Hash]bitvecwithjumpDests JumpDestsin theEVM. TheJumpDestsallows custom jumpdest analysis caches.I did not update the signature of
vm.NewEVMto keep the diff smaller. Instead I addedEVM.SetJumpDestswhich can be used directly after construction to set a customJumpDestsimplementation. IfSetJumpDestsis not called amapJumpDestsis set lazily within theEVM.Additionally I exported
bitvec, nowBitVec. This is necessary to support third-partyJumpDestsimplementations.