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

Create EventSource and EventSink handles #1267

Conversation

cardenaso11
Copy link
Contributor


  • CHANGELOG updated or not needed
  • Documentation updated or not needed
  • Haddocks updated or not needed
  • No new TODOs introduced or explained herafter

@cardenaso11 cardenaso11 changed the title Persistence (WIP) Persistence Updates (WIP) Jan 22, 2024
@ch1bo
Copy link
Collaborator

ch1bo commented Jan 23, 2024

@cardenaso11 Hey it's great to see you started work on implementing ADR29!

I'm a bit surprised though that you would update the Persistence handle instead of adding EventSource and EventSink(s) in the central HydraNode handle as designed?

Happy to have an alignment chat on discord or so about this?

Copy link
Collaborator

@ch1bo ch1bo left a comment

Choose a reason for hiding this comment

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

We discussed the approach and also drafted the call sites here: 4a281ce

hydra-node/src/Hydra/Node.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/Persistence.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/Persistence.hs Show resolved Hide resolved
@ch1bo ch1bo removed their assignment Feb 2, 2024
@cardenaso11 cardenaso11 force-pushed the SB-1352-persistence-types branch from f23b790 to fe72281 Compare February 15, 2024 17:14
@cardenaso11 cardenaso11 marked this pull request as ready for review February 21, 2024 09:48
@cardenaso11 cardenaso11 force-pushed the SB-1352-persistence-types branch from 4208eaf to 067edec Compare February 21, 2024 10:07
@ch1bo ch1bo self-requested a review February 21, 2024 10:35
Copy link
Collaborator

@ch1bo ch1bo left a comment

Choose a reason for hiding this comment

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

Wasn't sure if this is ready to review already, but left some comments nontheless.

I think you would benefit a lot from not changing the HeadLogic and API Server as this results in a lot of noise and is a too big of a step (see my "Must" comments)

hydra-node/src/Hydra/Persistence.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/API/Server.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/HeadLogic/Outcome.hs Show resolved Hide resolved
hydra-node/src/Hydra/HeadLogic.hs Show resolved Hide resolved
hydra-node/src/Hydra/Network/Reliability.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/Node.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/Node.hs Show resolved Hide resolved
hydra-node/src/Hydra/Persistence.hs Outdated Show resolved Hide resolved
hydra-node/test/Hydra/HeadLogicSpec.hs Outdated Show resolved Hide resolved
hydra-node/test/Hydra/PersistenceSpec.hs Outdated Show resolved Hide resolved
@ch1bo ch1bo mentioned this pull request Feb 26, 2024
3 tasks
@ch1bo ch1bo force-pushed the SB-1352-persistence-types branch 6 times, most recently from 95ea20a to 599b405 Compare March 4, 2024 17:54
@ch1bo ch1bo marked this pull request as draft March 4, 2024 17:55
@ch1bo ch1bo changed the title Persistence Updates (WIP) Create EventSource and EventSink handles Mar 4, 2024
@ch1bo ch1bo force-pushed the SB-1352-persistence-types branch 2 times, most recently from e379909 to c92df27 Compare March 4, 2024 18:34
…entSink.\n\nIt's not clear yet if we can have the statechange ID in the StateChanged type as a substitute for tracking the current stateChangeID in the node\nBut for now it works to get the node's stateChangedID into the disk-persistence eventSink's putEvent', where we can compare it against the last persisted stateChange\nThis works for the particular disk-based eventSink where we *do have* exactly-once, but in ex kinesis poc or redis or something, it can be the key for at-least-once dict

lint
cardenaso11 and others added 13 commits March 11, 2024 17:06
We can define an event source and event sink from the
PersistenceIncremental.
Having a dedicated module allows easier import in forks of hydra and
hopefully serves as a better extension points (with less breakage).
We kept the EventSource/EventSink very abstract to make implementations
not realy on the internas of the actual data type used. However, an
event source / sink will need at least identify individual events to
tell them apart, e.g. to deduplicate them in memory.
Current idea: Keep notes where extensions are possible so we don't
change things by accident breaking external/custom code of users.
We do not want to update this module (yet) with a different means for persistence.
@ch1bo ch1bo force-pushed the SB-1352-persistence-types branch from c92df27 to 8a00c06 Compare March 11, 2024 16:08
@ch1bo ch1bo changed the base branch from master to rename-events March 11, 2024 17:49
ch1bo added 5 commits March 11, 2024 19:55
By making the step-wise construction of HydraNode monadic (although not
specifically needed) we can simplify call-sites in the NodeSpec.
This is unfortunately very "white-boxy" and the testing code needs to
know that the generated events must be using parameters consistent with
the environment.

The alternative would be to move checkHeadState outside of hydrate, but
then 'WetHydraNode's can exist without this check happening.
@ch1bo ch1bo force-pushed the SB-1352-persistence-types branch 2 times, most recently from 2a1d836 to 644d232 Compare March 12, 2024 10:21
@ch1bo ch1bo self-assigned this Mar 12, 2024
@ch1bo ch1bo force-pushed the SB-1352-persistence-types branch from 644d232 to fa7d970 Compare March 12, 2024 11:13
@v0d1ch v0d1ch deleted the branch cardano-scaling:rename-events March 12, 2024 16:03
@v0d1ch v0d1ch closed this Mar 12, 2024
@ch1bo
Copy link
Collaborator

ch1bo commented Mar 13, 2024

Superseded by #1351

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