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

Commit b806da4

Browse files
committed
* Use latest versions of dependencies
* Add snockets
1 parent ce779cf commit b806da4

File tree

12 files changed

+228
-175
lines changed

12 files changed

+228
-175
lines changed

cabal.project

+82-46
Original file line numberDiff line numberDiff line change
@@ -95,58 +95,93 @@ source-repository-package
9595
source-repository-package
9696
type: git
9797
location: https://github.com/input-output-hk/ouroboros-network
98-
tag: 398004e1403367cc2a25c639eb6349d473e51b2d
99-
--sha256: 1x940w0sma3mhl4hfd937sp25hdl3migkl8zsyl92p59468218i9
98+
tag: 85934cc7e19e4a94547c79073d28ca77bb29897f
99+
--sha256: 1xgkdqi7cpmi0vq2lxq7d365yskp2v5rkh3g2m3ic3wplb00d7jd
100100
subdir: io-sim
101101

102102
source-repository-package
103103
type: git
104104
location: https://github.com/input-output-hk/ouroboros-network
105-
tag: 398004e1403367cc2a25c639eb6349d473e51b2d
106-
--sha256: 1x940w0sma3mhl4hfd937sp25hdl3migkl8zsyl92p59468218i9
105+
tag: 85934cc7e19e4a94547c79073d28ca77bb29897f
106+
--sha256: 1xgkdqi7cpmi0vq2lxq7d365yskp2v5rkh3g2m3ic3wplb00d7jd
107107
subdir: io-sim-classes
108108

109109
source-repository-package
110110
type: git
111111
location: https://github.com/input-output-hk/ouroboros-network
112-
tag: 398004e1403367cc2a25c639eb6349d473e51b2d
113-
--sha256: 1x940w0sma3mhl4hfd937sp25hdl3migkl8zsyl92p59468218i9
112+
tag: 85934cc7e19e4a94547c79073d28ca77bb29897f
113+
--sha256: 1xgkdqi7cpmi0vq2lxq7d365yskp2v5rkh3g2m3ic3wplb00d7jd
114114
subdir: ouroboros-consensus
115115

116116
source-repository-package
117117
type: git
118118
location: https://github.com/input-output-hk/ouroboros-network
119-
tag: 398004e1403367cc2a25c639eb6349d473e51b2d
120-
--sha256: 1x940w0sma3mhl4hfd937sp25hdl3migkl8zsyl92p59468218i9
119+
tag: 85934cc7e19e4a94547c79073d28ca77bb29897f
120+
--sha256: 1xgkdqi7cpmi0vq2lxq7d365yskp2v5rkh3g2m3ic3wplb00d7jd
121+
subdir: ouroboros-consensus-byron
122+
123+
source-repository-package
124+
type: git
125+
location: https://github.com/input-output-hk/ouroboros-network
126+
tag: 85934cc7e19e4a94547c79073d28ca77bb29897f
127+
--sha256: 1xgkdqi7cpmi0vq2lxq7d365yskp2v5rkh3g2m3ic3wplb00d7jd
121128
subdir: ouroboros-network
122129

123130
source-repository-package
124131
type: git
125132
location: https://github.com/input-output-hk/ouroboros-network
126-
tag: 398004e1403367cc2a25c639eb6349d473e51b2d
127-
--sha256: 1x940w0sma3mhl4hfd937sp25hdl3migkl8zsyl92p59468218i9
133+
tag: 85934cc7e19e4a94547c79073d28ca77bb29897f
134+
--sha256: 1xgkdqi7cpmi0vq2lxq7d365yskp2v5rkh3g2m3ic3wplb00d7jd
135+
subdir: ouroboros-network-framework
136+
137+
source-repository-package
138+
type: git
139+
location: https://github.com/input-output-hk/ouroboros-network
140+
tag: 85934cc7e19e4a94547c79073d28ca77bb29897f
141+
--sha256: 1xgkdqi7cpmi0vq2lxq7d365yskp2v5rkh3g2m3ic3wplb00d7jd
128142
subdir: ouroboros-network-testing
129143

