Skip to content

Fix the benchmark for disable_lp#2500

Open
open-junius wants to merge 14 commits intodevnet-readyfrom
fix-benchmark-disable-lp
Open

Fix the benchmark for disable_lp#2500
open-junius wants to merge 14 commits intodevnet-readyfrom
fix-benchmark-disable-lp

Conversation

@open-junius
Copy link
Copy Markdown
Contributor

@open-junius open-junius commented Mar 16, 2026

Description

The main purpose of the PR is to get the weigth for dissolve_all_liquidity_providers function,
which is called in dissolve_network. I'd like to update it before continue with my dissolve network PR.
The disable_lp also call it, just use the computed weight to set weight of disable_lp extrinsic.
I didn't update the benchmark because later, disable_lp will be removed after balancer implementation https://github.com/opentensor/subtensor/pull/2505/changes#diff-59099c09418a27c73c83511de538c50ab52c17424cfb89582e241c95f0ec9c06.

Related Issue(s)

  • Closes #[issue number]

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe):

Breaking Change

If this PR introduces a breaking change, please provide a detailed description of the impact and the migration path for existing applications.

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have run ./scripts/fix_rust.sh to ensure my code is formatted and linted correctly
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Screenshots (if applicable)

Please include any relevant screenshots or GIFs that demonstrate the changes made.

Additional Notes

Please provide any additional information or context that may be helpful for reviewers.

@open-junius open-junius self-assigned this Mar 16, 2026
@open-junius open-junius changed the title init solution Fix the benchmark for disable_lp Mar 16, 2026
@open-junius open-junius added the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label Mar 20, 2026
Comment on lines +216 to +217
// Will handle it in dissolve network PR.
let _ = T::SwapInterface::dissolve_all_liquidity_providers(netuid);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should ignore the weight but still propagate the error, I guess?

Suggested change
// Will handle it in dissolve network PR.
let _ = T::SwapInterface::dissolve_all_liquidity_providers(netuid);
// Will handle it in dissolve network PR.
let _ = T::SwapInterface::dissolve_all_liquidity_providers(netuid)?;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Add the error handler here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I get the impression it got modified at the wrong place? I see a propagation at the bottom in the disable_lp but this one is used in a lot of different places. Any reason why we don't want to propagate the error as it was before?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. I just modified the place after search in the code. I was think the whole dissolve_network will be updated so didn't realize it need change. just fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-cargo-audit This PR fails cargo audit but needs to be merged anyway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants