Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lib/trie): use MustBeHashed for V1 trie nodes with larger storage values #3739

Merged
merged 42 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
1ec531c
wip
EclesioMeloJunior Jan 25, 2024
692ee0c
chore: hashing nodes while in hybrid state
EclesioMeloJunior Jan 29, 2024
32fb14d
fix: use `MustBeHashed` for node inserted/updated in V1 tries
EclesioMeloJunior Feb 6, 2024
0069a00
chore: rollback deltas to `core/service.go`
EclesioMeloJunior Feb 7, 2024
c88b51f
Merge branch 'development' into trie-hybrid-state
EclesioMeloJunior Feb 7, 2024
8cce14e
chore: remove deltas to tracking
EclesioMeloJunior Feb 7, 2024
d918b99
chore: remove deltas from imports.go
EclesioMeloJunior Feb 7, 2024
927b3b1
chore: remove unneeded deltas to runtime/storage
EclesioMeloJunior Feb 7, 2024
3f5df45
chore: remove unneeded deltas
EclesioMeloJunior Feb 7, 2024
55b11fd
Merge branch 'development' into trie-hybrid-state
EclesioMeloJunior Feb 8, 2024
e4b0689
chore: testing changing version should not change older trie nodes
EclesioMeloJunior Feb 9, 2024
672b677
Merge branch 'trie-hybrid-state' of github.com:ChainSafe/gossamer int…
EclesioMeloJunior Feb 9, 2024
239ec11
wip: setting runtime storage version while instantiating
EclesioMeloJunior Feb 9, 2024
c643e80
chore: setting storage context if it is not nil and runtime state ver…
EclesioMeloJunior Feb 9, 2024
d254c54
chore: testing passing now
EclesioMeloJunior Feb 12, 2024
7187074
chore: add logs
EclesioMeloJunior Feb 12, 2024
015c5b9
chore: add logs to `core/service.go` and `chain_sync/handleBlock` method
EclesioMeloJunior Feb 12, 2024
06003d5
chore: use deltas finally
EclesioMeloJunior Feb 12, 2024
de8c4c6
chore: using deltas and setting nodes as dirty before hashing
EclesioMeloJunior Feb 14, 2024
52f32dd
chore: copy must be hashed in `Copy` method
EclesioMeloJunior Feb 14, 2024
5bbc7b0
wip: bug while storing trie state
EclesioMeloJunior Feb 15, 2024
102fc7c
chore: ...
EclesioMeloJunior Feb 15, 2024
e30040b
fix: using must be hashed and modified = true
EclesioMeloJunior Feb 15, 2024
1eba0fd
wip: while deleting a value make sure to keep the correct must be has…
EclesioMeloJunior Feb 21, 2024
fb920d4
chore: remove useless logs
EclesioMeloJunior Feb 22, 2024
f5a39e8
chore: cleanup
EclesioMeloJunior Feb 22, 2024
4379b04
chore: remove unneeded print
EclesioMeloJunior Feb 26, 2024
171d1ea
Merge branch 'development' into trie-hybrid-state
EclesioMeloJunior Feb 26, 2024
c3b070b
chore: cleaning up tests
EclesioMeloJunior Feb 26, 2024
08162f9
Merge branch 'development' into trie-hybrid-state
EclesioMeloJunior Feb 26, 2024
868b2eb
chore: fix `Test_Service_StorageRoot`
EclesioMeloJunior Feb 26, 2024
fcc4ace
chore: set a default runtime version to avoid calling `Core_version`
EclesioMeloJunior Feb 26, 2024
5f441a4
chore: refactor test runtime instance to use a set of options to chan…
EclesioMeloJunior Feb 26, 2024
f3ff9ec
chore: remove unneeded delta
EclesioMeloJunior Feb 27, 2024
2ec5496
chore: fix `Test_Service_handleCodeSubstitution`
EclesioMeloJunior Feb 27, 2024
a23d51f
chore: fix `TestService_Initialise`
EclesioMeloJunior Feb 27, 2024
439320c
chore: fix `Test_newTrieFromPairs`
EclesioMeloJunior Feb 27, 2024
15f7305
chore: fix `TestWithTrie` while instantiating a runtime
EclesioMeloJunior Feb 27, 2024
0162df3
chore: fix `Test_Node_Encode`
EclesioMeloJunior Feb 27, 2024
5de40ac
chore: uncomment
EclesioMeloJunior Feb 27, 2024
1560eb5
chore: fix `Test_Service_handleCodeSubstitution`
EclesioMeloJunior Feb 27, 2024
08dd662
Merge branch 'development' into trie-hybrid-state
EclesioMeloJunior Feb 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dot/core/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ func (s *Service) handleBlock(block *types.Block, state *rtstorage.TrieState) er
}

