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

Reactor: Decoupling pool-registry from pool-system and pool-fees #1983

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

lemunozm
Copy link
Contributor

@lemunozm lemunozm commented Aug 23, 2024

Description

The intention of this PR is to clean the mess we currently have when testing/benchmarking pool things from pool-registry PoV. Production logic is almost untouched, only for cases that affect the benchmarking

NOTE: Current tests do not cover everything, but they cover what the same they covered before the refactor.

Changes and Descriptions

  • Remove all pool-related dependencies from pool-registry (look at the mock.rs file!)
  • Added BoundedVec when needed to carry the Max information associated to those vecs
  • Remove PoolMetadata trait which is not used.
  • Simplify weight computation by removing some unused extra params.
  • Based of this comment I removed the capability of update & execute in the same call, which is impossible to be used right now in the runtime, and in case of required, it can be batched. Tell me if you agree or I revert.
    • This helps a lot simplifying the benchmarking infrastructure
  • Reorganize benchmarking traits (WIP)
  • Other minor simplifications

@lemunozm lemunozm added the I6-refactoring Code needs refactoring. label Aug 23, 2024
@lemunozm lemunozm requested review from cdamian and wischli August 23, 2024 13:18
@lemunozm lemunozm self-assigned this Aug 23, 2024
@lemunozm lemunozm force-pushed the ref/simplify-pool-registry branch from 69200a5 to eb3ab7d Compare August 23, 2024 13:21
@lemunozm lemunozm force-pushed the ref/simplify-pool-registry branch from eb3ab7d to d32bae1 Compare August 23, 2024 14:47
@lemunozm lemunozm marked this pull request as ready for review September 23, 2024 14:11
Copy link

codecov bot commented Sep 23, 2024

Codecov Report

Attention: Patch coverage is 17.24138% with 96 lines in your changes missing coverage. Please review.

Project coverage is 48.15%. Comparing base (927af06) to head (6f94dba).

Files with missing lines Patch % Lines
pallets/pool-system/src/impls.rs 10.38% 69 Missing ⚠️
libs/mocks/src/pools.rs 50.00% 8 Missing ⚠️
pallets/pool-fees/src/lib.rs 0.00% 7 Missing ⚠️
pallets/pool-registry/src/benchmarking.rs 0.00% 3 Missing ⚠️
libs/traits/src/lib.rs 0.00% 2 Missing ⚠️
pallets/pool-registry/src/lib.rs 66.66% 2 Missing ⚠️
pallets/pool-system/src/benchmarking.rs 0.00% 2 Missing ⚠️
pallets/pool-fees/src/benchmarking.rs 0.00% 1 Missing ⚠️
runtime/altair/src/lib.rs 0.00% 1 Missing ⚠️
runtime/centrifuge/src/lib.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1983      +/-   ##
==========================================
- Coverage   48.28%   48.15%   -0.13%     
==========================================
  Files         183      183              
  Lines       13406    13359      -47     
==========================================
- Hits         6473     6433      -40     
+ Misses       6933     6926       -7     
Flag Coverage Δ
48.15% <17.24%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I6-refactoring Code needs refactoring.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant