forked from IntersectMBO/ouroboros-consensus
-
Notifications
You must be signed in to change notification settings - Fork 0
Add LSQ leashing 0.30.0.1 #18
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
Draft
tweag-ev-ak
wants to merge
12
commits into
leashing-stub-branch-for-pr
Choose a base branch
from
add-leashing-0.30.0.1
base: leashing-stub-branch-for-pr
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c65cc4b
Add leashing
tweag-ev-ak f33caa4
Add leashing
tweag-ev-ak 5ac599d
Add leashing 0.27.0.0 leash (#13)
axman6 9020145
wip: fixing tests
tweag-ev-ak ef8c646
Add leashing
tweag-ev-ak 4179875
Add leashing
tweag-ev-ak 4210cb3
Fix review comments
tweag-ev-ak f113d1e
Stop throwing AcquireFailurePointStateIsBusy error
tweag-ev-ak be4260c
Add crucialLsqClients config
tweag-ev-ak a3161f4
Cleanup LoE variables
tweag-ev-ak 278cd8f
Fix tests
tweag-ev-ak 1be3526
Update the ouroboros-network pin.
tweag-ev-ak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,7 +71,7 @@ import qualified Codec.CBOR.Encoding as CBOR | |
| import Codec.Serialise (DeserialiseFailure) | ||
| import qualified Control.Concurrent.Class.MonadSTM.Strict as StrictSTM | ||
| import Control.DeepSeq (NFData) | ||
| import Control.Monad (forM_, when) | ||
| import Control.Monad (forM_, when, join) | ||
| import Control.Monad.Class.MonadTime.SI (MonadTime) | ||
| import Control.Monad.Class.MonadTimer.SI (MonadTimer) | ||
| import Control.ResourceRegistry | ||
|
|
@@ -83,6 +83,7 @@ import Data.Hashable (Hashable) | |
| import Data.Kind (Type) | ||
| import Data.Map.Strict (Map) | ||
| import qualified Data.Map.Strict as Map | ||
| import Data.Set (Set) | ||
| import Data.Maybe (fromMaybe, isNothing) | ||
| import Data.Time (NominalDiffTime) | ||
| import Data.Typeable (Typeable) | ||
|
|
@@ -172,6 +173,7 @@ import Ouroboros.Network.PeerSelection.PeerSharing.Codec | |
| ) | ||
| import Ouroboros.Network.Protocol.ChainSync.Codec (timeLimitsChainSync) | ||
| import Ouroboros.Network.RethrowPolicy | ||
| import Ouroboros.Network.Protocol.LocalStateQuery.Type(LeashId) | ||
| import qualified SafeWildCards | ||
| import System.Exit (ExitCode (..)) | ||
| import System.FS.API (SomeHasFS (..)) | ||
|
|
@@ -234,6 +236,7 @@ data RunNodeArgs m addrNTN addrNTC blk = RunNodeArgs | |
| , rnGetUseBootstrapPeers :: STM m UseBootstrapPeers | ||
| , rnGenesisConfig :: GenesisConfig | ||
| , rnMempoolTimeoutConfig :: Maybe Mempool.MempoolTimeoutConfig | ||
| , rnCrucialLsqClients :: Set LeashId | ||
| } | ||
|
|
||
| -- | Arguments that usually only tests /directly/ specify. | ||
|
|
@@ -321,6 +324,7 @@ data LowLevelRunNodeArgs m addrNTN addrNTC blk | |
| , llrnPublicPeerSelectionStateVar :: StrictSTM.StrictTVar m (PublicPeerSelectionState addrNTN) | ||
| , llrnLdbFlavorArgs :: Complete LedgerDbFlavorArgs m | ||
| -- ^ The flavor arguments | ||
| , llrnCrucialLsqClients :: Set LeashId | ||
| } | ||
|
|
||
| data NodeDatabasePaths | ||
|
|
@@ -504,8 +508,12 @@ runWith RunNodeArgs{..} encAddrNtN decAddrNtN LowLevelRunNodeArgs{..} = | |
| systemStart | ||
| (blockchainTimeTracer rnTraceConsensus) | ||
|
|
||
| (genesisArgs, setLoEinChainDbArgs) <- | ||
| mkGenesisNodeKernelArgs llrnGenesisConfig | ||
| let genesisArgs = mkGenesisNodeKernelArgs llrnGenesisConfig | ||
| varGetLoEFragment <- newTVarIO $ pure ChainDB.LoEDisabled | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO I didn't scrutinize this very much. Seems plausible as just a copy-paste from what used to be in |
||
| let setLoEinChainDbArgs argsCfg = argsCfg | ||
| { ChainDB.cdbsArgs = | ||
| (ChainDB.cdbsArgs argsCfg) { ChainDB.cdbsLoE = join $ readTVarIO varGetLoEFragment } | ||
| } | ||
|
|
||
| let maybeValidateAll | ||
| | lastShutDownWasClean = | ||
|
|
@@ -585,6 +593,8 @@ runWith RunNodeArgs{..} encAddrNtN decAddrNtN LowLevelRunNodeArgs{..} = | |
| genesisArgs | ||
| DiffusionPipeliningOn | ||
| rnMempoolTimeoutConfig | ||
| varGetLoEFragment | ||
| llrnCrucialLsqClients | ||
| nodeKernel <- initNodeKernel nodeKernelArgs | ||
| rnNodeKernelHook registry nodeKernel | ||
| churnModeVar <- StrictSTM.newTVarIO ChurnModeNormal | ||
|
|
@@ -858,9 +868,11 @@ mkNodeKernelArgs :: | |
| GSM.MarkerFileView m -> | ||
| STM m UseBootstrapPeers -> | ||
| StrictSTM.StrictTVar m (PublicPeerSelectionState addrNTN) -> | ||
| GenesisNodeKernelArgs m blk -> | ||
| GenesisNodeKernelArgs -> | ||
| DiffusionPipeliningSupport -> | ||
| Maybe Mempool.MempoolTimeoutConfig -> | ||
| StrictTVar m (ChainDB.GetLoEFragment m blk) -> | ||
| Set LeashId -> | ||
| m (NodeKernelArgs m addrNTN (ConnectionId addrNTC) blk) | ||
| mkNodeKernelArgs | ||
| registry | ||
|
|
@@ -880,7 +892,9 @@ mkNodeKernelArgs | |
| publicPeerSelectionStateVar | ||
| genesisArgs | ||
| getDiffusionPipeliningSupport | ||
| mempoolTimeoutConfig = | ||
| mempoolTimeoutConfig | ||
| varGetLoEFragment | ||
| crucialLsqClients = | ||
| do | ||
| let (kaRng, psRng) = split rng | ||
| return | ||
|
|
@@ -911,6 +925,8 @@ mkNodeKernelArgs | |
| , publicPeerSelectionStateVar | ||
| , genesisArgs | ||
| , getDiffusionPipeliningSupport | ||
| , varGetLoEFragment | ||
| , crucialLsqClients | ||
| } | ||
|
|
||
| -- | We allow the user running the node to customise the 'NodeKernelArgs' | ||
|
|
@@ -1057,6 +1073,7 @@ stdLowLevelRunNodeArgsIO | |
| Diffusion.dcPublicPeerSelectionVar srnDiffusionConfiguration | ||
| , llrnLdbFlavorArgs = | ||
| srnLdbFlavorArgs | ||
| , llrnCrucialLsqClients = mempty | ||
| } | ||
| where | ||
| networkMagic :: NetworkMagic | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
😬
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.
I needed it for Asahi linux! :D