polkadot-evm/frontier

DynamicFee and BaseFee Pallets

Opened this issue · 3 comments

Question

Frontier template includes both DynamicFee pallet and BaseFee pallet.

Is this necessary? Both pallets are included but it seems only BaseFee is used

Dynamic Fee: https://github.com/polkadot-evm/frontier/blob/master/template/runtime/src/lib.rs#L372-L374
Base Fee: https://github.com/polkadot-evm/frontier/blob/master/template/runtime/src/lib.rs#L382-L392

Fee Calculator:

type FeeCalculator = BaseFee;

I'm just wondering if there is something I missed :)

Is this necessary? Both pallets are included but it seems only BaseFee is used

It's hard to say whether that's necessary. These two pallets are two types of FeeCalculator implementations. The template runtime is intended as a reference for the beginner who wants to integrate the Frontier components. Keep these two pallet configurations in the runtime as an example for the users to adapt. But it also brings some confusion. It seems better to use the simplest static FeeCalculator in the template runtime and add some comments that other implementations can be chosen.

Agree, I just feel it is also confusing to have both pallets active in the template, while only one of them is being used. Tanssi EVM Appchains had both pallets active as well -> moondance-labs/tanssi#403

Feel free to close the issue if you think current template is fine as is.

I also agree that it's confusing to have both pallets active, maybe it should replaced by more simple FeeCalculator and have docs on how to switch it with base_fee or dynamic_fee pallet as needed. Can also refer to moonbeam custom fee calculator for reference so the devs are aware of all the options and know they only need one