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

Commit f947b9d

Browse files
iohk-bors[bot]rvlerikdkarknudeepfire
committed
Merge #3919 #3920
3919: [DEVOPS-1112] Bump applicationVersion 2 -> 3 for testnet r=jmitchell a=rvl ## Description Update applicationVersion for an update proposal on testnet. https://github.com/input-output-hk/internal-documentation/wiki/Daedalus-installer-history ## Linked issue https://iohk.myjetbrains.com/youtrack/issue/DEVOPS-1112 3920: Karknu/rcd 43 mitigation r=jmitchell a=karknu ## Description Improvement that makes the network disconnect in RCD-43 less likely to happen. ## Linked issue <!--- Put here the relevant issue from YouTrack --> Co-authored-by: Rodney Lorrimar <[email protected]> Co-authored-by: Erik de Castro Lopo <[email protected]> Co-authored-by: Karl Knutsson <[email protected]> Co-authored-by: Kosyrev Serge <[email protected]> Co-authored-by: Duncan Coutts <[email protected]>
3 parents cf9c5bd + c6362a8 + 52d1d9e commit f947b9d

File tree

5 files changed

+23
-5
lines changed

5 files changed

+23
-5
lines changed

db/cardano-sl-db.cabal

+1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ library
141141
, ekg-core
142142
, ether >= 0.5
143143
, exceptions
144+
, extra
144145
, filepath
145146
, formatting
146147
, lens

db/src/Pos/DB/Block/Epoch.hs

+12-4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import Data.Binary (decode, encode)
4747
import qualified Data.ByteString.Char8 as BS
4848
import qualified Data.ByteString.Lazy as LBS
4949
import Data.Either (partitionEithers)
50+
import Data.List.Extra (chunksOf)
5051
import Formatting (build, int, sformat, shown, (%))
5152
import System.Directory (removeFile)
5253
import System.FilePath ((</>))
@@ -363,7 +364,12 @@ consolidateOneEpoch ccp epochSlots = do
363364

364365
-- After the check point is written, delete old blunds for the epoch we have just
365366
-- consolidated.
366-
lift $ mapM_ deleteOldBlund sihs
367+
lift $ mapM_ deleter $ chunksOf 1000 sihs
368+
where
369+
deleter :: ConsolidateM ctx m => [SlotIndexHash] -> m ()
370+
deleter xs = do
371+
mapM_ deleteOldBlund xs
372+
sleepSeconds 2
367373

368374
deleteOldBlund :: ConsolidateM ctx m => SlotIndexHash -> m ()
369375
deleteOldBlund (SlotIndexHash _ hh) = do
@@ -389,16 +395,18 @@ consolidateEpochBlocks fpath xs = ExceptT $ do
389395
(liftIO . hClose)
390396
(\hdl -> do
391397
liftIO $ BS.hPutStr hdl epochFileHeader
392-
mapM (consolidate hdl) xs
398+
mapM (consolidate hdl) $ zip [0 .. ] xs
393399
)
394400
pure $ case partitionEithers ys of
395401
([], zs) -> Right $ epochIndexToOffset zs
396402
(e:_, _) -> Left e
397403
where
398404
consolidate
399405
:: ConsolidateM ctx m
400-
=> Handle -> SlotIndexHash -> m (Either ConsolidateError SlotIndexLength)
401-
consolidate hdl (SlotIndexHash lsi hh) = do
406+
=> Handle -> (Int, SlotIndexHash) -> m (Either ConsolidateError SlotIndexLength)
407+
consolidate hdl (indx, SlotIndexHash lsi hh) = do
408+
when (indx `mod` 1000 == 0) $
409+
sleepSeconds 2
402410
mblund <- getSerializedBlund hh
403411
case mblund of
404412
Nothing ->

db/src/Pos/DB/Rocks/Functions.hs

+7
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import qualified Database.RocksDB as Rocks
4141
import System.Directory (createDirectoryIfMissing, doesDirectoryExist,
4242
removeDirectoryRecursive)
4343
import System.FilePath (takeDirectory, (</>))
44+
import qualified System.Info (os)
4445

4546
import Pos.Binary.Class (Bi, serialize')
4647
import Pos.DB.BatchOp (rocksWriteBatch)
@@ -82,6 +83,7 @@ openNodeDBs recreate fp = do
8283
let gStatePath = fp </> "gState"
8384
let lrcPath = fp </> "lrc"
8485
let miscPath = fp </> "misc"
86+
8587
mapM_ ensureDirectoryExists
8688
[ blocksDir
8789
, _blockDataDir
@@ -91,6 +93,11 @@ openNodeDBs recreate fp = do
9193
, lrcPath
9294
, miscPath
9395
]
96+
97+
when (System.Info.os == "darwin") $
98+
-- Prevent indexing of blocks on OSX
99+
withFile (fp </> ".metadata_never_index") AppendMode (\_ -> return ())
100+
94101
_blockIndexDB <- openRocksDB blocksIndexPath
95102
_gStateDB <- openRocksDB gStatePath
96103
_lrcDB <- openRocksDB lrcPath

lib/configuration.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14929,7 +14929,7 @@ testnet_wallet: &testnet_wallet
1492914929
<<: *testnet_full
1493014930
update: &testnet_wallet_update
1493114931
applicationName: csl-daedalus
14932-
applicationVersion: 2
14932+
applicationVersion: 3
1493314933
lastKnownBlockVersion:
1493414934
bvMajor: 0
1493514935
bvMinor: 0

pkgs/default.nix

+2
Original file line numberDiff line numberDiff line change
@@ -16188,6 +16188,7 @@ license = stdenv.lib.licenses.mit;
1618816188
, ekg-core
1618916189
, ether
1619016190
, exceptions
16191+
, extra
1619116192
, filepath
1619216193
, formatting
1619316194
, hedgehog
@@ -16241,6 +16242,7 @@ directory
1624116242
ekg-core
1624216243
ether
1624316244
exceptions
16245+
extra
1624416246
filepath
1624516247
formatting
1624616248
lens

0 commit comments

Comments
 (0)