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

Fix thunks in RealPBFT #1602

Merged
merged 2 commits into from Feb 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions cabal.project
Expand Up @@ -116,25 +116,25 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-ledger
tag: 98048d95823b72e409b07481761b8a59c892c56c
tag: e8475e33772e7408e83ff22e4406673ea73f93fd
subdir: cardano-ledger

source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-ledger
tag: 98048d95823b72e409b07481761b8a59c892c56c
tag: e8475e33772e7408e83ff22e4406673ea73f93fd
subdir: crypto

source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-ledger
tag: 98048d95823b72e409b07481761b8a59c892c56c
tag: e8475e33772e7408e83ff22e4406673ea73f93fd
subdir: cardano-ledger/test

source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-ledger
tag: 98048d95823b72e409b07481761b8a59c892c56c
tag: e8475e33772e7408e83ff22e4406673ea73f93fd
subdir: crypto/test

-- version number matching the one specified in the stack resolver file
Expand Down
4 changes: 2 additions & 2 deletions nix/.stack.nix/cardano-crypto-test.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions nix/.stack.nix/cardano-crypto-wrapper.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions nix/.stack.nix/cardano-ledger-test.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions nix/.stack.nix/cardano-ledger.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions ouroboros-consensus/src/Ouroboros/Consensus/Protocol/PBFT.hs
Expand Up @@ -3,7 +3,6 @@
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE PatternSynonyms #-}
Expand Down Expand Up @@ -50,6 +49,8 @@ import qualified Data.Bimap as Bimap
import Data.Proxy (Proxy (..))
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Text (Text)
import qualified Data.Text as Text
import Data.Typeable (Typeable)
import Data.Word (Word64)
import GHC.Generics (Generic)
Expand Down Expand Up @@ -314,7 +315,7 @@ instance PBftCrypto c => OuroborosTag (PBft c) where
signed
pbftSignature of
Right () -> return ()
Left err -> throwError $ PBftInvalidSignature err
Left err -> throwError $ PBftInvalidSignature (Text.pack err)

-- FIXME confirm that non-strict inequality is ok in general.
-- It's here because EBBs have the same slot as the first block of their
Expand Down Expand Up @@ -461,11 +462,13 @@ genesisKeyHashes = CC.Genesis.unGenesisKeyHashes
PBFT specific types
-------------------------------------------------------------------------------}

-- | NOTE: this type is stored in the state, so it must be in normal form to
-- avoid space leaks.
data PBftValidationErr c
= PBftInvalidSignature String
| PBftNotGenesisDelegate (PBftVerKeyHash c) (PBftLedgerView c)
= PBftInvalidSignature !Text
| PBftNotGenesisDelegate !(PBftVerKeyHash c) !(PBftLedgerView c)
-- | We record how many slots this key signed
| PBftExceededSignThreshold (PBftVerKeyHash c) Word64
| PBftExceededSignThreshold !(PBftVerKeyHash c) !Word64
| PBftInvalidSlot
deriving (Generic, NoUnexpectedThunks)

Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Expand Up @@ -50,7 +50,7 @@ extra-deps:
- gray-code-0.3.1

- git: https://github.com/input-output-hk/cardano-ledger
commit: 98048d95823b72e409b07481761b8a59c892c56c
commit: e8475e33772e7408e83ff22e4406673ea73f93fd
subdirs:
- cardano-ledger
- cardano-ledger/test
Expand Down