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

Make query pool-state default to returning information on all pools #514

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

carlhammann
Copy link
Contributor

@carlhammann carlhammann commented Dec 11, 2023

Changelog

- description: |
    Make `query pool-state` default to returning information on all pools
# uncomment types applicable to the change:
  type:
  # - feature        # introduces a new feature
  # - breaking       # the API has changed in a breaking way
  # - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
  # - improvement    # QoL changes e.g. refactoring
  - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...

Context

This PR closes #496. I also took the liberty of making the flags of the pool-state query a bit more explicit, with an --all-stake-pools flag. This is similar to the stake-snapshot query.

There's also a remark from @CarlosLopezDeLara on the issue, where he notes that the query doesn't seem to work in Babbage. Before we figure out what's going on there, I propose we proceed with this PR, since it is orthogonal.

How to trust this PR

Highlight important bits of the PR that will make the review faster. If there are commands the reviewer can run to observe the new behavior, describe them.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

@carlhammann carlhammann changed the title Make query pool-state default to returning information on all pools; clarify flags Make query pool-state default to returning information on all pools Dec 11, 2023
@carlhammann carlhammann marked this pull request as ready for review December 11, 2023 15:01
@@ -216,7 +216,7 @@ pQueryPoolStateCmd envCli =
<$> pSocketPath envCli
<*> pConsensusModeParams
<*> pNetworkId envCli
<*> many (pStakePoolVerificationKeyHash Nothing)
<*> pAllStakePoolsOrOnly
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice job being able to reuse the same logic as another command 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I might extend that logic to some other commands as well in another PR. There's also potential to sharpen it some more, and make it require the --all_... flag, or a positive number of keys.

All -> Nothing
Only poolIds -> Just $ Set.fromList poolIds

result <- lift (queryPoolState beo poolFilter)
Copy link
Contributor

Choose a reason for hiding this comment

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

Where did you see that passing Nothing means "no-filtering"? Looking up the definition of QueryPoolState, it's not documented. (I don't see what other behavior Nothing could have, but being curious).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Code diving in consensus...

Copy link
Contributor

Choose a reason for hiding this comment

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

Good job finding that in consensus Carl! We should start adding docs in API for queries arguments to not loose that information.

@smelc
Copy link
Contributor

smelc commented Dec 12, 2023

LGTM 🍾

@carlhammann> were you able to test the new "all" behavior on a true node?

@carlhammann
Copy link
Contributor Author

@carlhammann> were you able to test the new "all" behavior on a true node?

That I'll do now, but I wanted to open the PR anyway.

Copy link
Contributor

@carbolymer carbolymer left a comment

Choose a reason for hiding this comment

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

Nice!

@carlhammann
Copy link
Contributor Author

@carlhammann> were you able to test the new "all" behavior on a true node?

That I'll do now, but I wanted to open the PR anyway.

It works, with the --all-stake-pools-option. 🎉 I'll merge this now.

@carlhammann carlhammann added this pull request to the merge queue Dec 12, 2023
Merged via the queue into main with commit 6eddc97 Dec 12, 2023
28 checks passed
@carlhammann carlhammann deleted the ch/fix/query-pool-state-empty branch December 12, 2023 12:25
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.

cli 8.16.0.1 returns an empty json for the query pool-state command
3 participants