-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat(block-producer): batch builder #515
feat(block-producer): batch builder #515
Conversation
This simplifies the lookups.
These allow better abstractions around note authentication and witnessing.
This includes support for witnessed input notes.
This allows us to re-use the tests for sanity checking.
489b0bf
to
4c48c91
Compare
One issue that @polydez has made me aware of is that notes must be ordered by transaction order. See here. I have some refactoring to do to support this properly. Thinking on this some more, likely the simplest is to remove my new input notes type entirely in favor of just passing around the original transaction/notes along with the note witnesses. Will draft this PR until I've fixed this; right now this would cause confusion as is. |
Yes, this is how I'm currently thinking about it. But one thing we should do to confirm this is sketch out batch kernel - or at least what we think it'll take as public inputs and what public outputs it'll produce. For example:
|
Remove all unecessary new types, wrappers.
These are no longer required
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.
Looks good! Thank you! I left some comments inline - most are minor, but there are a few where I think transaction validation logic needs to be improved.
fd7d997
to
c62b876
Compare
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.
Looks good! Thank you! I left a few more comments inline.
Once these and the comments from the previous review are addressed, I think we should merge this. If you'd prefer not to merge it into next
yet, we can merge into a separate branch. Then we can make more PRs with additional changes against that branch (e.g., the ones discussed here.
I've addressed the review comments; I'll merge this PR into |
4510bab
to
a884d23
Compare
This PR is intended as a review of the in-progress
block-producer
redesign. The initial body of work was done on thenext-block-producer
work, however that initial PR received little scrutiny and thus it makes more sense (to me) to review this one in the context ofnext
proper.In that context, this PR adds the following pieces:
mempool
consisting ofInflightState
to track stateTransactionGraph
to form a dependency graph between transactionsBatchGraph
to form a dependency graph of inflight batchesmempool
mempool
The builders reuse the existing
DefaultXXX
types to minimize the footprint of this PR. Once we've switched over we could refactor these further as needed.Outstanding work
The work items of #514:
InflightState
InflightAccountState
TransactionGraph
BatchGraph
Mempool
I'll continue expanding test coverage; though I'd appreciate a review already. In particular, anything that is unclear or looks bad in the components I've marked as tested.
I'm also uncertain about the amount of
# Panics
involved. I could return more errors and raise the panics up, but there are complications where certain actions just can't (trivially) be made atomic and leave the graphs/state in a broken state. And a brokenmempool
means that we're dead in the water anyway. Thoughts welcome.