Skip to content

Commit a29ee68

Browse files
authored
Merge pull request IntersectMBO#5423 from input-output-hk/sl/bump-cli
cardano-node 8.2.1
2 parents 8163a92 + 767e629 commit a29ee68

File tree

11 files changed

+110
-75
lines changed

11 files changed

+110
-75
lines changed

bench/plutus-scripts-bench/plutus-scripts-bench.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ library
7272
-- IOG dependencies
7373
--------------------------
7474
build-depends:
75-
, cardano-api ^>= 8.8
75+
, cardano-api ^>= 8.12
7676
, plutus-ledger-api >=1.0.0
7777
, plutus-tx >=1.0.0
7878
, plutus-tx-plugin >=1.0.0

bench/tx-generator/tx-generator.cabal

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ library
9797
, attoparsec
9898
, base16-bytestring
9999
, bytestring
100-
, cardano-api ^>= 8.8
100+
, cardano-api ^>= 8.12
101101
, cardano-binary
102-
, cardano-cli ^>= 8.4
102+
, cardano-cli ^>= 8.5
103103
, cardano-crypto-class
104104
, cardano-crypto-wrapper
105105
, cardano-data
@@ -193,8 +193,8 @@ test-suite tx-generator-apitest
193193
, bytestring
194194
, filepath
195195
, optparse-applicative-fork
196-
, cardano-api ^>= 8.8
197-
, cardano-cli ^>= 8.4
196+
, cardano-api ^>= 8.12
197+
, cardano-cli ^>= 8.5
198198
, cardano-node
199199
, plutus-tx
200200
, transformers
@@ -209,8 +209,8 @@ test-suite tx-generator-apitest
209209
, bytestring
210210
, filepath
211211
, optparse-applicative-fork
212-
, cardano-api ^>= 8.8
213-
, cardano-cli ^>= 8.4
212+
, cardano-api ^>= 8.12
213+
, cardano-cli ^>= 8.5
214214
, cardano-node
215215
, transformers
216216
, transformers-except

cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repository cardano-haskell-packages
1414
-- you need to run if you change them
1515
index-state:
1616
, hackage.haskell.org 2023-07-27T21:50:17Z
17-
, cardano-haskell-packages 2023-07-27T18:37:22Z
17+
, cardano-haskell-packages 2023-08-06T03:00:00Z
1818

1919
packages:
2020
cardano-client-demo

cardano-client-demo/StakeCredentialHistory.hs

