You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`[rpc]`[\#9759] Added `match_event` query parameter to indicate to Tendermint that the query should match event attributes within events, not only within a height.
20
-
21
19
### IMPROVEMENTS
22
20
23
-
-`[state/kvindexer]`[\#9759] Added `match.event` keyword to support condition evalution based on the event attributes belong to. (@jmalicevic)
24
-
-[crypto]\#9250 Update to use btcec v2 and the latest btcutil. (@wcsiu)
25
-
-[consensus]\#9760 Save peer LastCommit correctly to achieve 50% reduction in gossiped precommits. (@williambanfield)
26
-
-[metrics]\#9733 Add metrics for timing the consensus steps and for the progress of block gossip. (@williambanfield)
If the conditions are related to transaction events and the user wants to make sure the
202
-
conditions are true within the same events, the `match.event` keyword should be used,
203
-
as described [below](#querying_block_events)
204
148
205
149
Check out [API docs](https://docs.tendermint.com/v0.34/rpc/#/Info/tx_search)
206
150
for more information on query syntax and other options.
@@ -224,7 +168,7 @@ a query to `/subscribe` RPC endpoint.
224
168
Check out [API docs](https://docs.tendermint.com/v0.34/rpc/#subscribe) for more information
225
169
on query syntax and other options.
226
170
227
-
## Querying Block Events
171
+
## Querying Blocks Events
228
172
229
173
You can query for a paginated set of blocks by their events by calling the
230
174
`/block_search` RPC endpoint:
@@ -233,30 +177,5 @@ You can query for a paginated set of blocks by their events by calling the
233
177
curl "localhost:26657/block_search?query=\"block.height > 10 AND val_set.num_changed > 0\""
234
178
```
235
179
236
-
## `match_events` keyword
237
-
238
-
The query results in the height number(s) (or transaction hashes when querying transactions) which contain events whose attributes match the query conditions.
239
-
However, there are two options to query the indexers. To demonstrate the two modes, we reuse the two events
240
-
where Bob and Tom send money to Alice and query the block indexer. We issue the following query:
241
-
242
-
```bash
243
-
curl "localhost:26657/block_search?query=\"sender=Bob AND balance = 200\""
244
-
```
245
-
246
-
The result will return height 1 even though the attributes matching the conditions in the query
247
-
occurred in different events.
248
-
249
-
If we wish to retrieve only heights where the attributes occurred within the same event,
250
-
the query syntax is as follows:
251
-
252
-
```bash
253
-
curl "localhost:26657/block_search?query=\"sender=Bob AND balance = 200\"&match_events=true"
254
-
```
255
-
Currently the default behaviour is if `match_events` is set to false.
256
-
257
180
Check out [API docs](https://docs.tendermint.com/v0.34/rpc/#/Info/block_search)
258
181
for more information on query syntax and other options.
259
-
260
-
**Backwards compatibility**
261
-
262
-
Up until Tendermint 0.34.25, the event sequence was not stored in the kvstore and the `match_events` keyword in the RPC query is not ignored by older versions. Thus, in a network running mixed Tendermint versions, nodes running older versions will still return blocks (or transactions) whose attributes match within different events on the same height.
0 commit comments