Merge pull request #2446 from nspcc-dev/fix-stateroot

core: fix broken stateroot storage
This commit is contained in:
Roman Khimov 2022-04-23 00:35:28 +03:00 committed by GitHub
commit f65c638be4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -46,7 +46,7 @@ import (
// Tuning parameters.
const (
headerBatchCount = 2000
version = "0.2.5"
version = "0.2.6"
defaultInitialGAS = 52000000_00000000
defaultGCPeriod = 10000

View file

@ -277,7 +277,7 @@ func TestBlockchain_StartFromExistingDB(t *testing.T) {
cache := storage.NewMemCachedStore(ps) // Extra wrapper to avoid good DB corruption.
key := make([]byte, 5)
key[0] = byte(storage.DataMPTAux)
binary.BigEndian.PutUint32(key, h)
binary.BigEndian.PutUint32(key[1:], h)
cache.Delete(key)
_, _, _, err := chain.NewMultiWithCustomConfigAndStoreNoCheck(t, customConfig, cache)

View file

@ -51,7 +51,7 @@ func (s *Module) getStateRoot(key []byte) (*state.MPTRoot, error) {
func makeStateRootKey(index uint32) []byte {
key := make([]byte, 5)
key[0] = byte(storage.DataMPTAux)
binary.BigEndian.PutUint32(key, index)
binary.BigEndian.PutUint32(key[1:], index)
return key
}