Lines changed: 78 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{-# LANGUAGE BangPatterns #-}
22
{-# LANGUAGE DataKinds #-}
33
{-# LANGUAGE FlexibleContexts #-}
4+
{-# LANGUAGE GADTs #-}
45
{-# LANGUAGE LambdaCase #-}
56
{-# LANGUAGE OverloadedStrings #-}
67
{-# LANGUAGE ScopedTypeVariables #-}
@@ -15,11 +16,14 @@ import Cardano.Ledger.Compactible (Compactible (..))
1516
import qualified Cardano.Ledger.Core as LC
1617
import Cardano.Ledger.Crypto (StandardCrypto)
1718
import qualified Cardano.Ledger.Shelley.API as L
19+
import qualified Cardano.Ledger.Shelley.API as Shelley
1820
import qualified Cardano.Ledger.Shelley.Rewards as L
1921
import qualified Cardano.Ledger.Shelley.RewardUpdate as L
2022
import qualified Cardano.Ledger.UMap as UM
2123
import qualified Ouroboros.Consensus.Shelley.Ledger as Shelley
2224

25+
import qualified Cardano.Api.Ledger as L
26+
import qualified Cardano.Ledger.Coin as L
2327
import qualified Codec.Binary.Bech32 as Bech32
2428
import Control.Monad.Trans.Except (runExceptT)
2529
import Control.Monad.Trans.Fail.String
@@ -254,7 +258,7 @@ main = do
254258
_
255259
(BlockInMode
256260
(Block (BlockHeader slotNo _blockHeaderHash (BlockNo _blockNoI)) transactions)
257-
_era)
261+
eim)
258262
state -> do
259263
let getGoSnapshot = L.unStake . L.ssStake . L.ssStakeGo . L.esSnapshots . L.nesEs
260264
getBalances = UM.rewardMap
@@ -286,8 +290,8 @@ main = do
286290
("conway", L.nesEL ls, Just (L.nesRu ls, getGoSnapshot ls, getBalances ls, getPV ls))
287291

288292
let txBodyComponents = map ( (\(TxBody txbc) -> txbc) . getTxBody ) transactions
289-
290-
mapM_ (delegationEvents targetCredAsAPI epochNo slotNo) txBodyComponents
293+
let sbe'm = shelleyBasedEraFromEraInMode eim
294+
mapM_ (delegationEvents sbe'm targetCredAsAPI epochNo slotNo) txBodyComponents
291295
mapM_ (withdrawalEvents targetCredAsAPI epochNo slotNo) txBodyComponents
292296

293297
lastcheck <- displayCheckpoint slotNo (lastCheckpoint state) (checkpoint args)
@@ -315,7 +319,6 @@ main = do
315319

316320
return ()
317321
where
318-
319322
-- CheckPoints --
320323
displayCheckpoint :: SlotNo -> SlotNo -> CheckPoint -> IO SlotNo
321324
displayCheckpoint _ lastcheck CheckPointOff = return lastcheck
@@ -337,31 +340,64 @@ main = do
337340
else return pvLast
338341

339342
-- Delegation Events --
340-
delegationEvents :: StakeCredential -> EpochNo -> SlotNo -> TxBodyContent ViewTx era -> IO ()
341-
delegationEvents t epochNo slotNo txbc = case txCertificates txbc of
342-
TxCertificatesNone -> return ()
343-
TxCertificates _ cs _ -> mapM_ msg $ mapMaybe (targetedCert t epochNo slotNo) cs
344-
345-
targetedCert :: StakeCredential -> EpochNo -> SlotNo -> Certificate era -> Maybe (Event c)
346-
targetedCert t epochNo slotNo = \case
347-
StakeAddressRegistrationCertificate cred ->
348-
if t == cred then Just (StakeRegistrationEvent epochNo slotNo) else Nothing
349-
StakeAddressDeregistrationCertificate cred ->
350-
if t == cred then Just (StakeDeRegistrationEvent epochNo slotNo) else Nothing
351-
StakeAddressPoolDelegationCertificate cred pool ->
352-
if t == cred then Just (DelegationEvent slotNo pool) else Nothing
353-
StakePoolRegistrationCertificate pool ->
354-
inPoolCert t slotNo pool
355-
StakePoolRetirementCertificate _ _ -> Nothing
356-
GenesisKeyDelegationCertificate {} -> Nothing
357-
MIRCertificate pot (StakeAddressesMIR mir) ->
358-
inMir t epochNo slotNo mir pot
359-
MIRCertificate _ (SendToReservesMIR _) -> Nothing
360-
MIRCertificate _ (SendToTreasuryMIR _) -> Nothing
361-
362-
-- TODO CIP-1694 These are also delegation events. Should there be new events for these?
363-
CommitteeDelegationCertificate _ _ -> Nothing
364-
CommitteeHotKeyDeregistrationCertificate _ -> Nothing
343+
delegationEvents :: Maybe (ShelleyBasedEra era) -> StakeCredential -> EpochNo -> SlotNo -> TxBodyContent ViewTx era -> IO ()
344+
delegationEvents sbe'm t epochNo slotNo txbc = do
345+
case (txCertificates txbc, sbe'm) of
346+
(TxCertificates _ cs _, Just sbe) -> mapM_ msg $ mapMaybe (targetedCert sbe t epochNo slotNo) cs
347+
(_, _) -> return ()
348+
349+
targetedCert :: ShelleyBasedEra era -> StakeCredential -> EpochNo -> SlotNo -> Certificate era -> Maybe (Event c)
350+
targetedCert sbe t epochNo slotNo = shelleyBasedEraConstraints sbe $ \case
351+
ShelleyRelatedCertificate _ c ->
352+
case c of
353+
L.ShelleyTxCertDelegCert (L.ShelleyRegCert cred) ->
354+
if t == fromShelleyStakeCredential cred then Just (StakeRegistrationEvent epochNo slotNo) else Nothing
355+
L.ShelleyTxCertDelegCert (L.ShelleyUnRegCert cred) ->
356+
if t == fromShelleyStakeCredential cred then Just (StakeDeRegistrationEvent epochNo slotNo) else Nothing
357+
L.ShelleyTxCertDelegCert (L.ShelleyDelegCert cred poolId) ->
358+
if t == fromShelleyStakeCredential cred then Just (DelegationEvent slotNo (StakePoolKeyHash poolId)) else Nothing
359+
L.ShelleyTxCertPool (L.RetirePool _poolId _retirementEpoch) ->
360+
Nothing
361+
L.ShelleyTxCertPool (L.RegPool poolParams) ->
362+
inPoolCert t slotNo (fromShelleyPoolParams poolParams)
363+
L.ShelleyTxCertGenesisDeleg (L.GenesisDelegCert _genesisKeyHash _delegateKeyHash _vrfKeyHash) ->
364+
Nothing
365+
L.ShelleyTxCertMir (L.MIRCert pot (L.StakeAddressesMIR mir)) -> do
366+
let addrs = flip map (Map.assocs mir) $ \(cred, L.DeltaCoin coin) -> (fromShelleyStakeCredential cred, Lovelace coin)
367+
inMir t epochNo slotNo addrs pot
368+
L.ShelleyTxCertMir (L.MIRCert _pot (L.SendToOppositePotMIR _coin)) -> do
369+
Nothing -- TODO: unsure if Nothing
370+
371+
-- TODO: Any events for ConwayCertificates?
372+
ConwayCertificate w cert ->
373+
conwayEraOnwardsConstraints w $
374+
case cert of
375+
L.RegDRepTxCert _credential _coin ->
376+
Nothing
377+
L.UnRegDRepTxCert _credential _coin ->
378+
Nothing
379+
L.AuthCommitteeHotKeyTxCert (Shelley.KeyHash _coldKey) (Shelley.KeyHash _hotKey) ->
380+
Nothing
381+
L.ResignCommitteeColdTxCert (Shelley.KeyHash _coldKey) ->
382+
Nothing
383+
L.RegTxCert _stakeCredential ->
384+
Nothing
385+
L.UnRegTxCert _stakeCredential ->
386+
Nothing
387+
L.RegDepositTxCert _stakeCredential _deposit ->
388+
Nothing
389+
L.UnRegDepositTxCert _stakeCredential _refund ->
390+
Nothing
391+
L.DelegTxCert _stakeCredential _delegatee ->
392+
Nothing
393+
L.RegDepositDelegTxCert _stakeCredential _delegatee _deposit ->
394+
Nothing
395+
L.RegPoolTxCert _poolParams ->
396+
Nothing
397+
L.RetirePoolTxCert (Shelley.KeyHash _kh) _epoch ->
398+
Nothing
399+
L.DelegStakeTxCert _stakeCredential (Shelley.KeyHash _kh) ->
400+
Nothing
365401

366402
stakeCredentialFromStakeAddress (StakeAddress _ cred) = fromShelleyStakeCredential cred
367403

@@ -412,3 +448,16 @@ main = do
412448
-- Reward Calculation End Event --
413449
rewardEndEvent epochLast epochCurrent slot rs t =
414450
epochEvent epochLast epochCurrent slot rs t RewardEndEvent
451+
452+
shelleyBasedEraFromEraInMode :: EraInMode era mode -> Maybe (ShelleyBasedEra era)
453+
shelleyBasedEraFromEraInMode = \case
454+
ByronEraInByronMode -> Nothing
455+
ByronEraInCardanoMode -> Nothing
456+
ShelleyEraInCardanoMode -> Just ShelleyBasedEraShelley
457+
ShelleyEraInShelleyMode -> Just ShelleyBasedEraShelley
458+
AllegraEraInCardanoMode -> Just ShelleyBasedEraAllegra
459+
MaryEraInCardanoMode -> Just ShelleyBasedEraMary
460+
AlonzoEraInCardanoMode -> Just ShelleyBasedEraAlonzo
461+
BabbageEraInCardanoMode -> Just ShelleyBasedEraBabbage
462+
ConwayEraInCardanoMode -> Just ShelleyBasedEraConway
463+

cardano-node-chairman/cardano-node-chairman.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,5 @@ test-suite chairman-tests
8888
ghc-options: -threaded -rtsopts -with-rtsopts=-N -with-rtsopts=-T
8989

9090
build-tool-depends: cardano-node:cardano-node
91-
, cardano-cli:cardano-cli ^>= 8.3
91+
, cardano-cli:cardano-cli ^>= 8.5
9292
, cardano-node-chairman:cardano-node-chairman

cardano-node/ChangeLog.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Changelog for cardano-node
22

3-
# 8.2.0 -- July 2023
3+
## 8.2.1 -- August 2023
4+
5+
- prevent SIGHUP from killing node during ledger replay
6+
- upgrade cardano-cli to 8.4.1.0
7+
- upgrade cardano-api to 8.10.2.0
8+
9+
10+
## 8.2.0 -- July 2023
411

512
### node changes
613

cardano-node/cardano-node.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cabal-version: 3.0
22

33
name: cardano-node
4-
version: 8.2.0
4+
version: 8.2.1
55
synopsis: The cardano full node
66
description: The cardano full node.
77
category: Cardano,
@@ -137,7 +137,7 @@ library
137137
, async
138138
, base16-bytestring
139139
, bytestring
140-
, cardano-api ^>= 8.8
140+
, cardano-api ^>= 8.12
141141
, cardano-crypto-class
142142
, cardano-crypto-wrapper
143143
, cardano-git-rev
@@ -235,7 +235,7 @@ test-suite cardano-node-test
235235
, aeson >= 1.5.6.0
236236
, bytestring
237237
, cardano-crypto-class
238-
, cardano-api ^>= 8.8
238+
, cardano-api ^>= 8.12
239239
, cardano-ledger-core
240240
, cardano-node
241241
, cardano-slotting >= 0.1

cardano-node/src/Cardano/Tracing/OrphanInstances/Common.hs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,9 @@ module Cardano.Tracing.OrphanInstances.Common
4040
) where
4141

4242
import Data.Aeson hiding (Value)
43-
import qualified Data.ByteString.Base16 as B16
44-
import qualified Data.ByteString.Short as SBS
4543
import Data.Scientific (coefficient)
4644
import Data.Text (Text)
4745
import qualified Data.Text as Text
48-
import qualified Data.Text.Encoding as Text
4946
import Data.Void (Void)
5047
import Network.Socket (PortNumber)
5148
import Text.Read (readMaybe)
@@ -59,9 +56,6 @@ import Cardano.BM.Tracing (HasPrivacyAnnotation (..), HasSeverityAnnot
5956
Severity (..), ToObject (..), Tracer (..), TracingVerbosity (..),
6057
Transformable (..))
6158
import Cardano.Node.Handlers.Shutdown ()
62-
import Ouroboros.Consensus.Byron.Ledger.Block (ByronHash (..))
63-
import Ouroboros.Consensus.HardFork.Combinator (OneEraHash (..))
64-
import Ouroboros.Network.Block (HeaderHash, Tip (..))
6559
-- | A bit of a weird one, but needed because some of the very general
6660
-- consensus interfaces are sometimes instantiated to 'Void', when there are
6761
-- no cases needed.
@@ -88,21 +82,6 @@ instance FromJSON PortNumber where
8882
parseJSON invalid = fail $ "Parsing of port number failed due to type mismatch. "
8983
<> "Encountered: " <> show invalid
9084

91-
instance ToJSON (HeaderHash blk) => ToJSON (Tip blk) where
92-
toJSON TipGenesis = object [ "genesis" .= True ]
93-
toJSON (Tip slotNo headerHash blockNo) =
94-
object
95-
[ "slotNo" .= slotNo
96-
, "headerHash" .= headerHash
97-
, "blockNo" .= blockNo
98-
]
99-
100-
instance ToJSON (OneEraHash xs) where
101-
toJSON (OneEraHash bs) =
102-
toJSON . Text.decodeLatin1 . B16.encode . SBS.fromShort $ bs
103-
104-
deriving newtype instance ToJSON ByronHash
105-
10685
instance HasPrivacyAnnotation ResourceStats
10786
instance HasSeverityAnnotation ResourceStats where
10887
getSeverityAnnotation _ = Info

cardano-submit-api/cardano-submit-api.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ library
3939
, aeson
4040
, async
4141
, bytestring
42-
, cardano-api ^>= 8.8
42+
, cardano-api ^>= 8.12
4343
, cardano-binary
44-
, cardano-cli ^>= 8.4
44+
, cardano-cli ^>= 8.5
4545
, cardano-crypto-class ^>= 2.1
4646
, cardano-ledger-byron ^>= 1.0
4747
, formatting
@@ -86,7 +86,7 @@ executable cardano-submit-api
8686
ghc-options: -threaded -rtsopts "-with-rtsopts=-T -I0"
8787
build-depends: base
8888
, optparse-applicative-fork
89-
, cardano-cli ^>= 8.4
89+
, cardano-cli ^>= 8.5
9090
, cardano-crypto-class ^>= 2.1
9191
, cardano-submit-api
9292

cardano-testnet/cardano-testnet.cabal

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ library
3434
build-depends: aeson
3535
, ansi-terminal
3636
, bytestring
37-
, cardano-api ^>= 8.8
38-
, cardano-cli ^>= 8.4
37+
, cardano-api ^>= 8.12
38+
, cardano-cli ^>= 8.5
3939
, cardano-crypto-class
4040
, cardano-crypto-wrapper
4141
, cardano-ledger-alonzo
@@ -150,7 +150,7 @@ test-suite cardano-testnet-golden
150150
ghc-options: -threaded -rtsopts -with-rtsopts=-N -with-rtsopts=-T
151151

152152
build-tool-depends: cardano-node:cardano-node
153-
, cardano-cli:cardano-cli ^>= 8.4
153+
, cardano-cli:cardano-cli ^>= 8.5
154154
, cardano-submit-api:cardano-submit-api
155155
, cardano-testnet:cardano-testnet
156156

@@ -176,8 +176,8 @@ test-suite cardano-testnet-test
176176
build-depends: aeson
177177
, async
178178
, bytestring
179-
, cardano-api ^>= 8.8
180-
, cardano-cli ^>= 8.4
179+
, cardano-api ^>= 8.12
180+
, cardano-cli ^>= 8.5
181181
, cardano-crypto-class
182182
, cardano-testnet
183183
, containers
@@ -194,6 +194,6 @@ test-suite cardano-testnet-test
194194
ghc-options: -threaded -rtsopts -with-rtsopts=-N -with-rtsopts=-T
195195

196196
build-tool-depends: cardano-node:cardano-node
197-
, cardano-cli:cardano-cli ^>= 8.4
197+
, cardano-cli:cardano-cli ^>= 8.5
198198
, cardano-submit-api:cardano-submit-api
199199
, cardano-testnet:cardano-testnet

0 commit comments

Comments
 (0)