Skip to content

Commit d4595e6

Browse files
committed
Do not use Serialised in LedgerPeerSnapshot
1 parent a894d00 commit d4595e6

File tree

3 files changed

+11
-39
lines changed

3 files changed

+11
-39
lines changed

cabal.project

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,12 @@ constraints:
7878
source-repository-package
7979
type: git
8080
location: https://github.com/IntersectMBO/cardano-api
81-
tag: 076f7e966ec1d6457b1b9ec5ceee0f9e598fed12
82-
--sha256: sha256-XmuQTZdD/ZdCNlRuD+V5cNslEM05xwTACmMunzuCCJY=
81+
tag: 79b751a77ef2a4ecda563b6ec1855c7ef4653046
82+
--sha256: sha256-pb6eF52jUXvCCdY6hg80Z16E8FpNVfDR1eQMKeZxH4E=
8383
subdir:
8484
cardano-api
8585

8686

87-
8887
source-repository-package
8988
type: git
9089
location: https://github.com/IntersectMBO/ouroboros-consensus
@@ -127,4 +126,4 @@ source-repository-package
127126
libs/non-integral
128127
libs/set-algebra
129128
libs/small-steps
130-
libs/vector-map
129+
libs/vector-map

cardano-cli/cardano-cli.cabal

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,11 @@ library
278278
network,
279279
network-uri,
280280
optparse-applicative-fork,
281-
ouroboros-consensus,
282281
ouroboros-consensus-cardano,
283282
prettyprinter,
284283
prettyprinter-ansi-terminal,
285284
random,
286285
rio,
287-
sop-extras,
288286
split,
289287
io-classes:strict-stm,
290288
text,

cardano-cli/src/Cardano/CLI/EraBased/Query/Run.hs

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ import Cardano.Ledger.Conway.State (ChainAccountState (..))
6868
import Cardano.Slotting.EpochInfo (EpochInfo (..), epochInfoSlotToUTCTime, hoistEpochInfo)
6969
import Cardano.Slotting.Time (RelativeTime (..), toRelativeTime)
7070
import Ouroboros.Consensus.Cardano.Block as Consensus
71-
import Ouroboros.Consensus.HardFork.Combinator.NetworkVersion
72-
import Ouroboros.Consensus.Node.NetworkProtocolVersion
73-
import Ouroboros.Consensus.Shelley.Ledger.NetworkProtocolVersion
7471

7572
import RIO hiding (toList)
7673

@@ -82,7 +79,6 @@ import Data.ByteString.Lazy.Char8 qualified as LBS
8279
import Data.Coerce (coerce)
8380
import Data.List qualified as List
8481
import Data.Map.Strict qualified as Map
85-
import Data.SOP.Index
8682
import Data.Sequence qualified as Seq
8783
import Data.Set qualified as Set
8884
import Data.Text qualified as Text
@@ -878,7 +874,7 @@ runQueryLedgerPeerSnapshot
878874
} = do
879875
result <-
880876
fromEitherIOCli
881-
( executeLocalStateQueryExprWithVersion nodeConnInfo target $ \globalNtcVersion -> runExceptT $ do
877+
( executeLocalStateQueryExpr nodeConnInfo target $ runExceptT $ do
882878
AnyCardanoEra cEra <-
883879
lift queryCurrentEra
884880
& onLeft (left . QueryCmdUnsupportedNtcVersion)
@@ -888,13 +884,14 @@ runQueryLedgerPeerSnapshot
888884

889885
result <- easyRunQuery (queryLedgerPeerSnapshot sbe)
890886

891-
shelleyNtcVersion <- hoistEither $ getShelleyNodeToClientVersion era globalNtcVersion
887+
-- shelleyNtcVersion <- hoistEither $ getShelleyNodeToClientVersion era globalNtcVersion
892888

893-
hoist liftIO $
894-
obtainCommonConstraints era $
895-
case decodeBigLedgerPeerSnapshot shelleyNtcVersion result of
896-
Left (bs, _decoderError) -> pure $ Left bs
897-
Right snapshot -> pure $ Right snapshot
889+
pure $ Right result
890+
-- hoist liftIO $
891+
-- obtainCommonConstraints era $
892+
-- case decodeBigLedgerPeerSnapshot shelleyNtcVersion result of
893+
-- Left (bs, _decoderError) -> pure $ Left bs
894+
-- Right snapshot -> pure $ Right snapshot
898895
)
899896
& fromEitherCIOCli
900897

@@ -1065,28 +1062,6 @@ getQueryStakeAddressInfo
10651062

10661063
-- -------------------------------------------------------------------------------------------------
10671064

1068-
getShelleyNodeToClientVersion
1069-
:: Exp.Era era -> NodeToClientVersion -> Either QueryCmdError ShelleyNodeToClientVersion
1070-
getShelleyNodeToClientVersion era globalNtcVersion =
1071-
case supportedNodeToClientVersions (Proxy @(CardanoBlock StandardCrypto)) Map.! globalNtcVersion of
1072-
HardForkNodeToClientEnabled _ np ->
1073-
case era of
1074-
Exp.ConwayEra ->
1075-
case projectNP conwayIndex np of
1076-
EraNodeToClientDisabled -> Left QueryCmdNodeToClientDisabled
1077-
EraNodeToClientEnabled shelleyNtcVersion -> return shelleyNtcVersion
1078-
Exp.DijkstraEra ->
1079-
case projectNP dijkstraIndex np of
1080-
EraNodeToClientDisabled -> Left QueryCmdNodeToClientDisabled
1081-
EraNodeToClientEnabled shelleyNtcVersion -> return shelleyNtcVersion
1082-
HardForkNodeToClientDisabled _ -> Left QueryCmdNodeToClientDisabled
1083-
1084-
conwayIndex :: Index (x'1 : x'2 : x'3 : x'4 : x'5 : x'6 : x : xs1) x
1085-
conwayIndex = (IS (IS (IS (IS (IS (IS IZ))))))
1086-
1087-
dijkstraIndex :: Index (x'1 : x'2 : x'3 : x'4 : x'5 : x'6 : x'7 : x : xs1) x
1088-
dijkstraIndex = (IS (IS (IS (IS (IS (IS (IS IZ)))))))
1089-
10901065
writeStakeAddressInfo
10911066
:: StakeAddressInfoData
10921067
-> Vary [FormatJson, FormatYaml]

0 commit comments

Comments
 (0)