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

Allow to acquire tip by LocalStateQuery protocol client. #2875

Merged
merged 6 commits into from
Jan 18, 2021

Conversation

coot
Copy link
Contributor

@coot coot commented Jan 15, 2021

  • Change mini-protocol description
  • Redefine codec, add a test which ensures that the new version of the codec is compatible with the previous one.
  • Updated consensus, including the server.
  • Added new supported version in ouroboros-consensus-cardano
    As a bonus:
  • instance Monoid a => Monoid (IOSim s a)

`IO a` is a monoid (semigroup) whenever  `a` is a monoid (semigroup).
This patch provides similar instance for `IOSim`.
QuickCheck property which checks that two codecs are compatible.
Encoding a message with one of them and decoding it with the other one
yields the original message.
@coot coot added consensus issues related to ouroboros-consensus local-state-query Issues / PRs related to local-state-query protocol networking node-to-client Issues & PRs related to node-to-client protocols labels Jan 15, 2021
Copy link
Contributor

@dcoutts dcoutts left a comment

Choose a reason for hiding this comment

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

Looks great. Very neat, step by step.

@coot coot marked this pull request as draft January 15, 2021 14:09
@coot
Copy link
Contributor Author

coot commented Jan 15, 2021

I left some work in test-consensus (including an undefined). I hope @nfrisby can help to finish this.

^ this is solved.

@coot coot requested a review from nfrisby January 15, 2021 16:13
@coot coot assigned coot and unassigned nfrisby and dcoutts Jan 15, 2021
@coot coot marked this pull request as ready for review January 18, 2021 08:45
@coot
Copy link
Contributor Author

coot commented Jan 18, 2021

bors merge

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jan 18, 2021

@iohk-bors iohk-bors bot merged commit 81a3cd7 into master Jan 18, 2021
@iohk-bors iohk-bors bot deleted the coot/local-state-query branch January 18, 2021 17:48
@@ -140,16 +143,19 @@ checkOutcome k chain = conjoin . map (uncurry checkResult)
(property False)
| otherwise
-> tabulate "Acquired" ["AcquireFailurePointTooOld"] $ property True
checkResult Nothing = \case
Right _result -> tabulate "Acquired" ["Success"] True
Left failure -> counterexample ("acuire tip point resulted in " ++ show failure) False
Copy link
Contributor

Choose a reason for hiding this comment

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

"acuire" -> "acquired"

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'll fix this in another pr.

@@ -1,5 +1,6 @@
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
Copy link
Contributor

@nfrisby nfrisby Jan 18, 2021

Choose a reason for hiding this comment

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

Let's just use (,,) pt.

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'll fix this in another pr.

coot added a commit that referenced this pull request May 16, 2022
2875: Allow to acquire tip by LocalStateQuery protocol client. r=coot a=coot

* Change mini-protocol description
* Redefine codec, add a test which ensures that the new version of the codec is compatible with the previous one.
* Updated consensus, including the server.
* Added new supported version in `ouroboros-consensus-cardano`
As a bonus:
* `instance Monoid a => Monoid (IOSim s a)`

Co-authored-by: Marcin Szamotulski <profunctor@pm.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consensus issues related to ouroboros-consensus local-state-query Issues / PRs related to local-state-query protocol node-to-client Issues & PRs related to node-to-client protocols
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants