Skip to content

Conversation

athei
Copy link
Member

@athei athei commented Sep 22, 2025

Replacement of #9740.

Build on top of the new tx payment changes: #9780

Started a new PR because due to the rebase on top of the new tx payment changes this PR is substantially different and I don't want to invalidate the existing comments on #9740 which are not implemented, yet.

TODO

  • Decode gas supplied by the tx into Weight inside dry_run_eth_transact
  • Prevent users from submitting signed eth_* transactions. Otherwise they can set an arbitrary effective_gas_price. Probably using custom origins.
  • Prevent pallet_revive from consuming too much balance from the tx payment hold
  • Divide the storage deposit by the NextFeeMultiplier inside the dry run
  • Move everything dependent on pallet_transaction payment into a sealed trait to remove all the new trait bounds all over the place

@TorstenStueber
Copy link

I tried to find the logic where in new frames the weight limit needs to be converted to a gas limit and then back into a weigh limit.

For EVM it seems like both conversions are not implemented yet:

For PVM I can't find the code for either conversion. Is this actually implemented in the compiler?

@TorstenStueber
Copy link

All storage deposits deducted in a frame should be returned when the frame reverts. Is this the case?

@athei
Copy link
Member Author

athei commented Sep 23, 2025

I tried to find the logic where in new frames the weight limit needs to be converted to a gas limit and then back into a weigh limit.

For EVM it seems like both conversions are not implemented yet:

For PVM I can't find the code for either conversion. Is this actually implemented in the compiler?

Correct. This will be a follow up PR with the "on chain gas"/

All storage deposits deducted in a frame should be returned when the frame reverts. Is this the case?

You mean they should be reverted? Yeah. This PR doesn't touch this logic.

@athei athei changed the base branch from master to at/tx-credit September 23, 2025 11:23
@athei
Copy link
Member Author

athei commented Sep 23, 2025

@pgherveou @TorstenStueber

Sorry for the force push. This was the last one. I will now address the comments from #9740 with individual commits.

Choose a reason for hiding this comment

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

In line 1554 we must not call T::Currency::transfer but charge_deposit as every deposit should come from the hold/imbalance created in the preparation step of pallet-transaction-payment.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. Fixed.

@athei athei requested review from a team as code owners September 26, 2025 13:38
@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/18039439323
Failed job name: build-rustdoc

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