o1-labs / o1-labs/Archive-Node-API

Review comments/questions on the API implementation

Open
#109 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
19
Forks
9
Avg merge
14h 20m
Merged PRs (30d)
8

Description

Schema
  1. Action/Event output: ActionStates in the schema here corresponds to the account state after all the transactions in a block is applied. is the assumption that the values in ActionStates corresponds to each set of actions per transaction?
Output types
  1. Remove accountUpdateId from ActionData. 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
  2. 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
  1. Nit: blocksAccessedCTE is more like bocksFiltered
  2. I'm not sure if the filtering in emittedActionStateCTE makes 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
  1. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.