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

refactor: move collected network fee to swapping pallet #5014

Merged
merged 10 commits into from
Jul 15, 2024

Conversation

j4m1ef0rd
Copy link
Contributor

Pull Request

Closes: PRO-1404

Checklist

Please conduct a thorough self-review before opening the PR.

  • I am confident that the code works.
  • I have updated documentation where appropriate.

Summary

  • Moved the FlipBuyInterval and CollectedNetworkFee storage items from the pools pallet to the swapping pallet.
    • Moved related functions and genesis config item.
    • Moved related tests and benchmarks.
    • Added migration to runtime.
  • Changed the pools tests to no longer know anything about a network fee, this changed some of the values from swaps a little (no more network fee).
  • Refactored the tests that got moved to the swapping pallet. Might be hard to see the changes because of the move, I can try and split the move into a separate commit, but it didn't seem worth the time unless requested.
  • Added the test_fee_estimation_basis test, not sure why it was just stilling as a function description.

@j4m1ef0rd j4m1ef0rd requested a review from msgmaxim July 1, 2024 06:52
@j4m1ef0rd j4m1ef0rd self-assigned this Jul 1, 2024
@j4m1ef0rd j4m1ef0rd requested a review from dandanlen as a code owner July 1, 2024 06:52
Copy link

codecov bot commented Jul 1, 2024

Codecov Report

Attention: Patch coverage is 77.43056% with 65 lines in your changes missing coverage. Please review.

Project coverage is 71%. Comparing base (6f1c062) to head (d1cef49).

Files Patch % Lines
...-chain/runtime/src/migrations/move_network_fees.rs 0% 24 Missing ⚠️
state-chain/pallets/cf-swapping/src/lib.rs 86% 10 Missing and 6 partials ⚠️
state-chain/pallets/cf-swapping/src/weights.rs 0% 16 Missing ⚠️
state-chain/runtime/src/lib.rs 0% 0 Missing and 5 partials ⚠️
state-chain/pallets/cf-swapping/src/mock.rs 25% 3 Missing ⚠️
state-chain/pallets/cf-swapping/src/tests.rs 99% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##            main   #5014    +/-   ##
======================================
- Coverage     72%     71%    -0%     
======================================
  Files        433     434     +1     
  Lines      75474   75254   -220     
  Branches   75474   75254   -220     
======================================
- Hits       53991   53693   -298     
- Misses     18631   18710    +79     
+ Partials    2852    2851     -1     

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

state-chain/runtime/src/lib.rs Outdated Show resolved Hide resolved
state-chain/pallets/cf-swapping/src/tests.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@dandanlen dandanlen left a comment

Choose a reason for hiding this comment

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

LGTM.

Just a minor thing, no need to change this now, but in future please prefer to put the runtime-level migrations in their own modules - makes the diffing/merging much easier when the time comes to remove the migrations after they've passed.

@j4m1ef0rd j4m1ef0rd added this pull request to the merge queue Jul 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 5, 2024
@j4m1ef0rd j4m1ef0rd added this pull request to the merge queue Jul 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 5, 2024
@msgmaxim msgmaxim added this pull request to the merge queue Jul 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 5, 2024
@msgmaxim msgmaxim added this pull request to the merge queue Jul 8, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 8, 2024
@j4m1ef0rd j4m1ef0rd added this pull request to the merge queue Jul 8, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 8, 2024
@j4m1ef0rd j4m1ef0rd added this pull request to the merge queue Jul 9, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 9, 2024
@dandanlen dandanlen added this pull request to the merge queue Jul 9, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 9, 2024
@j4m1ef0rd j4m1ef0rd added this pull request to the merge queue Jul 10, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 10, 2024
@dandanlen dandanlen added this pull request to the merge queue Jul 10, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 10, 2024
@j4m1ef0rd
Copy link
Contributor Author

@dandanlen the upgrade test is still failing bouncer. I thought this was fixed. This branch is updated with main.

@dandanlen
Copy link
Collaborator

@dandanlen the upgrade test is still failing bouncer. I thought this was fixed. This branch is updated with main.

Yeah I thought it was fixed too... will take a look.

@dandanlen
Copy link
Collaborator

It must be something that's in main - this PR is failing the upgrade check too, and it doesn't change any code:
#5033

@j4m1ef0rd j4m1ef0rd added this pull request to the merge queue Jul 15, 2024
Merged via the queue into main with commit 518b0ad Jul 15, 2024
47 checks passed
@j4m1ef0rd j4m1ef0rd deleted the refactor/move_network_fee branch July 15, 2024 06:52
syan095 added a commit that referenced this pull request Jul 23, 2024
…-ccm-checker

* origin/wip/solana-api:
  Feat/solana ccm gas limit (#5048)
  feat: return early if no client ready on retry limited requests (#5057)
  feature/PRO-1378/validator-gas-refund (#4962)
  chore: fix bug in merge that caused tests to fail
  chore: build binaries on Mac M2 Runner 🍎 (#5005)
  chore: remove unused spec versioned migration util (#5054)
  test: update integration tests
  feat(docker images): add `chainflip-node` probe scripts 🩺 (#5033)
  Feat: Make FoK constants configurable (#5024)
  fix: cp .so files to /usr/lib (#5051)
  chore: run gas_limit test by default
  fix: allow validators to deregister once they no longer have relevant key material (#5045)
  Feat: RPC lp total balances (#4951)
  fix: rpath name on 1.4.5 dylib (#5046)
  chore: remove cp dylibs from post check (#5044)
  feat: add primary/secondary label to RPC_RETRIER_TOTAL_REQUESTS metric (#5015)
  feat: smart retrier endpoint selection (#4984)
  refactor: move collected network fee to swapping pallet (#5014)
  feat: consistent broker api address strings (#5030)

# Conflicts:
#	foreign-chains/solana/sol-prim/src/consts.rs
#	state-chain/chains/src/sol/api.rs
#	state-chain/pallets/cf-swapping/src/lib.rs
#	state-chain/pallets/cf-swapping/src/mock.rs
#	state-chain/runtime/src/lib.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants