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

Use ShelleyNTC for version check in node queries #403

Closed

Conversation

carbolymer
Copy link
Contributor

@carbolymer carbolymer commented Dec 15, 2023

Changelog

- description: |
    Use ShelleyNTC for version check in node queries
# 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

Fixes #391

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

@carbolymer carbolymer force-pushed the mgalazyn/feature/use-shelley-ntc-for-query-validation branch 4 times, most recently from 91e1197 to 60f5254 Compare December 22, 2023 14:42
@carbolymer carbolymer force-pushed the mgalazyn/feature/use-shelley-ntc-for-query-validation branch from 60f5254 to ec14f18 Compare December 22, 2023 14:57
@carbolymer carbolymer marked this pull request as ready for review December 22, 2023 14:59
@carbolymer carbolymer changed the title Reading ShelleyNTC when querying node Use ShelleyNTC for version check in node queries Dec 22, 2023
Net.Query.ClientStQuerying
{ Net.Query.recvMsgResult = f
}
| otherwise -> pure . Left $ UnsupportedNtcVersionError minNtcVersion ntcVersion
Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • TODO: include shelley NTC version info and/or use separate error for it

Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

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

I haven't look at this yet but I'm prematurely requesting changes as this needs to be carefully considered.

Copy link
Member

@amesgen amesgen left a comment

Choose a reason for hiding this comment

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

The new logic here looks correct to me.

We also talked about this in the Consensus Office Hours today, and came to the conclusion that we can avoid cardano-api having to implement this more complicated logic by a simple change in Consensus, see IntersectMBO/ouroboros-consensus#862 and IntersectMBO/ouroboros-consensus#863.

@amesgen amesgen removed their assignment Jan 8, 2024
@carbolymer
Copy link
Contributor Author

carbolymer commented Jan 8, 2024

Thanks @amesgen ! I think I prefer to rely on the consensus change and your assumption:

In order to reduce the number of possible version combinations, we currently follow the convention that all ShelleyNodeToClientVersions in one CardanoNodeToClientVersionX are equal.

this way we can just use NodeToClientVersion and avoid introducing redundant code.
@Jimbo4350 thoughts?

@carbolymer
Copy link
Contributor Author

Closing because of: #403 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

[BUG] - Incorrect check for query era compatiblity when submitting query to the node
3 participants