Skip to content

Commit

Permalink
Merge pull request #789 from IntersectMBO/jordan/bump-in-preparation-…
Browse files Browse the repository at this point in the history
…cardano-node-8.12

Dependency update for the Cardano Node 8.12 release
  • Loading branch information
disassembler authored Jun 19, 2024
2 parents fccfd72 + 478f9f5 commit 0d750dd
Show file tree
Hide file tree
Showing 19 changed files with 136 additions and 94 deletions.
11 changes: 6 additions & 5 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-06-12T10:10:17Z
, cardano-haskell-packages 2024-06-12T10:10:17Z
, hackage.haskell.org 2024-06-17T19:25:27Z
, cardano-haskell-packages 2024-06-19T14:54:52Z

packages:
cardano-cli
Expand All @@ -31,9 +31,10 @@ package bitvec
-- Workaround for windows cross-compilation
flags: -simd

constraints:
-- io-classes-mtl-0.1.2.0 is not buildable
io-classes-mtl < 0.1.2.0
extra-packages: Cabal
if os(windows)
constraints: time ^>=1.14
allow-newer: *:time

tests: True

Expand Down
12 changes: 6 additions & 6 deletions cardano-cli/cardano-cli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ library
, binary
, bytestring
, canonical-json
, cardano-api ^>= 8.47.0.0
, cardano-api ^>= 8.48
, cardano-binary
, cardano-crypto
, cardano-crypto-class ^>= 2.1.2
Expand Down Expand Up @@ -234,12 +234,12 @@ library
, microlens
, network
, optparse-applicative-fork
, ouroboros-consensus >= 0.17
, ouroboros-consensus ^>= 0.19
-- TODO: bump consensus back
, ouroboros-consensus-cardano >= 0.15
, ouroboros-consensus-protocol >= 0.9
, ouroboros-network-api
, ouroboros-network-protocols ^>=0.8
, ouroboros-consensus-cardano ^>= 0.17
, ouroboros-consensus-protocol ^>= 0.9.0.1
, ouroboros-network-api ^>= 0.7.3
, ouroboros-network-protocols
, parsec
, prettyprinter
, prettyprinter-ansi-terminal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ data GovernanceActionUpdateCommitteeCmdArgs era
, oldCommitteeVkeySource :: ![VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
, newCommitteeVkeySource :: ![(VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey, EpochNo)]
, requiredThreshold :: !Rational
, mPrevGovernanceActionId :: !(Maybe (TxId, Word32))
, mPrevGovernanceActionId :: !(Maybe (TxId, Word16))
, outFile :: !(File () Out)
} deriving Show

Expand All @@ -64,7 +64,7 @@ data GovernanceActionCreateConstitutionCmdArgs era
, networkId :: !L.Network
, deposit :: !L.Coin
, stakeCredential :: !StakeIdentifier
, mPrevGovernanceActionId :: !(Maybe (TxId, Word32))
, mPrevGovernanceActionId :: !(Maybe (TxId, Word16))
, proposalUrl :: !ProposalUrl
, proposalHash :: !(L.SafeHash L.StandardCrypto L.AnchorData)
, constitutionUrl :: !ConstitutionUrl
Expand Down Expand Up @@ -93,7 +93,7 @@ data GovernanceActionCreateNoConfidenceCmdArgs era
, returnStakeAddress :: !StakeIdentifier
, proposalUrl :: !ProposalUrl
, proposalHash :: !(L.SafeHash L.StandardCrypto L.AnchorData)
, mPrevGovernanceActionId :: !(Maybe (TxId, Word32))
, mPrevGovernanceActionId :: !(Maybe (TxId, Word16))
, outFile :: !(File () Out)
} deriving Show

