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: don't panic if we fail to convert hex to bytes #3734

Merged
Merged
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion dot/state/storage_notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ func (s *StorageState) notifyObserver(root common.Hash, o Observer) error {
} else {
// filter result to include only interested keys
for k, cachedValue := range o.GetFilter() {
value := t.Get(common.MustHexToBytes(k))
bytes, err := common.HexToBytes(k)
if err != nil {
return fmt.Errorf("failed to convert hex to bytes: %s", err)
}
value := t.Get(bytes)
if !reflect.DeepEqual(cachedValue, value) {
kv := &KeyValue{
Key: common.MustHexToBytes(k),
Expand Down
Loading