mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2026-03-01 04:28:51 +00:00
MPT can't get synced if RemoveUntraceableBlocks enabled #1509
Labels
No labels
I1
I2
I3
I4
S1
S2
S3
S4
U0
U1
U2
U3
U3
U4
blocked
bug
bug
cli
compiler
config
config
consensus
dependencies
discussion
documentation
enhancement
epic
feature
go
good first issue
help wanted
neotest
network
oracle
performance
question
rpc
security
smartcontract
task
task
task
test
vm
wallet
windows
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neo-go#1509
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Ayrtat on GitHub (Apr 18, 2025).
Current Behavior
MPT sync is not possible on n-th node when n-1 nodes ran GC on MPT
Expected Behavior
MPT sync is possible. n-th node get ready for protocol as its state gets synced
Possible Solution
Introduce a flag along with
RemoveUntraceableBlockswhich clarifies that MPT won't get truncated. Meanwhile, removing old data and transfers is OKOR
Fix billet traversal
Steps to Reproduce
This problem can be reproduced if we have 4 neo-go nodes
Generate chain
StateRootInHeader,P2PStateExchangeExtensionsfor all nodesRemoveUntraceableBlocksmust be enabled for all nodesMaxTraceableBlocks: 2104. TuneGarbageCollectionPeriod, make GC more frequent (2104is fine).TimePerBlock: 1sto generate blocks fasterTry to sync n-th node from the very beginning
mainnet.boltpanic: failed to get MPT node from the pool. See billetContext
I've tried to carry out an experiment: try to sync n-th node from the very beginning when the rest n-1 nodes have removed untraceable blocks.
Here is my understanding why this problem occurs:
StateRootInHeader,P2PStateExchangeExtensionsare enabled, then we activate this path in stateSync moduleStateSyncInterval, then for 230k blocks in the network it's going to sync ~200k headersRegression
No idea
Your Environment
The problem is reproduced on cluster but can be reproduced with dev-env
Version: 0.106.3 but I suppose it's fair for the latest version
@roman-khimov commented on GitHub (Apr 18, 2025):
StateSyncInterval. New node picks its target height as the nearest state sync point relative to the current height. So it has fromStateSyncIntervalto2×StateSyncIntervalof time to synchronize, otherwise the sync point becomes obsolete and there is nothing you can do about it. Can happen during header processing, can happen during MPT fetching.StateSyncIntervalis too small it's a network configuration problem.