-
Notifications
You must be signed in to change notification settings - Fork 15
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
Restore stable query cmds #955
Conversation
d1a63a1
to
a7bb1ad
Compare
a7bb1ad
to
ce10769
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments but LGTM 👍
I checked that all commands that were in 9.0.0 are brought back 👍
pTip envCli = | ||
subParser "tip" $ | ||
Opt.info (pQueryTipCmd ShelleyBasedEraConway envCli) $ | ||
Opt.progDesc "Get the node's current tip (slot no, hash, block no)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opt.progDesc "Get the node's current tip (slot no, hash, block no)" | |
Opt.progDesc "Get the node's current tip (slot number, hash, block number)" |
Optional.
Rationale: I think abbreviations can be misleading, in particular to non-native.
-- Queries actually depend on the node to client version which may coincide | ||
-- with a hardfork but not necessarily. We will expose commands at the top level | ||
-- regardless if they are compatible with the era or not. The help text should be | ||
-- updated to make this clear. Gating commands behind eras |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment's last sentence is incomplete.
@@ -32,6 +33,8 @@ data ClientCommand | |||
KeyCommands KeyCmds | |||
| -- | Era agnostic node commands | |||
NodeCommands NodeCmds | |||
| -- | Query commands | |||
forall era. QueryCommands (QueryCmds era) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pQueryCmdsTopLevel
is instantiated by ConwayEra
, so we can avoid the existential quantifier here if we want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this idea. I think we should define
type MainnetEra = ConwayEra
mainnetEra :: ShelleyBasedEra MainnetEra
mainnetEra = shelleyBasedEra
and use it wherever we need to reference the currently supported era.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I have a way to remove all mention of era.
Opt.info (pQueryPoolStateCmd ShelleyBasedEraConway envCli) $ | ||
Opt.progDesc $ | ||
mconcat | ||
[ "DEPRECATED. Use query pool-state instead. Dump the pool parameters " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this was deprecated, maybe not reintroduce it?
pStakeDistribution :: EnvCli -> Parser (QueryCmds ConwayEra) | ||
pStakeDistribution envCli = | ||
subParser "stake-distribution" $ | ||
Opt.info (pQueryStakeDistributionCmd ShelleyBasedEraConway envCli) $ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not hardcode eras in multiple places. The current era ShelleyBasedEraConway
should be defined in one place only and referenced from where it's needed.
Opt.info (pQueryTxMempoolCmd envCli) $ | ||
Opt.progDesc "Local Mempool info" | ||
|
||
pSlotNumber :: EnvCli -> Parser (QueryCmds ConwayEra) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All those parsers should accept era parameter (instead of hardcoding an era) and get reused in pQueryCmds
.
@@ -60,6 +61,13 @@ addressCmdsTopLevel envCli = AddressCommand <$> pAddressCmds envCli | |||
nodeCmdsTopLevel :: Parser ClientCommand | |||
nodeCmdsTopLevel = NodeCommands <$> pNodeCmds | |||
|
|||
-- Queries actually depend on the node to client version which may coincide | |||
-- with a hardfork but not necessarily. We will expose commands at the top level |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will expose commands at the top level (...)
The help text should be (...)
I don't think mentioning our intentions in the comments brings any value. Unless it's a TODO, which is easier to spot and correct than a prose with wishes.
i = | ||
Opt.progDesc $ | ||
mconcat | ||
[ "Node query commands. Will query the local node whose Unix domain socket is " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to mention why this commands set is narrowed down in comparison to conway query
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I left some non-critical remarks (can be done in a follow-up PR if we're in a hurry here).
Resolves #953
Changelog
Context
Additional context for the PR goes here. If the PR fixes a particular issue please provide a link to the issue.
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