-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate ouroboros-network
#1314
base: main
Are you sure you want to change the base?
Conversation
9efce6b
to
c27d199
Compare
36b2b58
to
e6ab67b
Compare
FYI, the cardano-ledger commit in the SRP is gone. I suspect the new one is IntersectMBO/cardano-ledger@3fe0221 or IntersectMBO/cardano-ledger@12f6aa6 (the merge commit of the PR). |
7cbd3f8
to
ef51726
Compare
ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Query/Types.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus-cardano/src/unstable-shelley-testlib/Test/ThreadNet/TxGen/Shelley.hs
Outdated
Show resolved
Hide resolved
let (ys, zs) = splitAt i xs | ||
in ys ++ dropElemsAt (drop 1 zs) is | ||
dropElemsAt xs is' = | ||
let is = Set.fromList is' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IntSet
is more efficient at handling Set of Int
s
let is = Set.fromList is' | |
let is = IntSet.fromList is' |
, gcfBlockFetchGracePeriod :: Maybe Integer | ||
, gcfBucketCapacity :: Maybe Integer | ||
, gcfBucketRate :: Maybe Integer | ||
, gcfCSJJumpSize :: Maybe Integer | ||
, gcfGDDRateLimit :: Maybe DiffTime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Configuration should always try and use the types that will be used in the end. This way we can protect against invalid values when parsing the config instead of allowing for dangerous values that can lead to overflows. For example, by using SlotNo
, we here we can protect against a very large value being placed in the config that will end up overflowing
, gcfBlockFetchGracePeriod :: Maybe Integer | |
, gcfBucketCapacity :: Maybe Integer | |
, gcfBucketRate :: Maybe Integer | |
, gcfCSJJumpSize :: Maybe Integer | |
, gcfGDDRateLimit :: Maybe DiffTime | |
, gcfBlockFetchGracePeriod :: Maybe DiffTime | |
, gcfBucketCapacity :: Maybe Integer | |
, gcfBucketRate :: Maybe Integer | |
, gcfCSJJumpSize :: Maybe SlotNo | |
, gcfGDDRateLimit :: Maybe DiffTime |
gbfcGracePeriod = fromInteger $ fromMaybe defaultBlockFetchGracePeriod gcfBlockFetchGracePeriod | ||
csbcCapacity = fromInteger $ fromMaybe defaultCapacity gcfBucketCapacity | ||
csbcRate = fromInteger $ fromMaybe defaultRate gcfBucketRate | ||
csjcJumpSize = fromInteger $ fromMaybe defaultCSJJumpSize gcfCSJJumpSize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@facundominguez I have a couple of suggestions and some minor concerns about this:
csbcCapacity
is already anInteger
, sofromInteger
is redundant- using
maybe
instead offromMaybe
allows for default values to have the expected type. - All conversions with
to/fromInteger
andfromIntegral
should have type annotations, because that way it is easier to spot dangers of overflow SlotNo
is backed byWord64
, so there is danger of overflow here, so it would be better to use that type instead ingcfCSJJumpSize
, as I suggested above.
gbfcGracePeriod = fromInteger $ fromMaybe defaultBlockFetchGracePeriod gcfBlockFetchGracePeriod | |
csbcCapacity = fromInteger $ fromMaybe defaultCapacity gcfBucketCapacity | |
csbcRate = fromInteger $ fromMaybe defaultRate gcfBucketRate | |
csjcJumpSize = fromInteger $ fromMaybe defaultCSJJumpSize gcfCSJJumpSize | |
gbfcGracePeriod = maybe defaultBlockFetchGracePeriod (fromInteger @DiffTime) gcfBlockFetchGracePeriod | |
csbcCapacity = fromMaybe defaultCapacity gcfBucketCapacity | |
csbcRate = maybe defaultRate (fromInteger @Rational) gcfBucketRate | |
csjcJumpSize = maybe defaultCSJJumpSize (fromInteger @SlotNo) gcfCSJJumpSize |
let is = Set.fromList is' | ||
in map fst $ filter (\(_, i) -> not $ i `Set.member` is) (zip xs [0..]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nbacquey List comprehensions seem to be more readable, more compact and won't rely on list fusion to be efficient.
Also switching to IntSet
will be more efficient and there are special functions in containers notMember x s
, that can be used instead of not $ member x s
let is = Set.fromList is' | |
in map fst $ filter (\(_, i) -> not $ i `Set.member` is) (zip xs [0..]) | |
let is = IntSet.fromList is' | |
in [x | (x, i) <- zip xs [0..], i `IntSet.notMember` is] |
9d27b2e
to
038f9d6
Compare
…kFetchConsensusInterface
* Addition of ChainSyncClientHandleCollection, grace period, and starvation event in BlockFetch * Plug `rotateDynamo` into `BlockFetchConsensusInterface` * Removal of `bfcMaxConcurrencyBulkSync` * Changes in blockfetch decision tracing
Port of IntersectMBO/ouroboros-network#2721 Co-authored-by: Thomas Winant <[email protected]> Co-authored-by: Alexander Esgen <[email protected]>
* Move Genesis-specific BlockFetch config to GenesisConfig * Introduce GenesisConfigFlags for interaction with config files/CLI * Add missing instances for Genesis configuration
* Mention that the objector also gets demoted * Edit note on Interactions with the BlockFetch logic * Expand the comments motivating DynamoInitState and ObjectorInitState Co-authored-by: Nicolas “Niols” Jeannerod <[email protected]>
* Run more repetitions of LoE, LoP, CSJ, and gdd tests * Print timestamps for node restarts * Disable boring timeouts in the node restart test * Wait sufficiently long at the end of tests * Expect CandidateTooSparse in gdd tests * Add a notice about untracked delays in the node restart test * Set the GDD rate limit to 0 in the peer simulator * Have the peer simulator use the default grace period for chainsel starvations * Relax expectations of test blockFetch in the BulkSync case * Allow to run the decision logic once after the last tick in the blockfetch leashing attack * Shift point schedule times before giving the schedules to tests * Accomodate for separate decision loop intervals for fetch modes * Accomodate for timer added in blockFetchLogic * Switch peer simulator to `FetchModeBulkSync` * Allow parameterizing whether chainsel starvation is handled * Add some wiggle room for duplicate headers in CSJ tests * Disable chainsel starvation in CSJ test
Co-authored-by: Nicolas Bacquey <[email protected]>
038f9d6
to
a50e092
Compare
ouroboros-network
and cardano-ledger
ouroboros-network
@lehins This branch should incorporate the latest commits in
I created #1351 which you can merge right away. |
- Always disable `mustReplyTimeout`; explain why - Always disable `idleTimeout`; explain why - Keep the others by default in all the tests This should fix the bug discussed in #1179
Co-authored-by: Nicolas Frisby <[email protected]>
I removed the If we apply this label too early in the process, we risk introducing changes in the meantime which don't end up in the Changelog. |
Description
Integrate
ouroboros-network
in preparation forcardano-node-10.2.0
releaseSee IntersectMBO/cardano-node#6040 for overall progress