mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-03-12 23:18:36 +00:00
mpt: extend Billet constructor documentation
Billet's mode must match the DB's MPT mode, otherwise Billet-level nodes decoding won't work properly startign from86cb4ed8
. Ref. https://github.com/nspcc-dev/neo-go/pull/3808#issuecomment-2703668032 and49945e9ae9
. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
parent
68d7e8e01c
commit
22a5bbcef3
1 changed files with 4 additions and 1 deletions
|
@ -37,7 +37,10 @@ type Billet struct {
|
|||
// NewBillet returns a new billet for MPT trie restoring. It accepts a MemCachedStore
|
||||
// to decouple storage errors from logic errors so that all storage errors are
|
||||
// processed during `store.Persist()` at the caller. Another benefit is
|
||||
// that every `Put` can be considered an atomic operation.
|
||||
// that every `Put` can be considered an atomic operation. Note that mode
|
||||
// parameter must match precisely the Trie mode that is used in the underlying
|
||||
// DB to store the MPT nodes. Using wrong mode will lead to improper MPT nodes
|
||||
// decoding and even runtime panic.
|
||||
func NewBillet(rootHash util.Uint256, mode TrieMode, prefix storage.KeyPrefix, store *storage.MemCachedStore) *Billet {
|
||||
return &Billet{
|
||||
TempStoragePrefix: prefix,
|
||||
|
|
Loading…
Add table
Reference in a new issue