Skip to content
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

Migrate Fee payment to use Fungible Adapter #2624

Merged
merged 9 commits into from Feb 6, 2024

Conversation

ahmadkaouk
Copy link
Contributor

@ahmadkaouk ahmadkaouk commented Jan 22, 2024

What does it do?

This PR fixes the transferable balance issue by migrating fee payment from Currency to fungible:

  • Use FungibleAdapter for fee payment in pallet_transaction_payment instead of CurrencyAdapter
  • Use EVMFungibleAdapter for fee payment in pallet_evm instead of EVMCurrencyAdapter
  • Update DealWithFees implementation to use fungible traits

What important points reviewers should know?

The majority of the failed tests can be attributed to the fact that the new implementation no longer triggers the Treasury deposit event for fees.

Is there something left for follow-up PRs?

What alternative implementations were considered?

Are there relevant PRs or issues in other repositories (Substrate, Polkadot, Frontier, Cumulus)?

What value does it bring to the blockchain users?

@ahmadkaouk ahmadkaouk added 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 labels Jan 29, 2024
@ahmadkaouk ahmadkaouk marked this pull request as ready for review January 29, 2024 13:22
@ahmadkaouk ahmadkaouk changed the title Transferable Balance Fix Migrate Fee payment to use Fungible Adapter Jan 29, 2024
@ahmadkaouk ahmadkaouk added the breaking Needs to be mentioned in breaking changes label Jan 29, 2024
Copy link
Contributor

Coverage Report

@@                        Coverage Diff                         @@
##           master   ahmad-transferable-balance-fix      +/-   ##
==================================================================
+ Coverage   80.90%                           80.95%   +0.05%     
  Files         287                              287              
- Lines       94465                            94367      -98     
==================================================================
- Hits        76423                            76392      -31     
- Misses      18042                            17975      -67     
Files Changed Coverage
/pallets/parachain-staking/src/lib.rs 90.58% (-0.04%) 🔽
/pallets/parachain-staking/src/tests.rs 91.58% (-0.01%) 🔽
/precompiles/parachain-staking/src/mock.rs 97.73% (-0.08%) 🔽
/runtime/common/src/apis.rs 85.28% (-0.10%) 🔽
/runtime/common/src/migrations.rs 90.67% (+23.19%) 🔼
/runtime/moonbase/src/lib.rs 49.30% (-0.45%) 🔽
/runtime/moonbase/tests/common/mod.rs 95.47% (-0.17%) 🔽
/runtime/moonbeam/src/lib.rs 46.20% (+0.40%) 🔼
/runtime/moonriver/src/lib.rs 46.19% (+0.40%) 🔼

Coverage generated Mon Jan 29 13:55:51 UTC 2024

let total_supply_after = Balances::total_issuance();
assert_eq!(total_supply_before - total_supply_after, 880);
});
ExtBuilder::default().build().execute_with(|| {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at this I do wonder if there's an alternative for duplicating tests like these

@@ -271,33 +271,6 @@ export const verifyBlockFees = async (
}
}
}
// Then search for Deposit event from treasury
Copy link
Contributor

Choose a reason for hiding this comment

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

should we be checking these from other event instead? say balances.Deposit on the treasury address or something?

@librelois librelois merged commit 9c0c4d9 into master Feb 6, 2024
29 of 34 checks passed
@librelois librelois deleted the ahmad-transferable-balance-fix branch February 6, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes breaking Needs to be mentioned in breaking changes D9-needsaudit👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants