-
Notifications
You must be signed in to change notification settings - Fork 2
Add NewBlock hook #304
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
Add NewBlock hook #304
Conversation
Deploying happychain with
|
| Latest commit: |
d6af5a2
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://dce7bf21.happychain.pages.dev |
| Branch Preview URL: | https://gabriel-on-new-block.happychain.pages.dev |
HAPPY-257 Create OnNewBlock hook
This hook will allow users to execute code on every new block without having to place that code inside the transaction collector or use another web3 client. In addition, after implementing this hook, we will have to move the randomness-service prune database function to this new hook and mark as expired the randomness for which the commitment has been submitted but not revealed, and it has already expired |
bd6c349 to
402e588
Compare
49be5b0 to
24dcb68
Compare
402e588 to
2edd290
Compare
24dcb68 to
3120be0
Compare
2edd290 to
737aae5
Compare
3120be0 to
9f8388b
Compare
737aae5 to
5e90c92
Compare
9f8388b to
4497b70
Compare
5e90c92 to
698e598
Compare
4497b70 to
2d677a8
Compare
698e598 to
1149cdf
Compare
2d677a8 to
655bb79
Compare
d379bf6 to
918c1f4
Compare
3521045 to
e895e28
Compare
a979cc1 to
c29c18f
Compare
| console.error("Failed to prune commitments", result.error) | ||
| } | ||
| }) | ||
| } |
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.
Just checking: the ordering of this with other block subscriptions doesn't matter, right?
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.
Yes, it doesn't matter
e895e28 to
205fe15
Compare
c29c18f to
aea40f9
Compare
aea40f9 to
1c39543
Compare
721eb06 to
3725784
Compare
1c39543 to
d6af5a2
Compare

Linked Issues
Description
Adds a new block hook to the transaction manager and moves
pruningandreveal not submittedlogic to be triggered by new blocks instead of by transaction collector. This improves the separation of concerns by having these operations respond to time-based triggers rather than transaction events.Key changes:
NewBlockhook type to transaction managerpruninglogic andreveal not submittedfrom transaction collector to new block handlerChecklist
Toggle Checklist
Checklist
Basics
norswap/build-system-caching).Reminder: PR review guidelines
Correctness
C1. Builds and passes tests.
C2. The code is properly parameterized & compatible with different environments (e.g. local,
testnet, mainnet, standalone wallet, ...).
C3. I have manually tested my changes & connected features.
C4. I have performed a thorough self-review of my code after submitting the PR,
and have updated the code & comments accordingly.
Architecture & Documentation
(2) commenting these boundaries correctly, (3) adding inline comments for context when needed.
comments.
in a Markdown document.