Skip to content

Commit 3a9650f

Browse files
authoredMar 18, 2025··
Merge pull request #1930 from IntersectMBO/1828-clean-code
1828 - Remove code due to hard fork - Dec 2024
2 parents cb61094 + 06edd10 commit 3a9650f

38 files changed

+44
-5775
lines changed
 

‎cardano-chain-gen/cardano-chain-gen.cabal

+2-15
Original file line numberDiff line numberDiff line change
@@ -130,33 +130,21 @@ test-suite cardano-chain-gen
130130
other-modules: Test.Cardano.Db.Mock.Config
131131
Test.Cardano.Db.Mock.Examples
132132
Test.Cardano.Db.Mock.Property.Property
133+
Test.Cardano.Db.Mock.UnifiedApi
133134
Test.Cardano.Db.Mock.Unit.Alonzo
134135
Test.Cardano.Db.Mock.Unit.Alonzo.Config
135-
Test.Cardano.Db.Mock.Unit.Alonzo.Plutus
136-
Test.Cardano.Db.Mock.Unit.Alonzo.PoolAndSmash
137-
Test.Cardano.Db.Mock.Unit.Alonzo.Reward
138136
Test.Cardano.Db.Mock.Unit.Alonzo.Simple
139-
Test.Cardano.Db.Mock.Unit.Alonzo.Stake
140137
Test.Cardano.Db.Mock.Unit.Alonzo.Tx
141138
Test.Cardano.Db.Mock.Unit.Babbage
142-
Test.Cardano.Db.Mock.Unit.Babbage.CommandLineArg.ConfigFile
143-
Test.Cardano.Db.Mock.Unit.Babbage.CommandLineArg.EpochDisabled
144-
Test.Cardano.Db.Mock.Unit.Babbage.Config.MigrateConsumedPruneTxOut
145-
Test.Cardano.Db.Mock.Unit.Babbage.Config.Parse
146-
Test.Cardano.Db.Mock.Unit.Babbage.InlineAndReference
147-
Test.Cardano.Db.Mock.Unit.Babbage.Other
148-
Test.Cardano.Db.Mock.Unit.Babbage.Plutus
149139
Test.Cardano.Db.Mock.Unit.Babbage.Reward
150-
Test.Cardano.Db.Mock.Unit.Babbage.Rollback
151140
Test.Cardano.Db.Mock.Unit.Babbage.Simple
152-
Test.Cardano.Db.Mock.Unit.Babbage.Stake
153141
Test.Cardano.Db.Mock.Unit.Babbage.Tx
154142
Test.Cardano.Db.Mock.Unit.Conway
155143
Test.Cardano.Db.Mock.Unit.Conway.CommandLineArg.ConfigFile
156144
Test.Cardano.Db.Mock.Unit.Conway.CommandLineArg.EpochDisabled
157145
Test.Cardano.Db.Mock.Unit.Conway.Config.JsonbInSchema
158-
Test.Cardano.Db.Mock.Unit.Conway.Config.Parse
159146
Test.Cardano.Db.Mock.Unit.Conway.Config.MigrateConsumedPruneTxOut
147+
Test.Cardano.Db.Mock.Unit.Conway.Config.Parse
160148
Test.Cardano.Db.Mock.Unit.Conway.Governance
161149
Test.Cardano.Db.Mock.Unit.Conway.InlineAndReference
162150
Test.Cardano.Db.Mock.Unit.Conway.Other
@@ -166,7 +154,6 @@ test-suite cardano-chain-gen
166154
Test.Cardano.Db.Mock.Unit.Conway.Simple
167155
Test.Cardano.Db.Mock.Unit.Conway.Stake
168156
Test.Cardano.Db.Mock.Unit.Conway.Tx
169-
Test.Cardano.Db.Mock.UnifiedApi
170157
Test.Cardano.Db.Mock.Validate
171158

172159
build-depends: aeson

‎cardano-chain-gen/src/Cardano/Mock/Forging/Tx/Babbage.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ mkUTxOBabbage :: AlonzoTx StandardBabbage -> [(TxIn StandardCrypto, BabbageTxOut
462462
mkUTxOBabbage = mkUTxOAlonzo
463463

464464
mkUTxOCollBabbage ::
465-
(BabbageEraTxBody era) =>
465+
BabbageEraTxBody era =>
466466
AlonzoTx era ->
467467
[(TxIn (EraCrypto era), TxOut era)]
468468
mkUTxOCollBabbage tx = Map.toList $ unUTxO $ collOuts $ getField @"body" tx

‎cardano-chain-gen/src/Cardano/Mock/Query.hs

+3-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ queryVoteCounts txHash idx = do
199199
`innerJoin` table @Db.Tx
200200
`on` (\(vote :& tx) -> vote ^. Db.VotingProcedureTxId ==. tx ^. Db.TxId)
201201
where_ $
202-
vote ^. Db.VotingProcedureVote ==. val v
202+
vote
203+
^. Db.VotingProcedureVote
204+
==. val v
203205
&&. tx ^. Db.TxHash ==. val txHash
204206
&&. vote ^. Db.VotingProcedureIndex ==. val idx
205207
pure countRows

‎cardano-chain-gen/test/Test/Cardano/Db/Mock/Config.hs

-6
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ data CommandLineArgs = CommandLineArgs
122122
, claEpochDisabled :: Bool
123123
, claHasCache :: Bool
124124
, claHasLedger :: Bool
125-
, claSkipFix :: Bool
126-
, claOnlyFix :: Bool
127125
, claForceIndexes :: Bool
128126
, claHasMultiAssets :: Bool
129127
, claHasMetadata :: Bool
@@ -286,8 +284,6 @@ mkSyncNodeParams staticDir mutableDir CommandLineArgs {..} = do
286284
, enpPGPassSource = DB.PGPassCached pgconfig
287285
, enpEpochDisabled = claEpochDisabled
288286
, enpHasCache = claHasCache
289-
, enpSkipFix = claSkipFix
290-
, enpOnlyFix = claOnlyFix
291287
, enpForceIndexes = claForceIndexes
292288
, enpHasInOut = True
293289
, enpSnEveryFollowing = 35
@@ -361,8 +357,6 @@ initCommandLineArgs =
361357
, claEpochDisabled = True
362358
, claHasCache = True
363359
, claHasLedger = True
364-
, claSkipFix = True
365-
, claOnlyFix = False
366360
, claForceIndexes = False
367361
, claHasMultiAssets = True
368362
, claHasMetadata = True

‎cardano-chain-gen/test/Test/Cardano/Db/Mock/Unit/Alonzo.hs

-69
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ import Test.Tasty (TestTree, testGroup)
1111
import Test.Tasty.HUnit (Assertion, testCase)
1212

1313
import qualified Test.Cardano.Db.Mock.Unit.Alonzo.Config as AlzConfig
14-
import qualified Test.Cardano.Db.Mock.Unit.Alonzo.Plutus as AlzPlutus
15-
import qualified Test.Cardano.Db.Mock.Unit.Alonzo.PoolAndSmash as AlzPnS
16-
import qualified Test.Cardano.Db.Mock.Unit.Alonzo.Reward as AlzReward
1714
import qualified Test.Cardano.Db.Mock.Unit.Alonzo.Simple as AlzSimple
18-
import qualified Test.Cardano.Db.Mock.Unit.Alonzo.Stake as AlzStake
1915
import qualified Test.Cardano.Db.Mock.Unit.Alonzo.Tx as AlzTx
2016

2117
{- HLINT ignore "Reduce duplication" -}
@@ -41,71 +37,6 @@ unitTests iom knownMigrations =
4137
[ test "simple tx" AlzTx.addSimpleTx
4238
, test "consume utxo same block" AlzTx.consumeSameBlock
4339
]
44-
, testGroup
45-
"stake addresses"
46-
[ test "(de)registrations" AlzStake.registrationTx
47-
, test "(de)registrations in same block" AlzStake.registrationsSameBlock
48-
, test "(de)registrations in same tx" AlzStake.registrationsSameTx
49-
, test "stake address pointers" AlzStake.stakeAddressPtr
50-
, test "stake address pointers deregistration" AlzStake.stakeAddressPtrDereg
51-
, test "stake address pointers. Use before registering." AlzStake.stakeAddressPtrUseBefore
52-
]
53-
, testGroup
54-
"rewards"
55-
[ test "rewards simple" AlzReward.simpleRewards
56-
, test "rewards with deregistration" AlzReward.rewardsDeregistration
57-
, test "rewards with reregistration. Fixed in Babbage." AlzReward.rewardsReregistration
58-
, test "Mir Cert" AlzReward.mirReward
59-
, test "Mir rollback" AlzReward.mirRewardRollback
60-
, test "Mir Cert deregistration" AlzReward.mirRewardDereg
61-
, -- , test "test rewards empty last part of epoch" rewardsEmptyChainLast
62-
-- , test "test delta rewards" rewardsDelta -- See the same test on Babbage for the reason it was disabled.
63-
test "rollback on epoch boundary" AlzReward.rollbackBoundary
64-
, test "single MIR Cert multiple outputs" AlzReward.singleMIRCertMultiOut
65-
]
66-
, testGroup
67-
"stake distribution"
68-
[ test "stake distribution from genesis" AlzStake.stakeDistGenesis
69-
, test "2000 delegations" AlzStake.delegations2000
70-
, test "2001 delegations" AlzStake.delegations2001
71-
, test "8000 delegations" AlzStake.delegations8000
72-
, test "many delegations" AlzStake.delegationsMany
73-
, test "many delegations, sparse chain" AlzStake.delegationsManyNotDense
74-
]
75-
, testGroup
76-
"plutus spend scripts"
77-
[ test "simple script lock" AlzPlutus.simpleScript
78-
, test "unlock script in same block" AlzPlutus.unlockScriptSameBlock
79-
, test "failed script" AlzPlutus.failedScript
80-
, test "failed script in same block" AlzPlutus.failedScriptSameBlock
81-
, test "multiple scripts unlocked" AlzPlutus.multipleScripts
82-
, test "multiple scripts unlocked same block" AlzPlutus.multipleScriptsSameBlock
83-
, test "multiple scripts failed" AlzPlutus.multipleScriptsFailed
84-
, test "multiple scripts failed same block" AlzPlutus.multipleScriptsFailedSameBlock
85-
]
86-
, testGroup
87-
"plutus cert scripts"
88-
[ test "stake scripts" AlzPlutus.registrationScriptTx
89-
, test "stake scripts deregistration" AlzPlutus.deregistrationScriptTx
90-
, test "multiple stake scripts deregistration" AlzPlutus.deregistrationsScriptTxs
91-
, test "multiple stake scripts deregistration in same tx" AlzPlutus.deregistrationsScriptTx
92-
, test "multiple stake scripts deregistration in same tx missing redeemer 1" AlzPlutus.deregistrationsScriptTx'
93-
, test "multiple stake scripts deregistration in same tx missing redeemer 2" AlzPlutus.deregistrationsScriptTx''
94-
]
95-
, testGroup
96-
"MultiAssets plutus scripts"
97-
[ test "mint simple multi asset" AlzPlutus.mintMultiAsset
98-
, test "mint many multi assets" AlzPlutus.mintMultiAssets
99-
, test "swap many multi assets" AlzPlutus.swapMultiAssets
100-
]
101-
, testGroup
102-
"pools and smash"
103-
[ test "pool registration" AlzPnS.poolReg
104-
, test "query pool that's not registered" AlzPnS.nonexistantPoolQuery
105-
, test "pool deregistration" AlzPnS.poolDeReg
106-
, test "pool multiple deregistration" AlzPnS.poolDeRegMany
107-
, test "delist pool" AlzPnS.poolDelist
108-
]
10940
]
11041
where
11142
test :: String -> (IOManager -> [(Text, Text)] -> Assertion) -> TestTree

‎cardano-chain-gen/test/Test/Cardano/Db/Mock/Unit/Alonzo/Plutus.hs

-467
This file was deleted.

‎cardano-chain-gen/test/Test/Cardano/Db/Mock/Unit/Alonzo/PoolAndSmash.hs

-273
This file was deleted.

‎cardano-chain-gen/test/Test/Cardano/Db/Mock/Unit/Alonzo/Reward.hs

-486
This file was deleted.

‎cardano-chain-gen/test/Test/Cardano/Db/Mock/Unit/Alonzo/Stake.hs

-340
This file was deleted.

‎cardano-chain-gen/test/Test/Cardano/Db/Mock/Unit/Babbage.hs

-151
Original file line numberDiff line numberDiff line change
@@ -11,59 +11,15 @@ import Data.Text (Text)
1111
import Test.Tasty (TestTree, testGroup)
1212
import Test.Tasty.HUnit (Assertion, testCase)
1313

14-
import qualified Test.Cardano.Db.Mock.Unit.Babbage.CommandLineArg.ConfigFile as ConfigFile
15-
import qualified Test.Cardano.Db.Mock.Unit.Babbage.CommandLineArg.EpochDisabled as EpochDisabled
16-
import qualified Test.Cardano.Db.Mock.Unit.Babbage.Config.MigrateConsumedPruneTxOut as MigrateConsumedPruneTxOut
17-
import qualified Test.Cardano.Db.Mock.Unit.Babbage.Config.Parse as Config
18-
import qualified Test.Cardano.Db.Mock.Unit.Babbage.InlineAndReference as BabInlineRef
19-
import qualified Test.Cardano.Db.Mock.Unit.Babbage.Other as BabOther
20-
import qualified Test.Cardano.Db.Mock.Unit.Babbage.Plutus as BabPlutus
2114
import qualified Test.Cardano.Db.Mock.Unit.Babbage.Reward as BabReward
22-
import qualified Test.Cardano.Db.Mock.Unit.Babbage.Rollback as BabRollback
2315
import qualified Test.Cardano.Db.Mock.Unit.Babbage.Simple as BabSimple
24-
import qualified Test.Cardano.Db.Mock.Unit.Babbage.Stake as BabStake
2516
import qualified Test.Cardano.Db.Mock.Unit.Babbage.Tx as BabTx
26-
import Test.Cardano.Db.Mock.Validate (expectFailSilent)
2717

2818
unitTests :: IOManager -> [(Text, Text)] -> TestTree
2919
unitTests iom knownMigrations =
3020
testGroup
3121
"Babbage unit tests"
3222
[ testGroup
33-
"config"
34-
[ testCase "default insert config" Config.defaultInsertConfig
35-
, testCase "insert config" Config.insertConfig
36-
, testGroup
37-
"tx-out"
38-
[ test "basic prune" MigrateConsumedPruneTxOut.basicPrune
39-
, test "basic prune with address table" MigrateConsumedPruneTxOut.basicPruneWithAddress
40-
, test "prune with simple rollback" MigrateConsumedPruneTxOut.pruneWithSimpleRollback
41-
, test "prune with full tx rollback" MigrateConsumedPruneTxOut.pruneWithFullTxRollback
42-
, test "pruning should keep some tx" MigrateConsumedPruneTxOut.pruningShouldKeepSomeTx
43-
, test "prune and rollback one block" MigrateConsumedPruneTxOut.pruneAndRollBackOneBlock
44-
, test "no pruning and rollback" MigrateConsumedPruneTxOut.noPruneAndRollBack
45-
, test "prune same block" MigrateConsumedPruneTxOut.pruneSameBlock
46-
, test "no pruning same block" MigrateConsumedPruneTxOut.noPruneSameBlock
47-
, expectFailSilent "restart with new consumed set to false" $ MigrateConsumedPruneTxOut.migrateAndPruneRestart iom knownMigrations
48-
, expectFailSilent "set prune flag, restart missing prune flag" $ MigrateConsumedPruneTxOut.pruneRestartMissingFlag iom knownMigrations
49-
, expectFailSilent "set bootstrap flag, restart missing bootstrap flag" $ MigrateConsumedPruneTxOut.bootstrapRestartMissingFlag iom knownMigrations
50-
]
51-
, testGroup
52-
"tx-out using Address table"
53-
[ test "basic prune with address table" MigrateConsumedPruneTxOut.basicPruneWithAddress
54-
, test "prune with simple rollback with address table" MigrateConsumedPruneTxOut.pruneWithSimpleRollbackWithAddress
55-
, test "prune with full tx rollback with address table" MigrateConsumedPruneTxOut.pruneWithFullTxRollbackWithAddress
56-
, test "pruning should keep some tx with address table" MigrateConsumedPruneTxOut.pruningShouldKeepSomeTxWithAddress
57-
, test "prune and rollback one block with address table" MigrateConsumedPruneTxOut.pruneAndRollBackOneBlockWithAddress
58-
, test "no pruning and rollback with address table" MigrateConsumedPruneTxOut.noPruneAndRollBackWithAddress
59-
, test "prune same block with address table" MigrateConsumedPruneTxOut.pruneSameBlockWithAddress
60-
, test "no pruning same block with address table" MigrateConsumedPruneTxOut.noPruneSameBlockWithAddress
61-
, expectFailSilent "restart with new consumed set to false, with address table" $ MigrateConsumedPruneTxOut.migrateAndPruneRestartWithAddress iom knownMigrations
62-
, expectFailSilent "set prune flag, restart missing prune flag, with address table" $ MigrateConsumedPruneTxOut.pruneRestartMissingFlagWithAddress iom knownMigrations
63-
, expectFailSilent "set bootstrap flag, restart missing bootstrap flag, with address table" $ MigrateConsumedPruneTxOut.bootstrapRestartMissingFlagWithAddress iom knownMigrations
64-
]
65-
]
66-
, testGroup
6723
"simple"
6824
[ test "simple forge blocks" BabSimple.forgeBlocks
6925
, test "sync one block" BabSimple.addSimple
@@ -72,60 +28,12 @@ unitTests iom knownMigrations =
7228
, test "node restart" BabSimple.nodeRestart
7329
, test "node restart boundary" BabSimple.nodeRestartBoundary
7430
]
75-
, testGroup
76-
"Command Line Arguments"
77-
[ testGroup
78-
"config"
79-
[ expectFailSilent "fails if incorrect config file given" $ ConfigFile.checkConfigFileArg iom knownMigrations
80-
]
81-
, testGroup
82-
"disable-epoch"
83-
[ test "Epoch doesn't update when disabled" EpochDisabled.checkEpochDisabledArg
84-
, test "Epoch updates when enabled" EpochDisabled.checkEpochEnabled
85-
]
86-
]
87-
, testGroup
88-
"rollbacks"
89-
[ test "simple rollback" BabRollback.simpleRollback
90-
, test "sync bigger chain" BabRollback.bigChain
91-
, test "rollback while db-sync is off" BabRollback.restartAndRollback
92-
, -- , test "rollback further" rollbackFurther disabled
93-
test "big rollbacks executed lazily" BabRollback.lazyRollback
94-
, test "lazy rollback on restart" BabRollback.lazyRollbackRestart
95-
, test "rollback while rollbacking" BabRollback.doubleRollback
96-
, test "rollback stake address cache" BabRollback.stakeAddressRollback
97-
, test "rollback change order of txs" BabRollback.rollbackChangeTxOrder
98-
, test "rollback full tx" BabRollback.rollbackFullTx
99-
]
100-
, testGroup
101-
"different configs"
102-
[ test "genesis config without pool" BabOther.configNoPools
103-
, test "genesis config without stakes" BabOther.configNoStakes
104-
]
10531
, testGroup
10632
"blocks with txs"
10733
[ test "simple tx" BabTx.addSimpleTx
10834
, test "simple tx in Shelley era" BabTx.addSimpleTxShelley
10935
, test "consume utxo same block" BabTx.consumeSameBlock
11036
]
111-
, testGroup
112-
"stake addresses"
113-
[ test "(de)registrations" BabStake.registrationTx
114-
, test "(de)registrations in same block" BabStake.registrationsSameBlock
115-
, test "(de)registrations in same tx" BabStake.registrationsSameTx
116-
, test "stake address pointers" BabStake.stakeAddressPtr
117-
, test "stake address pointers deregistration" BabStake.stakeAddressPtrDereg
118-
, test "stake address pointers. Use before registering." BabStake.stakeAddressPtrUseBefore
119-
]
120-
, testGroup
121-
"stake distribution"
122-
[ test "stake distribution from genesis" BabStake.stakeDistGenesis
123-
, test "2000 delegations" BabStake.delegations2000
124-
, test "2001 delegations" BabStake.delegations2001
125-
, test "8000 delegations" BabStake.delegations8000
126-
, test "many delegations" BabStake.delegationsMany
127-
, test "many delegations, sparse chain" BabStake.delegationsManyNotDense
128-
]
12937
, testGroup
13038
"rewards"
13139
[ test "rewards simple" BabReward.simpleRewards
@@ -141,65 +49,6 @@ unitTests iom knownMigrations =
14149
test "rollback on epoch boundary" BabReward.rollbackBoundary
14250
, test "single MIR Cert multiple outputs" BabReward.singleMIRCertMultiOut
14351
]
144-
, testGroup
145-
"plutus spend scripts"
146-
[ test "simple script lock" BabPlutus.simpleScript
147-
, test "unlock script in same block" BabPlutus.unlockScriptSameBlock
148-
, test "failed script" BabPlutus.failedScript
149-
, test "failed script fees" BabPlutus.failedScriptFees
150-
, test "failed script in same block" BabPlutus.failedScriptSameBlock
151-
, test "multiple scripts unlocked" BabPlutus.multipleScripts
152-
, test "multiple scripts unlocked rollback" BabPlutus.multipleScriptsRollback
153-
, test "multiple scripts unlocked same block" BabPlutus.multipleScriptsSameBlock
154-
, test "multiple scripts failed" BabPlutus.multipleScriptsFailed
155-
, test "multiple scripts failed same block" BabPlutus.multipleScriptsFailedSameBlock
156-
]
157-
, testGroup
158-
"plutus cert scripts"
159-
[ test "stake scripts" BabPlutus.registrationScriptTx
160-
, test "stake scripts deregistration" BabPlutus.deregistrationScriptTx
161-
, test "multiple stake scripts deregistration" BabPlutus.deregistrationsScriptTxs
162-
, test "multiple stake scripts deregistration in same tx" BabPlutus.deregistrationsScriptTx
163-
, test "multiple stake scripts deregistration in same tx missing redeemer 1" BabPlutus.deregistrationsScriptTx'
164-
, test "multiple stake scripts deregistration in same tx missing redeemer 2" BabPlutus.deregistrationsScriptTx''
165-
]
166-
, testGroup
167-
"MultiAssets plutus scripts"
168-
[ test "mint simple multi asset" BabPlutus.mintMultiAsset
169-
, test "mint many multi assets" BabPlutus.mintMultiAssets
170-
, test "swap many multi assets" BabPlutus.swapMultiAssets
171-
]
172-
, testGroup
173-
"pools and smash"
174-
[ test "pool registration" BabOther.poolReg
175-
, test "query pool that's not registered" BabOther.nonexistantPoolQuery
176-
, test "pool deregistration" BabOther.poolDeReg
177-
, test "pool multiple deregistration" BabOther.poolDeRegMany
178-
, test "delist pool" BabOther.poolDelist
179-
]
180-
, testGroup
181-
"Babbage inline and reference"
182-
[ test "spend inline datum" BabInlineRef.unlockDatumOutput
183-
, test "spend inline datum same block" BabInlineRef.unlockDatumOutputSameBlock
184-
, test "inline datum with non canonical CBOR" BabInlineRef.inlineDatumCBOR
185-
, test "spend reference script" BabInlineRef.spendRefScript
186-
, test "spend reference script same block" BabInlineRef.spendRefScriptSameBlock
187-
, test "spend collateral output of invalid tx" BabInlineRef.spendCollateralOutput
188-
, test "spend collateral output of invalid tx rollback" BabInlineRef.spendCollateralOutputRollback
189-
, test "spend collateral output of invalid tx same block" BabInlineRef.spendCollateralOutputSameBlock
190-
, test "reference input to output which is not spent" BabInlineRef.referenceInputUnspend
191-
, test "supply and run script which is both reference and in witnesses" BabInlineRef.supplyScriptsTwoWays
192-
, test "supply and run script which is both reference and in witnesses same block" BabInlineRef.supplyScriptsTwoWaysSameBlock
193-
, test "reference script as minting" BabInlineRef.referenceMintingScript
194-
, test "reference script as delegation" BabInlineRef.referenceDelegation
195-
]
196-
, testGroup
197-
"Hard Fork"
198-
[ test "fork from Alonzo to Babbage fixed epoch" BabOther.forkFixedEpoch
199-
, test "fork from Alonzo to Babbage and rollback" BabOther.rollbackFork
200-
-- TODO fix this test.
201-
-- , test "fork from Alonzo to Babbage using proposal" forkWithProposal
202-
]
20352
]
20453
where
20554
test :: String -> (IOManager -> [(Text, Text)] -> Assertion) -> TestTree

‎cardano-chain-gen/test/Test/Cardano/Db/Mock/Unit/Babbage/CommandLineArg/ConfigFile.hs

-20
This file was deleted.

‎cardano-chain-gen/test/Test/Cardano/Db/Mock/Unit/Babbage/CommandLineArg/EpochDisabled.hs

-50
This file was deleted.

‎cardano-chain-gen/test/Test/Cardano/Db/Mock/Unit/Babbage/Config/MigrateConsumedPruneTxOut.hs

-413
This file was deleted.

‎cardano-chain-gen/test/Test/Cardano/Db/Mock/Unit/Babbage/Config/Parse.hs

-41
This file was deleted.

‎cardano-chain-gen/test/Test/Cardano/Db/Mock/Unit/Babbage/InlineAndReference.hs

-434
This file was deleted.

‎cardano-chain-gen/test/Test/Cardano/Db/Mock/Unit/Babbage/Other.hs

-392
This file was deleted.

‎cardano-chain-gen/test/Test/Cardano/Db/Mock/Unit/Babbage/Plutus.hs

-508
This file was deleted.

‎cardano-chain-gen/test/Test/Cardano/Db/Mock/Unit/Babbage/Rollback.hs

-257
This file was deleted.

‎cardano-chain-gen/test/Test/Cardano/Db/Mock/Unit/Babbage/Stake.hs

-340
This file was deleted.

‎cardano-db-sync/app/cardano-db-sync.hs

+8-211
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ import Paths_cardano_db_sync (version)
1818
import System.Info (arch, compilerName, compilerVersion, os)
1919
import Prelude (error)
2020

21+
---------------------------------------------------------------------------------------------------
22+
-- Main entry point into the app
23+
---------------------------------------------------------------------------------------------------
2124
main :: IO ()
2225
main = do
2326
cmd <- Opt.execParser opts
@@ -43,7 +46,7 @@ main = do
4346
-- Or to ignore ledger and not specify the state
4447
(Nothing, LedgerIgnore) -> error stateDirErrorMsg
4548
-- Otherwise, it's OK
46-
_ -> pure ()
49+
_otherwise -> pure ()
4750

4851
let prometheusPort = dncPrometheusPort syncNodeConfigFromFile
4952
withMetricSetters prometheusPort $ \metricsSetters ->
@@ -55,12 +58,13 @@ main = do
5558
<> "For more details view https://github.com/IntersectMBO/cardano-db-sync/blob"
5659
<> "/master/doc/syncing-and-rollbacks.md#ledger-state"
5760

58-
-- -------------------------------------------------------------------------------------------------
59-
61+
---------------------------------------------------------------------------------------------------
62+
-- Command Line Configurations
63+
---------------------------------------------------------------------------------------------------
6064
opts :: ParserInfo SyncCommand
6165
opts =
6266
Opt.info
63-
(pDeprecated <*> pCommandLine <**> Opt.helper)
67+
(pCommandLine <**> Opt.helper)
6468
( Opt.fullDesc
6569
<> Opt.progDesc "Cardano PostgreSQL sync node."
6670
)
@@ -73,27 +77,6 @@ pCommandLine =
7377
, CmdRun <$> pRunDbSyncNode
7478
]
7579

76-
pDeprecated :: Parser (a -> a)
77-
pDeprecated =
78-
pDisableOfflineData
79-
<*> pHasLedger
80-
<*> pShouldUseLedger
81-
<*> pKeepTxMetadata
82-
<*> pHasShelley
83-
<*> pHasMultiAssets
84-
<*> pHasMetadata
85-
<*> pHasPlutusExtra
86-
<*> pHasGov
87-
<*> pHasOffChainPoolData
88-
<*> pForceTxIn
89-
<*> pDisableAllMode
90-
<*> pFullMode
91-
<*> pOnlyUTxO
92-
<*> pOnlyGov
93-
<*> pMigrateConsumed
94-
<*> pPruneTxOut
95-
<*> pBootstrap
96-
9780
pRunDbSyncNode :: Parser SyncNodeParams
9881
pRunDbSyncNode = do
9982
SyncNodeParams
@@ -104,8 +87,6 @@ pRunDbSyncNode = do
10487
<*> pPGPassSource
10588
<*> pEpochDisabled
10689
<*> pHasCache
107-
<*> pSkipFix
108-
<*> pOnlyFix
10990
<*> pForceIndexes
11091
<*> pHasInOut
11192
<*> pure 500
@@ -161,15 +142,6 @@ pEpochDisabled =
161142
<> Opt.help "Makes epoch table remain empty"
162143
)
163144

164-
pSkipFix :: Parser Bool
165-
pSkipFix =
166-
Opt.flag
167-
False
168-
True
169-
( Opt.long "skip-fix"
170-
<> Opt.help "Disables the db-sync fix procedure for the wrong datum and redeemer_data bytes."
171-
)
172-
173145
pForceIndexes :: Parser Bool
174146
pForceIndexes =
175147
Opt.flag
@@ -179,18 +151,6 @@ pForceIndexes =
179151
<> Opt.help "Forces the Index creation at the start of db-sync. Normally they're created later."
180152
)
181153

182-
pOnlyFix :: Parser Bool
183-
pOnlyFix =
184-
Opt.flag
185-
False
186-
True
187-
( Opt.long "fix-only"
188-
<> Opt.help
189-
"Runs only the db-sync fix procedure for the wrong datum, redeemer_data and plutus script bytes and exits. \
190-
\This doesn't run any migrations. This can also be ran on previous schema, ie 13.0 13.1 to fix the issues without \
191-
\bumping the schema version minor number."
192-
)
193-
194154
pHasCache :: Parser Bool
195155
pHasCache =
196156
Opt.flag
@@ -244,169 +204,6 @@ pVersionCommand =
244204
)
245205
]
246206

247-
-- * Deprecated flags
248-
pDisableOfflineData :: Parser (a -> a)
249-
pDisableOfflineData =
250-
Opt.abortOption
251-
(Opt.InfoMsg "Error: disable-offline-data has been deprecated, please use disable-offchain-pool-data instead")
252-
( Opt.long "disable-offline-data"
253-
<> Opt.help "disable-offline-data is deprecated"
254-
<> Opt.hidden
255-
)
256-
257-
pHasLedger :: Parser (a -> a)
258-
pHasLedger =
259-
Opt.abortOption
260-
(Opt.InfoMsg "Error: disable-ledger has been deprecated, please configure ledger in db-sync-config.json instead")
261-
( Opt.long "disable-ledger"
262-
<> Opt.help "disable-ledger is deprecated"
263-
<> Opt.hidden
264-
)
265-
266-
pShouldUseLedger :: Parser (a -> a)
267-
pShouldUseLedger =
268-
Opt.abortOption
269-
(Opt.InfoMsg "Error: dont-use-ledger has been deprecated, please configure ledger in db-sync-config.json instead")
270-
( Opt.long "dont-use-ledger"
271-
<> Opt.help "dont-use-ledger is deprecated"
272-
<> Opt.hidden
273-
)
274-
275-
pKeepTxMetadata :: Parser (a -> a)
276-
pKeepTxMetadata =
277-
Opt.abortOption
278-
(Opt.InfoMsg "Error: keep-tx-metadata has been deprecated, please configure ledger in db-sync-config.json instead")
279-
( Opt.long "keep-tx-metadata"
280-
<> Opt.help "keep-tx-metadata is deprecated"
281-
<> Opt.hidden
282-
)
283-
284-
pHasShelley :: Parser (a -> a)
285-
pHasShelley =
286-
Opt.abortOption
287-
(Opt.InfoMsg "Error: disable-shelley has been deprecated, please configure shelley in db-sync-config.json instead")
288-
( Opt.long "disable-shelley"
289-
<> Opt.help "disable-shelley is deprecated"
290-
<> Opt.hidden
291-
)
292-
293-
pHasMultiAssets :: Parser (a -> a)
294-
pHasMultiAssets =
295-
Opt.abortOption
296-
(Opt.InfoMsg "Error: disable-multiassets has been deprecated, please configure multi-assets in db-sync-config.json instead")
297-
( Opt.long "disable-multiassets"
298-
<> Opt.help "disable-multiassets is deprecated"
299-
<> Opt.hidden
300-
)
301-
302-
pHasMetadata :: Parser (a -> a)
303-
pHasMetadata =
304-
Opt.abortOption
305-
(Opt.InfoMsg "Error: disable-metadata has been deprecated, please configure metadata in db-sync-config.json instead")
306-
( Opt.long "disable-metadata"
307-
<> Opt.help "disable-metadata is deprecated"
308-
<> Opt.hidden
309-
)
310-
311-
pHasPlutusExtra :: Parser (a -> a)
312-
pHasPlutusExtra =
313-
Opt.abortOption
314-
(Opt.InfoMsg "Error: disable-plutus-extra has been deprecated, please configure plutus in db-sync-config.json instead")
315-
( Opt.long "disable-metadata"
316-
<> Opt.help "disable-metadata is deprecated"
317-
<> Opt.hidden
318-
)
319-
320-
pHasGov :: Parser (a -> a)
321-
pHasGov =
322-
Opt.abortOption
323-
(Opt.InfoMsg "Error: disable-gov has been deprecated, please configure governance in db-sync-config.json instead")
324-
( Opt.long "disable-gov"
325-
<> Opt.help "disable-gov is deprecated"
326-
<> Opt.hidden
327-
)
328-
329-
pHasOffChainPoolData :: Parser (a -> a)
330-
pHasOffChainPoolData =
331-
Opt.abortOption
332-
(Opt.InfoMsg "Error: disable-offchain-pool-data has been deprecated, please configure offchain pool data in db-sync-config.json instead")
333-
( Opt.long "disable-offchain-pool-data"
334-
<> Opt.help "disable-gov is deprecated"
335-
<> Opt.hidden
336-
)
337-
338-
pForceTxIn :: Parser (a -> a)
339-
pForceTxIn =
340-
Opt.abortOption
341-
(Opt.InfoMsg "Error: force-tx-in has been deprecated, please configure tx-out in db-sync-config.json instead")
342-
( Opt.long "force-tx-in"
343-
<> Opt.help "force-tx-in is deprecated"
344-
<> Opt.hidden
345-
)
346-
347-
pDisableAllMode :: Parser (a -> a)
348-
pDisableAllMode =
349-
Opt.abortOption
350-
(Opt.InfoMsg "Error: disable-all has been deprecated, please configure db-sync-config.json instead")
351-
( Opt.long "disable-all"
352-
<> Opt.help "disable-all is deprecated"
353-
<> Opt.hidden
354-
)
355-
356-
pFullMode :: Parser (a -> a)
357-
pFullMode =
358-
Opt.abortOption
359-
(Opt.InfoMsg "Error: full has been deprecated, please configure db-sync-config.json instead")
360-
( Opt.long "full"
361-
<> Opt.help "full is deprecated"
362-
<> Opt.hidden
363-
)
364-
365-
pOnlyUTxO :: Parser (a -> a)
366-
pOnlyUTxO =
367-
Opt.abortOption
368-
(Opt.InfoMsg "Error: only-utxo has been deprecated, please configure db-sync-config.json instead")
369-
( Opt.long "only-utxo"
370-
<> Opt.help "only-utxo is deprecated"
371-
<> Opt.hidden
372-
)
373-
374-
pOnlyGov :: Parser (a -> a)
375-
pOnlyGov =
376-
Opt.abortOption
377-
(Opt.InfoMsg "Error: only-gov has been deprecated, please configure db-sync-config.json instead")
378-
( Opt.long "only-gov"
379-
<> Opt.help "only-gov is deprecated"
380-
<> Opt.hidden
381-
)
382-
383-
pMigrateConsumed :: Parser (a -> a)
384-
pMigrateConsumed =
385-
Opt.abortOption
386-
(Opt.InfoMsg "Error: consumed-tx-out has been deprecated, please configure tx-out in db-sync-config.json instead")
387-
( Opt.long "consumed-tx-out"
388-
<> Opt.help "consumed-tx-out is deprecated"
389-
<> Opt.hidden
390-
)
391-
392-
pPruneTxOut :: Parser (a -> a)
393-
pPruneTxOut =
394-
Opt.abortOption
395-
(Opt.InfoMsg "Error: prune-tx-out has been deprecated, please configure tx-out in db-sync-config.json instead")
396-
( Opt.long "prune-tx-out"
397-
<> Opt.help "prune-tx-out is deprecated"
398-
<> Opt.hidden
399-
)
400-
401-
pBootstrap :: Parser (a -> a)
402-
pBootstrap =
403-
Opt.abortOption
404-
(Opt.InfoMsg "Error: bootstrap-tx-out has been deprecated, please configure tx-out in db-sync-config.json instead")
405-
( Opt.long "bootstrap-tx-out"
406-
<> Opt.help "bootstrap-tx-out is deprecated"
407-
<> Opt.hidden
408-
)
409-
410207
command' :: String -> String -> Parser a -> Opt.Mod Opt.CommandFields a
411208
command' c descr p =
412209
Opt.command c $

‎cardano-db-sync/cardano-db-sync.cabal

-5
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,6 @@ library
119119

120120
Cardano.DbSync.Rollback
121121

122-
Cardano.DbSync.Fix.ConsumedBy
123-
Cardano.DbSync.Fix.EpochStake
124-
Cardano.DbSync.Fix.PlutusDataBytes
125-
Cardano.DbSync.Fix.PlutusScripts
126-
127122
-- OffChain
128123
Cardano.DbSync.OffChain
129124
Cardano.DbSync.OffChain.FetchQueue

‎cardano-db-sync/src/Cardano/DbSync.hs

+1-7
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ runDbSync metricsSetters knownMigrations iomgr trce params syncNodeConfigFromFil
122122
trce
123123
iomgr
124124
connectionString
125-
ranMigrations
126125
(void . runMigration)
127126
syncNodeConfigFromFile
128127
params
@@ -150,15 +149,13 @@ runSyncNode ::
150149
Trace IO Text ->
151150
IOManager ->
152151
ConnectionString ->
153-
-- | migrations were ran on startup
154-
Bool ->
155152
-- | run migration function
156153
RunMigration ->
157154
SyncNodeConfig ->
158155
SyncNodeParams ->
159156
SyncOptions ->
160157
IO ()
161-
runSyncNode metricsSetters trce iomgr dbConnString ranMigrations runMigrationFnc syncNodeConfigFromFile syncNodeParams syncOptions = do
158+
runSyncNode metricsSetters trce iomgr dbConnString runMigrationFnc syncNodeConfigFromFile syncNodeParams syncOptions = do
162159
whenJust maybeLedgerDir $
163160
\enpLedgerStateDir -> do
164161
createDirectoryIfMissing True (unLedgerStateDir enpLedgerStateDir)
@@ -185,7 +182,6 @@ runSyncNode metricsSetters trce iomgr dbConnString ranMigrations runMigrationFnc
185182
genCfg
186183
syncNodeConfigFromFile
187184
syncNodeParams
188-
ranMigrations
189185
runMigrationFnc
190186

