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

Polkadot v0.9.43: Loan and investment benchmarks fixed #1602

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

lemunozm
Copy link
Contributor

Description

Fixes over the main polkadot-v0.9.43 branch

  • pallet-loans benchmarks
  • pallet-investment benchmarks (test)

@lemunozm lemunozm self-assigned this Oct 27, 2023
@@ -5,7 +5,7 @@ use sp_runtime::traits::BadOrigin;
use super::*;
use crate::mock::*;

const REWARD: u128 = 100 * crate::mock::ExistentialDeposit::get();
const REWARD: u128 = 100 + crate::mock::ExistentialDeposit::get();
Copy link
Contributor Author

@lemunozm lemunozm Oct 27, 2023

Choose a reason for hiding this comment

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

Here's the change in case a positive output from #1577 (comment)

Copy link
Contributor

@wischli wischli left a comment

Choose a reason for hiding this comment

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

LGTM

@lemunozm
Copy link
Contributor Author

We can wait once you rebase the branch @wischli

@lemunozm
Copy link
Contributor Author

I think we can rebase this!

@lemunozm lemunozm merged commit 249f688 into polkadot-v0.9.43 Oct 27, 2023
4 of 10 checks passed
@lemunozm lemunozm deleted the polkadot-v0.9.43-fixes branch October 27, 2023 13:03
mustermeiszer added a commit that referenced this pull request Nov 10, 2023
* fix: docker relay

* feat: update rococo local to polkadot v0.9.43

* fix: bump relay docker img version

* Update most deps to 0.9.43

* Drop dependency on randomness-collective pallet

* Fix grandpa package

* cargo update

* toolchain: bump to 1.71.0

* bump

* Fix pool-system pallet

* Rename purestake to moonbeam-foundation

* Work on dup dependencies

* Fix dup dependencies

* Fixes fixes fixes

* fmt

* bump

* bump

* Fix restricted_tokens pallet

* wip on order-book

* Fix order-book with Reason = ()

* fmt

* Fix pallet-rewards

* fix runtime-common

* cu

* try: fix frame--system-benchmarking issues

* nix

Was trying to catch any new dup dep

* Fix lots of benchmarks

* bump

* Drop RandomnessCollectiveFlip

* weights

* bump

* Lots of evm-related fixes

* more evm fixes

* bump

* bump: xcm stuff

* more fixes

* fix evm stuff

* Deprecate Weight::from_ref_time

* Deprecate Weight::from_proof_size with from_parts

* more evm

* fixes++

* More fixes

* fmt

* Use polkadot xcm-simulator

* Use sp_io::offchain::random_seed

* wip: service + cli + command + evm + anchors

* wip

* wip

* Fix AuraConsensus::build SyncOracle trait bound issue

* Fix new_partial instantiation of frontier_backend

* Fix apis using FrontierBackend

* Last node fix

It now compiles but runtime_integrity_tests fails

* Remove some todos

* wip: fix rpc/evm create

* bump

* Done at rpc/evm create

* fmt

* Address rpc/evm create todos

* update todo

* bump toolchain to 1.74 nightly-2023-08-24

* Fix issue with assert_last_event

* fix: collator compose

* Use my fork of substrate

This fixes the weird compilation error and now shows our own compilation
errors under runtime/integration-tests

* e2e: Fix complilation errors

* fmt

* wip: clippy

* wip: clippy

* fixup

* Fix runtime_integrity_tests

Reduce MaxCandidates and MaxVoter from (1k, 10k) to (20, 100) like
Acala. We can discuss higher values that don't break block times during
the review process.

* Fix tests::<router>::send::success

* Fix ExistentialDeposit 0 issues

* wip

* Fix fungible_transfer_on_hold

* Fix pallets/restricted-tokens/src/tests

* Fix block-rewards/tests/joining_leaving_collators

So the issue here is that in do_init_collator we would mint the
StakeAmount into the collator's account and then call
Rewards::deposit_stake which in turn calls Currency::can_hold, which
fails because the new version of fungibles/tokens etc doesn't support
ExistentialDeposit = 0, so that can_hold check fails since it can NOT
hold the entire balance (i.e, the entire balance of said account). So
the solution here involves adding ExistentialDeposit as a Config value
and, when minting the balance in do_init_collator, add the
ExistentialDeposit to it. By doing so, the tests also need to take the
ED value into account when checking values.

