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

[CLI] Add debug prints for execution time of a tx / dry run #19374

Conversation

stefan-mysten
Copy link
Contributor

@stefan-mysten stefan-mysten commented Sep 14, 2024

Description

Adds debug prints for preparing a tx and executing it. Similarly, adds debug prints for executing a dry run.

Test plan

How did you test the new or updated feature?


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):
  • Indexer:
  • JSON-RPC:
  • GraphQL:
  • CLI: Adds debug prints for preparing a transaction and executing it. Similarly, adds debug prints for executing a dry run. Use RUST_LOG=debug sui to run sui CLI with the debug logging enabled.
  • Rust SDK:
  • REST API:

@stefan-mysten stefan-mysten requested review from lxfind and a team September 14, 2024 00:17
@stefan-mysten stefan-mysten self-assigned this Sep 14, 2024
Copy link

vercel bot commented Sep 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 14, 2024 0:22am
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Sep 14, 2024 0:22am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Sep 14, 2024 0:22am
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Sep 14, 2024 0:22am

@lxfind
Copy link
Contributor

lxfind commented Sep 14, 2024

Does devs typically turn on debug logging? I was more of thinking about explicitly print out the elapsed time

@stefan-mysten
Copy link
Contributor Author

stefan-mysten commented Sep 14, 2024

Does devs typically turn on debug logging? I was more of thinking about explicitly print out the elapsed time

Usually not, but also not sure why a dev would be interested in knowing the time it took to prepare the transaction or execution time from the CLI(they could just use time instead for a rough estimation). What more exact use case did you have in mind?

So far, we kept info-like output only via tracing and focused on showing relevant information. Would love to hear your thoughts if you think more "meta" output should be shown.

Finally, from the slack discussion I thought this was for cases where maybe an execution is slow, so one could run the CLI command with debug to see what's going on. We could document it.

@stefan-mysten stefan-mysten merged commit c337a96 into MystenLabs:main Sep 16, 2024
44 checks passed
@stefan-mysten stefan-mysten deleted the cli_debug_time_tx_making_and_executing branch September 16, 2024 17:21
suiwombat pushed a commit that referenced this pull request Sep 16, 2024
## Description 

Adds debug prints for preparing a tx and executing it. Similarly, adds
debug prints for executing a dry run.

## Test plan 

How did you test the new or updated feature?

---

## 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): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [x] CLI: Added debug prints for preparing a tx and executing it. Similarly, adds
debug prints for executing a dry run. Use `RUST_LOG=debug sui` to see the extra information printed on the terminal.
- [ ] Rust SDK:
- [ ] REST API:
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