-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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 gas estimate feature #17322
[cli] Add gas estimate feature #17322
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Ignored Deployments
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Check out the comment on the actual gas estimation logic, but other than that, I think this is good to go!
Excellent. With this occasion, I also fixed a bug there and now the TS SDK implementation and this one match. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the output from --preview
for PTB commands that do not have --gas-budget
is slightly broken, but that's the only remaining comment.
crates/sui/tests/snapshots/ptb_files_tests__assign_valid.ptb.snap
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy days! Thanks @stefan-mysten
## 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:
## 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:
## 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: - [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:
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
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.
--gas-budget
flag is now optional. Please note that this incurs a small cost in performance due to the additional dry run call.