This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
free unknown EOS VM OC codegen versions from the code cache #8771
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.
Change Description
Code stored in EOS VM OC's code cache has a "code gen version" attached to it. This is always the value 0 now. The idea was in the future if EOS VM OC's code generation changes (due to a new optimization, or some other improvement), nodeos could make a determination to still run code gen version 0 while code gen version 1 is being compiled. That way there is no gap in time for when EOS VM OC can be used for a contract on a nodeos upgrade.
Yes, there are considerable limitations in this approach (like that the code_descriptor layout can't change much), but it offers at least some flexibility.
There is code in place to ignore any entries in the cache with code gen version other than 0. This covers the case someone upgrades nodeos but then downgrades it. But just ignoring these entries leaks memory in the code cache. We need to free the memory when "dropping" code cache entries.
Consensus Changes
API Changes
Documentation Additions