Expand Down Expand Up @@ -133,7 +133,7 @@ data GovernanceActionHardforkInitCmdArgs era
, networkId :: !L.Network
, deposit :: !L.Coin
, returnStakeAddress :: !StakeIdentifier
, mPrevGovernanceActionId :: !(Maybe (TxId, Word32))
, mPrevGovernanceActionId :: !(Maybe (TxId, Word16))
, proposalUrl :: !ProposalUrl
, proposalHash :: !(L.SafeHash L.StandardCrypto L.AnchorData)
, protVer :: !L.ProtVer
Expand All @@ -156,7 +156,7 @@ data UpdateProtocolParametersConwayOnwards era
, returnAddr :: !StakeIdentifier
, proposalUrl :: !ProposalUrl
, proposalHash :: !(L.SafeHash L.StandardCrypto L.AnchorData)
, governanceActionId :: !(Maybe (TxId, Word32))
, governanceActionId :: !(Maybe (TxId, Word16))
, constitutionScriptHash :: !(Maybe ScriptHash)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ data GovernanceVoteCreateCmdArgs era
= GovernanceVoteCreateCmdArgs
{ eon :: ConwayEraOnwards era
, voteChoice :: Vote
, governanceAction :: (TxId, Word32)
, governanceAction :: (TxId, Word16)
, votingStakeCredentialSource :: AnyVotingStakeVerificationKeyOrHashOrFile
, mAnchor :: Maybe (VoteUrl, L.SafeHash L.StandardCrypto L.AnchorData)
, outFile :: VoteFile Out
Expand Down
14 changes: 7 additions & 7 deletions cardano-cli/src/Cardano/CLI/EraBased/Options/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3284,21 +3284,21 @@ pAnchorDataHash =
, Opt.help "Proposal anchor data hash (obtain it with \"cardano-cli conway governance hash anchor-data ...\")"
]

pPreviousGovernanceAction :: Parser (Maybe (TxId, Word32))
pPreviousGovernanceAction :: Parser (Maybe (TxId, Word16))
pPreviousGovernanceAction = optional $
(,) <$> pTxId "prev-governance-action-tx-id" "Txid of the previous governance action."
<*> pWord32 "prev-governance-action-index" "Action index of the previous governance action."
<*> pWord16 "prev-governance-action-index" "Action index of the previous governance action."

pGovernanceActionId :: Parser (TxId, Word32)
pGovernanceActionId :: Parser (TxId, Word16)
pGovernanceActionId =
(,) <$> pTxId "governance-action-tx-id" "Txid of the governance action."
<*> pWord32 "governance-action-index" "Tx's governance action index."
<*> pWord16 "governance-action-index" "Tx's governance action index."

pWord32 :: String -> String -> Parser Word32
pWord32 l h =
pWord16 :: String -> String -> Parser Word16
pWord16 l h =
Opt.option auto $ mconcat
[ Opt.long l
, Opt.metavar "WORD32"
, Opt.metavar "WORD16"
, Opt.help h
]

Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/Read.hs
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ instance Error CostModelsError where
CostModelsErrorReadFile e ->
"Cannot read cost model: " <> prettyError e
CostModelsErrorJSONDecode fp err ->
"Error decoding JSON cost model at " <> pshow fp <> ": " <> pshow err <> formatExplanation
"Error decoding JSON cost model at " <> pshow fp <> ": " <> pretty err <> formatExplanation
CostModelsErrorEmpty fp ->
"The decoded cost model was empty at: " <> pshow fp <> formatExplanation
where
Expand Down
15 changes: 3 additions & 12 deletions cardano-cli/src/Cardano/CLI/Types/Governance.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,13 @@ module Cardano.CLI.Types.Governance where
import Cardano.Api
import Cardano.Api.Shelley

import Cardano.CLI.Types.Key (DRepHashSource, VerificationKeyOrFile,
VerificationKeyOrHashOrFile, VerificationKeyOrHashOrFileOrScriptHash)
import Cardano.CLI.Types.Key (DRepHashSource, VerificationKeyOrHashOrFile,
VerificationKeyOrHashOrFileOrScriptHash)

import Data.Word

data ConwayVote
type VoteFile = File ConwayVote

data ConwayVote
= ConwayVote
{ cvVoteChoice :: Vote
, cvVoterType :: VType
, cvGovActionId :: (TxId, Word32)
, cvVotingStakeCredential :: VerificationKeyOrFile StakePoolKey
, cvEra :: AnyShelleyBasedEra
, cvFilepath :: VoteFile Out
} deriving Show

-- Vote type -- TODO: Conway era - remove me
data VType = VCC -- committee
Expand Down
30 changes: 21 additions & 9 deletions cardano-cli/src/Cardano/CLI/Types/Output.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import qualified Data.List as List
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map
import Data.Text (Text)
import qualified Data.Text as Text
import Data.Time.Clock (UTCTime)
import Data.Word

Expand Down Expand Up @@ -261,7 +262,10 @@ instance ToJSON ScriptCostOutput where
data PlutusScriptCostError
= PlutusScriptCostErrPlutusScriptNotFound ScriptWitnessIndex
| PlutusScriptCostErrExecError ScriptWitnessIndex (Maybe ScriptHash) ScriptExecutionError
| PlutusScriptCostErrRationalExceedsBound L.Prices ExecutionUnits
| PlutusScriptCostErrRationalExceedsBound
[Text] -- ^ Execution logs
L.Prices
ExecutionUnits
| PlutusScriptCostErrRefInputNoScript TxIn
| PlutusScriptCostErrRefInputNotInUTxO TxIn
deriving Show
Expand All @@ -274,9 +278,17 @@ instance Error PlutusScriptCostError where
PlutusScriptCostErrExecError sWitIndex sHash sExecErro ->
"Plutus script at: " <> pshow sWitIndex <> " with hash: " <> pshow sHash <>
" errored with: " <> prettyError sExecErro
PlutusScriptCostErrRationalExceedsBound eUnitPrices eUnits ->
"Either the execution unit prices: " <> pshow eUnitPrices <> " or the execution units: " <>
pshow eUnits <> " or both are either too precise or not within bounds"
PlutusScriptCostErrRationalExceedsBound executionLogs eUnitPrices eUnits ->
let firstLine = mconcat [ "Either the execution unit prices: "
, pshow eUnitPrices
, " or the execution units: "
, pshow eUnits
, " or both are either too precise or not within bounds"
]
in vsep [ firstLine
, "Execution logs: " <> pretty (Text.unlines executionLogs)
]

PlutusScriptCostErrRefInputNoScript txin ->
"No reference script found at input: " <> pretty (renderTxIn txin)
PlutusScriptCostErrRefInputNotInUTxO txin ->
Expand All @@ -289,7 +301,7 @@ renderScriptCosts
-- ^ Initial mapping of script witness index to actual script.
-- We need this in order to know which script corresponds to the
-- calculated execution units.
-> Map ScriptWitnessIndex (Either ScriptExecutionError ExecutionUnits)
-> Map ScriptWitnessIndex (Either ScriptExecutionError ([Text], ExecutionUnits))
-- ^ Post execution cost calculation mapping of script witness
-- index to execution units.
-> Either PlutusScriptCostError [ScriptCostOutput]
Expand All @@ -302,13 +314,13 @@ renderScriptCosts (UTxO utxo) eUnitPrices scriptMapping executionCostMapping =
Just (AnyScriptWitness (PlutusScriptWitness _ pVer (PScript pScript) _ _ _)) -> do
let scriptHash = hashScript $ PlutusScript pVer pScript
case eExecUnits of
Right execUnits ->
Right (logs, execUnits) ->
case calculateExecutionUnitsLovelace eUnitPrices execUnits of
Just llCost ->
Right (ScriptCostOutput scriptHash execUnits llCost)
: accum
Nothing ->
Left (PlutusScriptCostErrRationalExceedsBound eUnitPrices execUnits)
Left (PlutusScriptCostErrRationalExceedsBound logs eUnitPrices execUnits)
: accum
Left err -> Left (PlutusScriptCostErrExecError sWitInd (Just scriptHash) err) : accum
-- TODO: Create a new sum type to encapsulate the fact that we can also
Expand All @@ -321,13 +333,13 @@ renderScriptCosts (UTxO utxo) eUnitPrices scriptMapping executionCostMapping =
ReferenceScriptNone -> Left (PlutusScriptCostErrRefInputNoScript refTxIn) : accum
ReferenceScript _ (ScriptInAnyLang _ script) ->
case eExecUnits of
Right execUnits ->
Right (logs, execUnits) ->
case calculateExecutionUnitsLovelace eUnitPrices execUnits of
Just llCost ->
Right (ScriptCostOutput (hashScript script) execUnits llCost)
: accum
Nothing ->
Left (PlutusScriptCostErrRationalExceedsBound eUnitPrices execUnits)
Left (PlutusScriptCostErrRationalExceedsBound logs eUnitPrices execUnits)
: accum
Left err -> Left (PlutusScriptCostErrExecError sWitInd Nothing err) : accum

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Error decoding JSON cost model at "some/file.txt": "some error"
Error decoding JSON cost model at "some/file.txt": some error
The expected format of the cost models file is
{
"PlutusV1" : <costModel>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "Governance proposal",
"description": "Update protocol parameters proposal",
"cborHex": "84193039581de18f4a3466a404c11eb410313015b88e447d81b60089e25f611600e6058400f6a3031904d212a3009f1a000302590001011a00060bc719026d00011a000249f01903e800011a000249f018201a0025cea81971f70419744d186419744d186419744d186419744d186419744d186419744d18641864186419744d18641a000249f018201a000249f018201a000249f018201a000249f01903e800011a000249f018201a000249f01903e800081a000242201a00067e2318760001011a000249f01903e800081a000249f01a0001b79818f7011a000249f0192710011a0002155e19052e011903e81a000249f01903e8011a000249f018201a000249f018201a000249f0182001011a000249f0011a000249f0041a000194af18f8011a000194af18f8011a0002377c190556011a0002bdea1901f1011a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000242201a00067e23187600010119f04c192bd200011a000249f018201a000242201a00067e2318760001011a000242201a00067e2318760001011a0025cea81971f707001a000141bb041a000249f019138800011a000249f018201a000302590001011a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a00330da70101ff019f1a0003236119032c01011903e819023b00011903e8195e7104011903e818201a0001ca761928eb041959d818641959d818641959d818641959d818641959d818641959d81864186418641959d81864194c5118201a0002acfa182019b551041a000363151901ff00011a00015c3518201a000797751936f404021a0002ff941a0006ea7818dc0001011903e8196ff604021a0003bd081a00034ec5183e011a00102e0f19312a011a00032e801901a5011a0002da781903e819cf06011a00013a34182019a8f118201903e818201a00013aac0119e143041903e80a1a00030219189c011a00030219189c011a0003207c1901d9011a000330001901ff0119ccf3182019fd40182019ffd5182019581e18201940b318201a00012adf18201a0002ff941a0006ea7818dc0001011a00010f92192da7000119eabb18201a0002ff941a0006ea7818dc0001011a0002ff941a0006ea7818dc0001011a0011b22c1a0005fdde00021a000c504e197712041a001d6af61a0001425b041a00040c660004001a00014fab18201a0003236119032c010119a0de18201a00033d7618201979f41820197fb8182019a95d1820197df718201995aa18201a0223accc0a1a009063b91903fd0a1a02515e841980b30aff029f0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101ff181e1a075bc371f6826b6578616d706c652e636f6d5820c7ddb5b493faa4d3d2d679847740bdce0c5d358d56f9b1470ca67f5652a02745"
"cborHex": "84193039581de18f4a3466a404c11eb410313015b88e447d81b60089e25f611600e6058400f6a3031904d212a3009f1a000302590001011a00060bc719026d00011a000249f01903e800011a000249f018201a0025cea81971f70419744d186419744d186419744d186419744d186419744d186419744d18641864186419744d18641a000249f018201a000249f018201a000249f018201a000249f01903e800011a000249f018201a000249f01903e800081a000242201a00067e2318760001011a000249f01903e800081a000249f01a0001b79818f7011a000249f0192710011a0002155e19052e011903e81a000249f01903e8011a000249f018201a000249f018201a000249f0182001011a000249f0011a000249f0041a000194af18f8011a000194af18f8011a0002377c190556011a0002bdea1901f1011a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000242201a00067e23187600010119f04c192bd200011a000249f018201a000242201a00067e2318760001011a000242201a00067e2318760001011a0025cea81971f707001a000141bb041a000249f019138800011a000249f018201a000302590001011a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a00330da70101ff019f1a0003236119032c01011903e819023b00011903e8195e7104011903e818201a0001ca761928eb041959d818641959d818641959d818641959d818641959d818641959d81864186418641959d81864194c5118201a0002acfa182019b551041a000363151901ff00011a00015c3518201a000797751936f404021a0002ff941a0006ea7818dc0001011903e8196ff604021a0003bd081a00034ec5183e011a00102e0f19312a011a00032e801901a5011a0002da781903e819cf06011a00013a34182019a8f118201903e818201a00013aac0119e143041903e80a1a00030219189c011a00030219189c011a0003207c1901d9011a000330001901ff0119ccf3182019fd40182019ffd5182019581e18201940b318201a00012adf18201a0002ff941a0006ea7818dc0001011a00010f92192da7000119eabb18201a0002ff941a0006ea7818dc0001011a0002ff941a0006ea7818dc0001011a0011b22c1a0005fdde00021a000c504e197712041a001d6af61a0001425b041a00040c660004001a00014fab18201a0003236119032c010119a0de18201a00033d7618201979f41820197fb8182019a95d1820197df718201995aa18201a0223accc0a1a009063b91903fd0a1a02515e841980b30a01010101010101010101ff029f0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101ff181e1a075bc371f6826b6578616d706c652e636f6d5820c7ddb5b493faa4d3d2d679847740bdce0c5d358d56f9b1470ca67f5652a02745"
}
Loading

0 comments on commit 0d750dd

Please sign in to comment.