Skip to content

Commit a368da1

Browse files
committed
Remove legacy {Shelley,Cardano}NodeToClientVersions
1 parent e924f61 commit a368da1

File tree

12 files changed

+53
-1221
lines changed

12 files changed

+53
-1221
lines changed

docs/website/contents/for-developers/AddingAnEra.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ be adding is the Alonzo era, which comes after the Mary era.
9494

9595
### `test`
9696

97-
* In `Test.Consensus.Cardano.ByronCompatibility`, update `toCardanoCodecConfig`.
98-
9997
* In `Test.Consensus.Cardano.Serialisation`, update `testCodecCfg` and
10098
`dictNestedHdr`.
10199

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

130128
* In `Test.Consensus.Cardano.Examples`, update `eraExamples`, `combineEras`, and
131-
the rest.
129+
the rest.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Breaking
2+
3+
- Removed legacy `{Shelley,Cardano}NodeToClientVersion`s and related code.

ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@ library
123123
Ouroboros.Consensus.Shelley.Protocol.TPraos
124124
Ouroboros.Consensus.Shelley.ShelleyHFC
125125

126-
other-modules:
127-
Ouroboros.Consensus.Shelley.Ledger.Query.PParamsLegacyEncoder
128-
129126
build-depends:
130127
base >=4.14 && <4.21,
131128
base-deriving-via,
@@ -416,7 +413,6 @@ test-suite cardano-test
416413
hs-source-dirs: test/cardano-test
417414
main-is: Main.hs
418415
other-modules:
419-
Test.Consensus.Cardano.ByronCompatibility
420416
Test.Consensus.Cardano.DiffusionPipelining
421417
Test.Consensus.Cardano.Golden
422418
Test.Consensus.Cardano.MiniProtocol.LocalTxSubmission.ByteStringTxParser

ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Node.hs

Lines changed: 0 additions & 182 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,10 @@ module Ouroboros.Consensus.Cardano.Node (
4242
, protocolClientInfoCardano
4343
, protocolInfoCardano
4444
-- * SupportedNetworkProtocolVersion
45-
, pattern CardanoNodeToClientVersion1
46-
, pattern CardanoNodeToClientVersion10
47-
, pattern CardanoNodeToClientVersion11
4845
, pattern CardanoNodeToClientVersion12
4946
, pattern CardanoNodeToClientVersion13
5047
, pattern CardanoNodeToClientVersion14
5148
, pattern CardanoNodeToClientVersion15
52-
, pattern CardanoNodeToClientVersion2
53-
, pattern CardanoNodeToClientVersion3
54-
, pattern CardanoNodeToClientVersion4
55-
, pattern CardanoNodeToClientVersion5
56-
, pattern CardanoNodeToClientVersion6
57-
, pattern CardanoNodeToClientVersion7
58-
, pattern CardanoNodeToClientVersion8
59-
, pattern CardanoNodeToClientVersion9
6049
, pattern CardanoNodeToNodeVersion1
6150
, pattern CardanoNodeToNodeVersion2
6251
) where
@@ -272,177 +261,6 @@ pattern CardanoNodeToNodeVersion2 =
272261
:* Nil
273262
)
274263

275-
-- | We support the sole Byron version with the hard fork disabled.
276-
pattern CardanoNodeToClientVersion1 :: BlockNodeToClientVersion (CardanoBlock c)
277-
pattern CardanoNodeToClientVersion1 =
278-
HardForkNodeToClientDisabled ByronNodeToClientVersion1
279-
280-
-- | The hard fork enabled and the Shelley era enabled.
281-
pattern CardanoNodeToClientVersion2 :: BlockNodeToClientVersion (CardanoBlock c)
282-
pattern CardanoNodeToClientVersion2 =
283-
HardForkNodeToClientEnabled
284-
HardForkSpecificNodeToClientVersion1
285-
( EraNodeToClientEnabled ByronNodeToClientVersion1
286-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion1
287-
:* EraNodeToClientDisabled
288-
:* EraNodeToClientDisabled
289-
:* EraNodeToClientDisabled
290-
:* EraNodeToClientDisabled
291-
:* EraNodeToClientDisabled
292-
:* Nil
293-
)
294-
295-
-- | The hard fork enabled and the Shelley era enabled, but using
296-
-- 'ShelleyNodeToClientVersion2' and 'HardForkSpecificNodeToClientVersion2'.
297-
pattern CardanoNodeToClientVersion3 :: BlockNodeToClientVersion (CardanoBlock c)
298-
pattern CardanoNodeToClientVersion3 =
299-
HardForkNodeToClientEnabled
300-
HardForkSpecificNodeToClientVersion2
301-
( EraNodeToClientEnabled ByronNodeToClientVersion1
302-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion2
303-
:* EraNodeToClientDisabled
304-
:* EraNodeToClientDisabled
305-
:* EraNodeToClientDisabled
306-
:* EraNodeToClientDisabled
307-
:* EraNodeToClientDisabled
308-
:* Nil
309-
)
310-
311-
-- | The hard fork enabled, and the Shelley and Allegra eras enabled.
312-
--
313-
-- We don't bother with 'ShelleyNodeToClientVersion1' and
314-
-- 'HardForkSpecificNodeToClientVersion1'.
315-
pattern CardanoNodeToClientVersion4 :: BlockNodeToClientVersion (CardanoBlock c)
316-
pattern CardanoNodeToClientVersion4 =
317-
HardForkNodeToClientEnabled
318-
HardForkSpecificNodeToClientVersion2
319-
( EraNodeToClientEnabled ByronNodeToClientVersion1
320-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion2
321-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion2
322-
:* EraNodeToClientDisabled
323-
:* EraNodeToClientDisabled
324-
:* EraNodeToClientDisabled
325-
:* EraNodeToClientDisabled
326-
:* Nil
327-
)
328-
329-
-- | The hard fork enabled, and the Shelley, Allegra, and Mary eras enabled.
330-
--
331-
-- We don't bother with 'ShelleyNodeToClientVersion1'.
332-
pattern CardanoNodeToClientVersion5 :: BlockNodeToClientVersion (CardanoBlock c)
333-
pattern CardanoNodeToClientVersion5 =
334-
HardForkNodeToClientEnabled
335-
HardForkSpecificNodeToClientVersion2
336-
( EraNodeToClientEnabled ByronNodeToClientVersion1
337-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion2
338-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion2
339-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion2
340-
:* EraNodeToClientDisabled
341-
:* EraNodeToClientDisabled
342-
:* EraNodeToClientDisabled
343-
:* Nil
344-
)
345-
346-
-- | The hard fork enabled, and the Shelley, Allegra, and Mary eras enabled, but
347-
-- using 'ShelleyNodeToClientVersion3' for the Shelley-based eras , which
348-
-- enables new queries.
349-
pattern CardanoNodeToClientVersion6 :: BlockNodeToClientVersion (CardanoBlock c)
350-
pattern CardanoNodeToClientVersion6 =
351-
HardForkNodeToClientEnabled
352-
HardForkSpecificNodeToClientVersion2
353-
( EraNodeToClientEnabled ByronNodeToClientVersion1
354-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion3
355-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion3
356-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion3
357-
:* EraNodeToClientDisabled
358-
:* EraNodeToClientDisabled
359-
:* EraNodeToClientDisabled
360-
:* Nil
361-
)
362-
363-
-- | The hard fork enabled, and the Shelley, Allegra, Mary and Alonzo eras enabled
364-
pattern CardanoNodeToClientVersion7 :: BlockNodeToClientVersion (CardanoBlock c)
365-
pattern CardanoNodeToClientVersion7 =
366-
HardForkNodeToClientEnabled
367-
HardForkSpecificNodeToClientVersion2
368-
( EraNodeToClientEnabled ByronNodeToClientVersion1
369-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion4
370-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion4
371-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion4
372-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion4
373-
:* EraNodeToClientDisabled
374-
:* EraNodeToClientDisabled
375-
:* Nil
376-
)
377-
378-
-- | The hard fork enabled, and the Shelley, Allegra, Mary and Alonzo eras enabled
379-
-- Using 'ShelleyNodeToClientVersion5' for the Shelley-based eras , which
380-
-- enables new queries.
381-
pattern CardanoNodeToClientVersion8 :: BlockNodeToClientVersion (CardanoBlock c)
382-
pattern CardanoNodeToClientVersion8 =
383-
HardForkNodeToClientEnabled
384-
HardForkSpecificNodeToClientVersion2
385-
( EraNodeToClientEnabled ByronNodeToClientVersion1
386-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion5
387-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion5
388-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion5
389-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion5
390-
:* EraNodeToClientDisabled
391-
:* EraNodeToClientDisabled
392-
:* Nil
393-
)
394-
395-
-- | The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo and Babbage
396-
-- eras enabled Using 'ShelleyNodeToClientVersion5' for the Shelley-based eras,
397-
-- which enables new queries.
398-
pattern CardanoNodeToClientVersion9 :: BlockNodeToClientVersion (CardanoBlock c)
399-
pattern CardanoNodeToClientVersion9 =
400-
HardForkNodeToClientEnabled
401-
HardForkSpecificNodeToClientVersion2
402-
( EraNodeToClientEnabled ByronNodeToClientVersion1
403-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion5
404-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion5
405-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion5
406-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion5
407-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion5
408-
:* EraNodeToClientDisabled
409-
:* Nil
410-
)
411-
412-
-- | The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo and Babbage
413-
-- eras enabled Using 'ShelleyNodeToClientVersion6' for the Shelley-based eras,
414-
-- which enables new queries.
415-
pattern CardanoNodeToClientVersion10 :: BlockNodeToClientVersion (CardanoBlock c)
416-
pattern CardanoNodeToClientVersion10 =
417-
HardForkNodeToClientEnabled
418-
HardForkSpecificNodeToClientVersion2
419-
( EraNodeToClientEnabled ByronNodeToClientVersion1
420-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion6
421-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion6
422-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion6
423-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion6
424-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion6
425-
:* EraNodeToClientDisabled
426-
:* Nil
427-
)
428-
429-
-- | The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo and Babbage
430-
-- eras enabled, using 'ShelleyNodeToClientVersion7' for the Shelley-based eras,
431-
-- which enables new queries.
432-
pattern CardanoNodeToClientVersion11 :: BlockNodeToClientVersion (CardanoBlock c)
433-
pattern CardanoNodeToClientVersion11 =
434-
HardForkNodeToClientEnabled
435-
HardForkSpecificNodeToClientVersion2
436-
( EraNodeToClientEnabled ByronNodeToClientVersion1
437-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion7
438-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion7
439-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion7
440-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion7
441-
:* EraNodeToClientEnabled ShelleyNodeToClientVersion7
442-
:* EraNodeToClientDisabled
443-
:* Nil
444-
)
445-
446264
-- | The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo and Babbage
447265
-- and Conway eras enabled, using 'ShelleyNodeToClientVersion8' for the
448266
-- Shelley-based eras.

ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Block.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ import Ouroboros.Consensus.Protocol.Praos.Common
6363
(PraosChainSelectView)
6464
import Ouroboros.Consensus.Protocol.Signed (SignedHeader)
6565
import Ouroboros.Consensus.Shelley.Eras
66-
import Ouroboros.Consensus.Shelley.Ledger.Query.PParamsLegacyEncoder
6766
import Ouroboros.Consensus.Shelley.Protocol.Abstract (ProtoCrypto,
6867
ProtocolHeaderSupportsEnvelope (pHeaderPrevHash),
6968
ProtocolHeaderSupportsProtocol (CannotForgeError),
@@ -101,10 +100,6 @@ class
101100
-- Hard-fork related constraints
102101
, HasPartialConsensusConfig proto
103102
, DecCBOR (SL.PState era)
104-
105-
-- Backwards compatibility
106-
, Plain.FromCBOR (LegacyPParams era)
107-
, Plain.ToCBOR (LegacyPParams era)
108103
) => ShelleyCompatible proto era
109104

