[DataAvailability] Implement fork-aware Events Endpoints
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 575
- Forks
- 217
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 9
Description
Update Events endpoints to use caching layer to get data from local storage.
GetEventsForHeightRangeGetEventsForBlockIDs
Implementation tasks
- Add arguments to backend implementation that specify the user query criteria
- Update grpc handler to extract and pass the criteria from the protobuf request
- Update rest handler to extract and pass the criteria
- In the backend implementation:
a. Get the block(s) the request relates to
b. Lookup the execution result for the provided block
c. Get the snapshot for the result, then get the storage reader(s) required for the endpoint
d. Use the reader as usual - Update error handling to use the new framework
- Ensure godocs are up to standard for all methods that are interacted with during the code paths.
Notes:
Both of these methods allow querying a set of blocks. Since there can be forks, the API needs to ensure that all results are from the same fork. This can be done by finding the block from the range with the highest height and using it to get the result. This will be the newest descendant in the fork. From there, the snapshot will ensure that querying for additional blocks will return only data from the fork.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the implementations of GetEventsForHeightRange and GetEventsForBlockIDs, then trace the corresponding gRPC and REST handlers and their protobuf requests. Follow how backend criteria, blocks, execution results, snapshots, and storage readers are passed through the endpoints, and review the linked error framework. Done means both endpoints return fork-consistent data, use the updated error handling, and have the required godoc coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, grpc
- Domain
- api, backend, distributed-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100