Skip to content

Commit

Permalink
Update ouroboros-network and ledger-specs deps
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Apr 30, 2021
1 parent 5654860 commit 5fbd89f
Show file tree
Hide file tree
Showing 19 changed files with 63 additions and 50 deletions.
22 changes: 12 additions & 10 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,16 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-base
tag: 4251c0bb6e4f443f00231d28f5f70d42876da055
--sha256: 02a61ymvx054pcdcgvg5qj9kpybiajg993nr22iqiya196jmgciv
tag: 47db5b818ca4fa051f2e44cdf5e7c5c18c1fb0bf
--sha256: 0fr0r5dwfmsp15j19xh20js8nzsqyhwx4q797rxsvpyjfabb2y11
subdir:
binary
binary/test
cardano-crypto-class
cardano-crypto-praos
cardano-crypto-tests
slotting
strict-containers

source-repository-package
type: git
Expand All @@ -119,15 +120,16 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-ledger-specs
tag: 653dadcc70cd6456784f597866dd44a952cfbfb9
--sha256: 03dc6qf9w5xi8psz6sd14w7y1fa6dxf356c0nfp1q8qlg8ndix1r
tag: e8f19bcc9c8f405131cb95ca6ada26b2b4eac638
--sha256: 1v36d3lyhmadzj0abdfsppjna7n7llzqzp9ikx5yq28l2kda2f1p
subdir:
byron/chain/executable-spec
byron/crypto
byron/crypto/test
byron/ledger/executable-spec
byron/ledger/impl
byron/ledger/impl/test
cardano-ledger-core
semantics/executable-spec
semantics/small-steps-test
shelley/chain-and-ledger/dependencies/non-integer
Expand All @@ -139,8 +141,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-prelude
tag: ee4e7b547a991876e6b05ba542f4e62909f4a571
--sha256: 0dg6ihgrn5mgqp95c4f11l6kh9k3y75lwfqf47hdp554w7wyvaw6
tag: bb4ed71ba8e587f672d06edf9d2e376f4b055555
--sha256: 00h10l5mmiza9819p9v5q5749nb9pzgi20vpzpy1d34zmh6gf1cj
subdir:
cardano-prelude
cardano-prelude-test
Expand All @@ -154,8 +156,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/iohk-monitoring-framework
tag: bf3b4336dfd202fe0b5e765cdaa97788674e456c
--sha256: 1ilq7yq8a3mpy21fiqharx7vs2b555n78gf7m48kkd0pl58vq759
tag: 808724ff8a19a33d0ed06f9ef59fbd900b08553c
--sha256: 0298dpl29gxzs9as9ha6y0w18hqwc00ipa3hzkxv7nlfrjjz8hmz
subdir:
contra-tracer
iohk-monitoring
Expand All @@ -175,8 +177,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/ouroboros-network
tag: ec79b87254589276e75f11ea95c069266b7b151d
--sha256: 1j8dzx1x3nbxwahbm3nv6l8k9my1f9sw0ppccdkq7kdb75qzvyag
tag: 9b279c7548ee549e1ed755cd1acb69b6e69d0c7b
--sha256: 0d7bk9vzmhhb2z4ns2qw7f1vz6lr186m98sh8wvrnfpxk3z86dxb
subdir:
io-sim
io-sim-classes
Expand Down
3 changes: 3 additions & 0 deletions cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ library
, cardano-crypto-class
, cardano-crypto-wrapper
, cardano-ledger-byron
, cardano-ledger-core
, cardano-ledger-shelley-ma
, cardano-prelude
, cardano-slotting
Expand All @@ -126,6 +127,7 @@ library
, shelley-spec-ledger
, small-steps
, stm
, strict-containers
, text
, time
, transformers
Expand All @@ -151,6 +153,7 @@ test-suite cardano-api-test
, cardano-crypto-test
, cardano-crypto-tests
, cardano-ledger-byron-test
, cardano-ledger-core
, cardano-prelude
, cardano-slotting
, containers
Expand Down
2 changes: 1 addition & 1 deletion cardano-api/src/Cardano/Api/Certificate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import Ouroboros.Consensus.Shelley.Protocol.Crypto (StandardCrypto)

import Shelley.Spec.Ledger.BaseTypes (maybeToStrictMaybe, strictMaybeToMaybe)
import qualified Shelley.Spec.Ledger.BaseTypes as Shelley
import qualified Shelley.Spec.Ledger.Coin as Shelley (toDeltaCoin)
import qualified Cardano.Ledger.Coin as Shelley (toDeltaCoin)
import Shelley.Spec.Ledger.TxBody (MIRPot (..))
import qualified Shelley.Spec.Ledger.TxBody as Shelley

