Skip to content

Conversation

@stefan-mysten
Copy link
Contributor

@stefan-mysten stefan-mysten commented Oct 23, 2025

Description

This PR adds a caching of chain-id to the Sui CLI. This will be used in the new pkg-alt system.

In particular, the caching will happen when one of the client commands will do an RPC request anyway / or execute a tx. It will not happen when any client command does not work with the RPC.

For publish and upgrade, it will try first to load it from cache; if it does not exist, then it will cache it. For all other commands it will always cache it.

Test plan

Manual test with check on the client.yaml file. Tested also the updated client.yaml file with an old CLI to ensure backwards compatibility.


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:

@stefan-mysten stefan-mysten temporarily deployed to sui-typescript-aws-kms-test-env October 23, 2025 22:36 — with GitHub Actions Inactive
@vercel
Copy link

vercel bot commented Oct 23, 2025

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

Project Deployment Preview Comments Updated (UTC)
sui-docs Ready Ready Preview Comment Oct 24, 2025 9:06pm
2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
multisig-toolkit Ignored Ignored Preview Oct 24, 2025 9:06pm
sui-kiosk Ignored Ignored Preview Oct 24, 2025 9:06pm

@stefan-mysten stefan-mysten temporarily deployed to sui-typescript-aws-kms-test-env October 24, 2025 21:00 — with GitHub Actions Inactive
Copy link
Contributor

@mdgeorge4153 mdgeorge4153 left a comment

Choose a reason for hiding this comment

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

Looks good. It might be good to add some tests that (1) the value does get recached if you do a network operation even if it is already cached, and (2) that if the value is cached and you perform a non-network operation then nothing fails.

It would also be good to make sure that when we create the default config for testnet that we include the testnet chain ID

@stefan-mysten stefan-mysten self-assigned this Oct 24, 2025
@stefan-mysten stefan-mysten merged commit 4d5c8b5 into MystenLabs:main Oct 24, 2025
51 of 52 checks passed
@stefan-mysten stefan-mysten deleted the cli-chain-id-cache branch October 24, 2025 22:23
stefan-mysten added a commit to stefan-mysten/sui that referenced this pull request Oct 27, 2025
MystenLabs#24072)

This PR adds a caching of chain-id to the Sui CLI. This will be used in
the new pkg-alt system.

In particular, the caching will happen when one of the `client` commands
will do an RPC request anyway / or execute a tx. It will not happen when
any client command does not work with the RPC.

For `publish` and `upgrade`, it will try first to load it from cache; if
it does not exist, then it will cache it. For all other commands it will
always cache it.

Manual test with check on the `client.yaml` file. Tested also the
updated `client.yaml` file with an old CLI to ensure backwards
compatibility.

---

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:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants