Skip to content

Split base fee and tip handling#700

Merged
sorpaas merged 3 commits intopolkadot-evm:masterfrom
moonbeam-foundation:tgm-split-base-fee-and-tip-handling
May 23, 2022
Merged

Split base fee and tip handling#700
sorpaas merged 3 commits intopolkadot-evm:masterfrom
moonbeam-foundation:tgm-split-base-fee-and-tip-handling

Conversation

@tgmichel
Copy link
Copy Markdown
Contributor

@tgmichel tgmichel commented May 23, 2022

The motivation for this is, currently is not possible to reproduce the Ethereum behaviour, as it was previously noticed by @icodezjb in #646, although that proposal was initially discarded because it didn't fullill some of the use cases (i.e. ability of not paying the author, even if there are priority fees).

This PR changes the OnChargeEVMTransaction trait to handle base fee and tip fees separately:

  • correct_and_deposit_fee will issue the refund and call on_unbalanced with just the base fee, returning the NegativeImbalance of the eventual tip.
  • pay_priority_fee takes the NegativeImbalance as an argument.

This way one can:

  • Handle the fees in the Ethereum way: burn the base fee on_unbalanced and pay the remaining NegativeImbalance to the block author.
  • Or ration both fee types as the chain implementation sees fit (like in Moonbeam).

@sorpaas sorpaas merged commit 96f2b50 into polkadot-evm:master May 23, 2022
@tgmichel tgmichel deleted the tgm-split-base-fee-and-tip-handling branch June 24, 2022 07:38
abhijeetbhagat pushed a commit to web3labs/frontier that referenced this pull request Jan 11, 2023
* Split base fee and tip handling

* Return `NegativeImbalance`

* clippy
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