Skip to content

Commit

Permalink
state: fix block event indexing reserved key check (#6314) (#6315)
Browse files Browse the repository at this point in the history
  • Loading branch information
tnasu committed Dec 23, 2021
1 parent 4f22ffe commit aea3813
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion state/indexer/block/kv/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,10 @@ func (idx *BlockerIndexer) indexEvents(batch db.Batch, events []abci.Event, typ

// index iff the event specified index:true and it's not a reserved event
compositeKey := fmt.Sprintf("%s.%s", event.Type, string(attr.Key))
if compositeKey == types.TxHashKey || compositeKey == types.TxHeightKey {
if compositeKey == types.BlockHeightKey {
return fmt.Errorf("event type and attribute key \"%s\" is reserved; please use a different key", compositeKey)
}

if attr.GetIndex() {
key, err := eventKey(compositeKey, typ, string(attr.Value), height)
if err != nil {
Expand Down

0 comments on commit aea3813

Please sign in to comment.