Skip to content

Commit 4920b7a

Browse files
authored
Merge pull request #5009 from IntersectMBO/dnadales/remove-blockForgeUTCTime
Remove field `blockForgeUTCTime` since `headerForgeUTCTime` is enough.
2 parents c2e0a4e + c4946bf commit 4920b7a

File tree

9 files changed

+9
-17
lines changed

9 files changed

+9
-17
lines changed

ouroboros-network-api/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
* `accBigPoolStake` -> `accumulateBigLedgerStake`
2121
and `reRelativeStake` -> `recomputeRelativeStake`
2222
* Using `typed-protocols-0.3.0.0`.
23-
* Added `NodeToClientV_19`.
23+
* Added `NodeToClientV_19`.
24+
* Removed `blockForgeUTCTime` from `BlockFetchConsensusInterface`.
2425

2526
### Non-breaking changes
2627

ouroboros-network-api/src/Ouroboros/Network/BlockFetch/ConsensusInterface.hs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,6 @@ data BlockFetchConsensusInterface peer header block m =
177177
-- ancillary functions\/interfaces from this function.
178178
headerForgeUTCTime :: FromConsensus header -> STM m UTCTime,
179179

180-
-- | Calculate when a block was forged.
181-
--
182-
-- PRECONDITION: Same as 'headerForgeUTCTime'.
183-
--
184-
-- WARNING: Same as 'headerForgeUTCTime'.
185-
blockForgeUTCTime :: FromConsensus block -> STM m UTCTime,
186-
187180
-- | Information on the ChainSel starvation status; whether it is ongoing
188181
-- or has ended recently. Needed by the bulk sync decision logic.
189182
readChainSelStarvation :: STM m ChainSelStarvation,

ouroboros-network/CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* Introduced `daReadLedgerPeerSnapshot` to `P2P.ArgumentsExtra` which holds
2121
a `Maybe LedgerPeerSnapshot` from a node's configuration. If present, it
2222
may be used to pick big ledger peers by the peer selection governor when
23-
bootstrapping a node in Genesis consensus mode, or in general when
23+
bootstrapping a node in Genesis consensus mode, or in general when
2424
LedgerStateJudgement = TooOld, subject to conditions in
2525
`LedgerPeers.ledgerPeersThread`.
2626
* Diffusion run function in P2P mode has new paramaters:
@@ -46,6 +46,7 @@
4646
* `Ouroboros.Network.NodeToNode.connectTo` returns either an error or the
4747
result of the first terminated mini-protocol.
4848
* Adjusted for changes in `ouroboros-network-framework` (PR #4990)
49+
* Renamed `blockForgeUTCTime` to `headerForgeUTCTime` in `FetchClientPolicy`.
4950

5051
### Non-Breaking changes
5152

@@ -60,7 +61,7 @@
6061
a node is syncing up.
6162
* Implemented verification of big ledger peer snapshot when syncing reaches
6263
the point at which the snapshot was taken. An error is raised when there's
63-
a mismatch detected.
64+
a mismatch detected.
6465
* Added `defaultDeadlineChurnInterval` and `defaultBulkChurnInterval` to Configuration
6566
module. Previously these were hard coded in node.
6667
* Updated tests for `network-mux` changes.

ouroboros-network/demo/chain-sync.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,6 @@ clientBlockFetch sockAddrs maxSlotNo = withIOManager $ \iocp -> do
436436
blockMatchesHeader = \_ _ -> True,
437437

438438
headerForgeUTCTime,
439-
blockForgeUTCTime = headerForgeUTCTime . fmap blockHeader,
440439
readChainSelStarvation = pure (ChainSelStarvationEndedAt (Time 0)),
441440

442441
demoteChainSyncJumpingDynamo = \_ -> pure ()

ouroboros-network/sim-tests-lib/Ouroboros/Network/BlockFetch/Examples.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ sampleBlockFetchPolicy1 fetchMode headerFieldsForgeUTCTime blockHeap currentChai
301301
blockMatchesHeader = \_ _ -> True,
302302

303303
headerForgeUTCTime = headerFieldsForgeUTCTime,
304-
blockForgeUTCTime = headerFieldsForgeUTCTime,
305304
readChainSelStarvation = pure (ChainSelStarvationEndedAt (Time 0)),
306305

307306
demoteChainSyncJumpingDynamo = \_ -> pure ()

ouroboros-network/sim-tests-lib/Test/Ouroboros/Network/Testnet/Node.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ run blockGeneratorArgs limits ni na tracersExtra tracerBlockFetch =
327327
blockMatchesHeader = \_ _ -> True,
328328

329329
headerForgeUTCTime,
330-
blockForgeUTCTime = headerForgeUTCTime . fmap blockHeader,
331330

332331
readChainSelStarvation = pure (ChainSelStarvationEndedAt (Time 0)),
333332
demoteChainSyncJumpingDynamo = \_ -> pure ()

ouroboros-network/src/Ouroboros/Network/BlockFetch.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ blockFetchLogic decisionTracer clientStateTracer
208208
blockFetchSize,
209209
blockMatchesHeader,
210210
addFetchedBlock,
211-
blockForgeUTCTime
211+
headerForgeUTCTime
212212
}
213213

214214
fetchDecisionPolicy :: FetchDecisionPolicy header

ouroboros-network/src/Ouroboros/Network/BlockFetch/Client.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ blockFetchClient _version controlMessageSTM reportFetched
8383
blockFetchSize,
8484
blockMatchesHeader,
8585
addFetchedBlock,
86-
blockForgeUTCTime
86+
headerForgeUTCTime
8787
},
8888
fetchClientCtxStateVars = stateVars
8989
} =
@@ -266,7 +266,7 @@ blockFetchClient _version controlMessageSTM reportFetched
266266
-- Add the block to the chain DB, notifying of any new chains.
267267
addFetchedBlock (castPoint (blockPoint header)) block
268268

269-
forgeTime <- atomically $ blockForgeUTCTime $ FromConsensus block
269+
forgeTime <- atomically $ headerForgeUTCTime $ FromConsensus header
270270
let blockDelay = diffUTCTime now forgeTime
271271

272272
let hf = getHeaderFields header

ouroboros-network/src/Ouroboros/Network/BlockFetch/ClientState.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ data FetchClientPolicy header block m =
8080
blockFetchSize :: header -> SizeInBytes,
8181
blockMatchesHeader :: header -> block -> Bool,
8282
addFetchedBlock :: Point block -> block -> m (),
83-
blockForgeUTCTime :: FromConsensus block -> STM m UTCTime
83+
headerForgeUTCTime :: FromConsensus header -> STM m UTCTime
8484
}
8585

8686
-- | A set of variables shared between the block fetch logic thread and each

0 commit comments

Comments
 (0)