Expand Down
10 changes: 5 additions & 5 deletions cardano-api/src/Cardano/Api/Fees.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE EmptyCase #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}

-- | Fee calculation
--
Expand All @@ -11,15 +13,13 @@ module Cardano.Api.Fees (

import Prelude

import Numeric.Natural

import qualified Data.ByteString as BS
import GHC.Records (HasField (..))
import Numeric.Natural

import qualified Cardano.Binary as CBOR
import qualified Cardano.Chain.Common as Byron

import qualified Shelley.Spec.Ledger.LedgerState as Shelley

import Cardano.Api.Eras
import Cardano.Api.NetworkId
import Cardano.Api.Tx
Expand All @@ -46,7 +46,7 @@ transactionFee txFeeFixed txFeePerByte (ShelleyTx _ tx) =
Lovelace (a * x + b)
where
a = toInteger txFeePerByte
x = Shelley.txsize tx
x = getField @"txsize" tx
b = toInteger txFeeFixed

--TODO: This can be made to work for Byron txs too. Do that: fill in this case
Expand Down
2 changes: 1 addition & 1 deletion cardano-api/src/Cardano/Api/Orphans.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import qualified Data.Text as Text
import qualified Data.Text.Encoding as Text

import qualified Cardano.Crypto.Hash.Class as Crypto
import qualified Cardano.Ledger.Coin as Shelley
import qualified Cardano.Ledger.Core as Core
import qualified Cardano.Ledger.Crypto as Crypto
import qualified Cardano.Ledger.Mary.Value as Mary
Expand All @@ -32,7 +33,6 @@ import Cardano.Slotting.Slot (SlotNo (..))
import qualified Ouroboros.Consensus.Shelley.Eras as Consensus
import qualified Shelley.Spec.Ledger.API as Shelley
import Shelley.Spec.Ledger.BaseTypes (StrictMaybe (..))
import qualified Shelley.Spec.Ledger.Coin as Shelley
import qualified Shelley.Spec.Ledger.Delegation.Certificates as Shelley
import qualified Shelley.Spec.Ledger.EpochBoundary as ShelleyEpoch
import qualified Shelley.Spec.Ledger.LedgerState as ShelleyLedger
Expand Down
4 changes: 2 additions & 2 deletions cardano-api/src/Cardano/Api/ProtocolParameters.hs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ import Cardano.Api.SerialiseTextEnvelope
import Cardano.Api.StakePoolMetadata
import Cardano.Api.TxMetadata
import Cardano.Api.Value
import Cardano.Binary


-- | The values of the set of /updateable/ protocol paramaters. At any
Expand Down Expand Up @@ -478,8 +479,7 @@ instance HasTextEnvelope UpdateProposal where
instance SerialiseAsCBOR UpdateProposal where
serialiseToCBOR = CBOR.serializeEncoding' . toCBOR . toShelleyUpdate @StandardShelley
deserialiseFromCBOR _ bs =
fromShelleyUpdate @StandardShelley <$>
CBOR.decodeAnnotator "UpdateProposal" fromCBOR (LBS.fromStrict bs)
fromShelleyUpdate @StandardShelley <$> decodeFull (LBS.fromStrict bs)


makeShelleyUpdateProposal :: ProtocolParametersUpdate
Expand Down
6 changes: 4 additions & 2 deletions cardano-api/src/Cardano/Api/Script.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}

