o1-labs / o1-labs/Archive-Node-API
Review comments/questions on the API implementation
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 19
- Forks
- 9
- Avg merge
- 14h 20m
- Merged PRs (30d)
- 8
Description
Schema
- Action/Event output:
ActionStatesin the schema here corresponds to the account state after all the transactions in a block is applied. is the assumption that the values inActionStatescorresponds to each set of actions per transaction?
Output types
- Remove
accountUpdateIdfromActionData. This refers to the database primary key. Consider replacing it with account ID and computed sequence number of the corresponding account update in the transaction - Similarly for
EventData. In fact, there are 2 more orderings from here- For each account update there is a list of actions/events and each action is an array of field elements. Refer to the ordering issue here (Issue)
Queries
- Nit:
blocksAccessedCTEis more likebocksFiltered - I'm not sure if the filtering in
emittedActionStateCTEmakes sense. When would one want to retrieve field elements within a certain range? afaiu you'd need the action state value from the DB to confirm the order of actions applied. Filtering based on account and block height seems sufficient. Also the current implementation here isn't seem right https://github.com/o1-labs/Archive-Node-API/blob/1bad4d3f8d23025cc2f8dc268aa85f438d4fed9f/src/db/sql/events-actions/queries.ts#L192. The comparison is using primary key field
Error handling
fullChainCTE: Add missing block checks. Any gaps will go unnoticed wherever this is used and affect the final result in unexpected ways
Contributor guide
No contributing guide indexed for this repository
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 by reading the API schema and src/db/sql/events-actions/queries.ts, especially blocksAccessedCTE, emittedActionStateCTE, and fullChainCTE. Check the linked ordering issue and compare the current ActionData, EventData, and ActionStates behavior with the requested account and transaction ordering. Done means the schema, query naming and filtering, and missing-block handling match the review requirements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, sql, typescript
- Domain
- api, backend, database
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100