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

Integrate in preparation for cardano-node release 10.2.0 #687

Draft
wants to merge 15 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
71 changes: 68 additions & 3 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ repository cardano-haskell-packages
-- See CONTRIBUTING for information about these, including some Nix commands
-- you need to run if you change them
index-state:
, hackage.haskell.org 2024-10-10T08:11:33Z
, cardano-haskell-packages 2024-10-14T23:19:53Z
, hackage.haskell.org 2024-11-20T00:00:00Z
, cardano-haskell-packages 2024-11-27T20:49:28Z

packages:
cardano-api
Expand Down Expand Up @@ -51,4 +51,69 @@ write-ghc-environment-files: always

constraints:
Cabal < 3.14,
cardano-ledger-shelley ^>= 1.14.1

source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-ledger.git
tag: 75c4006eba366b41831ddf11083c8368605254ae
--sha256: sha256-zPkntErLZaE8vfoTH9K4EhmWYEe8l5zExIEP2R0q7ZQ=
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/crypto/test
eras/byron/ledger/executable-spec
eras/byron/ledger/impl
eras/byron/ledger/impl/test
eras/conway/impl
eras/conway/test-suite
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-protocol-tpraos
libs/non-integral
libs/plutus-preprocessor
libs/set-algebra
libs/small-steps
libs/vector-map

source-repository-package
type: git
location: https://github.com/IntersectMBO/ouroboros-network.git
tag: 7e8909f97d6ecc9fff320b3ac2b785aec74751c6
--sha256: sha256-Evv2EwaXbr2tXlxnHVr/AAV+QB7B8EWJbQR6t4IvOQ4=
subdir:
cardano-client
cardano-ping
monoidal-synchronisation
network-mux
ntp-client
ouroboros-network
ouroboros-network-api
ouroboros-network-framework
ouroboros-network-mock
ouroboros-network-protocols
ouroboros-network-testing
quickcheck-monoids

source-repository-package
type: git
location: https://github.com/IntersectMBO/ouroboros-consensus.git
tag: 91ed216681757b02d24d4bc6e1bcc293dda03d7c
--sha256: sha256-RHRku+LQxT3H7IL4iu6LWD6GdmQXmYw3GlVgq0HuNGA=
subdir:
ouroboros-consensus
ouroboros-consensus-cardano
ouroboros-consensus-protocol
ouroboros-consensus-diffusion
sop-extras
strict-sop-core
2 changes: 1 addition & 1 deletion cardano-api-gen/cardano-api-gen.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ license-files:
NOTICE

build-type: Simple
extra-source-files:
extra-doc-files:
CHANGELOG.md
README.md

Expand Down
18 changes: 10 additions & 8 deletions cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ library internal
cardano-data >=1.0,
cardano-ledger-allegra >=1.6,
cardano-ledger-alonzo >=1.10.2,
cardano-ledger-api ^>=1.9.3,
cardano-ledger-api >=1.9.3,
cardano-ledger-babbage >=1.9,
cardano-ledger-binary >=1.3,
cardano-ledger-byron >=1.0.1,
Expand Down Expand Up @@ -202,16 +202,17 @@ library internal
microlens-aeson,
mtl,
network,
network-mux,
ouroboros-consensus ^>=0.21,
ouroboros-consensus-cardano ^>=0.20,
ouroboros-consensus-diffusion ^>=0.18,
ouroboros-consensus-protocol ^>=0.9.0.2,
ouroboros-network,
ouroboros-network-api ^>=0.10,
ouroboros-network-api ^>=0.11,
ouroboros-network-framework,
ouroboros-network-protocols,
parsec,
plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} ^>=1.36,
plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} ^>=1.37,
prettyprinter,
prettyprinter-ansi-terminal,
prettyprinter-configurable ^>=1.36,
Expand All @@ -226,7 +227,7 @@ library internal
time,
transformers,
transformers-except ^>=0.1.3,
typed-protocols ^>=0.1.1,
typed-protocols ^>=0.3,
vector,
yaml,

Expand Down Expand Up @@ -261,8 +262,9 @@ library
deepseq,
memory,
nothunks,
ouroboros-network,
ouroboros-network-protocols,
typed-protocols ^>=0.1.1,
typed-protocols,

