ethereum/go-ethereum

Feature Request: A query that returns the most recent event for a given filter.

Open

#20.593 aberto em 25 de jan. de 2020

Ver no GitHub
 (4 comments) (2 reactions) (0 assignees)Go (21.913 forks)batch import
help wantedtype:feature

Métricas do repositório

Stars
 (51.042 stars)
Métricas de merge de PR
 (Mesclagem média 21d 10h) (82 fundiu PRs em 30d)

Description

Thanks to the developers for this great software!

This is a "would be nice to have" feature request to add a flag to the JSON-RPC/GraphQL query input have Geth search for the events in reverse chronological order and only return the most recent log (or the batch from that block).

Unless I'm mistaken, at the moment it is only possible to construct queries that return all of the events for a given filter.

If you have a case where you only want the most recent event, but you don't know when it occurred, you still need to get back all of the events and filter (potentially not ideal on a client machine).

See also:

https://ethereum.stackexchange.com/questions/41976/how-to-get-only-latest-log-from-my-event https://ethereum.stackexchange.com/questions/8699/how-to-get-only-latest-logged-event-via-web3-api

Thanks,

Lee

Guia do colaborador