Add set of currently active leash clients to LsqLeashingState#21
Open
axman6 wants to merge 2 commits intoadd-leashing-0.30.0.1from
Open
Add set of currently active leash clients to LsqLeashingState#21axman6 wants to merge 2 commits intoadd-leashing-0.30.0.1from
axman6 wants to merge 2 commits intoadd-leashing-0.30.0.1from
Conversation
axman6
commented
Mar 17, 2026
|
|
||
| varLsqLeashingState <- newTVarIO $ mempty | ||
| varGenesisLoEFragment <- newTVarIO LoEDisabled | ||
| varLsqLeashingState <- newTVarIO $ LsqLeashingState Map.empty Set.empty |
Author
There was a problem hiding this comment.
This might need to be extended to support the set of expected leash clients @tweag-ev-ak was working on to prevent progress before clients are able to connect.
| idle :: ServerStIdle blk (Point blk) (Query blk) m () | ||
| idle = | ||
| idle :: Maybe LeashId -> ServerStIdle blk (Point blk) (Query blk) m () | ||
| idle clientLeashId = |
Author
There was a problem hiding this comment.
All states now know this thread's client's LeashId if the client provided one.
| lsqLeashingState <- readTVar lsqLeashingStateVar | ||
| let newState = Map.delete leashId lsqLeashingState | ||
| writeTVar lsqLeashingStateVar newState | ||
| releaseLeash leashId = do |
Author
There was a problem hiding this comment.
Always removed the leash and the active client ID - maintains the set of active clients always being a subset of the known leashes.
| in (toList $ lsqActiveClients l', l') | ||
| traceM $ "currently live clients: " <> show active | ||
|
|
||
| deactivateLeashClient :: Maybe LeashId -> m () |
Author
There was a problem hiding this comment.
Only removes the active client ID.
bddbd43 to
e4e7c5b
Compare
e4e7c5b to
8097d2f
Compare
c155bf7 to
9f9c384
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes tweag/plutus-script-reexecutor#161
Adds a set of currently known leashing client IDs -
LeashId's which currently have active connections to clients (and hence an active thread which can update that ID's leash). This should be a subset of all the IDs in the keys of the leash fragments map.Also note that:
It is possible that a client sends a new
LeashIdwhen in theIdlestate, which does not match the previousLeashIdfrom that connection. Currently I'm not checking for or handling that case because I'm not sure what the appropriate action is:LeashId(and remove it from the active set) - seereleaseLeash.I haven't made any changes to the protocol constructors, so the error case when a
LeashIdis reused currently sendsAcquireFailurePointNotOnChain. This should probably be a new error constructor.MsgDonealso no longer needs theMaybe LeashId, if there is a known ID it will be passed into theidlefunction.