Skip to content

Leashing on demand#156

Open
adithyaov wants to merge 3 commits intomainfrom
ondemand-ss
Open

Leashing on demand#156
adithyaov wants to merge 3 commits intomainfrom
ondemand-ss

Conversation

@adithyaov
Copy link
Member

@adithyaov adithyaov commented Mar 5, 2026

Endpoints:

curl http://localhost:8090/leashing/status
curl http://localhost:8090/leashing/unleash
curl http://localhost:8090/leashing/leash

TODO:

res <- C.executeLocalStateQueryExprLeashed conn leashId False (Net.Query.SpecificPoint cp) query
runLocalStateQueryExprWith refLeashPoint conn leashId cp shouldRelease query = do
IORef.atomicModifyIORef refLeashPoint (const (Just cp, ()))
res <- C.executeLocalStateQueryExprLeashed conn leashId shouldRelease (Net.Query.SpecificPoint cp) query
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should bracket this.

Side note: This seems a little hacky. Is there a better alternative to sync this with the state of the node?

Copy link
Collaborator

@tweag-ev-ak tweag-ev-ak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Please don't merge yet. I want to think about the ouroboros-consensus side more.

Copy link
Contributor

@axman6 axman6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I fully understand this one, and I think it might be better to leave this untill we have abetter understanding of how rollbacks will be handled by the PSR.

Nothing -> pure ()
Just cp ->
void $
runLocalStateQueryExprWith leashRef conn leashId cp True sysStartQuery
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the sysStartQuery here just used as a no-op query? I have a feeling you can just use pure () since queries are Applicatives.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed that's a great suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants