Skip to content

Conversation

alex-mysten
Copy link
Contributor

@alex-mysten alex-mysten commented Sep 20, 2025

Description

This PR charges gas to a transaction signer's account balance. Gated by protocol config; see referenced branch

Test plan

New e2e tests added


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:

Copy link

vercel bot commented Sep 20, 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 16, 2025 8:00pm
2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
multisig-toolkit Ignored Ignored Preview Oct 16, 2025 8:00pm
sui-kiosk Ignored Ignored Preview Oct 16, 2025 8:00pm

}

if self.gas_data().is_paid_from_address_balance() {
let gas_withdraw = FundsWithdrawalArg::balance_from_sender(
Copy link
Contributor

Choose a reason for hiding this comment

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

Depending on the gas owner, this may or may not be the sender

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added support for different gas owner and associated e2e test cases

@alex-mysten alex-mysten marked this pull request as ready for review October 7, 2025 11:50
@alex-mysten alex-mysten requested a review from a team as a code owner October 7, 2025 11:50
@alex-mysten alex-mysten force-pushed the steka-ab-gas-model branch 3 times, most recently from 980c32b to 67d0e7a Compare October 10, 2025 10:35
Base automatically changed from steka-ab-gas-model to main October 10, 2025 11:18
@alex-mysten alex-mysten temporarily deployed to sui-typescript-aws-kms-test-env October 10, 2025 11:42 — with GitHub Actions Inactive
@alex-mysten alex-mysten temporarily deployed to sui-typescript-aws-kms-test-env October 10, 2025 15:48 — with GitHub Actions Inactive
);

let delete_gas_summary = delete_effects.gas_cost_summary();
let _delete_gas_used = calculate_total_gas_cost(delete_gas_summary);
Copy link
Contributor

Choose a reason for hiding this comment

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

what is this for?

Copy link
Contributor

Choose a reason for hiding this comment

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

were you trying to verify that there is a net gas rebate here? that does seem useful to test since there is an explicit branch in the code on +/- net gas

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Assert added

sender.hash(&mut hasher);
gas_owner.hash(&mut hasher);
"storage".hash(&mut hasher);
let nonce = hasher.finish() as u32;
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need the nonce? the sender and gas_owner will already be committed to by the tx digest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed

let WithdrawFrom::Sender = withdraw.withdraw_from;
let account_address = match withdraw.withdraw_from {
WithdrawFrom::Sender => self.sender(),
WithdrawFrom::Sponsor => self.gas_owner(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we ban explicit Sponsor withdrawals for now? Its a bit of an additional security burden on sponsor code that I'm not sure they are ready for.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed

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.

3 participants