130144
source-repository-package
131145
type: git
132146
location: https://github.com/input-output-hk/ouroboros-network
133-
tag: 398004e1403367cc2a25c639eb6349d473e51b2d
134-
--sha256: 1x940w0sma3mhl4hfd937sp25hdl3migkl8zsyl92p59468218i9
147+
tag: 85934cc7e19e4a94547c79073d28ca77bb29897f
148+
--sha256: 1xgkdqi7cpmi0vq2lxq7d365yskp2v5rkh3g2m3ic3wplb00d7jd
135149
subdir: network-mux
136150

137151
source-repository-package
138152
type: git
139153
location: https://github.com/input-output-hk/ouroboros-network
140-
tag: 398004e1403367cc2a25c639eb6349d473e51b2d
141-
--sha256: 1x940w0sma3mhl4hfd937sp25hdl3migkl8zsyl92p59468218i9
154+
tag: 85934cc7e19e4a94547c79073d28ca77bb29897f
155+
--sha256: 1xgkdqi7cpmi0vq2lxq7d365yskp2v5rkh3g2m3ic3wplb00d7jd
142156
subdir: typed-protocols
143157

144158
source-repository-package
145159
type: git
146160
location: https://github.com/input-output-hk/ouroboros-network
147-
tag: 398004e1403367cc2a25c639eb6349d473e51b2d
148-
--sha256: 1x940w0sma3mhl4hfd937sp25hdl3migkl8zsyl92p59468218i9
149-
subdir: typed-protocols-cbor
161+
tag: 85934cc7e19e4a94547c79073d28ca77bb29897f
162+
--sha256: 1xgkdqi7cpmi0vq2lxq7d365yskp2v5rkh3g2m3ic3wplb00d7jd
163+
subdir: typed-protocols-examples
164+
165+
source-repository-package
166+
type: git
167+
location: https://github.com/input-output-hk/cardano-ledger-specs
168+
tag: 2500720815d30a29c95d153b3d97b1e0307f6906
169+
--sha256: 1qb3a1wv65r73dkl07r48ni6j653b28fjfp1hdvr7049ibzfyb91
170+
subdir: byron/ledger/executable-spec
171+
172+
source-repository-package
173+
type: git
174+
location: https://github.com/input-output-hk/cardano-ledger-specs
175+
tag: 2500720815d30a29c95d153b3d97b1e0307f6906
176+
--sha256: 1qb3a1wv65r73dkl07r48ni6j653b28fjfp1hdvr7049ibzfyb91
177+
subdir: byron/chain/executable-spec
178+
179+
source-repository-package
180+
type: git
181+
location: https://github.com/input-output-hk/cardano-ledger-specs
182+
tag: f27e8b66a393f0b7da1893889dcea07da0fe4dec
183+
--sha256: 1f1r1vidnlyka800jpm9z2myrggasqyzw0aw97q8vw81sh72l51s
184+
subdir: byron/ledger/executable-spec
150185

151186
--
152187
-- from cardano-crypto-1.2.0.nix
@@ -155,78 +190,78 @@ source-repository-package
155190
source-repository-package
156191
type: git
157192
location: https://github.com/input-output-hk/cardano-base
158-
tag: eed4fc484366214831576eef0c7fe90d1d08c78b
159-
--sha256: 0h9vbs2bsx6pvb300vl66znwpkqn169pmvsl4pv8mn0sz8iw4pk6
193+
tag: f869bee9b08ba1044b1476737c9d65083e1c6c7f
194+
--sha256: 0df3bdf13cwx3hd8n4q53g9hybb0w8mh837y64ydd88xhdfaf6a3
160195
subdir: binary
161196

162197
source-repository-package
163198
type: git
164199
location: https://github.com/input-output-hk/cardano-base
165-
tag: eed4fc484366214831576eef0c7fe90d1d08c78b
166-
--sha256: 0h9vbs2bsx6pvb300vl66znwpkqn169pmvsl4pv8mn0sz8iw4pk6
200+
tag: f869bee9b08ba1044b1476737c9d65083e1c6c7f
201+
--sha256: 0df3bdf13cwx3hd8n4q53g9hybb0w8mh837y64ydd88xhdfaf6a3
167202
subdir: binary/test
168203

169204
source-repository-package
170205
type: git
171206
location: https://github.com/input-output-hk/cardano-base
172-
tag: eed4fc484366214831576eef0c7fe90d1d08c78b
173-
--sha256: 0h9vbs2bsx6pvb300vl66znwpkqn169pmvsl4pv8mn0sz8iw4pk6
207+
tag: f869bee9b08ba1044b1476737c9d65083e1c6c7f
208+
--sha256: 0df3bdf13cwx3hd8n4q53g9hybb0w8mh837y64ydd88xhdfaf6a3
174209
subdir: cardano-crypto-class
175210

176211
source-repository-package
177212
type: git
178213
location: https://github.com/input-output-hk/cardano-base
179-
tag: eed4fc484366214831576eef0c7fe90d1d08c78b
180-
--sha256: 0h9vbs2bsx6pvb300vl66znwpkqn169pmvsl4pv8mn0sz8iw4pk6
214+
tag: f869bee9b08ba1044b1476737c9d65083e1c6c7f
215+
--sha256: 0df3bdf13cwx3hd8n4q53g9hybb0w8mh837y64ydd88xhdfaf6a3
181216
subdir: slotting
182217

183218
source-repository-package
184219
type: git
185220
location: https://github.com/input-output-hk/cardano-ledger
186-
tag: c62e2eeba5756898cbf59732fccd6a83a4065c18
187-
--sha256: 04s2dp5dyikm2pxfphiyh429pckkg06dqx3sl4bbzvg6x5qfqvbn
221+
tag: e2240ccda93e52835cd25b04e1963c8929bbfa64
222+
--sha256: 08c1dz9plnqb6i3ysnfbw6b6y2ij2f8crkij5aqrgsdjar51p91n
188223
subdir: cardano-ledger
189224

190225
source-repository-package
191226
type: git
192227
location: https://github.com/input-output-hk/cardano-ledger
193-
tag: c62e2eeba5756898cbf59732fccd6a83a4065c18
194-
--sha256: 04s2dp5dyikm2pxfphiyh429pckkg06dqx3sl4bbzvg6x5qfqvbn
228+
tag: e2240ccda93e52835cd25b04e1963c8929bbfa64
229+
--sha256: 08c1dz9plnqb6i3ysnfbw6b6y2ij2f8crkij5aqrgsdjar51p91n
195230
subdir: crypto
196231

197232
source-repository-package
198233
type: git
199234
location: https://github.com/input-output-hk/cardano-ledger
200-
tag: c62e2eeba5756898cbf59732fccd6a83a4065c18
201-
--sha256: 04s2dp5dyikm2pxfphiyh429pckkg06dqx3sl4bbzvg6x5qfqvbn
235+
tag: e2240ccda93e52835cd25b04e1963c8929bbfa64
236+
--sha256: 08c1dz9plnqb6i3ysnfbw6b6y2ij2f8crkij5aqrgsdjar51p91n
202237
subdir: cardano-ledger/test
203238

204239
source-repository-package
205240
type: git
206241
location: https://github.com/input-output-hk/cardano-ledger
207-
tag: c62e2eeba5756898cbf59732fccd6a83a4065c18
208-
--sha256: 04s2dp5dyikm2pxfphiyh429pckkg06dqx3sl4bbzvg6x5qfqvbn
242+
tag: e2240ccda93e52835cd25b04e1963c8929bbfa64
243+
--sha256: 08c1dz9plnqb6i3ysnfbw6b6y2ij2f8crkij5aqrgsdjar51p91n
209244
subdir: crypto/test
210245

