MPT-backed storage (mpt.TrieStore) uses Billet for MPT traversal during Seek operations. MPT traversal strategy differs from the one that simple storage Seek assumes (probably due to the Branch node traversal in case when the last child is non-empty leaf and there are other children except the last in this Branch). The difference is that items with the key exactly matching provided prefix are being traversed after the ones that has extra data after prefix (by MPT-based storage). This affects every component that tries to use MPT-backed storage as a replacement to a simple storage, including:
It may affect the findstates RPC handler in terms that current findstates behaviour matches the C# one, and to fix this bug we have to change the traversal strategy which will affect the findstates result.
This problem needs additional investigation, we may consider adding a traversal strategy option to Billet.
MPT-backed storage (
mpt.TrieStore
) usesBillet
for MPT traversal duringSeek
operations. MPT traversal strategy differs from the one that simple storageSeek
assumes (probably due to theBranch
node traversal in case when the last child is non-empty leaf and there are other children except the last in thisBranch
). The difference is that items with the key exactly matching provided prefix are being traversed after the ones that has extra data after prefix (by MPT-based storage). This affects every component that tries to use MPT-backed storage as a replacement to a simple storage, including:findstoragehistoric
RPC handler (ref. https://github.com/nspcc-dev/neo-go/pull/3099#discussion_r1302046422).It may affect the
findstates
RPC handler in terms that currentfindstates
behaviour matches the C# one, and to fix this bug we have to change the traversal strategy which will affect thefindstates
result.This problem needs additional investigation, we may consider adding a traversal strategy option to
Billet
.