MNT Part 2: feat(state): add MNT state support - #28
Open
ping-ke wants to merge 2 commits into
Open
Conversation
ping-ke
requested review from
blockchaindevsh,
iteyelmp,
qizhou,
qzhodl and
syntrust
July 5, 2026 08:17
qzhodl
reviewed
Jul 8, 2026
qzhodl
reviewed
Jul 8, 2026
qzhodl
reviewed
Jul 8, 2026
|
This PR is stacked on #24, so the base shouldn't be |
This was referenced Jul 14, 2026
ping-ke
force-pushed
the
feature/mnt-state
branch
from
July 17, 2026 02:10
1f8eff7 to
c4a732c
Compare
ping-ke
force-pushed
the
feature/mnt-core-types
branch
from
July 24, 2026 04:05
53e97c4 to
56fa444
Compare
ping-ke
force-pushed
the
feature/mnt-core-types
branch
from
August 3, 2026 04:12
56fa444 to
61adf84
Compare
ping-ke
force-pushed
the
feature/mnt-state
branch
from
August 3, 2026 08:17
fb5eb96 to
2623b83
Compare
ping-ke
force-pushed
the
feature/mnt-core-types
branch
from
August 5, 2026 10:19
ceef3d7 to
7ef2bab
Compare
ping-ke
force-pushed
the
feature/mnt-state
branch
2 times, most recently
from
August 6, 2026 03:39
d9ea7ce to
d514d05
Compare
ping-ke
force-pushed
the
feature/mnt-state
branch
from
August 10, 2026 09:55
d514d05 to
94486d4
Compare
ping-ke
force-pushed
the
feature/mnt-state
branch
4 times, most recently
from
August 14, 2026 05:35
87ce75f to
3357d5b
Compare
ping-ke
force-pushed
the
feature/mnt-state
branch
from
August 19, 2026 08:11
88f8ef4 to
a3d68df
Compare
ping-ke
force-pushed
the
feature/mnt-state
branch
from
August 24, 2026 07:04
a3d68df to
d31d1a2
Compare
Carry QuarkChain multi-native-token (MNT) balances through the state layer so accounts can hold per-token balances alongside the native Ether balance. - state_object_qkc.go / statedb_qkc.go: MNT balance accessors on stateObject and StateDB (Get/Add/Sub/Set), guarding the per-account token count against the MNT limit. - journal.go: journal entries for MNT balance changes so they revert correctly with snapshots. - state_object.go: deep-copy MntBalances in newObject and on copy, so a mutation through one object cannot leak into another. - reader.go: decode MntBalances and FullShardKey out of the slim account served by the flat reader. - database_mpt.go / database_ubt.go: re-encode AccountsOrigin from slim-RLP to full QKC account RLP before handing it to pathdb, which needs it to match the trie leaf format for history verification. - pathdb/execute.go: decode AccountsOrigin as a full QKC StateAccount instead of slim-RLP, matching the invariant the commit paths now establish. mnt_test.go covers the accessors, journal revert, and copy isolation. The in-package test adaptations (state_test.go, statedb_fuzz_test.go) follow the account encoding change.
ping-ke
force-pushed
the
feature/mnt-state
branch
from
August 27, 2026 10:13
d31d1a2 to
a1791e3
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.
Summary
StateDBand state objects.FullShardKeywhen creating accounts.Notes
This PR is based on
feature/mnt-core-types. The default QKC token continues to use the existing balance APIs, while other native tokens use the new MNT APIs.