Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rosetta: Fast canonical lookups chain_status #9797

Merged
merged 2 commits into from
Nov 10, 2021

Conversation

bkase
Copy link
Member

@bkase bkase commented Nov 10, 2021

The rosetta side of the equation

Explain your changes:

  • Only use the archive-node path for /account/balance
  • Use chain-status for "old" queries of blocks rather than the slower recursive queries

Explain how you tested your changes:

The rosetta side of the equation
@bkase bkase added the ci-build-me Add this label to trigger a circle+buildkite build for this branch label Nov 10, 2021
ON b.id = chain.parent_id AND chain.id <> chain.parent_id
),

let common_sql =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a comment here how this is shared by query_old and query_recent would be helpful for future audiences

let%map max_height =
Conn.find query_max_height ()
in
(* buffer an epsilon of 5 just in case archive node isn't caught up *)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the criterion to distinguish old from new queries based just on the current height, or should it examine whether blocks have marked as canonical?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I was thinking we should just rely on height here -- we know performing the long recursive queries in rosetta cause Postgres to choke, so I'd rather the queries fail in the case that we haven't marked things as canonical as opposed to trying the big recursive queries in that case and then fail.

@bkase bkase merged commit 6af366f into rosetta-1.2.1-safe Nov 10, 2021
@bkase bkase deleted the feature/rosetta-chain-status-fast-archive branch November 10, 2021 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-build-me Add this label to trigger a circle+buildkite build for this branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants