Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Remove legacy {Shelley,Cardano}NodeToClientVersions
  • Loading branch information
amesgen committed Jan 9, 2025
commit a368da1990e894cd1be1ba6f4cc0b0fb8f6cd53c
4 changes: 1 addition & 3 deletions docs/website/contents/for-developers/AddingAnEra.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ be adding is the Alonzo era, which comes after the Mary era.

### `test`

* In `Test.Consensus.Cardano.ByronCompatibility`, update `toCardanoCodecConfig`.

* In `Test.Consensus.Cardano.Serialisation`, update `testCodecCfg` and
`dictNestedHdr`.

Expand Down Expand Up @@ -128,4 +126,4 @@ be adding is the Alonzo era, which comes after the Mary era.
of them and add the missing cases.

* In `Test.Consensus.Cardano.Examples`, update `eraExamples`, `combineEras`, and
the rest.
the rest.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Breaking

- Removed legacy `{Shelley,Cardano}NodeToClientVersion`s and related code.
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ library
Ouroboros.Consensus.Shelley.Protocol.TPraos
Ouroboros.Consensus.Shelley.ShelleyHFC

other-modules:
Ouroboros.Consensus.Shelley.Ledger.Query.PParamsLegacyEncoder

build-depends:
base >=4.14 && <4.21,
base-deriving-via,
Expand Down Expand Up @@ -416,7 +413,6 @@ test-suite cardano-test
hs-source-dirs: test/cardano-test
main-is: Main.hs
other-modules:
Test.Consensus.Cardano.ByronCompatibility
Test.Consensus.Cardano.DiffusionPipelining
Test.Consensus.Cardano.Golden
Test.Consensus.Cardano.MiniProtocol.LocalTxSubmission.ByteStringTxParser
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,10 @@ module Ouroboros.Consensus.Cardano.Node (
, protocolClientInfoCardano
, protocolInfoCardano
-- * SupportedNetworkProtocolVersion
, pattern CardanoNodeToClientVersion1
, pattern CardanoNodeToClientVersion10
, pattern CardanoNodeToClientVersion11
, pattern CardanoNodeToClientVersion12
, pattern CardanoNodeToClientVersion13
, pattern CardanoNodeToClientVersion14
, pattern CardanoNodeToClientVersion15
, pattern CardanoNodeToClientVersion2
, pattern CardanoNodeToClientVersion3
, pattern CardanoNodeToClientVersion4
, pattern CardanoNodeToClientVersion5
, pattern CardanoNodeToClientVersion6
, pattern CardanoNodeToClientVersion7
, pattern CardanoNodeToClientVersion8
, pattern CardanoNodeToClientVersion9
, pattern CardanoNodeToNodeVersion1
, pattern CardanoNodeToNodeVersion2
) where
Expand Down Expand Up @@ -272,177 +261,6 @@ pattern CardanoNodeToNodeVersion2 =
:* Nil
)

-- | We support the sole Byron version with the hard fork disabled.
pattern CardanoNodeToClientVersion1 :: BlockNodeToClientVersion (CardanoBlock c)
pattern CardanoNodeToClientVersion1 =
HardForkNodeToClientDisabled ByronNodeToClientVersion1

-- | The hard fork enabled and the Shelley era enabled.
pattern CardanoNodeToClientVersion2 :: BlockNodeToClientVersion (CardanoBlock c)
pattern CardanoNodeToClientVersion2 =
HardForkNodeToClientEnabled
HardForkSpecificNodeToClientVersion1
( EraNodeToClientEnabled ByronNodeToClientVersion1
:* EraNodeToClientEnabled ShelleyNodeToClientVersion1
:* EraNodeToClientDisabled
:* EraNodeToClientDisabled
:* EraNodeToClientDisabled
:* EraNodeToClientDisabled
:* EraNodeToClientDisabled
:* Nil
)

-- | The hard fork enabled and the Shelley era enabled, but using
-- 'ShelleyNodeToClientVersion2' and 'HardForkSpecificNodeToClientVersion2'.
pattern CardanoNodeToClientVersion3 :: BlockNodeToClientVersion (CardanoBlock c)
pattern CardanoNodeToClientVersion3 =
HardForkNodeToClientEnabled
HardForkSpecificNodeToClientVersion2
( EraNodeToClientEnabled ByronNodeToClientVersion1
:* EraNodeToClientEnabled ShelleyNodeToClientVersion2
:* EraNodeToClientDisabled
:* EraNodeToClientDisabled
:* EraNodeToClientDisabled
:* EraNodeToClientDisabled
:* EraNodeToClientDisabled
:* Nil
)

-- | The hard fork enabled, and the Shelley and Allegra eras enabled.
--
-- We don't bother with 'ShelleyNodeToClientVersion1' and
-- 'HardForkSpecificNodeToClientVersion1'.
pattern CardanoNodeToClientVersion4 :: BlockNodeToClientVersion (CardanoBlock c)
pattern CardanoNodeToClientVersion4 =
HardForkNodeToClientEnabled
HardForkSpecificNodeToClientVersion2
( EraNodeToClientEnabled ByronNodeToClientVersion1
:* EraNodeToClientEnabled ShelleyNodeToClientVersion2
:* EraNodeToClientEnabled ShelleyNodeToClientVersion2
:* EraNodeToClientDisabled
:* EraNodeToClientDisabled
:* EraNodeToClientDisabled
:* EraNodeToClientDisabled
:* Nil
)

-- | The hard fork enabled, and the Shelley, Allegra, and Mary eras enabled.
--
-- We don't bother with 'ShelleyNodeToClientVersion1'.
pattern CardanoNodeToClientVersion5 :: BlockNodeToClientVersion (CardanoBlock c)
pattern CardanoNodeToClientVersion5 =
HardForkNodeToClientEnabled
HardForkSpecificNodeToClientVersion2
( EraNodeToClientEnabled ByronNodeToClientVersion1
:* EraNodeToClientEnabled ShelleyNodeToClientVersion2
:* EraNodeToClientEnabled ShelleyNodeToClientVersion2
:* EraNodeToClientEnabled ShelleyNodeToClientVersion2
:* EraNodeToClientDisabled
:* EraNodeToClientDisabled
:* EraNodeToClientDisabled
:* Nil
)

-- | The hard fork enabled, and the Shelley, Allegra, and Mary eras enabled, but
-- using 'ShelleyNodeToClientVersion3' for the Shelley-based eras , which
-- enables new queries.
pattern CardanoNodeToClientVersion6 :: BlockNodeToClientVersion (CardanoBlock c)
pattern CardanoNodeToClientVersion6 =
HardForkNodeToClientEnabled
HardForkSpecificNodeToClientVersion2
( EraNodeToClientEnabled ByronNodeToClientVersion1
:* EraNodeToClientEnabled ShelleyNodeToClientVersion3
:* EraNodeToClientEnabled ShelleyNodeToClientVersion3
:* EraNodeToClientEnabled ShelleyNodeToClientVersion3
:* EraNodeToClientDisabled
:* EraNodeToClientDisabled
:* EraNodeToClientDisabled
:* Nil
)

-- | The hard fork enabled, and the Shelley, Allegra, Mary and Alonzo eras enabled
pattern CardanoNodeToClientVersion7 :: BlockNodeToClientVersion (CardanoBlock c)
pattern CardanoNodeToClientVersion7 =
HardForkNodeToClientEnabled
HardForkSpecificNodeToClientVersion2
( EraNodeToClientEnabled ByronNodeToClientVersion1
:* EraNodeToClientEnabled ShelleyNodeToClientVersion4
:* EraNodeToClientEnabled ShelleyNodeToClientVersion4
:* EraNodeToClientEnabled ShelleyNodeToClientVersion4
:* EraNodeToClientEnabled ShelleyNodeToClientVersion4
:* EraNodeToClientDisabled
:* EraNodeToClientDisabled
:* Nil
)

-- | The hard fork enabled, and the Shelley, Allegra, Mary and Alonzo eras enabled
-- Using 'ShelleyNodeToClientVersion5' for the Shelley-based eras , which
-- enables new queries.
pattern CardanoNodeToClientVersion8 :: BlockNodeToClientVersion (CardanoBlock c)
pattern CardanoNodeToClientVersion8 =
HardForkNodeToClientEnabled
HardForkSpecificNodeToClientVersion2
( EraNodeToClientEnabled ByronNodeToClientVersion1
:* EraNodeToClientEnabled ShelleyNodeToClientVersion5
:* EraNodeToClientEnabled ShelleyNodeToClientVersion5
:* EraNodeToClientEnabled ShelleyNodeToClientVersion5
:* EraNodeToClientEnabled ShelleyNodeToClientVersion5
:* EraNodeToClientDisabled
:* EraNodeToClientDisabled
:* Nil
)

