Merge two VM fixes into the v4.8.2 Nile build:#65
Merged
nileTestNet merged 2 commits intoJun 29, 2026
Merged
Conversation
#6857) * fix(vm): self-dispatch vote-witness cost by proposal flag getVoteWitnessCost3 falls back to cost2 when Osaka is off, and cost2 to the legacy cost when energy adjustment is off. The energy then stays correct even if a stale cost function lingers in the shared jump table after a reorg, or is read by a constant call whose view has the proposal off. * fix(vm): isolate constant-call config view to prevent global pollution Constant calls bound to a lagging solidity/PBFT snapshot loaded their flags into the process-global VMConfig, racing block processing during a proposal's activation-to-solidification window and risking a fork. Route a constant call's config into a thread-local snapshot; the block/broadcast path keeps writing (and reading) the global.
5f3fca2
into
tron-nile-testnet:release_v4.8.2_build2
12 of 20 checks passed
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.
What does this PR do?
Integrates two upstream VM fixes into the v4.8.2 Nile build:
fix(vm): isolate constant-call config & self-dispatch vote-witness costgetVoteWitnessCost3now falls back tocost2when Osaka is off, andcost2falls back to the legacy cost when energy adjustment is off. The charged energy stays correct even if a stale cost function lingers in the shared jump table after a reorg, or is read by a constant call whose chain view has the proposal disabled.VMConfig, racing block processing during a proposal's activation-to-solidification window. The constant-call path now reads its config from a thread-local snapshot; the block/broadcast path continues to own the global config.perf(vm): hoistallowDynamicEnergyout of the opcode loop. The dynamic-energy flag is read once per execution instead of on every opcode, removing per-instruction overhead from the hot path.Why are these changes required?
VMConfigis a data race against concurrent block processing during the proposal activation→solidification window, and could cause a fork. Isolating the constant-call view into a thread-local snapshot closes that race.allowDynamicEnergywas being evaluated inside the per-opcode loop; hoisting it is a pure performance improvement with no behavioral change.This PR has been tested by:
VMConfigIsolationTest(new) verifies a constant call cannot pollute the global VM config;VoteWitnessCost3Test(extended) covers thecost3 → cost2 → legacyfallback across proposal-flag combinations.