211246
source-repository-package
212247
type: git
213248
location: https://github.com/input-output-hk/cardano-ledger-specs
214-
tag: f27e8b66a393f0b7da1893889dcea07da0fe4dec
215-
--sha256: 1f1r1vidnlyka800jpm9z2myrggasqyzw0aw97q8vw81sh72l51s
249+
tag: afacc7969445e4db5427936489f5a49a8a3a8f99
250+
--sha256: 0j5c669x7lr5fi7s9lm4jrzhprq8vz8q5z0pb1mrbp5fv4ja352c
216251
subdir: byron/semantics/executable-spec
217252

218253
source-repository-package
219254
type: git
220255
location: https://github.com/input-output-hk/cardano-ledger-specs
221-
tag: f27e8b66a393f0b7da1893889dcea07da0fe4dec
222-
--sha256: 1f1r1vidnlyka800jpm9z2myrggasqyzw0aw97q8vw81sh72l51s
256+
tag: afacc7969445e4db5427936489f5a49a8a3a8f99
257+
--sha256: 0j5c669x7lr5fi7s9lm4jrzhprq8vz8q5z0pb1mrbp5fv4ja352c
223258
subdir: byron/ledger/executable-spec
224259

225260
source-repository-package
226261
type: git
227262
location: https://github.com/input-output-hk/cardano-ledger-specs
228-
tag: f27e8b66a393f0b7da1893889dcea07da0fe4dec
229-
--sha256: 1f1r1vidnlyka800jpm9z2myrggasqyzw0aw97q8vw81sh72l51s
263+
tag: afacc7969445e4db5427936489f5a49a8a3a8f99
264+
--sha256: 0j5c669x7lr5fi7s9lm4jrzhprq8vz8q5z0pb1mrbp5fv4ja352c
230265
subdir: byron/chain/executable-spec
231266

232267
source-repository-package
@@ -238,21 +273,22 @@ source-repository-package
238273
source-repository-package
239274
type: git
240275
location: https://github.com/input-output-hk/cardano-prelude
241-
tag: 00487726c4bc21b4744e59d913334ebfeac7d68e
242-
--sha256: 0v4fcq5kdd2r5dgwys8kv46ff33qp756n26ycxrca10wq14zkwm5
276+
tag: 3893f21db1665e7bab9e8c6504c547fc7c28f98c
277+
--sha256: 09qqcjzmjsa3r7f1yiwk4bn8bpv7nvqf7hfyg784shasspwfq8n4
243278

244279
source-repository-package
245280
type: git
246281
location: https://github.com/input-output-hk/cardano-prelude
247-
tag: 00487726c4bc21b4744e59d913334ebfeac7d68e
248-
--sha256: 0v4fcq5kdd2r5dgwys8kv46ff33qp756n26ycxrca10wq14zkwm5
282+
tag: 3893f21db1665e7bab9e8c6504c547fc7c28f98c
283+
--sha256: 09qqcjzmjsa3r7f1yiwk4bn8bpv7nvqf7hfyg784shasspwfq8n4
249284
subdir: test
250285

286+
-- version number matching the one specified in the stack resolver file
251287
source-repository-package
252288
type: git
253-
location: https://github.com/input-output-hk/cardano-crypto
254-
tag: 4590efa638397e952a51a8994b5543e4ea3c1ecd
255-
--sha256: 0hl2n3bba5v2j0lmxhs7hs01z3aznh2bwf9cb434icq2g0bl8ms3
289+
location: https://github.com/input-output-hk/cardano-crypto/
290+
tag: 2547ad1e80aeabca2899951601079408becbc92c
291+
--sha256: 1p2kg2w02q5w1cvqzhfhqmxviy4xrzada3mmb096j2n6hfr20kri
256292

257293
source-repository-package
258294
type: git

cardano-byron-proxy.cabal

+3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ library
5050
memory,
5151
network-mux,
5252
ouroboros-consensus,
53+
ouroboros-consensus-byron,
5354
ouroboros-network,
5455
resourcet,
5556
sqlite-simple,
@@ -111,7 +112,9 @@ executable cardano-byron-proxy
111112
network-mux,
112113
optparse-applicative,
113114
ouroboros-consensus,
115+
ouroboros-consensus-byron,
114116
ouroboros-network,
117+
ouroboros-network-framework,
115118
random,
116119
reflection,
117120
resourcet,