-- | The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo and Babbage
-- eras enabled Using 'ShelleyNodeToClientVersion5' for the Shelley-based eras,
-- which enables new queries.
pattern CardanoNodeToClientVersion9 :: BlockNodeToClientVersion (CardanoBlock c)
pattern CardanoNodeToClientVersion9 =
HardForkNodeToClientEnabled
HardForkSpecificNodeToClientVersion2
( EraNodeToClientEnabled ByronNodeToClientVersion1
:* EraNodeToClientEnabled ShelleyNodeToClientVersion5
:* EraNodeToClientEnabled ShelleyNodeToClientVersion5
:* EraNodeToClientEnabled ShelleyNodeToClientVersion5
:* EraNodeToClientEnabled ShelleyNodeToClientVersion5
:* EraNodeToClientEnabled ShelleyNodeToClientVersion5
:* EraNodeToClientDisabled
:* Nil
)

-- | The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo and Babbage
-- eras enabled Using 'ShelleyNodeToClientVersion6' for the Shelley-based eras,
-- which enables new queries.
pattern CardanoNodeToClientVersion10 :: BlockNodeToClientVersion (CardanoBlock c)
pattern CardanoNodeToClientVersion10 =
HardForkNodeToClientEnabled
HardForkSpecificNodeToClientVersion2
( EraNodeToClientEnabled ByronNodeToClientVersion1
:* EraNodeToClientEnabled ShelleyNodeToClientVersion6
:* EraNodeToClientEnabled ShelleyNodeToClientVersion6
:* EraNodeToClientEnabled ShelleyNodeToClientVersion6
:* EraNodeToClientEnabled ShelleyNodeToClientVersion6
:* EraNodeToClientEnabled ShelleyNodeToClientVersion6
:* EraNodeToClientDisabled
:* Nil
)

-- | The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo and Babbage
-- eras enabled, using 'ShelleyNodeToClientVersion7' for the Shelley-based eras,
-- which enables new queries.
pattern CardanoNodeToClientVersion11 :: BlockNodeToClientVersion (CardanoBlock c)
pattern CardanoNodeToClientVersion11 =
HardForkNodeToClientEnabled
HardForkSpecificNodeToClientVersion2
( EraNodeToClientEnabled ByronNodeToClientVersion1
:* EraNodeToClientEnabled ShelleyNodeToClientVersion7
:* EraNodeToClientEnabled ShelleyNodeToClientVersion7
:* EraNodeToClientEnabled ShelleyNodeToClientVersion7
:* EraNodeToClientEnabled ShelleyNodeToClientVersion7
:* EraNodeToClientEnabled ShelleyNodeToClientVersion7
:* EraNodeToClientDisabled
:* Nil
)

-- | The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo and Babbage
-- and Conway eras enabled, using 'ShelleyNodeToClientVersion8' for the
-- Shelley-based eras.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ import Ouroboros.Consensus.Protocol.Praos.Common
(PraosChainSelectView)
import Ouroboros.Consensus.Protocol.Signed (SignedHeader)
import Ouroboros.Consensus.Shelley.Eras
import Ouroboros.Consensus.Shelley.Ledger.Query.PParamsLegacyEncoder
import Ouroboros.Consensus.Shelley.Protocol.Abstract (ProtoCrypto,
ProtocolHeaderSupportsEnvelope (pHeaderPrevHash),
ProtocolHeaderSupportsProtocol (CannotForgeError),
Expand Down Expand Up @@ -101,10 +100,6 @@ class
-- Hard-fork related constraints
, HasPartialConsensusConfig proto
, DecCBOR (SL.PState era)

-- Backwards compatibility
, Plain.FromCBOR (LegacyPParams era)
, Plain.ToCBOR (LegacyPParams era)
) => ShelleyCompatible proto era

instance ShelleyCompatible proto era => ConvertRawHash (ShelleyBlock proto era) where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,8 @@ data ShelleyNodeToNodeVersion = ShelleyNodeToNodeVersion1
deriving (Show, Eq, Ord, Enum, Bounded)

data ShelleyNodeToClientVersion =
ShelleyNodeToClientVersion1

-- | New queries introduced
| ShelleyNodeToClientVersion2

-- | New query introduced
| ShelleyNodeToClientVersion3

-- | New queries introduced
| ShelleyNodeToClientVersion4

-- | New queries introduced: GetRewardInfoPools
| ShelleyNodeToClientVersion5

-- | New queries introduced: GetPoolDistr, GetPoolState, GetStakeSnapshots
| ShelleyNodeToClientVersion6

-- | New queries introduced: GetStakeDelegDeposits
| ShelleyNodeToClientVersion7

-- | New queries introduced: GetConstitutionHash, GetFilteredVoteDelegatees
| ShelleyNodeToClientVersion8
ShelleyNodeToClientVersion8

-- | New queries introduced: GetProposals, GetRatifyState
| ShelleyNodeToClientVersion9
Expand Down
Loading