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

[cherry-pick][cli] Add gas estimate feature (#17322) #17457

Conversation

stefan-mysten
Copy link
Contributor

@stefan-mysten stefan-mysten commented May 1, 2024

Description

Cherry picking feature into releases/sui-v1.24.0-release branch for the next release next week.
This PR adds automatic gas estimation by dry running the transaction if the gas budget is not provided. That means that the gas_budget flag is now optional.

Test plan

Existing tests + new test

cd crates/sui && cargo test -- test_gas_estimation

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: Added automatic gas estimation feature for the Sui CLI. If gas budget is not provided, the tool will dry run the transaction to get a gas budget estimate, and then it will execute the transaction. That means that for all relevant commands the --gas-budget flag is now optional. Please note that this incurs a small cost in performance due to the additional dry run call.
  • Rust SDK:

## Description 

This PR adds automatic gas estimation by dry running the transaction if
the gas budget is not provided. That means that the `gas_budget` flag is
now optional.

## Test plan 

Existing tests + new test
```
cd crates/sui && cargo test -- test_gas_estimation
```

---

## 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 automatic gas estimation feature for the Sui CLI. If
gas budget is not provided, the tool will dry run the transaction to get
a gas budget estimate, and then it will execute the transaction. That
means that for all relevant commands the `--gas-budget` flag is now
optional. Please note that this incurs a small cost in performance due
to the additional dry run call.
- [ ] Rust SDK:
@stefan-mysten stefan-mysten requested review from ebmifa and a team May 1, 2024 23:07
Copy link

vercel bot commented May 1, 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 May 1, 2024 11:09pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview May 1, 2024 11:09pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview May 1, 2024 11:09pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview May 1, 2024 11:09pm

@stefan-mysten stefan-mysten merged commit 784c3dd into MystenLabs:releases/sui-v1.24.0-release May 1, 2024
43 of 44 checks passed
@stefan-mysten stefan-mysten deleted the cherry_pick_automated_gas_budget branch May 1, 2024 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants