Skip to content

sui-indexer-alt-framework: rename fetch to checkpoint - #25834

Merged
evan-wall-mysten merged 1 commit into
mainfrom
rename_fetch
Mar 17, 2026
Merged

sui-indexer-alt-framework: rename fetch to checkpoint#25834
evan-wall-mysten merged 1 commit into
mainfrom
rename_fetch

Conversation

@evan-wall-mysten

@evan-wall-mysten evan-wall-mysten commented Mar 13, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR renames fetch to checkpoint in anticipation of future PRs that will add additional methods like chain_id and latest_checkpoint_number.

Test plan

No functional changes.


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • Indexing Framework: Renamed IngestionClientTrait::fetch to IngestionClientTrait::checkpoint.

@evan-wall-mysten
evan-wall-mysten requested a review from a team as a code owner March 13, 2026 18:41
@evan-wall-mysten
evan-wall-mysten temporarily deployed to sui-typescript-aws-kms-test-env March 13, 2026 18:41 — with GitHub Actions Inactive
@vercel

vercel Bot commented Mar 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sui-docs Ready Ready Preview, Comment Mar 17, 2026 5:02pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
multisig-toolkit Ignored Ignored Preview Mar 17, 2026 5:02pm
sui-kiosk Ignored Ignored Preview Mar 17, 2026 5:02pm

Request Review

@amnn

amnn commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

@evan-wall-mysten, please can you explain what those other functions would be used for, why they belong on IngestionClient, and how they would be implemented on our existing ingestion clients? It's not clear to me that they would be easy to implement on the object-store-based ingestion clients.

@evan-wall-mysten

evan-wall-mysten commented Mar 16, 2026

Copy link
Copy Markdown
Collaborator Author

@evan-wall-mysten, please can you explain what those other functions would be used for, why they belong on IngestionClient, and how they would be implemented on our existing ingestion clients? It's not clear to me that they would be easy to implement on the object-store-based ingestion clients.

I looked through the StoreIngestionClient API and think the 2 functions can be implemented like this, but I haven't actually tested them out:

  • fetch_chain_id() to store and compare chain_id to make sure it does not change
    • object-store impl
      1. StoreIngestionClient::checkpoint(0).summary.content_digest
    • rpc-client impl
      1. Client::ledger_client().get_service_info().chain_id()
  • fetch_latest_checkpoint_number() to seed a starting checkpoint to index backwards from
    • object-store impl:
      1. StoreIngestionClient::end_of_epoch_checkpoints.pop() to get last checkpoint of the most recently ended epoch
      2. exponential binary search to find a range between an existing and missing checkpoint (self.store.head to check if file exists)
      3. binary search to find largest existing checkpoint in that range (self.store.head to check if file exists)
    • rpc-client impl
      1. Client::ledger_client().get_service_info().checkpoint_height()

@amnn amnn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Got it, thanks for clarifying -- the chain_id part makes sense to me, the latest_checkpoint_number part I have more questions for but overall that makes sense for this PR.

Also let's just drop fetch_ from all these names -- it's kind of an empty word for a client trait, which is fine when there's only one function on the trait, but if you have multiple, and they all start with fetch_ then you might as well get rid of it.