default.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ let
5151
pkgconfig
5252
sqlite-interactive
5353
tmux
54-
commonLib.cabalProjectRegenerate
54+
# commonLib.cabalProjectRegenerate
5555
]);
5656

5757
# Prevents cabal from choosing alternate plans, so that

src/exec/Byron.hs

+12-9
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,22 @@ import qualified Pos.Chain.Block as CSL (Block, BlockHeader (..), GenesisBlock,
3434
MainBlockHeader, HeaderHash, headerHash)
3535
import qualified Pos.Infra.Diffusion.Types as CSL
3636

37-
import Ouroboros.Byron.Proxy.Block (ByronBlock,
38-
coerceHashToLegacy, headerHash)
39-
import Ouroboros.Byron.Proxy.Main
37+
import Ouroboros.Consensus.Byron.Ledger.Block (ByronBlock)
4038
import Ouroboros.Consensus.Block (Header)
41-
import Ouroboros.Consensus.Ledger.Byron (ByronHash(..),
39+
import Ouroboros.Consensus.Byron.Ledger.Block (ByronHash(..),
4240
byronHeaderRaw, mkByronBlock)
43-
import Ouroboros.Consensus.Ledger.Byron.Auxiliary as Cardano
4441
import Ouroboros.Consensus.Protocol.Abstract (SecurityParam (maxRollbacks))
4542
import Ouroboros.Network.Block (ChainHash (..), Point, pointHash)
4643
import qualified Ouroboros.Network.AnchoredFragment as AF
4744
import qualified Ouroboros.Network.ChainFragment as CF
48-
import Ouroboros.Storage.ChainDB.API (ChainDB)
49-
import qualified Ouroboros.Storage.ChainDB.API as ChainDB
45+
import Ouroboros.Consensus.Storage.ChainDB.API (ChainDB)
46+
import qualified Ouroboros.Consensus.Storage.ChainDB.API as ChainDB
5047

48+
import Ouroboros.Byron.Proxy.Block (coerceHashToLegacy, headerHash)
49+
import Ouroboros.Byron.Proxy.Main (ByronProxy, BestTip(..)
50+
, bestTip
51+
, downloadChain
52+
, announceChain)
5153
-- | Download the best available chain from Byron peers and write to the
5254
-- database, over and over again. It will download the best chain from its
5355
-- Byron peers regardless of whether it has a better one in the database.
@@ -73,7 +75,7 @@ download tracer genesisBlock epochSlots securityParam db bp = do
7375
Nothing -> do
7476
traceWith tracer "Seeding database with genesis"
7577
genesisBlock' :: ByronBlock <- recodeBlockOrFail epochSlots throwIO (Left genesisBlock)
76-
ChainDB.addBlock db genesisBlock'
78+
_ <- ChainDB.addBlock db genesisBlock'
7779
pure $ CSL.headerHash genesisBlock
7880
Just header -> pure $ coerceHashToLegacy (headerHash header)
7981
mainLoop gen tipHash
@@ -171,7 +173,7 @@ download tracer genesisBlock epochSlots securityParam db bp = do
171173
commitBlock :: CSL.HeaderHash -> CSL.Block -> IO CSL.HeaderHash
172174
commitBlock _ blk = do
173175
blk' <- recodeBlockOrFail epochSlots throwIO blk
174-
ChainDB.addBlock db blk'
176+
_ <- ChainDB.addBlock db blk'
175177
pure $ CSL.headerHash blk
176178

177179
-- Catch all sync exceptions from the downloadChain call that uses the
@@ -219,6 +221,7 @@ recodeBlock epochSlots cslBlk = case Binary.decodeFullAnnotatedBytes "Block" dec
219221
-- stored... _unless_ in recovery mode! i.e. precisely when the new block is
220222
-- a continuation of the current chain.
221223
-- Do we wish to / need to stick to that style?
224+
222225
announce
223226
:: Maybe Cardano.HeaderHash -- ^ Of block most recently announced.
224227
-> ChainDB IO ByronBlock

src/exec/DB.hs

+13-11
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,20 @@ import Ouroboros.Byron.Proxy.Block (ByronBlock)
1717
import qualified Ouroboros.Byron.Proxy.Index.ChainDB as Index (trackChainDB)
1818
import qualified Ouroboros.Byron.Proxy.Index.Sqlite as Sqlite
1919
import Ouroboros.Byron.Proxy.Index.Types (Index)
20-
import Ouroboros.Consensus.Block (BlockProtocol,
21-
GetHeader (Header))
20+
import Ouroboros.Consensus.Block (GetHeader (Header))
2221
import Ouroboros.Consensus.BlockchainTime (BlockchainTime)
23-
import Ouroboros.Consensus.Ledger.Byron.Config (pbftEpochSlots)
2422
import Ouroboros.Consensus.Ledger.Extended (ExtLedgerState)
2523
import Ouroboros.Consensus.Node (openChainDB)
26-
import Ouroboros.Consensus.Protocol (NodeConfig)
27-
import Ouroboros.Consensus.Protocol.ExtConfig (extNodeConfig)
2824
import Ouroboros.Consensus.Util.ResourceRegistry (ResourceRegistry)
2925
import qualified Ouroboros.Consensus.Util.ResourceRegistry as ResourceRegistry
30-
import Ouroboros.Storage.ChainDB (ChainDB)
31-
import qualified Ouroboros.Storage.ChainDB as ChainDB
32-
import Ouroboros.Storage.ChainDB.Impl.Args (ChainDbArgs (..))
26+
import Ouroboros.Consensus.Storage.ChainDB.API (ChainDB)
27+
import qualified Ouroboros.Consensus.Storage.ChainDB.API as ChainDB
28+
import Ouroboros.Consensus.Storage.ChainDB.Impl.Args (ChainDbArgs (..))
29+
import Ouroboros.Consensus.Config (TopLevelConfig, configBlock)
30+
import Ouroboros.Consensus.Byron.Ledger.Config (byronEpochSlots)
31+
import Ouroboros.Consensus.Byron.Node ()
32+
import Ouroboros.Consensus.Storage.ChainDB.Impl.Types as ChainDB (TraceEvent)
33+
import Ouroboros.Consensus.Storage.VolatileDB.Types (mkBlocksPerFile)
3334

3435
data DBConfig = DBConfig
3536
{ dbFilePath :: !FilePath
@@ -41,14 +42,15 @@ data DBConfig = DBConfig
4142
-- | Set up and use a DB.
4243
--
4344
-- The directory at `dbFilePath` will be created if it does not exist.
45+
4446
withDB
4547
:: forall t .
4648
DBConfig
4749
-> Tracer IO (ChainDB.TraceEvent ByronBlock)
4850
-> Tracer IO Sqlite.TraceEvent
4951
-> ResourceRegistry IO
5052
-> BlockchainTime IO
51-
-> NodeConfig (BlockProtocol ByronBlock)
53+
-> TopLevelConfig ByronBlock
5254
-> ExtLedgerState ByronBlock
5355
-> (Index IO (Header ByronBlock) -> ChainDB IO ByronBlock -> IO t)
5456
-> IO t
@@ -67,10 +69,10 @@ withDB dbOptions dbTracer indexTracer rr btime nodeConfig extLedgerState k = do
6769
where
6870

6971
epochSlots :: Cardano.EpochSlots
70-
epochSlots = pbftEpochSlots $ extNodeConfig nodeConfig
72+
epochSlots = byronEpochSlots $ configBlock nodeConfig
7173

7274
customiseArgs :: ChainDbArgs IO ByronBlock -> ChainDbArgs IO ByronBlock
7375
customiseArgs args = args
74-
{ cdbBlocksPerFile = 21600 -- ?
76+
{ cdbBlocksPerFile = mkBlocksPerFile 21600 -- ?
7577
, cdbGcDelay = secondsToDiffTime 20
7678
}

0 commit comments

Comments
 (0)