library gen
import: project-config
Expand Down Expand Up @@ -324,7 +326,7 @@ test-suite cardano-api-test
cardano-crypto-test ^>=1.5,
cardano-crypto-tests ^>=2.1,
cardano-ledger-alonzo,
cardano-ledger-api ^>=1.9,
cardano-ledger-api >=1.9,
cardano-ledger-binary,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.14,
cardano-ledger-mary,
Expand Down Expand Up @@ -395,7 +397,7 @@ test-suite cardano-api-golden
cardano-crypto-class ^>=2.1.2,
cardano-data >=1.0,
cardano-ledger-alonzo,
cardano-ledger-api ^>=1.9,
cardano-ledger-api >=1.9,
cardano-ledger-babbage >=1.9,
cardano-ledger-binary,
cardano-ledger-core:{cardano-ledger-core, testlib} >=1.14,
Expand All @@ -409,7 +411,7 @@ test-suite cardano-api-golden
hedgehog-extras ^>=0.6.1.0,
microlens,
parsec,
plutus-core ^>=1.36,
plutus-core ^>=1.37,
plutus-ledger-api,
tasty,
tasty-hedgehog,
Expand Down
2 changes: 1 addition & 1 deletion cardano-api/internal/Cardano/Api/Block.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import qualified Cardano.Crypto.Hash.Class as Crypto
import qualified Cardano.Crypto.Hashing
import qualified Cardano.Ledger.Api as L
import qualified Cardano.Ledger.Block as Ledger
import qualified Cardano.Ledger.Era as Ledger
import qualified Cardano.Ledger.Core as Ledger
import Cardano.Slotting.Block (BlockNo)
import Cardano.Slotting.Slot (EpochNo, SlotNo, WithOrigin (..))
import qualified Ouroboros.Consensus.Block as Consensus
Expand Down
9 changes: 5 additions & 4 deletions cardano-api/internal/Cardano/Api/Certificate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ import Cardano.Api.StakePoolMetadata
import Cardano.Api.Utils (noInlineMaybeToStrictMaybe)
import Cardano.Api.Value

import qualified Cardano.Crypto.Hash as Hash
import Cardano.Ledger.BaseTypes (strictMaybe)
import qualified Cardano.Ledger.Coin as L
import qualified Cardano.Ledger.Keys as Ledger
Expand Down Expand Up @@ -362,7 +363,7 @@ makeStakePoolRetirementCertificate req =
ConwayCertificate atMostBab $
Ledger.mkRetirePoolTxCert (unStakePoolKeyHash poolId) retirementEpoch

data GenesisKeyDelegationRequirements ere where
data GenesisKeyDelegationRequirements era where
GenesisKeyDelegationRequirements
:: ShelleyToBabbageEra era
-> Hash GenesisKey
Expand All @@ -381,7 +382,7 @@ makeGenesisKeyDelegationCertificate
ShelleyRelatedCertificate atMostEra $
shelleyToBabbageEraConstraints atMostEra $
Ledger.ShelleyTxCertGenesisDeleg $
Ledger.GenesisDelegCert hGenKey hGenDelegKey hVrfKey
Ledger.GenesisDelegCert hGenKey hGenDelegKey (Ledger.VRFVerKeyHash . Hash.castHash $ hVrfKey)

data MirCertificateRequirements era where
MirCertificateRequirements
Expand Down Expand Up @@ -613,7 +614,7 @@ toShelleyPoolParams
-- do simple client-side sanity checks, e.g. on the pool metadata url
Ledger.PoolParams
{ Ledger.ppId = poolkh
, Ledger.ppVrf = vrfkh
, Ledger.ppVrf = Ledger.VRFVerKeyHash . Hash.castHash $ vrfkh
, Ledger.ppPledge = stakePoolPledge
, Ledger.ppCost = stakePoolCost
, Ledger.ppMargin =
Expand Down Expand Up @@ -685,7 +686,7 @@ fromShelleyPoolParams
} =
StakePoolParameters
{ stakePoolId = StakePoolKeyHash ppId
, stakePoolVRF = VrfKeyHash ppVrf
, stakePoolVRF = VrfKeyHash (Hash.castHash . Ledger.unVRFVerKeyHash $ ppVrf)
, stakePoolCost = ppCost
, stakePoolMargin = Ledger.unboundRational ppMargin
, stakePoolRewardAccount = fromShelleyStakeAddr ppRewardAccount
Expand Down
27 changes: 17 additions & 10 deletions cardano-api/internal/Cardano/Api/IPC.hs
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,15 @@ import qualified Ouroboros.Network.Protocol.LocalTxSubmission.Client as Net.Tx

import Control.Concurrent.STM (TMVar, atomically, newEmptyTMVarIO, putTMVar, takeTMVar,
tryPutTMVar)
import Control.Exception (throwIO)
import Control.Monad (void)
import Control.Monad.IO.Class
import Control.Tracer (nullTracer)
import Data.Aeson (ToJSON, object, toJSON, (.=))
import qualified Data.ByteString.Lazy as LBS
import Data.Void (Void)
import GHC.Exts (IsList (..))
import qualified Network.Mux as Net

-- ----------------------------------------------------------------------------
-- The types for the client side of the node-to-client IPC protocols
Expand Down Expand Up @@ -202,15 +204,19 @@ connectToLocalNodeWithVersion
, localConsensusModeParams
}
clients =
liftIO $ Net.withIOManager $ \iomgr ->
Net.connectTo
(Net.localSnocket iomgr)
Net.NetworkConnectTracers
{ Net.nctMuxTracer = nullTracer
, Net.nctHandshakeTracer = nullTracer
}
versionedProtocls
(unFile localNodeSocketPath)
liftIO $ Net.withIOManager $ \iomgr -> do
r <-
Net.connectTo
(Net.localSnocket iomgr)
Net.NetworkConnectTracers
{ Net.nctMuxTracer = nullTracer
, Net.nctHandshakeTracer = nullTracer
}
versionedProtocls
(unFile localNodeSocketPath)
case r of
Left e -> throwIO e
Right _ -> pure ()
where
versionedProtocls =
-- First convert from the mode-parametrised view of things to the
Expand Down Expand Up @@ -302,10 +308,11 @@ mkVersionedProtocols networkid ptcl unversionedClients =
)
, localStateQueryProtocol =
Net.InitiatorProtocolOnly $
Net.mkMiniProtocolCbFromPeer $
Net.mkMiniProtocolCbFromPeerSt $
const
( nullTracer
, cStateQueryCodec
, Net.Query.StateIdle
, maybe
Net.localStateQueryPeerNull
Net.Query.localStateQueryClientPeer
Expand Down
2 changes: 1 addition & 1 deletion cardano-api/internal/Cardano/Api/Keys/Praos.hs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ instance Key VrfKey where

verificationKeyHash :: VerificationKey VrfKey -> Hash VrfKey
verificationKeyHash (VrfVerificationKey vkey) =
VrfKeyHash (Shelley.hashVerKeyVRF vkey)
VrfKeyHash (Crypto.hashVerKeyVRF vkey)

instance SerialiseAsRawBytes (VerificationKey VrfKey) where
serialiseToRawBytes (VrfVerificationKey vk) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ toLedgerEventConway evt =
case govEvent of
Conway.GovNewProposals txid props ->
Just $ NewGovernanceProposals txid (AnyProposals props)
Conway.GovRemovedVotes txid replacedVotes unregisteredDReps ->
Just $ RemovedGovernanceVotes txid replacedVotes unregisteredDReps

instance ConvertLedgerEvent (HardForkBlock (Consensus.CardanoEras StandardCrypto)) where
toLedgerEvent wrappedLedgerEvent =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ data LedgerEvent

-- | Newly submittted governance proposals in a single transaction.
NewGovernanceProposals (Ledger.TxId StandardCrypto) AnyProposals
| -- | Governance votes that were invalidated.
RemovedGovernanceVotes
(Ledger.TxId StandardCrypto)
(Set (Ledger.Voter StandardCrypto, Ledger.GovActionId StandardCrypto))
-- ^ Votes that were replaced in this tx.
(Set (Ledger.Credential 'Ledger.DRepRole StandardCrypto))
-- ^ Any votes from these DReps in this or in previous txs are removed
| -- | The current state of governance matters at the epoch boundary.
-- I.E the current constitution, committee, protocol parameters, etc.
EpochBoundaryRatificationState AnyRatificationState
Expand Down
Loading
Loading