191187
-- Warn the user that jsonb datatypes are being removed from the database schema.
@@ -243,8 +239,6 @@ extractSyncOptions snp aop snc =
243239
&& not (enpEpochDisabled snp || not (enpHasCache snp))
244240
, soptAbortOnInvalid = aop
245241
, soptCache = enpHasCache snp
246-
, soptSkipFix = enpSkipFix snp
247-
, soptOnlyFix = enpOnlyFix snp
248242
, soptPruneConsumeMigration =
249243
initPruneConsumeMigration
250244
isTxOutConsumed'

‎cardano-db-sync/src/Cardano/DbSync/Api.hs

+2-33
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ module Cardano.DbSync.Api (
1313
getConsistentLevel,
1414
isConsistent,
1515
getIsConsumedFixed,
16-
noneFixed,
17-
isDataFixed,
18-
getIsSyncFixed,
19-
setIsFixed,
20-
setIsFixedAndMigrate,
2116
getDisableInOutState,
2217
getRanIndexes,
2318
runIndexMigrations,
@@ -125,26 +120,6 @@ getIsConsumedFixed env =
125120
pcm = soptPruneConsumeMigration $ envOptions env
126121
backend = envBackend env
127122

128-
noneFixed :: FixesRan -> Bool
129-
noneFixed NoneFixRan = True
130-
noneFixed _ = False
131-
132-
isDataFixed :: FixesRan -> Bool
133-
isDataFixed DataFixRan = True
134-
isDataFixed _ = False
135-
136-
getIsSyncFixed :: SyncEnv -> IO FixesRan
137-
getIsSyncFixed = readTVarIO . envIsFixed
138-
139-
setIsFixed :: SyncEnv -> FixesRan -> IO ()
140-
setIsFixed env fr = do
141-
atomically $ writeTVar (envIsFixed env) fr
142-
143-
setIsFixedAndMigrate :: SyncEnv -> FixesRan -> IO ()
144-
setIsFixedAndMigrate env fr = do
145-
envRunDelayedMigration env DB.Fix
146-
atomically $ writeTVar (envIsFixed env) fr
147-
148123
getDisableInOutState :: SyncEnv -> IO Bool
149124
getDisableInOutState syncEnv = do
150125
bst <- readTVarIO $ envBootstrap syncEnv
@@ -343,10 +318,9 @@ mkSyncEnv ::
343318
SystemStart ->
344319
SyncNodeConfig ->
345320
SyncNodeParams ->
346-
Bool ->
347321
RunMigration ->
348322
IO SyncEnv
349-
mkSyncEnv trce backend connectionString syncOptions protoInfo nw nwMagic systemStart syncNodeConfigFromFile syncNP ranMigrations runMigrationFnc = do
323+
mkSyncEnv trce backend connectionString syncOptions protoInfo nw nwMagic systemStart syncNodeConfigFromFile syncNP runMigrationFnc = do
350324
dbCNamesVar <- newTVarIO =<< dbConstraintNamesExists backend
351325
cache <-
352326
if soptCache syncOptions
@@ -361,7 +335,6 @@ mkSyncEnv trce backend connectionString syncOptions protoInfo nw nwMagic systemS
361335
}
362336
else pure useNoCache
363337
consistentLevelVar <- newTVarIO Unchecked
364-
fixDataVar <- newTVarIO $ if ranMigrations then DataFixRan else NoneFixRan
365338
indexesVar <- newTVarIO $ enpForceIndexes syncNP
366339
bts <- getBootstrapInProgress trce (isTxOutConsumedBootstrap' syncNodeConfigFromFile) backend
367340
bootstrapVar <- newTVarIO bts
@@ -403,7 +376,6 @@ mkSyncEnv trce backend connectionString syncOptions protoInfo nw nwMagic systemS
403376
, envCurrentEpochNo = epochVar
404377
, envEpochSyncTime = epochSyncTime
405378
, envIndexes = indexesVar
406-
, envIsFixed = fixDataVar
407379
, envLedgerEnv = ledgerEnvType
408380
, envNetworkMagic = nwMagic
409381
, envOffChainPoolResultQueue = oprq
@@ -427,12 +399,10 @@ mkSyncEnvFromConfig ::
427399
GenesisConfig ->
428400
SyncNodeConfig ->
429401
SyncNodeParams ->
430-
-- | migrations were ran on startup
431-
Bool ->
432402
-- | run migration function
433403
RunMigration ->
434404
IO (Either SyncNodeError SyncEnv)
435-
mkSyncEnvFromConfig trce backend connectionString syncOptions genCfg syncNodeConfigFromFile syncNodeParams ranMigration runMigrationFnc =
405+
mkSyncEnvFromConfig trce backend connectionString syncOptions genCfg syncNodeConfigFromFile syncNodeParams runMigrationFnc =
436406
case genCfg of
437407
GenesisCardano _ bCfg sCfg _ _
438408
| unProtocolMagicId (Byron.configProtocolMagicId bCfg) /= Shelley.sgNetworkMagic (scConfig sCfg) ->
@@ -468,7 +438,6 @@ mkSyncEnvFromConfig trce backend connectionString syncOptions genCfg syncNodeCon
468438
(SystemStart . Byron.gdStartTime $ Byron.configGenesisData bCfg)
469439
syncNodeConfigFromFile
470440
syncNodeParams
471-
ranMigration
472441
runMigrationFnc
473442

474443
-- | 'True' is for in memory points and 'False' for on disk

‎cardano-db-sync/src/Cardano/DbSync/Api/Types.hs

-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ module Cardano.DbSync.Api.Types (
88
InsertOptions (..),
99
LedgerEnv (..),
1010
RunMigration,
11-
FixesRan (..),
1211
ConsistentLevel (..),
1312
CurrentEpochNo (..),
1413
) where
@@ -46,7 +45,6 @@ data SyncEnv = SyncEnv
4645
, envCurrentEpochNo :: !(StrictTVar IO CurrentEpochNo)
4746
, envEpochSyncTime :: !(StrictTVar IO UTCTime)
4847
, envIndexes :: !(StrictTVar IO Bool)
49-
, envIsFixed :: !(StrictTVar IO FixesRan)
5048
, envBootstrap :: !(StrictTVar IO Bool)
5149
, envLedgerEnv :: !LedgerEnv
5250
, envNetworkMagic :: !NetworkMagic
@@ -64,8 +62,6 @@ data SyncOptions = SyncOptions
6462
{ soptEpochAndCacheEnabled :: !Bool
6563
, soptAbortOnInvalid :: !Bool
6664
, soptCache :: !Bool
67-
, soptSkipFix :: !Bool
68-
, soptOnlyFix :: !Bool
6965
, soptPruneConsumeMigration :: !DB.PruneConsumeMigration
7066
, soptInsertOptions :: !InsertOptions
7167
, snapshotEveryFollowing :: !Word64
@@ -98,8 +94,6 @@ data LedgerEnv where
9894

9995
type RunMigration = DB.MigrationToRun -> IO ()
10096

101-
data FixesRan = NoneFixRan | DataFixRan | AllFixRan
102-
10397
data ConsistentLevel = Consistent | DBAheadOfLedger | Unchecked
10498
deriving (Show, Eq)
10599

‎cardano-db-sync/src/Cardano/DbSync/Config/Types.hs

-2
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ data SyncNodeParams = SyncNodeParams
103103
, enpPGPassSource :: !PGPassSource
104104
, enpEpochDisabled :: !Bool
105105
, enpHasCache :: !Bool
106-
, enpSkipFix :: !Bool
107-
, enpOnlyFix :: !Bool
108106
, enpForceIndexes :: !Bool
109107
, enpHasInOut :: !Bool
110108
, enpSnEveryFollowing :: !Word64

‎cardano-db-sync/src/Cardano/DbSync/Default.hs

-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import Cardano.DbSync.Era.Universal.Epoch (hasEpochStartEvent, hasNewEpochEvent)
2424
import Cardano.DbSync.Era.Universal.Insert.Certificate (mkAdaPots)
2525
import Cardano.DbSync.Era.Universal.Insert.LedgerEvent (insertNewEpochLedgerEvents)
2626
import Cardano.DbSync.Error
27-
import Cardano.DbSync.Fix.EpochStake
2827
import Cardano.DbSync.Ledger.State (applyBlockAndSnapshot, defaultApplyResult)
2928
import Cardano.DbSync.Ledger.Types (ApplyResult (..))
3029
import Cardano.DbSync.LocalStateQuery
@@ -83,7 +82,6 @@ applyAndInsertBlockMaybe syncEnv tracer cblk = do
8382
, ". Time to restore consistency."
8483
]
8584
rollbackFromBlockNo syncEnv (blockNo cblk)
86-
void $ migrateStakeDistr syncEnv (apOldLedger applyRes)
8785
insertBlock syncEnv cblk applyRes True tookSnapshot
8886
liftIO $ setConsistentLevel syncEnv Consistent
8987
Right blockId | Just (adaPots, slotNo, epochNo) <- getAdaPots applyRes -> do

‎cardano-db-sync/src/Cardano/DbSync/Fix/ConsumedBy.hs

-59
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.