-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rework fee payment #1687
rework fee payment #1687
Conversation
8c3717c
to
2edccd3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can change to type Currency: Currency<Self::AccountId, Balance = Balance>
to avoid u128 and conversion
Great! I think we could also replace all |
4b18530
to
d6f3f1c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing to keep in mind is that people can always send money to system accounts. So need to make sure nothing goes bad if that happens.
…hmarks --features=with-mandala-runtime -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=module_transaction_payment --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/mandala/src/weights/
/bench runtime acala module_transaction_payment |
Finished benchmark for branch: fee_management_rework Benchmark: Benchmark Runtime Acala Module cargo run --release --color=never --bin=acala --features=runtime-benchmarks --features=with-acala-runtime -- benchmark --chain=acala-latest --steps=50 --repeat=20 --pallet=module_transaction_payment --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/acala/src/weights/ ResultsPallet: "module_transaction_payment", Extrinsic: "set_alternative_fee_swap_path", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
|
…hmarks --features=with-acala-runtime -- benchmark --chain=acala-latest --steps=50 --repeat=20 --pallet=module_transaction_payment --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/acala/src/weights/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the name treasury account is over used and confusing. we should only use name treasury account to the real treasury, and call it fee pool account for the pallet sub account.
Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
/bench runtime karura module_transaction_payment |
Finished benchmark for branch: fee_management_rework Benchmark: Benchmark Runtime Karura Module cargo run --release --color=never --bin=acala --features=runtime-benchmarks --features=with-karura-runtime -- benchmark --chain=karura-dev --steps=50 --repeat=20 --pallet=module_transaction_payment --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/karura/src/weights/ ResultsPallet: "module_transaction_payment", Extrinsic: "set_alternative_fee_swap_path", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
|
…hmarks --features=with-karura-runtime -- benchmark --chain=karura-dev --steps=50 --repeat=20 --pallet=module_transaction_payment --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/karura/src/weights/
/bench runtime mandala module_transaction_payment |
Finished benchmark for branch: fee_management_rework Benchmark: Benchmark Runtime Mandala Module cargo run --release --color=never --bin=acala --features=runtime-benchmarks --features=with-mandala-runtime -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=module_transaction_payment --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/mandala/src/weights/ ResultsPallet: "module_transaction_payment", Extrinsic: "set_alternative_fee_swap_path", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
|
…hmarks --features=with-mandala-runtime -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=module_transaction_payment --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/mandala/src/weights/
/bench runtime acala module_transaction_payment |
Finished benchmark for branch: fee_management_rework Benchmark: Benchmark Runtime Acala Module cargo run --release --color=never --bin=acala --features=runtime-benchmarks --features=with-acala-runtime -- benchmark --chain=acala-latest --steps=50 --repeat=20 --pallet=module_transaction_payment --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/acala/src/weights/ ResultsPallet: "module_transaction_payment", Extrinsic: "set_alternative_fee_swap_path", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
|
…hmarks --features=with-acala-runtime -- benchmark --chain=acala-latest --steps=50 --repeat=20 --pallet=module_transaction_payment --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=./templates/runtime-weight-template.hbs --output=./runtime/acala/src/weights/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@StrawberryFlavor need test it on testnet |
A few note about test, ping me if you have question:
|
* origin/master: (102 commits) Fix collect_fee (#1754) Update HEADER-GPL3 Update extrinsic-ordering-check-from-bin.yml (#1752) Update HEADER-GPL3 bump version (#1751) Remove homa-lite from karura runtime (#1744) off-by-one (#1747) Revert "simulate exchange rate (#1742)" (#1746) simulate exchange rate (#1742) bump version (#1743) refactor homa (#1648) Update stable asset (#1741) add more info to events (#1740) Fix mandala swap path error (#1736) update stable asset (#1738) remove unnecessary code (#1735) fix currency id testing (#1733) rework fee payment (#1687) Add Deposit for Setting Alternative Fee Swap Path (#1730) Add register_erc20_asset and update_erc20_asset (#1731) ... # Conflicts: # .github/workflows/coverage.yml.disabled # Cargo.lock # Cargo.toml
closes: #1233
PoolSize
of native asset andED
of foreign token from treasury accounttrigger by block numberdefault to PoolSize div 5.ensure_can_charge_fee
to use fix rateuse an switch to change to chage fee from poolWeightTrader
depend on the rate in the storage.move to other package(i.e. runtime?), so that no depend on xcm related module.transaction payment
->PeriodUpdatedRateOfFungible
TransactionFeePoolTrader
design work flow:
review point:
discussion:
min_target_amount
ofDEX::swap_with_exact_supply
then should be ED + account.