110105
instance ShelleyCompatible proto era => ConvertRawHash (ShelleyBlock proto era) where

ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/NetworkProtocolVersion.hs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,8 @@ data ShelleyNodeToNodeVersion = ShelleyNodeToNodeVersion1
1515
deriving (Show, Eq, Ord, Enum, Bounded)
1616

1717
data ShelleyNodeToClientVersion =
18-
ShelleyNodeToClientVersion1
19-
20-
-- | New queries introduced
21-
| ShelleyNodeToClientVersion2
22-
23-
-- | New query introduced
24-
| ShelleyNodeToClientVersion3
25-
26-
-- | New queries introduced
27-
| ShelleyNodeToClientVersion4
28-
29-
-- | New queries introduced: GetRewardInfoPools
30-
| ShelleyNodeToClientVersion5
31-
32-
-- | New queries introduced: GetPoolDistr, GetPoolState, GetStakeSnapshots
33-
| ShelleyNodeToClientVersion6
34-
35-
-- | New queries introduced: GetStakeDelegDeposits
36-
| ShelleyNodeToClientVersion7
37-
3818
-- | New queries introduced: GetConstitutionHash, GetFilteredVoteDelegatees
39-
| ShelleyNodeToClientVersion8
19+
ShelleyNodeToClientVersion8
4020

4121
-- | New queries introduced: GetProposals, GetRatifyState
4222
| ShelleyNodeToClientVersion9

0 commit comments

Comments
 (0)