@@ -691,12 +691,10 @@ checkKnownIntersectionInvariants ::
691
691
( HasHeader blk
692
692
, HasHeader (Header blk )
693
693
, HasAnnTip blk
694
- , ConsensusProtocol (BlockProtocol blk )
695
694
) =>
696
- ConsensusConfig (BlockProtocol blk ) ->
697
695
KnownIntersectionState blk ->
698
696
Either String ()
699
- checkKnownIntersectionInvariants cfg kis
697
+ checkKnownIntersectionInvariants kis
700
698
-- 'theirHeaderStateHistory' invariant
701
699
| let HeaderStateHistory snapshots = theirHeaderStateHistory
702
700
historyTips :: [WithOrigin (AnnTip blk )]
@@ -723,19 +721,6 @@ checkKnownIntersectionInvariants cfg kis
723
721
, show fragmentAnchorPoint
724
722
]
725
723
-- 'ourFrag' invariants
726
- | let nbHeaders = AF. length ourFrag
727
- ourAnchorPoint = AF. anchorPoint ourFrag
728
- , nbHeaders < fromIntegral (unNonZero k)
729
- , ourAnchorPoint /= GenesisPoint =
730
- throwError $
731
- unwords
732
- [ " ourFrag contains fewer than k headers and not close to genesis:"
733
- , show nbHeaders
734
- , " vs"
735
- , show k
736
- , " with anchor"
737
- , show ourAnchorPoint
738
- ]
739
724
| let ourFragAnchor = AF. anchorPoint ourFrag
740
725
theirFragAnchor = AF. anchorPoint theirFrag
741
726
, ourFragAnchor /= castPoint theirFragAnchor =
@@ -761,8 +746,6 @@ checkKnownIntersectionInvariants cfg kis
761
746
| otherwise =
762
747
return ()
763
748
where
764
- SecurityParam k = protocolSecurityParam cfg
765
-
766
749
KnownIntersectionState
767
750
{ mostRecentIntersection
768
751
, ourFrag
@@ -774,14 +757,12 @@ assertKnownIntersectionInvariants ::
774
757
( HasHeader blk
775
758
, HasHeader (Header blk )
776
759
, HasAnnTip blk
777
- , ConsensusProtocol (BlockProtocol blk )
778
760
, HasCallStack
779
761
) =>
780
- ConsensusConfig (BlockProtocol blk ) ->
781
762
KnownIntersectionState blk ->
782
763
KnownIntersectionState blk
783
- assertKnownIntersectionInvariants cfg kis =
784
- assertWithMsg (checkKnownIntersectionInvariants cfg kis) kis
764
+ assertKnownIntersectionInvariants kis =
765
+ assertWithMsg (checkKnownIntersectionInvariants kis) kis
785
766
786
767
{- ------------------------------------------------------------------------------
787
768
The ChainSync client definition
@@ -892,8 +873,7 @@ chainSyncClient cfgEnv dynEnv =
892
873
(ForkTooDeep GenesisPoint )
893
874
where
894
875
ConfigEnv
895
- { cfg
896
- , chainDbView
876
+ { chainDbView
897
877
, tracer
898
878
} = cfgEnv
899
879
@@ -995,7 +975,7 @@ chainSyncClient cfgEnv dynEnv =
995
975
-- we will /never/ adopt them, which is handled in the "no
996
976
-- more intersection case".
997
977
StillIntersects () $
998
- assertKnownIntersectionInvariants (configConsensus cfg) $
978
+ assertKnownIntersectionInvariants $
999
979
KnownIntersectionState
1000
980
{ mostRecentIntersection = castPoint intersection
1001
981
, ourFrag = ourFrag'
@@ -1158,7 +1138,7 @@ findIntersectionTop cfgEnv dynEnv intEnv =
1158
1138
(ourTipFromChain ourFrag)
1159
1139
theirTip
1160
1140
let kis =
1161
- assertKnownIntersectionInvariants (configConsensus cfg) $
1141
+ assertKnownIntersectionInvariants $
1162
1142
KnownIntersectionState
1163
1143
{ mostRecentIntersection = intersection
1164
1144
, ourFrag
@@ -1234,7 +1214,6 @@ knownIntersectionStateTop cfgEnv dynEnv intEnv =
1234
1214
ConfigEnv
1235
1215
{ mkPipelineDecision0
1236
1216
, tracer
1237
- , cfg
1238
1217
, historicityCheck
1239
1218
} = cfgEnv
1240
1219
@@ -1622,9 +1601,8 @@ knownIntersectionStateTop cfgEnv dynEnv intEnv =
1622
1601
else mostRecentIntersection
1623
1602
1624
1603
kis' =
1625
- assertKnownIntersectionInvariants
1626
- (configConsensus cfg)
1627
- $ KnownIntersectionState
1604
+ assertKnownIntersectionInvariants $
1605
+ KnownIntersectionState
1628
1606
{ mostRecentIntersection = mostRecentIntersection'
1629
1607
, ourFrag = ourFrag
1630
1608
, theirFrag = theirFrag'
@@ -1961,7 +1939,7 @@ checkValid cfgEnv intEnv hdr hdrSlotTime theirTip kis ledgerView = do
1961
1939
traceWith (tracer cfgEnv) $ TraceValidatedHeader hdr
1962
1940
1963
1941
pure $
1964
- assertKnownIntersectionInvariants (configConsensus cfg) $
1942
+ assertKnownIntersectionInvariants $
1965
1943
KnownIntersectionState
1966
1944
{ mostRecentIntersection = mostRecentIntersection'
1967
1945
, ourFrag = ourFrag
0 commit comments