* Add ExistentialDeposit to all block_rewards::Config

* Fix pallets/bridge tests

* fix Tokens fungible can_hold implementation

As far as I can see, we forgot to check with the underlying
`NativeFungible` implementation whether the account can actually hold
amount.

* fix order-book tests

* fix pallet-claims tests

* block_rewards: Fix single_claim_rewards

The error was that the reward value was lower than the ED, so such a
transfer (Reward :: Rewards account -> Dest Account) could not take
place. Increasing the Reward value to something above the ED fixed it.

* fix pallet-investments tests

* Fix most pallet-investments benchmarks

* fmt

* fix keystore benchmarking

* Merge remote-tracking branch 'origin/main' into polkadot-v0.9.43

fix: precompile_account_codes.rs migration

* chore: bump rust version

* chore: bump srtool version

* loan and investment benchmarks fixed (#1602)

* bench: fix investments

* tests: fix runtime api declarations

* tests: fix integration utils

* reverting to Nuno's change

* fixup

* fmt

* Migrate weight::from_deprecated

* fix weights

* clippy wip

* clippy

* clippy is happy!!!

* fixup

* fmt

* bench: fix anchors

* bench: fix keystore

* bench: fix pool-system

* bench: fix frame-system

* Fix mocks/src/liquidity_pools_gateway_routers

* fmt

* Drop tmp workaround

I needed this to run the tests through Clion.

* fix: Set MaxHolds to 1 for all mocks

* chore: fix + update restricted tokens

* refactor: use Currency API instead of hardcoded ED

* wip: address todos and fix tests

* drop more todos

* fix: assert_last_event

* fix: warnings

* chore: cleanup comments in tomls

* Align pallet_elections_phragmen runtime values

* clean up more todos

* fixup

* docker: Bump local relay to 0.9.43

* docker: Update relayer command options

* fix: run local relay in Polkadot v1.0.0

* Delete cautios change note on db_config_dir fn

* Drop leftover debug comments

* fix: enable client block production

* fix: run local collator

* fix: run docker collator

* feat: add backwards cmp for para docker compose

* ci: disable frame_system in check_benchmarks

* integration-tests: Use latest version of fudge-polkadot-v0.9.43 (#1590)

* integration-tests: Use latest version of fudge-polkadot-v0.9.43 and adapt testing setup

* integration-tests: Use fudge in development LP tests

* integration-tests: Drop unnecessary envs and funcs from development tests

* integration-tests: Add sibling to generic envs, fix LP tests

* integration-tests: Adapt LP kusama tests to use the generic framework

* integration-tests: Adapt LP polkadot tests to use the generic framework

* integration-tests: Don't evolve fudge env during creation

* development: Add max holds and max freezes to pallet-balances config.

* integration-tests: Remove unused imports

* integration-tests: Disable liquidity_rewards_runtime_api_works test

* investments: Remove commented code

* development: Remove MaxFreezes const

* integration-tests: Handle extrinsics errors, evolve fudge env on init

* integration-tests: Add missing LP foreign investment test

* integration-tests: Use correct sibling ID in convert_ausd for centrifuge runtime

* integration-tests: Test LP restricted call on all runtimes

* integration-tests: Update total fee in LP tests

* clippy: Obey

* fix: artifact Cargo.timl

* fix: align compose platform

* fix: adapt evm ratios

* fix: notes for unburned ED of stake currency

* fix: investments rm not needed order id update

* fix: rm debug artifacts

* fix: warning, note for dust handler

* fix: prt uses orml api and consistend non-dusting

* fix: locks of balances

* fix: impl metadata left overs

* fix: benches need holds. Moving it up to 10 for all

* fix: taplo

* feat: weights altair

* feat: weights centrifuge

* feat: weights development

* fix: revoer develppment pallet-xcm weight file

* fix: allowlist and other benches in dev

---------

Co-authored-by: William Freudenberger <[email protected]>
Co-authored-by: Luis Enrique Muñoz Martín <[email protected]>
Co-authored-by: Cosmin Damian <[email protected]>
Co-authored-by: Frederik Gartenmeister <[email protected]>
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