logger.Debugf("imported block %s and stored state trie with root %s",
block.Header.Hash(), state.MustRoot(trie.NoMaxInlineValueSize))
block.Header.Hash(), state.MustRoot())

parentRuntimeInstance, err := s.blockState.GetRuntime(block.Header.ParentHash)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions dot/core/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ func generateExtrinsic(t *testing.T) (extrinsic, externalExtrinsic types.Extrins
func Test_Service_StorageRoot(t *testing.T) {
t.Parallel()

ts := rtstorage.NewTrieState(trie.NewEmptyTrie())

tests := []struct {
name string
service *Service
Expand All @@ -152,7 +150,7 @@ func Test_Service_StorageRoot(t *testing.T) {
service: &Service{},
exp: common.Hash{0x3, 0x17, 0xa, 0x2e, 0x75, 0x97, 0xb7, 0xb7, 0xe3, 0xd8, 0x4c, 0x5, 0x39, 0x1d, 0x13, 0x9a,
0x62, 0xb1, 0x57, 0xe7, 0x87, 0x86, 0xd8, 0xc0, 0x82, 0xf2, 0x9d, 0xcf, 0x4c, 0x11, 0x13, 0x14},
retTrieState: ts,
retTrieState: rtstorage.NewTrieState(trie.NewEmptyTrie()),
trieStateCall: true,
stateVersion: 0,
},
Expand All @@ -161,7 +159,7 @@ func Test_Service_StorageRoot(t *testing.T) {
service: &Service{},
exp: common.Hash{0x3, 0x17, 0xa, 0x2e, 0x75, 0x97, 0xb7, 0xb7, 0xe3, 0xd8, 0x4c, 0x5, 0x39, 0x1d, 0x13, 0x9a,
0x62, 0xb1, 0x57, 0xe7, 0x87, 0x86, 0xd8, 0xc0, 0x82, 0xf2, 0x9d, 0xcf, 0x4c, 0x11, 0x13, 0x14},
retTrieState: ts,
retTrieState: rtstorage.NewTrieState(trie.NewEmptyTrie()),
trieStateCall: true,
stateVersion: 1,
},
Expand Down Expand Up @@ -282,6 +280,7 @@ func Test_Service_handleCodeSubstitution(t *testing.T) {
errWrapped: io.ErrUnexpectedEOF,
},
"store_code_substitution_block_hash_error": {
trieState: rtstorage.NewTrieState(trie.NewEmptyTrie()),
serviceBuilder: func(ctrl *gomock.Controller) *Service {
storedRuntime := NewMockInstance(ctrl)
storedRuntime.EXPECT().Keystore().Return(nil)
Expand Down Expand Up @@ -339,6 +338,7 @@ func Test_Service_handleCodeSubstitution(t *testing.T) {
}
},
blockHash: common.Hash{0x01},
trieState: rtstorage.NewTrieState(trie.NewEmptyTrie()),
},
}

Expand Down
6 changes: 3 additions & 3 deletions dot/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

// ImportState imports the state in the given files to the database with the given path.
func ImportState(basepath, stateFP, headerFP string, stateTrieVersion trie.TrieLayout, firstSlot uint64) error {
tr, err := newTrieFromPairs(stateFP)
tr, err := newTrieFromPairs(stateFP, trie.V0)
if err != nil {
return err
}
Expand All @@ -41,7 +41,7 @@ func ImportState(basepath, stateFP, headerFP string, stateTrieVersion trie.TrieL
return srv.Import(header, tr, stateTrieVersion, firstSlot)
}

func newTrieFromPairs(filename string) (*trie.Trie, error) {
func newTrieFromPairs(filename string, version trie.TrieLayout) (*trie.Trie, error) {
data, err := os.ReadFile(filepath.Clean(filename))
if err != nil {
return nil, err
Expand All @@ -62,7 +62,7 @@ func newTrieFromPairs(filename string) (*trie.Trie, error) {
entries[pairArr[0].(string)] = pairArr[1].(string)
}

tr, err := trie.LoadFromMap(entries)
tr, err := trie.LoadFromMap(entries, version)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion dot/import_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func Test_newTrieFromPairs(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

got, err := newTrieFromPairs(tt.filename)
got, err := newTrieFromPairs(tt.filename, tt.stateVersion)
if tt.err != nil {
assert.EqualError(t, err, tt.err.Error())
} else {
Expand Down
2 changes: 1 addition & 1 deletion dot/node_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ func TestInitNode_LoadStorageRoot(t *testing.T) {
node, err := NewNode(config, ks)
require.NoError(t, err)

expected, err := trie.LoadFromMap(gen.GenesisFields().Raw["top"])
expected, err := trie.LoadFromMap(gen.GenesisFields().Raw["top"], trie.V0)
require.NoError(t, err)

expectedRoot, err := trie.V0.Hash(&expected) // Since we are using a runtime with state trie V0
Expand Down
2 changes: 1 addition & 1 deletion dot/rpc/modules/childstate_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func setupChildStateStorage(t *testing.T) (*ChildStateModule, common.Hash) {
err = tr.SetChild([]byte(":child_storage_key"), childTr)
require.NoError(t, err)

stateRoot, err := tr.Root(trie.NoMaxInlineValueSize)
stateRoot, err := tr.Root()
require.NoError(t, err)

bb, err := st.Block.BestBlock()
Expand Down
2 changes: 1 addition & 1 deletion dot/rpc/modules/childstate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func createTestTrieState(t *testing.T) (*trie.Trie, common.Hash) {
err := tr.SetChild([]byte(":child_storage_key"), childTr)
require.NoError(t, err)

stateRoot, err := tr.Root(trie.NoMaxInlineValueSize)
stateRoot, err := tr.Root()
require.NoError(t, err)

return tr.Trie(), stateRoot
Expand Down
2 changes: 1 addition & 1 deletion dot/rpc/modules/dev_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func newBABEService(t *testing.T) *babe.Service {

bs, es := newState(t)
tt := trie.NewEmptyTrie()
rt := wazero_runtime.NewTestInstanceWithTrie(t, runtime.WESTEND_RUNTIME_v0929, tt)
rt := wazero_runtime.NewTestInstance(t, runtime.WESTEND_RUNTIME_v0929, wazero_runtime.TestWithTrie(tt))
bs.StoreRuntime(bs.GenesisHash(), rt)
tt.Put(
common.MustHexToBytes("0x886726f904d8372fdabb7707870c2fad"),
Expand Down
2 changes: 1 addition & 1 deletion dot/rpc/modules/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func newWestendLocalGenesisWithTrieAndHeader(t *testing.T) (
require.NoError(t, err)

parentHash := common.NewHash([]byte{0})
stateRoot := genesisTrie.MustHash(trie.NoMaxInlineValueSize)
stateRoot := genesisTrie.MustHash()
extrinsicRoot := trie.EmptyHash
const number = 0
digest := types.NewDigest()
Expand Down
3 changes: 1 addition & 2 deletions dot/rpc/modules/state_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/ChainSafe/gossamer/dot/rpc/modules/mocks"
"github.com/ChainSafe/gossamer/dot/types"
"github.com/ChainSafe/gossamer/lib/common"
"github.com/ChainSafe/gossamer/pkg/trie"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
Expand Down Expand Up @@ -575,7 +574,7 @@ func setupStateModule(t *testing.T) (*StateModule, *common.Hash, *common.Hash) {
err = ts.SetChildStorage([]byte(`:child1`), []byte(`:key1`), []byte(`:childValue1`))
require.NoError(t, err)

sr1, err := ts.Root(trie.NoMaxInlineValueSize)
sr1, err := ts.Root()
require.NoError(t, err)
err = chain.Storage.StoreTrie(ts, nil)
require.NoError(t, err)
Expand Down
4 changes: 2 additions & 2 deletions dot/rpc/modules/system_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ func setupSystemModule(t *testing.T) *SystemModule {
Header: types.Header{
Number: 3,
ParentHash: chain.Block.BestBlockHash(),
StateRoot: ts.MustRoot(trie.NoMaxInlineValueSize),
StateRoot: ts.MustRoot(),
Digest: digest,
},
Body: types.Body{},
Expand All @@ -354,7 +354,7 @@ func setupSystemModule(t *testing.T) *SystemModule {
func newCoreService(t *testing.T, srvc *state.Service) *core.Service {
// setup service
tt := trie.NewEmptyTrie()
rt := wazero_runtime.NewTestInstanceWithTrie(t, runtime.WESTEND_RUNTIME_v0929, tt)
rt := wazero_runtime.NewTestInstance(t, runtime.WESTEND_RUNTIME_v0929, wazero_runtime.TestWithTrie(tt))
ks := keystore.NewGlobalKeystore()
t.Cleanup(func() {
rt.Stop()
Expand Down
6 changes: 3 additions & 3 deletions dot/state/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ func TestTrie_StoreAndLoadFromDB(t *testing.T) {
err := tt.WriteDirty(db)
require.NoError(t, err)

encroot, err := tt.Hash(trie.NoMaxInlineValueSize)
encroot, err := tt.Hash()
require.NoError(t, err)

expected := tt.MustHash(trie.NoMaxInlineValueSize)
expected := tt.MustHash()

tt = trie.NewEmptyTrie()
err = tt.Load(db, encroot)
require.NoError(t, err)
require.Equal(t, expected, tt.MustHash(trie.NoMaxInlineValueSize))
require.Equal(t, expected, tt.MustHash())
}

func TestStoreAndLoadGenesisData(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion dot/state/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ func (bs *BlockState) HandleRuntimeChanges(newState *rtstorage.TrieState,
return fmt.Errorf("failed to update code substituted block hash: %w", err)
}

newVersion, err := parentRuntimeInstance.Version()
newVersion, err := instance.Version()
EclesioMeloJunior marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion dot/state/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func newWestendDevGenesisWithTrieAndHeader(t *testing.T) (
require.NoError(t, err)

parentHash := common.NewHash([]byte{0})
stateRoot := genesisTrie.MustHash(trie.NoMaxInlineValueSize)
stateRoot := genesisTrie.MustHash()
extrinsicRoot := trie.EmptyHash
const number = 0
digest := types.NewDigest()
Expand Down
8 changes: 4 additions & 4 deletions dot/state/service_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func TestService_Initialise(t *testing.T) {
require.NoError(t, err)

genesisHeaderPtr := types.NewHeader(common.NewHash([]byte{77}),
genTrie.MustHash(trie.NoMaxInlineValueSize), trie.EmptyHash, 0, nil)
genTrie.MustHash(), trie.EmptyHash, 0, nil)

err = state.Initialise(&genData, genesisHeaderPtr, genTrieCopy)
require.NoError(t, err)
Expand Down Expand Up @@ -287,7 +287,7 @@ func TestService_PruneStorage(t *testing.T) {
copiedTrie := trieState.Trie().DeepCopy()

var rootHash common.Hash
rootHash, err = copiedTrie.Hash(trie.NoMaxInlineValueSize)
rootHash, err = copiedTrie.Hash()
require.NoError(t, err)

prunedArr = append(prunedArr, prunedBlock{hash: block.Header.StateRoot, dbKey: rootHash[:]})
Expand Down Expand Up @@ -400,7 +400,7 @@ func TestService_Import(t *testing.T) {
require.NoError(t, err)
header := &types.Header{
Number: 77,
StateRoot: tr.MustHash(trie.NoMaxInlineValueSize),
StateRoot: tr.MustHash(),
Digest: digest,
}

Expand Down Expand Up @@ -440,7 +440,7 @@ func generateBlockWithRandomTrie(t *testing.T, serv *Service,
err = trieState.Put(key, value)
require.NoError(t, err)

trieStateRoot, err := trieState.Root(trie.NoMaxInlineValueSize)
trieStateRoot, err := trieState.Root()
require.NoError(t, err)

if parent == nil {
Expand Down
11 changes: 5 additions & 6 deletions dot/state/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ func NewStorageState(db database.Database, blockState *BlockState,

// StoreTrie stores the given trie in the StorageState and writes it to the database
func (s *StorageState) StoreTrie(ts *rtstorage.TrieState, header *types.Header) error {
root := ts.MustRoot(trie.NoMaxInlineValueSize)

root := ts.MustRoot()
s.tries.softSet(root, ts.Trie())

if header != nil {
Expand Down Expand Up @@ -92,7 +91,7 @@ func (s *StorageState) TrieState(root *common.Hash) (*rtstorage.TrieState, error
if root == nil {
sr, err := s.blockState.BestBlockStateRoot()
if err != nil {
return nil, err
return nil, fmt.Errorf("while getting best block state root: %w", err)
}
root = &sr
}
Expand All @@ -102,11 +101,11 @@ func (s *StorageState) TrieState(root *common.Hash) (*rtstorage.TrieState, error
var err error
t, err = s.LoadFromDB(*root)
if err != nil {
return nil, err
return nil, fmt.Errorf("while loading from database: %w", err)
}

s.tries.softSet(*root, t)
} else if t.MustHash(trie.NoMaxInlineValueSize) != *root {
} else if t.MustHash() != *root {
panic("trie does not have expected root")
}

Expand All @@ -125,7 +124,7 @@ func (s *StorageState) LoadFromDB(root common.Hash) (*trie.Trie, error) {
return nil, err
}

s.tries.softSet(t.MustHash(trie.NoMaxInlineValueSize), t)
s.tries.softSet(t.MustHash(), t)
return t, nil
}

Expand Down
14 changes: 7 additions & 7 deletions dot/state/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestStorage_StoreAndLoadTrie(t *testing.T) {
ts, err := storage.TrieState(&trie.EmptyHash)
require.NoError(t, err)

root, err := ts.Root(trie.NoMaxInlineValueSize)
root, err := ts.Root()
require.NoError(t, err)
err = storage.StoreTrie(ts, nil)
require.NoError(t, err)
Expand All @@ -59,7 +59,7 @@ func TestStorage_GetStorageByBlockHash(t *testing.T) {
value := []byte("testvalue")
ts.Put(key, value)

root, err := ts.Root(trie.NoMaxInlineValueSize)
root, err := ts.Root()
require.NoError(t, err)
err = storage.StoreTrie(ts, nil)
require.NoError(t, err)
Expand Down Expand Up @@ -91,7 +91,7 @@ func TestStorage_TrieState(t *testing.T) {
require.NoError(t, err)
ts.Put([]byte("noot"), []byte("washere"))

root, err := ts.Root(trie.NoMaxInlineValueSize)
root, err := ts.Root()
require.NoError(t, err)
err = storage.StoreTrie(ts, nil)
require.NoError(t, err)
Expand All @@ -102,7 +102,7 @@ func TestStorage_TrieState(t *testing.T) {
storage.blockState.tries.delete(root)
ts3, err := storage.TrieState(&root)
require.NoError(t, err)
require.Equal(t, ts.Trie().MustHash(trie.NoMaxInlineValueSize), ts3.Trie().MustHash(trie.NoMaxInlineValueSize))
require.Equal(t, ts.Trie().MustHash(), ts3.Trie().MustHash())
}

func TestStorage_LoadFromDB(t *testing.T) {
Expand All @@ -125,7 +125,7 @@ func TestStorage_LoadFromDB(t *testing.T) {
ts.Put(kv.key, kv.value)
}

root, err := ts.Root(trie.NoMaxInlineValueSize)
root, err := ts.Root()
require.NoError(t, err)

// Write trie to disk.
Expand Down Expand Up @@ -205,13 +205,13 @@ func TestGetStorageChildAndGetStorageFromChild(t *testing.T) {

trieState := runtime.NewTrieState(&genTrie)

header := types.NewHeader(blockState.GenesisHash(), trieState.MustRoot(trie.NoMaxInlineValueSize),
header := types.NewHeader(blockState.GenesisHash(), trieState.MustRoot(),
common.Hash{}, 1, types.NewDigest())

err = storage.StoreTrie(trieState, header)
require.NoError(t, err)

rootHash, err := genTrie.Hash(trie.NoMaxInlineValueSize)
rootHash, err := genTrie.Hash()
require.NoError(t, err)

_, err = storage.GetStorageChild(&rootHash, []byte("keyToChild"))
Expand Down
2 changes: 1 addition & 1 deletion dot/state/tries.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (t *Tries) SetEmptyTrie() {

// SetTrie sets the trie at its root hash in the tries map.
func (t *Tries) SetTrie(tr *trie.Trie) {
t.softSet(tr.MustHash(trie.NoMaxInlineValueSize), tr)
t.softSet(tr.MustHash(), tr)
}

// softSet sets the given trie at the given root hash
Expand Down
2 changes: 1 addition & 1 deletion dot/state/tries_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func Test_Tries_SetTrie(t *testing.T) {

expectedTries := &Tries{
rootToTrie: map[common.Hash]*trie.Trie{
tr.MustHash(trie.NoMaxInlineValueSize): tr,
tr.MustHash(): tr,
},
triesGauge: triesGauge,
setCounter: setCounter,
Expand Down
3 changes: 1 addition & 2 deletions dot/sync/chain_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/ChainSafe/gossamer/internal/database"
"github.com/ChainSafe/gossamer/lib/common"
"github.com/ChainSafe/gossamer/lib/common/variadic"
"github.com/ChainSafe/gossamer/pkg/trie"
)

var _ ChainSync = (*chainSync)(nil)
Expand Down Expand Up @@ -872,7 +871,7 @@ func (cs *chainSync) handleBlock(block *types.Block, announceImportedBlock bool)
return err
}

root := ts.MustRoot(trie.NoMaxInlineValueSize)
root := ts.MustRoot()
if !bytes.Equal(parent.StateRoot[:], root[:]) {
panic("parent state root does not match snapshot state root")
}
Expand Down
Loading
Loading