Skip to content

Add Dynamic Fee support for Moonbeam#2166

Merged
crystalin merged 11 commits intomasterfrom
notlesh-dynamic-fee-moonbeam
Apr 12, 2023
Merged

Add Dynamic Fee support for Moonbeam#2166
crystalin merged 11 commits intomasterfrom
notlesh-dynamic-fee-moonbeam

Conversation

@notlesh
Copy link
Contributor

@notlesh notlesh commented Mar 16, 2023

What does it do?

The final quest in the epic journey to bring dynamic fees to Moonbeam. ⚔️ 🐉

Previously: #2078 (Moonriver) and #1765 (Moonbase). See the latter for more context on the R&D that went into this.

Briefly: this uses pallet-transaction-payment's fee multiplier as a basis for an EIP-1559 gas price, aligning both Substrate-based and Ethereum-based fees to use a similar congestion-based dynamic fee.

⚠️ Breaking Changes ⚠️

  • All changes are moonbeam runtime only
  • Fixed 100 gwei gas price replaced with dynamic fee
  • Minimum multiplier set to a gas price of 125 gwei
  • Algorithm responsiveness tuned to double/halve in 1 hour (same as moonbase and moonriver)

TODO:

  • Tests
  • Fix VALID_ETH_TXN tests
  • Document breaking changes
  • Review parameters / extremes
  • Perform fork test

@notlesh notlesh added B5-clientnoteworthy Changes should be mentioned in any downstream projects' release notes B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes D9-needsaudit👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited breaking Needs to be mentioned in breaking changes labels Mar 16, 2023
@librelois librelois mentioned this pull request Apr 11, 2023
20 tasks
Comment on lines +1256 to +1262
assert_eq!(
TransactionPaymentAsGasPrice::min_gas_price(),
(
125_000_000_000u128.into(),
Weight::from_ref_time(25_000_000u64)
)
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tgmichel this should address your earlier comment. It is indeed 125 gwei, but this should be in line with other runtimes when you take the SUPPLY_FACTOR into account.

Does 125 gwei still seem unreasonable?

@notlesh notlesh added the A0-pleasereview Pull request needs code review. label Apr 11, 2023
@crystalin crystalin merged commit 6772b27 into master Apr 12, 2023
@crystalin crystalin deleted the notlesh-dynamic-fee-moonbeam branch April 12, 2023 13:39
@notlesh notlesh added D1-audited👍 PR contains changes to fund-managing logic that has been properly reviewed and externally audited and removed D9-needsaudit👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited labels Apr 26, 2023
imstar15 pushed a commit to AvaProtocol/moonbeam that referenced this pull request May 16, 2023
* Initial mods for dynamic fee on moonbeam

* Update tests to use increase fee

* Bump gas price in test

* Comment out failing test (temporarily)

* fmt

* Some actually VALID_ETH_TX bytes!

* Remove unused import

* Add multiplier tests

* Enabled dynamic fees smoketest for MB

---------

Co-authored-by: timbrinded <79199034+timbrinded@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A0-pleasereview Pull request needs code review. B5-clientnoteworthy Changes should be mentioned in any downstream projects' release notes B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes breaking Needs to be mentioned in breaking changes D1-audited👍 PR contains changes to fund-managing logic that has been properly reviewed and externally audited

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants