Skip to content

[DRAFT] Node release 10.6.0 integration #854

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

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,73 @@ repository cardano-haskell-packages
c00aae8461a256275598500ea0e187588c35a5d5d7454fb57eac18d9edb86a56
d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee

source-repository-package
type: git
location: https://github.com/IntersectMBO/ouroboros-consensus
tag: c982eb9ef4d2fb561f1c17fbefacb2bcaef0646d
--sha256: sha256-TRLbfeEtcPNyiorjHOSTkL+X4OCJSazc+PizWkTF5a0=
subdir:
ouroboros-consensus
ouroboros-consensus-cardano
ouroboros-consensus-diffusion
ouroboros-consensus-protocol
sop-extras
strict-sop-core

source-repository-package
type: git
location: https://github.com/IntersectMBO/ouroboros-network
tag: 3e8d3b4b8c87ead794876c62d7fe25f32efb5142
--sha256: sha256-uKrxpHhcNGzKUSeA4zIdkslfDFIJjkCsHUg+FUef1yE=
subdir:
ouroboros-network-api

source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-ledger
tag: 651e1dd0a43422f01ca43e5ae0ead587e748ccf5
--sha256: sha256-5cIcFcsvbMwpNQBrothZQC4j+rWjMK3vqPC4lntZ+4c=
subdir:
eras/allegra/impl
eras/alonzo/impl
eras/alonzo/test-suite
eras/babbage/impl
eras/babbage/test-suite
eras/byron/chain/executable-spec
eras/byron/crypto
eras/byron/ledger/executable-spec
eras/byron/ledger/impl
eras/conway/impl
eras/conway/test-suite
eras/dijkstra
eras/mary/impl
eras/shelley/impl
eras/shelley-ma/test-suite
eras/shelley/test-suite
libs/cardano-data
libs/cardano-ledger-api
libs/cardano-ledger-binary
libs/cardano-ledger-core
libs/cardano-ledger-test
libs/cardano-protocol-tpraos
libs/constrained-generators
libs/non-integral
libs/set-algebra
libs/small-steps
libs/vector-map

source-repository-package
type: git
location: https://github.com/IntersectMBO/plutus
tag: 30b27c2dd952dced1671b296f87bcc07b1dee7d5
--sha256: sha256-efB8UbgomaKYmrw95Yb53lsBKenDPby9Kkt72tbT6Io=
subdir:
plutus-core
plutus-metatheory
plutus-ledger-api
plutus-tx
plutus-tx-plugin

-- See CONTRIBUTING for information about these, including some Nix commands
-- you need to run if you change them
index-state:
Expand Down
18 changes: 9 additions & 9 deletions cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ library
cardano-data >=1.0,
cardano-ledger-allegra >=1.7,
cardano-ledger-alonzo >=1.13,
cardano-ledger-api >=1.11,
cardano-ledger-api >=1.12,
cardano-ledger-babbage >=1.11,
cardano-ledger-binary >=1.6,
cardano-ledger-byron >=1.1,
Expand Down Expand Up @@ -167,7 +167,7 @@ library
ouroboros-network-framework,
ouroboros-network-protocols >=0.14,
parsec,
plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} ^>=1.45,
plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} ^>=1.46,
prettyprinter,
prettyprinter-ansi-terminal,
prettyprinter-configurable ^>=1.36,
Expand Down Expand Up @@ -310,9 +310,9 @@ library gen
cardano-crypto-class ^>=2.2.1,
cardano-crypto-test ^>=1.6,
cardano-ledger-alonzo:{cardano-ledger-alonzo, testlib} >=1.8.1,
cardano-ledger-byron-test >=1.5,
cardano-ledger-byron:{testlib} >=1.1,
cardano-ledger-conway:testlib,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.14,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.17,
cardano-ledger-shelley >=1.13,
containers,
directory,
Expand Down Expand Up @@ -343,10 +343,10 @@ test-suite cardano-api-test
cardano-crypto-test ^>=1.6,
cardano-crypto-tests ^>=2.2,
cardano-ledger-alonzo,
cardano-ledger-api >=1.9,
cardano-ledger-api >=1.12,
cardano-ledger-binary,
cardano-ledger-conway,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.14,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.17,
cardano-ledger-mary,
cardano-protocol-tpraos,
cardano-slotting,
Expand Down Expand Up @@ -415,9 +415,9 @@ test-suite cardano-api-golden
cardano-crypto-class ^>=2.2.1,
cardano-data >=1.0,
cardano-ledger-alonzo,
cardano-ledger-api >=1.9,
cardano-ledger-api >=1.12,
cardano-ledger-binary,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.14,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.17,
cardano-ledger-shelley,
cardano-ledger-shelley-test >=1.2.0.1,
cardano-protocol-tpraos,
Expand All @@ -427,7 +427,7 @@ test-suite cardano-api-golden
hedgehog >=1.1,
hedgehog-extras ^>=0.7,
microlens,
plutus-core ^>=1.45,
plutus-core ^>=1.46,
plutus-ledger-api,
tasty,
tasty-hedgehog,
Expand Down
2 changes: 0 additions & 2 deletions cardano-api/src/Cardano/Api/Block.hs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ import Ouroboros.Consensus.Byron.Ledger qualified as Consensus
import Ouroboros.Consensus.Cardano.Block qualified as Consensus
import Ouroboros.Consensus.HardFork.Combinator qualified as Consensus
import Ouroboros.Consensus.Shelley.Ledger qualified as Consensus
import Ouroboros.Consensus.Shelley.Protocol.Abstract qualified as Consensus
import Ouroboros.Network.Block qualified as Consensus

import Data.Aeson (FromJSON (..), ToJSON (..), Value (..), object, withObject, (.:), (.=))
Expand Down Expand Up @@ -167,7 +166,6 @@ getShelleyBlockTxs
:: forall era ledgerera blockheader
. ShelleyLedgerEra era ~ ledgerera
=> Consensus.ShelleyCompatible (ConsensusProtocol era) ledgerera
=> Consensus.ShelleyProtocolHeader (ConsensusProtocol era) ~ blockheader
=> ShelleyBasedEra era
-> Ledger.Block blockheader ledgerera
-> [Tx era]
Expand Down
8 changes: 7 additions & 1 deletion cardano-api/src/Cardano/Api/Certificate/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,8 @@ selectStakeCredentialWitness = \case
getTxCertWitness (convert cEra) conwayCert

filterUnRegCreds
:: Certificate era -> Maybe StakeCredential
:: forall era
. Certificate era -> Maybe StakeCredential
filterUnRegCreds =
fmap fromShelleyStakeCredential . \case
ShelleyRelatedCertificate stbEra shelleyCert -> shelleyToBabbageEraConstraints stbEra $
Expand All @@ -576,6 +577,7 @@ filterUnRegCreds =
Ledger.RetirePoolTxCert _ _ -> Nothing
Ledger.MirTxCert _ -> Nothing
Ledger.GenesisDelegTxCert{} -> Nothing
_ -> error "Impossible"
ConwayCertificate cEra conwayCert -> conwayEraOnwardsConstraints cEra $
case conwayCert of
Ledger.RegPoolTxCert _ -> Nothing
Expand All @@ -593,6 +595,7 @@ filterUnRegCreds =
Ledger.RegTxCert _ -> Nothing
-- stake cred deregistration w/o deposit
Ledger.UnRegTxCert cred -> Just cred
_ -> error "Impossible"

filterUnRegDRepCreds
:: Certificate era -> Maybe (Ledger.Credential Ledger.DRepRole)
Expand All @@ -615,6 +618,7 @@ filterUnRegDRepCreds = \case
Ledger.RegTxCert _ -> Nothing
-- stake cred deregistration w/o deposit
Ledger.UnRegTxCert _ -> Nothing
_ -> error "Impossible"

-- ----------------------------------------------------------------------------
-- Internal conversion functions
Expand Down Expand Up @@ -803,6 +807,7 @@ getAnchorDataFromCertificate c =
Ledger.RetirePoolTxCert _ _ -> return Nothing
Ledger.GenesisDelegTxCert{} -> return Nothing
Ledger.MirTxCert _ -> return Nothing
_ -> error "Impossible"
ConwayCertificate ceo ccert ->
conwayEraOnwardsConstraints ceo $
case ccert of
Expand All @@ -819,6 +824,7 @@ getAnchorDataFromCertificate c =
Ledger.UpdateDRepTxCert _ mAnchor -> return $ Ledger.strictMaybeToMaybe mAnchor
Ledger.AuthCommitteeHotKeyTxCert _ _ -> return Nothing
Ledger.ResignCommitteeColdTxCert _ mAnchor -> return $ Ledger.strictMaybeToMaybe mAnchor
_ -> error "Impossible"
where
anchorDataFromPoolMetadata
:: MonadError AnchorDataFromCertificateError m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import Cardano.Ledger.Conway.Core qualified as L
import Cardano.Ledger.Conway.Governance qualified as L
import Cardano.Ledger.Conway.TxCert qualified as L
import Cardano.Ledger.Mary.Value qualified as L
import Cardano.Ledger.State qualified as L
import Cardano.Ledger.Conway.State qualified as L
import Cardano.Protocol.Crypto qualified as L
import Ouroboros.Consensus.Protocol.Abstract qualified as Consensus
import Ouroboros.Consensus.Protocol.Praos.Common qualified as Consensus
Expand Down Expand Up @@ -101,6 +101,7 @@ type ConwayEraOnwardsConstraints era =
, L.ConwayEraPParams (ShelleyLedgerEra era)
, L.ConwayEraTxBody (ShelleyLedgerEra era)
, L.ConwayEraTxCert (ShelleyLedgerEra era)
, L.ConwayEraCertState (ShelleyLedgerEra era)
, L.Era (ShelleyLedgerEra era)
, L.EraGov (ShelleyLedgerEra era)
, L.EraPParams (ShelleyLedgerEra era)
Expand Down
1 change: 0 additions & 1 deletion cardano-api/src/Cardano/Api/Experimental/Tx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ import Cardano.Crypto.Hash qualified as Hash
import Cardano.Ledger.Alonzo.TxBody qualified as L
import Cardano.Ledger.Api qualified as L
import Cardano.Ledger.Conway qualified as Ledger
import Cardano.Ledger.Conway.TxBody qualified as L
import Cardano.Ledger.Core qualified as Ledger
import Cardano.Ledger.Hashes qualified as L hiding (Hash)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeOperators #-}

module Cardano.Api.Experimental.Tx.Internal.Certificate
( Certificate (..)
Expand All @@ -28,8 +29,9 @@ import Cardano.Api.Plutus.Internal.Script qualified as Api
import Cardano.Api.Tx.Internal.Body (TxCertificates (..))
import Cardano.Api.Tx.Internal.Body qualified as Api

import Cardano.Ledger.Allegra.Scripts qualified as L
import Cardano.Ledger.Plutus.Language qualified as L
import Cardano.Ledger.Core qualified as L
import Cardano.Ledger.Allegra.Scripts qualified as L
import Cardano.Ledger.Plutus.Language qualified as Plutus

import GHC.IsList
Expand Down Expand Up @@ -83,7 +85,9 @@ mkTxCertificates certs =
)

newToOldSimpleScriptWitness
:: L.AllegraEraScript (LedgerEra era)
:: ( L.AllegraEraScript (LedgerEra era)
, L.NativeScript (LedgerEra era) ~ L.Timelock (LedgerEra era)
)
=> Era era -> Exp.SimpleScriptOrReferenceInput (LedgerEra era) -> Api.ScriptWitness Api.WitCtxStake era
newToOldSimpleScriptWitness era simple =
case simple of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ data AnyGovernanceAction = forall era. AnyGovernanceAction (Gov.GovAction era)
-- TODO: Conway - Transitiion to Ledger.GovAction
data GovernanceAction era
= MotionOfNoConfidence
(StrictMaybe (Ledger.GovPurposeId Ledger.CommitteePurpose (ShelleyLedgerEra era)))
(StrictMaybe (Ledger.GovPurposeId Ledger.CommitteePurpose))
| ProposeNewConstitution
(StrictMaybe (Ledger.GovPurposeId Ledger.ConstitutionPurpose (ShelleyLedgerEra era)))
(StrictMaybe (Ledger.GovPurposeId Ledger.ConstitutionPurpose))
Ledger.Anchor
(StrictMaybe Shelley.ScriptHash)
| ProposeNewCommittee
(StrictMaybe (Ledger.GovPurposeId Ledger.CommitteePurpose (ShelleyLedgerEra era)))
(StrictMaybe (Ledger.GovPurposeId Ledger.CommitteePurpose))
[L.Credential ColdCommitteeRole]
-- ^ Old constitutional committee
(Map (L.Credential ColdCommitteeRole) EpochNo)
Expand All @@ -63,11 +63,11 @@ data GovernanceAction era
[(Network, StakeCredential, L.Coin)]
!(StrictMaybe Shelley.ScriptHash)
| InitiateHardfork
(StrictMaybe (Ledger.GovPurposeId Ledger.HardForkPurpose (ShelleyLedgerEra era)))
(StrictMaybe (Ledger.GovPurposeId Ledger.HardForkPurpose))
ProtVer
| -- | Governance policy
UpdatePParams
(StrictMaybe (Ledger.GovPurposeId Ledger.PParamUpdatePurpose (ShelleyLedgerEra era)))
(StrictMaybe (Ledger.GovPurposeId Ledger.PParamUpdatePurpose))
(Ledger.PParamsUpdate (ShelleyLedgerEra era))
!(StrictMaybe Shelley.ScriptHash)

