Skip to content

Commit

Permalink
Fix return loops instead of deleted keys
Browse files Browse the repository at this point in the history
  • Loading branch information
dimartiro committed Jan 11, 2025
1 parent 38bfc5f commit 9b645c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/runtime/storage/storagediff.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (cs *storageDiff) clearPrefix(prefix []byte, trieKeys []string, limit int)
}
}

return deleted, deleted == uint32(len(keysToClear))
return uint32(len(trieKeys)), deleted == uint32(len(keysToClear))
}

// getFromChild attempts to retrieve a value associated with a specific key
Expand Down
11 changes: 1 addition & 10 deletions lib/runtime/wazero/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ var (
noneEncoded []byte = []byte{0x00}
allZeroesBytes = [32]byte{}

childStorageKeyPrefix = []byte(":child_storage:")
imOnlinePalletProblematicKey = []byte{0x2b, 0x06, 0xaf, 0x97, 0x19, 0xac, 0x64, 0xd7, 0x55, 0x62, 0x3c, 0xda,
0x8d, 0xdd, 0x9b, 0x94, 0x4e, 0x7b, 0x90, 0x12, 0x09, 0x6b, 0x41, 0xc4, 0xeb, 0x3a, 0xaf,
0x94, 0x7f, 0x6e, 0xa4, 0x29}
childStorageKeyPrefix = []byte(":child_storage:")
)

const (
Expand Down Expand Up @@ -2317,12 +2314,6 @@ func ext_storage_set_version_1(ctx context.Context, m api.Module, keySpan, value
storage := rtCtx.Storage

key := read(m, keySpan)

// TODO: temporal fix if key is pallet: "ImOnline" ++ ":__storage_version__:"
if bytes.Equal(key, imOnlinePalletProblematicKey) {
return
}

value := read(m, valueSpan)

cp := make([]byte, len(value))
Expand Down

0 comments on commit 9b645c4

Please sign in to comment.