Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit d9e5218

Browse files
committed
Fix various CardanoConfiguration types to align with cardano-ledger
1 parent 132f96c commit d9e5218

File tree

5 files changed

+33
-33
lines changed

5 files changed

+33
-33
lines changed

nix/.stack.nix/cardano-shell.nix

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nix/.stack.nix/default.nix

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Cardano/Shell/Constants/Types.hs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ data Initializer = Initializer
100100

101101
-- | These options determine balances of nodes specific for testnet.
102102
data TestBalance = TestBalance
103-
{ tePoors :: !Int
103+
{ tePoors :: !Word
104104
-- ^ Number of poor nodes (with small balance).
105105
, teRichmen :: !Word
106106
-- ^ Number of rich nodes (with huge balance).
107107
, teRichmenShare :: !Double
108108
-- ^ Portion of stake owned by all richmen together.
109109
, teUseHDAddresses :: !Bool
110110
-- ^ Whether generate plain addresses or with hd payload.
111-
, teTotalBalance :: !Int
111+
, teTotalBalance :: !Word64
112112
-- ^ Total balance owned by these nodes.
113113
} deriving (Eq, Show)
114114

@@ -126,41 +126,41 @@ data ModuleAutoRestart
126126
deriving (Eq, Show)
127127

128128
data BlockVersionData = BlockVersionData
129-
{ bvdScriptVersion :: !Int
129+
{ bvdScriptVersion :: !Word16
130130
, bvdSlotDuration :: !Int
131-
, bvdMaxBlockSize :: !Int
132-
, bvdMaxHeaderSize :: !Int
133-
, bvdMaxTxSize :: !Int
134-
, bvdMaxProposalSize :: !Int
135-
, bvdMpcThd :: !Float
136-
, bvdHeavyDelThd :: !Float
137-
, bvdUpdateVoteThd :: !Float
138-
, bvdUpdateProposalThd :: !Float
139-
, bvdUpdateImplicit :: !Int
131+
, bvdMaxBlockSize :: !Natural
132+
, bvdMaxHeaderSize :: !Natural
133+
, bvdMaxTxSize :: !Natural
134+
, bvdMaxProposalSize :: !Natural
135+
, bvdMpcThd :: !Word64
136+
, bvdHeavyDelThd :: !Word64
137+
, bvdUpdateVoteThd :: !Word64
138+
, bvdUpdateProposalThd :: !Word64
139+
, bvdUpdateImplicit :: !Word64
140140
, bvdSoftforkRule :: !SoftForkRule
141141
, bvdTXFeePolicy :: !TxFeePolicy
142-
, bvdUnlockStakeEpoch :: !Integer
142+
, bvdUnlockStakeEpoch :: !Word64
143143
} deriving (Eq, Show)
144144

145145
data SoftForkRule = SoftForkRule
146-
{ sfrInitThd :: !Float
147-
, sfrMinThd :: !Float
148-
, sfrThdDecrement :: !Float
146+
{ sfrInitThd :: !Word64
147+
, sfrMinThd :: !Word64
148+
, sfrThdDecrement :: !Word64
149149
} deriving (Eq, Show)
150150

151151
data TxFeePolicy = TxFeePolicy
152152
{ txfTXSizeLinear :: !TxSizeLinear
153153
} deriving (Eq, Show)
154154

155155
data TxSizeLinear = TxSizeLinear
156-
{ txsA :: !Int
157-
, txsB :: !Float
156+
{ txsA :: !Word64
157+
, txsB :: !Word64
158158
} deriving (Eq, Show)
159159

160160
data ProtocolConstants = ProtocolConstants
161-
{ prK :: !Int
161+
{ prK :: !Word64
162162
-- ^ Security parameter from the paper.
163-
, prProtocolMagic :: !Int
163+
, prProtocolMagic :: !Word32
164164
-- ^ Magic constant for separating real/testnet.
165165
} deriving (Eq, Show)
166166

src/Cardano/Shell/Presets.hs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ mainnetConfiguration =
101101
, geSrc = "mainnet-genesis.json"
102102
, geFileHash = "5f20df933584822601f9e3f8c024eb5eb252fe8cefb24d1317dc3d432e940ebb"
103103
}
104-
, coRequiresNetworkMagic = "NetworkMainOrStage"
104+
, coRequiresNetworkMagic = "RequiresNoMagic"
105105
, coDBSerializeVersion = 0
106106
}
107107
, ccNTP =
@@ -249,23 +249,23 @@ devConfiguration =
249249
, bvdMaxHeaderSize = 2000000
250250
, bvdMaxTxSize = 4096
251251
, bvdMaxProposalSize = 700
252-
, bvdMpcThd = 0.01
253-
, bvdHeavyDelThd = 0.005
254-
, bvdUpdateVoteThd = 0.001
255-
, bvdUpdateProposalThd = 0.1
252+
, bvdMpcThd = 10
253+
, bvdHeavyDelThd = 5
254+
, bvdUpdateVoteThd = 1
255+
, bvdUpdateProposalThd = 100
256256
, bvdUpdateImplicit = 10
257257
, bvdSoftforkRule =
258258
SoftForkRule
259-
{ sfrInitThd = 0.9
260-
, sfrMinThd = 0.6
261-
, sfrThdDecrement = 0.05
259+
{ sfrInitThd = 90
260+
, sfrMinThd = 60
261+
, sfrThdDecrement = 5
262262
}
263263
, bvdTXFeePolicy =
264264
TxFeePolicy
265265
{ txfTXSizeLinear =
266266
TxSizeLinear
267267
{ txsA = 155381
268-
, txsB = 43.946
268+
, txsB = 43
269269
}
270270
}
271271
, bvdUnlockStakeEpoch = 18446744073709551615

stack.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# resolver: ./custom-snapshot.yaml
2020
# resolver: https://example.com/snapshots/2018-01-01.yaml
2121

22-
resolver: https://raw.githubusercontent.com/input-output-hk/cardano-prelude/7f8544ae9e162b6664f07093227edb148f1c8a5b/snapshot.yaml
22+
resolver: https://raw.githubusercontent.com/input-output-hk/cardano-prelude/106f3e31b2c89865a90e9be0afbc6a28fb50ad65/snapshot.yaml
2323

2424
# User packages to be built.
2525
# Various formats can be used as shown in the example below.
@@ -71,7 +71,7 @@ extra-deps:
7171
- containers-0.5.11.0
7272

7373
- process-1.6.5.0
74-
74+
7575
- transformers-0.5.6.2
7676

7777
# Override default flag values for local packages and extra-deps

0 commit comments

Comments
 (0)