Skip to content
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

Remove field blockForgeUTCTime since headerForgeUTCTime is enough. #5009

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ouroboros-network-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
* `accBigPoolStake` -> `accumulateBigLedgerStake`
and `reRelativeStake` -> `recomputeRelativeStake`
* Using `typed-protocols-0.3.0.0`.
* Added `NodeToClientV_19`.
* Added `NodeToClientV_19`.
* Removed `blockForgeUTCTime` from `BlockFetchConsensusInterface`.

### Non-breaking changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,6 @@ data BlockFetchConsensusInterface peer header block m =
-- ancillary functions\/interfaces from this function.
headerForgeUTCTime :: FromConsensus header -> STM m UTCTime,

-- | Calculate when a block was forged.
--
-- PRECONDITION: Same as 'headerForgeUTCTime'.
--
-- WARNING: Same as 'headerForgeUTCTime'.
blockForgeUTCTime :: FromConsensus block -> STM m UTCTime,

-- | Information on the ChainSel starvation status; whether it is ongoing
-- or has ended recently. Needed by the bulk sync decision logic.
readChainSelStarvation :: STM m ChainSelStarvation,
Expand Down
5 changes: 3 additions & 2 deletions ouroboros-network/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* Introduced `daReadLedgerPeerSnapshot` to `P2P.ArgumentsExtra` which holds
a `Maybe LedgerPeerSnapshot` from a node's configuration. If present, it
may be used to pick big ledger peers by the peer selection governor when
bootstrapping a node in Genesis consensus mode, or in general when
bootstrapping a node in Genesis consensus mode, or in general when
LedgerStateJudgement = TooOld, subject to conditions in
`LedgerPeers.ledgerPeersThread`.
* Diffusion run function in P2P mode has new paramaters:
Expand All @@ -46,6 +46,7 @@
* `Ouroboros.Network.NodeToNode.connectTo` returns either an error or the
result of the first terminated mini-protocol.
* Adjusted for changes in `ouroboros-network-framework` (PR #4990)
* Renamed `blockForgeUTCTime` to `headerForgeUTCTime` in `FetchClientPolicy`.

### Non-Breaking changes

Expand All @@ -60,7 +61,7 @@
a node is syncing up.
* Implemented verification of big ledger peer snapshot when syncing reaches
the point at which the snapshot was taken. An error is raised when there's
a mismatch detected.
a mismatch detected.
* Added `defaultDeadlineChurnInterval` and `defaultBulkChurnInterval` to Configuration
module. Previously these were hard coded in node.
* Updated tests for `network-mux` changes.
Expand Down
1 change: 0 additions & 1 deletion ouroboros-network/demo/chain-sync.hs
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,6 @@ clientBlockFetch sockAddrs maxSlotNo = withIOManager $ \iocp -> do
blockMatchesHeader = \_ _ -> True,

headerForgeUTCTime,
blockForgeUTCTime = headerForgeUTCTime . fmap blockHeader,
readChainSelStarvation = pure (ChainSelStarvationEndedAt (Time 0)),

demoteChainSyncJumpingDynamo = \_ -> pure ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ sampleBlockFetchPolicy1 fetchMode headerFieldsForgeUTCTime blockHeap currentChai
blockMatchesHeader = \_ _ -> True,

headerForgeUTCTime = headerFieldsForgeUTCTime,
blockForgeUTCTime = headerFieldsForgeUTCTime,
readChainSelStarvation = pure (ChainSelStarvationEndedAt (Time 0)),

demoteChainSyncJumpingDynamo = \_ -> pure ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ run blockGeneratorArgs limits ni na tracersExtra tracerBlockFetch =
blockMatchesHeader = \_ _ -> True,

headerForgeUTCTime,
blockForgeUTCTime = headerForgeUTCTime . fmap blockHeader,

readChainSelStarvation = pure (ChainSelStarvationEndedAt (Time 0)),
demoteChainSyncJumpingDynamo = \_ -> pure ()
Expand Down
2 changes: 1 addition & 1 deletion ouroboros-network/src/Ouroboros/Network/BlockFetch.hs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ blockFetchLogic decisionTracer clientStateTracer
blockFetchSize,
blockMatchesHeader,
addFetchedBlock,
blockForgeUTCTime
headerForgeUTCTime
}

fetchDecisionPolicy :: FetchDecisionPolicy header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ blockFetchClient _version controlMessageSTM reportFetched
blockFetchSize,
blockMatchesHeader,
addFetchedBlock,
blockForgeUTCTime
headerForgeUTCTime
},
fetchClientCtxStateVars = stateVars
} =
Expand Down Expand Up @@ -266,7 +266,7 @@ blockFetchClient _version controlMessageSTM reportFetched
-- Add the block to the chain DB, notifying of any new chains.
addFetchedBlock (castPoint (blockPoint header)) block

forgeTime <- atomically $ blockForgeUTCTime $ FromConsensus block
forgeTime <- atomically $ headerForgeUTCTime $ FromConsensus header
let blockDelay = diffUTCTime now forgeTime

let hf = getHeaderFields header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ data FetchClientPolicy header block m =
blockFetchSize :: header -> SizeInBytes,
blockMatchesHeader :: header -> block -> Bool,
addFetchedBlock :: Point block -> block -> m (),
blockForgeUTCTime :: FromConsensus block -> STM m UTCTime
headerForgeUTCTime :: FromConsensus header -> STM m UTCTime
}

-- | A set of variables shared between the block fetch logic thread and each
Expand Down
Loading