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

Commit

Permalink
Merge pull request #4033 from input-output-hk/jc/merge/release-2.0.1-…
Browse files Browse the repository at this point in the history
…master

Jc/merge/release 2.0.1 master
  • Loading branch information
jcmincke authored Jan 28, 2019
2 parents d35bfbf + c11c2ac commit c6a50c2
Show file tree
Hide file tree
Showing 52 changed files with 374 additions and 770 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG

## Cardano SL 2.0.1

### Fixes

- Relocate fee sanity check and make it relative to each transaction (rather than absolute) ([CO-446](https://iohk.myjetbrains.com/youtrack/issue/CO-446) [#3993](https://github.com/input-output-hk/cardano-sl/pull/3993)
- Correction to block retrieval concurrency and exception handling, so that it will recover in case of certain network failure conditions. ([CDEC-658](https://iohk.myjetbrains.com/youtrack/issue/CDEC-658) [#3998](https://github.com/input-output-hk/cardano-sl/pull/3998))


## Cardano SL 2.0.0


Expand Down
2 changes: 1 addition & 1 deletion auxx/cardano-sl-auxx.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cardano-sl-auxx
version: 2.0.0
version: 2.0.1
synopsis: Cardano SL - Auxx
description: Cardano SL - Auxx
license: MIT
Expand Down
2 changes: 1 addition & 1 deletion binary/cardano-sl-binary.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cardano-sl-binary
version: 2.0.0
version: 2.0.1
synopsis: Cardano SL - binary serialization
description: This package defines a type class for binary serialization,
helpers and instances.
Expand Down
2 changes: 1 addition & 1 deletion binary/test/cardano-sl-binary-test.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cardano-sl-binary-test
version: 2.0.0
version: 2.0.1
synopsis: Cardano SL - binary serializarion (tests)
description: This package contains test helpers for cardano-sl-binary.
license: MIT
Expand Down
2 changes: 1 addition & 1 deletion chain/cardano-sl-chain.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cardano-sl-chain
version: 2.0.0
version: 2.0.1
synopsis: Cardano SL - transaction processing
description: Cardano SL - transaction processing
license: MIT
Expand Down
2 changes: 1 addition & 1 deletion chain/test/cardano-sl-chain-test.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cardano-sl-chain-test
version: 2.0.0
version: 2.0.1
synopsis: Cardano SL - arbitrary instances for cardano-sl-chain
description: Cardano SL - arbitrary instances for cardano-sl-chain
license: MIT
Expand Down
2 changes: 1 addition & 1 deletion client/cardano-sl-client.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cardano-sl-client
version: 2.0.0
version: 2.0.1
synopsis: Cardano SL client modules
description: Cardano SL client modules
license: MIT
Expand Down
2 changes: 1 addition & 1 deletion cluster/cardano-sl-cluster.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cardano-sl-cluster
version: 2.0.0
version: 2.0.1
synopsis: Utilities to generate and run cluster of nodes
description: See README
homepage: https://github.com/input-output-hk/cardano-sl/cluster/README.md
Expand Down
2 changes: 1 addition & 1 deletion core/cardano-sl-core.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cardano-sl-core
version: 2.0.0
version: 2.0.1
synopsis: Cardano SL - core
description: Cardano SL - core
license: MIT
Expand Down
2 changes: 1 addition & 1 deletion core/test/cardano-sl-core-test.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cardano-sl-core-test
version: 2.0.0
version: 2.0.1
synopsis: Cardano SL - core functionality (tests)
description: QuickCheck Arbitrary instances for the Cardano SL core
functionality.
Expand Down
2 changes: 1 addition & 1 deletion crypto/cardano-sl-crypto.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cardano-sl-crypto
version: 2.0.0
version: 2.0.1
synopsis: Cardano SL - cryptography primitives
description: This package contains cryptography primitives used in Cardano SL.
license: MIT
Expand Down
2 changes: 1 addition & 1 deletion crypto/test/cardano-sl-crypto-test.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cardano-sl-crypto-test
version: 2.0.0
version: 2.0.1
synopsis: Cardano SL - arbitrary instances for cardano-sl-crypto
description: This package contains arbitrary instances for the cryptography primitives used in Cardano SL.
license: MIT
Expand Down
2 changes: 1 addition & 1 deletion db/cardano-sl-db.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cardano-sl-db
version: 2.0.0
version: 2.0.1
synopsis: Cardano SL - basic DB interfaces
description: Cardano SL - basic DB interfaces
license: MIT
Expand Down
2 changes: 1 addition & 1 deletion db/test/cardano-sl-db-test.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cardano-sl-db-test
version: 2.0.0
version: 2.0.1
synopsis: Cardano SL - arbitrary instances for cardano-sl-db
description: Cardano SL - arbitrary instances for cardano-sl-db
license: MIT
Expand Down
2 changes: 1 addition & 1 deletion explorer/cardano-sl-explorer.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cardano-sl-explorer
version: 2.0.0
version: 2.0.1
synopsis: Cardano explorer
description: Please see README.md
license: MIT
Expand Down
2 changes: 1 addition & 1 deletion faucet/cardano-sl-faucet.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cardano-sl-faucet
version: 2.0.0
version: 2.0.1
description: Cardano SL - faucet
license: MIT
author: Ben Ford
Expand Down
2 changes: 1 addition & 1 deletion generator/cardano-sl-generator.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cardano-sl-generator
version: 2.0.0
version: 2.0.1
synopsis: Cardano SL - arbitrary data generation
description: Cardano SL - arbitrary data generation
license: MIT
Expand Down
2 changes: 1 addition & 1 deletion infra/cardano-sl-infra.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cardano-sl-infra
version: 2.0.0
version: 2.0.1
synopsis: Cardano SL - infrastructural
description: Cardano SL - infrastructural
license: MIT
Expand Down
24 changes: 22 additions & 2 deletions infra/src/Pos/Infra/Diffusion/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ module Pos.Infra.Diffusion.Types
, Diffusion (..)
, hoistDiffusion
, dummyDiffusionLayer
, StreamBlocks (..)
, hoistStreamBlocks
, DiffusionHealth (..)
) where

Expand All @@ -29,6 +31,24 @@ import Pos.Infra.Diffusion.Subscription.Status (SubscriptionStates,
emptySubscriptionStates)
import Pos.Infra.Reporting.Health.Types (HealthStatus (..))

-- | How to handle a stream of blocks.
data StreamBlocks block m t = StreamBlocks
{ streamBlocksMore :: NonEmpty block -> m (StreamBlocks block m t)
-- ^ The server gives a batch of blocks.
, streamBlocksDone :: m t
-- ^ The server has no more blocks.
}

hoistStreamBlocks
:: ( Functor n )
=> (forall x . m x -> n x)
-> StreamBlocks block m t
-> StreamBlocks block n t
hoistStreamBlocks nat streamBlocks = streamBlocks
{ streamBlocksMore = \blks ->
fmap (hoistStreamBlocks nat) (nat (streamBlocksMore streamBlocks blks))
, streamBlocksDone = nat (streamBlocksDone streamBlocks)
}

data DiffusionHealth = DiffusionHealth {
dhStreamWriteQueue :: !Gauge -- Number of blocks stored in the block stream write queue
Expand All @@ -49,7 +69,7 @@ data Diffusion m = Diffusion
NodeId
-> HeaderHash
-> [HeaderHash]
-> ([Block] -> m t)
-> StreamBlocks Block m t
-> m (Maybe t)
-- | This is needed because there's a security worker which will request
-- tip-of-chain from the network if it determines it's very far behind.
Expand Down Expand Up @@ -108,7 +128,7 @@ hoistDiffusion
-> Diffusion n
hoistDiffusion nat rnat orig = Diffusion
{ getBlocks = \nid bh hs -> nat $ getBlocks orig nid bh hs
, streamBlocks = \nid hh hhs k -> nat $ streamBlocks orig nid hh hhs (rnat . k)
, streamBlocks = \nid hh hhs k -> nat $ streamBlocks orig nid hh hhs (hoistStreamBlocks rnat k)
, requestTip = nat $ (fmap . fmap) nat (requestTip orig)
, announceBlockHeader = nat . announceBlockHeader orig
, sendTx = nat . sendTx orig
Expand Down
2 changes: 1 addition & 1 deletion infra/test/cardano-sl-infra-test.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cardano-sl-infra-test
version: 2.0.0
version: 2.0.1
synopsis: Cardano SL - generators for cardano-sl-infra
description: This package contains generators for the infrastructural data types used in Cardano SL.
license: MIT
Expand Down
8 changes: 6 additions & 2 deletions lib/bench/Bench/Pos/Diffusion/BlockDownload.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ import Pos.Diffusion.Full (FullDiffusionConfiguration (..),
FullDiffusionInternals (..),
RunFullDiffusionInternals (..),
diffusionLayerFullExposeInternals)
import Pos.Infra.Diffusion.Types as Diffusion (Diffusion (..))
import Pos.Infra.Diffusion.Types as Diffusion (Diffusion (..),
StreamBlocks (..))
import qualified Pos.Infra.Network.Policy as Policy
import Pos.Infra.Network.Types (Bucket (..))
import Pos.Infra.Reporting.Health.Types (HealthStatus (..))
Expand Down Expand Up @@ -226,7 +227,10 @@ blockDownloadStream serverAddress setStreamIORef client ~(blockHeader, checkpoin
where
numBlocks = batches * 2200

writeCallback !_ = return ()
writeCallback = StreamBlocks
{ streamBlocksMore = \(!_) -> pure writeCallback
, streamBlocksDone = pure ()
}

blockDownloadBenchmarks :: NodeId -> (Int -> IO ()) -> Diffusion IO -> [Criterion.Benchmark]
blockDownloadBenchmarks serverAddress setStreamIORef client =
Expand Down
2 changes: 1 addition & 1 deletion lib/cardano-sl.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cardano-sl
version: 2.0.0
version: 2.0.1
synopsis: Cardano SL main implementation
description: Please see README.md
license: MIT
Expand Down
23 changes: 7 additions & 16 deletions lib/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14839,7 +14839,7 @@ mainnet_wallet_win64: &mainnet_wallet_win64
<<: *mainnet_full
update:
applicationName: csl-daedalus
applicationVersion: 11
applicationVersion: 12
lastKnownBlockVersion:
bvMajor: 0
bvMinor: 1
Expand All @@ -14849,7 +14849,7 @@ mainnet_wallet_macos64: &mainnet_wallet_macos64
<<: *mainnet_full
update:
applicationName: csl-daedalus
applicationVersion: 11
applicationVersion: 12
lastKnownBlockVersion:
bvMajor: 0
bvMinor: 1
Expand All @@ -14859,7 +14859,7 @@ mainnet_wallet_linux64: &mainnet_wallet_linux64
<<: *mainnet_full
update:
applicationName: csl-daedalus
applicationVersion: 11
applicationVersion: 12
lastKnownBlockVersion:
bvMajor: 0
bvMinor: 1
Expand Down Expand Up @@ -14929,29 +14929,20 @@ testnet_wallet: &testnet_wallet
<<: *testnet_full
update: &testnet_wallet_update
applicationName: csl-daedalus
applicationVersion: 4
applicationVersion: 6
lastKnownBlockVersion:
bvMajor: 0
bvMinor: 0
bvAlt: 0

testnet_wallet_win64: &testnet_wallet_win64
<<: *testnet_wallet
update:
<<: *testnet_wallet_update
systemTag: win64

testnet_wallet_macos64: &testnet_wallet_macos64
<<: *testnet_wallet
update:
<<: *testnet_wallet_update
systemTag: macos64

testnet_wallet_linux64: &testnet_wallet_linux64
<<: *testnet_wallet
update:
<<: *testnet_wallet_update
systemTag: linux

##############################################################################
## ##
Expand All @@ -14973,7 +14964,7 @@ mainnet_dryrun_wallet_win64: &mainnet_dryrun_wallet_win64
<<: *mainnet_dryrun_full
update:
applicationName: csl-daedalus
applicationVersion: 18
applicationVersion: 21
lastKnownBlockVersion:
bvMajor: 0
bvMinor: 2
Expand All @@ -14983,7 +14974,7 @@ mainnet_dryrun_wallet_macos64: &mainnet_dryrun_wallet_macos64
<<: *mainnet_dryrun_full
update:
applicationName: csl-daedalus
applicationVersion: 18
applicationVersion: 21
lastKnownBlockVersion:
bvMajor: 0
bvMinor: 2
Expand All @@ -14993,7 +14984,7 @@ mainnet_dryrun_wallet_linux64: &mainnet_dryrun_wallet_linux64
<<: *mainnet_dryrun_full
update:
applicationName: csl-daedalus
applicationVersion: 18
applicationVersion: 21
lastKnownBlockVersion:
bvMajor: 0
bvMinor: 2
Expand Down
5 changes: 3 additions & 2 deletions lib/src/Pos/Diffusion/Full.hs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ import Pos.Infra.Diffusion.Subscription.Status (SubscriptionStates,
emptySubscriptionStates)
import Pos.Infra.Diffusion.Transport.TCP (bracketTransportTCP)
import Pos.Infra.Diffusion.Types (Diffusion (..),
DiffusionHealth (..), DiffusionLayer (..))
DiffusionHealth (..), DiffusionLayer (..),
StreamBlocks (..))
import Pos.Infra.Network.Types (Bucket (..), NetworkConfig (..),
NodeType, SubscriptionWorker (..), initQueue,
topologyHealthStatus, topologyRunKademlia,
Expand Down Expand Up @@ -358,7 +359,7 @@ diffusionLayerFullExposeInternals fdconf
NodeId
-> HeaderHash
-> [HeaderHash]
-> ([Block] -> IO t)
-> StreamBlocks Block IO t
-> IO (Maybe t)
streamBlocks = Diffusion.Block.streamBlocks logTrace diffusionHealth logic streamWindow enqueue

Expand Down
Loading

0 comments on commit c6a50c2

Please sign in to comment.