Repository navigation
feat(vm): optimize resource processing (TIP-945) - #7069
Open
yanghang8612 wants to merge 8 commits into
Open
yanghang8612 wants to merge 8 commits into
yanghang8612 wants to merge 8 commits into
Conversation
yanghang8612
force-pushed
the
feature/tip-945-resource-processing
branch
from
October 29, 2026 10:03
db3830a to
b88c860
Compare
payEnergyBill returns before writing the account, so the Stake 2.0 reservation stays after a successful zero-energy transaction.
yanghang8612
force-pushed
the
feature/tip-945-resource-processing
branch
from
November 4, 2026 08:26
341cb0b to
198963e
Compare
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?
Implement TIP-945 behind
ALLOW_TVM_RESOURCE_OPTIMIZATION(104), applying the specified vote-input validation order and per-account Stake 2.0 weight accounting.Behind the same parameter, persist the restored Stake 2.0 energy window when a successful contract transaction uses no energy.
Behind the same parameter, and only while Stake 2.0 is enabled, contract execution uses the same fractional energy weight as the account-resource query.
Why are these changes required?
Keep TVM resource processing consistent with the protocol's validation and accounting rules.
Related to TIP-945.
This PR has been tested by:
./gradlew clean build -x teston macOS ARM64 / JDK 17.Tip944VmTest,Tip945VmTest, and:framework:checkstyleTeston macOS ARM64 / JDK 17. The new tests cover a zero-energy call with the caller and origin as the same account and as different accounts, both with parameter 104 on and off.RepositoryImplHardenTestand:framework:checkstyleTeston macOS ARM64 / JDK 17. The new test checks fractional energy weight with parameter 104 on and off, with and without hardened calculation, and with Stake 2.0 disabled..github/scripts/check_math_usage.sh.Follow up
Merge the TIP-944 implementation first, then rebase/retarget this PR onto
release_v4.8.3.Extra details
Targets
feature/tip-944-voting-powerso this review contains only TIP-945 changes. This is a branch dependency; runtime activation remains independent. Proposal validation, application, and parameter output follow the order 102, 103, 104.