Expand Down
6 changes: 3 additions & 3 deletions cardano-api/src/Cardano/Api/Ledger/Internal/Reexport.hs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ module Cardano.Api.Ledger.Internal.Reexport
, toPlainDecoder
-- Shelley
, secondsToNominalDiffTimeMicro
, AccountState (..)
, ChainAccountState (..)
, NewEpochState (..)
, ShelleyGenesisStaking (..)
-- Babbage
Expand Down Expand Up @@ -266,7 +266,6 @@ import Cardano.Ledger.Binary
, toPlainDecoder
)
import Cardano.Ledger.Binary.Plain (Decoder, serializeAsHexText)
import Cardano.Ledger.CertState (DRepState (..), csCommitteeCredsL)
import Cardano.Ledger.Coin (Coin (..), addDeltaCoin, toDeltaCoin)
import Cardano.Ledger.Conway.Core
( DRepVotingThresholds (..)
Expand All @@ -293,6 +292,7 @@ import Cardano.Ledger.Conway.Governance
)
import Cardano.Ledger.Conway.PParams (UpgradeConwayPParams (..))
import Cardano.Ledger.Conway.Scripts (ConwayPlutusPurpose (..))
import Cardano.Ledger.Conway.State (DRepState (..), csCommitteeCredsL)
import Cardano.Ledger.Conway.TxCert
( ConwayDelegCert (..)
, ConwayEraTxCert (..)
Expand Down Expand Up @@ -336,7 +336,7 @@ import Cardano.Ledger.Plutus.Data (Data (..), unData)
import Cardano.Ledger.Plutus.Language (Language, Plutus, languageToText, plutusBinary)
import Cardano.Ledger.PoolParams (PoolMetadata (..), PoolParams (..), StakePoolRelay (..))
import Cardano.Ledger.Shelley.API
( AccountState (..)
( ChainAccountState (..)
, GenDelegPair (..)
, NewEpochState (..)
, StakeReference (..)
Expand Down
6 changes: 5 additions & 1 deletion cardano-api/src/Cardano/Api/Plutus/Internal/Script.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,10 @@ toAllegraTimelock = go
-- | Conversion for the 'Timelock.Timelock' language that is shared between the
-- Allegra and Mary eras.
fromAllegraTimelock
:: Allegra.AllegraEraScript era
:: forall era
. ( Allegra.AllegraEraScript era
, Ledger.NativeScript era ~ Allegra.Timelock era
)
=> Ledger.NativeScript era -> SimpleScript
fromAllegraTimelock = go
where
Expand All @@ -1334,6 +1337,7 @@ fromAllegraTimelock = go
go (Shelley.RequireAllOf s) = RequireAllOf (map go (toList s))
go (Shelley.RequireAnyOf s) = RequireAnyOf (map go (toList s))
go (Shelley.RequireMOf i s) = RequireMOf i (map go (toList s))
go _ = error "Impossible"

type family ToLedgerPlutusLanguage lang where
ToLedgerPlutusLanguage PlutusScriptV1 = Plutus.PlutusV1
Expand Down
7 changes: 3 additions & 4 deletions cardano-api/src/Cardano/Api/Query/Internal/Convenience.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ import Cardano.Api.Query.Internal.Type.QueryInMode
import Cardano.Api.Tx.Internal.Body
import Cardano.Api.UTxO (UTxO (..))

import Cardano.Ledger.CertState (DRepState (..))
import Cardano.Ledger.Coin qualified as L
import Cardano.Ledger.Credential qualified as L
import Cardano.Ledger.Keys qualified as L
import Cardano.Ledger.Shelley.LedgerState qualified as L
import Cardano.Ledger.State (ChainAccountState (..), DRepState (..))
import Ouroboros.Consensus.HardFork.Combinator.AcrossEras (EraMismatch (..))
import Ouroboros.Network.Protocol.LocalStateQuery.Type (Target (..))

Expand Down Expand Up @@ -164,11 +163,11 @@ queryStateForBalancedTx era allTxIns certs = runExceptT $ do
caseShelleyToBabbageOrConwayEraOnwards
(const $ pure Nothing)
( \cOnwards -> do
L.AccountState{L.asTreasury} <-
ChainAccountState{casTreasury} <-
lift (queryAccountState cOnwards)
& onLeft (left . QceUnsupportedNtcVersion)
& onLeft (left . QueryEraMismatch)
let txCurrentTreasuryValue = TxCurrentTreasuryValue asTreasury
let txCurrentTreasuryValue = TxCurrentTreasuryValue casTreasury
return $ Just $ Featured cOnwards txCurrentTreasuryValue
)
sbe
Expand Down
4 changes: 2 additions & 2 deletions cardano-api/src/Cardano/Api/Query/Internal/Expr.hs
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ import Cardano.Api.UTxO

import Cardano.Ledger.Api qualified as L
import Cardano.Ledger.Api.State.Query qualified as L
import Cardano.Ledger.CertState qualified as L
import Cardano.Ledger.Coin qualified as L
import Cardano.Ledger.Credential qualified as L
import Cardano.Ledger.Hashes hiding (Hash)
import Cardano.Ledger.Keys qualified as L
import Cardano.Ledger.Shelley.LedgerState qualified as L
import Cardano.Ledger.State qualified as L
import Cardano.Slotting.Slot
import Ouroboros.Consensus.Cardano.Block qualified as Consensus
import Ouroboros.Consensus.HardFork.Combinator.AcrossEras as Consensus
Expand Down Expand Up @@ -484,7 +484,7 @@ queryAccountState
QueryInMode
r
IO
(Either UnsupportedNtcVersionError (Either EraMismatch L.AccountState))
(Either UnsupportedNtcVersionError (Either EraMismatch L.ChainAccountState))
queryAccountState eon = querySbe eon QueryAccountState

queryProposals
Expand Down
Loading
Loading