module Cardano.Api.Script (
Expand Down Expand Up @@ -99,6 +100,7 @@ import qualified Cardano.Ledger.ShelleyMA.Timelocks as Timelock
import Ouroboros.Consensus.Shelley.Eras (StandardCrypto)
import qualified Shelley.Spec.Ledger.Keys as Shelley
import qualified Shelley.Spec.Ledger.Scripts as Shelley
import qualified Shelley.Spec.Ledger.Tx as Shelley

import Cardano.Api.Eras
import Cardano.Api.HasTypeProxy
Expand Down Expand Up @@ -645,15 +647,15 @@ hashScript (SimpleScript SimpleScriptV1 s) =
-- For V1, we convert to the Shelley-era version specifically and hash that.
-- Later ledger eras have to be compatible anyway.
ScriptHash
. Shelley.hashMultiSigScript
. Shelley.hashMultiSigScript @(ShelleyLedgerEra ShelleyEra)
. toShelleyMultiSig
$ s

hashScript (SimpleScript SimpleScriptV2 s) =
-- For V1, we convert to the Allegra-era version specifically and hash that.
-- Later ledger eras have to be compatible anyway.
ScriptHash
. Timelock.hashTimelockScript
. Shelley.hashScript @(ShelleyLedgerEra AllegraEra)
. (toAllegraTimelock :: SimpleScript SimpleScriptV2
-> Timelock.Timelock StandardCrypto)
$ s
Expand Down
20 changes: 13 additions & 7 deletions cardano-api/src/Cardano/Api/Tx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as LBS

import Data.Functor.Identity (Identity)
import qualified Data.Map.Strict as Map
import qualified Data.Set as Set
import qualified Data.Vector as Vector

--
-- Common types, consensus, network
--
Expand Down Expand Up @@ -88,6 +88,7 @@ import qualified Cardano.Ledger.Core as Ledger
import qualified Cardano.Ledger.Era as Ledger
import qualified Cardano.Ledger.SafeHash as Ledger
import qualified Cardano.Ledger.Shelley.Constraints as Shelley
import qualified Shelley.Spec.Ledger.TxBody as Ledger (EraIndependentTxBody)

import qualified Shelley.Spec.Ledger.Address.Bootstrap as Shelley
import Shelley.Spec.Ledger.BaseTypes (maybeToStrictMaybe, strictMaybeToMaybe)
Expand Down Expand Up @@ -373,7 +374,7 @@ instance IsCardanoEra era => HasTextEnvelope (KeyWitness era) where
MaryEra -> "TxWitness MaryEra"


pattern Tx :: TxBody era -> [KeyWitness era] -> Tx era
pattern Tx :: Ledger.Era era => TxBody era -> [KeyWitness era] -> Tx era
pattern Tx txbody ws <- (getTxBodyAndWitnesses -> (txbody, ws))
where
Tx txbody ws = makeSignedTransaction ws txbody
Expand All @@ -393,20 +394,21 @@ getTxBody (ShelleyTx era tx) =
where
getShelleyTxBody :: forall ledgerera.
ShelleyLedgerEra era ~ ledgerera
=> Ledger.Witnesses ledgerera ~ Shelley.WitnessSetHKD Identity ledgerera
=> Shelley.ShelleyBased ledgerera
=> Shelley.Tx ledgerera
-> TxBody era
getShelleyTxBody Shelley.Tx {
Shelley._body = txbody,
Shelley._metadata = txmetadata,
Shelley._witnessSet = Shelley.WitnessSet
Shelley.body = txbody,
Shelley.auxiliaryData = txAuxiliaryData,
Shelley.wits = Shelley.WitnessSet
_addrWits
msigWits
_bootWits
} =
ShelleyTxBody era txbody
(Map.elems msigWits)
(strictMaybeToMaybe txmetadata)
(strictMaybeToMaybe txAuxiliaryData)


getTxWitnesses :: forall era. Tx era -> [KeyWitness era]
Expand All @@ -424,11 +426,13 @@ getTxWitnesses (ShelleyTx era tx) =
where
getShelleyTxWitnesses :: forall ledgerera.
Ledger.Crypto ledgerera ~ StandardCrypto
=> Ledger.Witnesses ledgerera ~ Shelley.WitnessSetHKD Identity ledgerera
=> ToCBOR (Ledger.Witnesses ledgerera)
=> Shelley.ShelleyBased ledgerera
=> Shelley.Tx ledgerera
-> [KeyWitness era]
getShelleyTxWitnesses Shelley.Tx {
Shelley._witnessSet =
Shelley.wits =
Shelley.WitnessSet
addrWits
_msigWits
Expand Down Expand Up @@ -458,6 +462,8 @@ makeSignedTransaction witnesses (ShelleyTxBody era txbody txscripts txmetadata)
makeShelleySignedTransaction :: forall ledgerera.
ShelleyLedgerEra era ~ ledgerera
=> Ledger.Crypto ledgerera ~ StandardCrypto
=> Ledger.Witnesses ledgerera ~ Shelley.WitnessSetHKD Identity ledgerera
=> ToCBOR (Ledger.Witnesses ledgerera)
=> Shelley.ShelleyBased ledgerera
=> Shelley.ValidateScript ledgerera
=> Ledger.TxBody ledgerera
Expand Down
2 changes: 1 addition & 1 deletion cardano-api/src/Cardano/Api/Value.hs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ import qualified Data.Text.Encoding as Text

import qualified Cardano.Chain.Common as Byron

import qualified Cardano.Ledger.Coin as Shelley
import qualified Cardano.Ledger.Mary.Value as Mary
import qualified Cardano.Ledger.ShelleyMA.Rules.Utxo as Shelley
import qualified Shelley.Spec.Ledger.Coin as Shelley

import Ouroboros.Consensus.Shelley.Protocol.Crypto (StandardCrypto)

Expand Down
2 changes: 1 addition & 1 deletion cardano-api/test/Test/Cardano/Api/Genesis.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import Ouroboros.Consensus.Util.Time

import Shelley.Spec.Ledger.Address (Addr (..))
import Shelley.Spec.Ledger.BaseTypes (Network (..), truncateUnitInterval)
import Shelley.Spec.Ledger.Coin (Coin (..))
import Cardano.Ledger.Coin (Coin (..))
import Shelley.Spec.Ledger.Credential (Credential (..), PaymentCredential,
StakeCredential, StakeReference (..))
import Shelley.Spec.Ledger.Keys (GenDelegPair (..), Hash, KeyHash (..), KeyRole (..),
Expand Down
2 changes: 1 addition & 1 deletion cardano-api/test/Test/Cardano/Api/Typed/Gen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import Data.String
import qualified Cardano.Binary as CBOR
import qualified Cardano.Crypto.Hash as Crypto
import qualified Cardano.Crypto.Seed as Crypto
import qualified Cardano.Ledger.SafeHash as Ledger
import qualified Shelley.Spec.Ledger.TxBody as Ledger (EraIndependentTxBody)


import Hedgehog (Gen, Range)
Expand Down
1 change: 1 addition & 0 deletions cardano-api/test/cardano-api-test.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ library
, cardano-crypto-class
, cardano-crypto-test
, cardano-ledger-byron-test
, cardano-ledger-core
, cardano-prelude
, containers
, hedgehog
Expand Down
2 changes: 2 additions & 0 deletions cardano-cli/cardano-cli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ library
, cardano-crypto-class
, cardano-crypto-wrapper
, cardano-ledger-byron
, cardano-ledger-core
, cardano-ledger-shelley-ma
, cardano-prelude
, contra-tracer
Expand All @@ -131,6 +132,7 @@ library
, shelley-spec-ledger
, small-steps
, split
, strict-containers
, text
, time
, transformers-except
Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/Shelley/Run/Genesis.hs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import Ouroboros.Consensus.Shelley.Protocol (StandardCrypto)

import qualified Shelley.Spec.Ledger.API as Ledger
import qualified Shelley.Spec.Ledger.BaseTypes as Ledger
import Shelley.Spec.Ledger.Coin (Coin (..))
import Cardano.Ledger.Coin (Coin (..))
import qualified Shelley.Spec.Ledger.Keys as Ledger
import qualified Shelley.Spec.Ledger.PParams as Shelley

Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/Shelley/Run/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import Ouroboros.Network.Block (Serialised (..))
import Ouroboros.Network.Protocol.LocalStateQuery.Type as LocalStateQuery
(AcquireFailure (..))
import qualified Shelley.Spec.Ledger.API.Protocol as Ledger
import Shelley.Spec.Ledger.Coin
import Cardano.Ledger.Coin
import Shelley.Spec.Ledger.EpochBoundary
import Shelley.Spec.Ledger.Keys (KeyHash (..), KeyRole (..))
import Shelley.Spec.Ledger.LedgerState hiding (_delegations)
Expand Down
1 change: 1 addition & 0 deletions cardano-node/cardano-node.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ library
, cardano-crypto-class
, cardano-crypto-wrapper
, cardano-ledger-byron
, cardano-ledger-core
, cardano-ledger-shelley-ma
, cardano-prelude
, cardano-slotting
Expand Down
7 changes: 1 addition & 6 deletions cardano-node/src/Cardano/Node/Configuration/POM.hs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE StandaloneDeriving #-}

{-# OPTIONS_GHC -Wno-noncanonical-monoid-instances #-}
{-# OPTIONS_GHC -Wno-orphans #-}

module Cardano.Node.Configuration.POM
( NodeConfiguration (..)
Expand Down Expand Up @@ -35,12 +33,9 @@ import Cardano.Crypto (RequiresNetworkMagic (..))
import Cardano.Node.Protocol.Types (Protocol (..))
import Cardano.Node.Types
import Cardano.Tracing.Config
import Ouroboros.Consensus.Storage.LedgerDB.DiskPolicy (SnapshotInterval (..))
import Ouroboros.Network.Block (MaxSlotNo (..))
import Ouroboros.Network.NodeToNode (DiffusionMode (..))
import Ouroboros.Consensus.Storage.LedgerDB.DiskPolicy (SnapshotInterval (..))

deriving instance Eq SnapshotInterval
deriving instance Generic SnapshotInterval

data NodeConfiguration
= NodeConfiguration
Expand Down

0 comments on commit 5fbd89f

Please sign in to comment.