Skip to content

Commit

Permalink
Merge pull request #399 from onflow/gregor/log-decode
Browse files Browse the repository at this point in the history
Bugfix to avoid decoding empty blooms
  • Loading branch information
sideninja authored Jul 30, 2024
2 parents d1e1ffd + 57cab34 commit cea96cd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions storage/pebble/receipts.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package pebble

import (
"bytes"
"encoding/binary"
"errors"
"fmt"
Expand Down Expand Up @@ -254,6 +255,12 @@ func (r *Receipts) BloomsForBlockRange(start, end *big.Int) ([]*models.BloomsHei
}

var bloomsHeight []*gethTypes.Bloom

// if empty skip it, workaround for empty blooms stored, todo investigate why we store empty blooms
if bytes.Equal(val, make([]byte, len(val))) {
continue
}

if err := rlp.DecodeBytes(val, &bloomsHeight); err != nil {
return nil, fmt.Errorf("failed to decode blooms: %w", err)
}
Expand Down

0 comments on commit cea96cd

Please sign in to comment.