-
Notifications
You must be signed in to change notification settings - Fork 1
feat: blocks package
#18
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
Conversation
Co-authored-by: Stephen Buttolph <stephen@avalabs.org> Signed-off-by: Arran Schlosberg <519948+ARR4N@users.noreply.github.com>
Co-authored-by: Stephen Buttolph <stephen@avalabs.org> Signed-off-by: Arran Schlosberg <519948+ARR4N@users.noreply.github.com>
Co-authored-by: Stephen Buttolph <stephen@avalabs.org> Signed-off-by: Arran Schlosberg <519948+ARR4N@users.noreply.github.com>
blocks/settlement.go
Outdated
| // LastSettled returns the last-settled block at the time of b's acceptance, | ||
| // unless [Block.MarkSettled] has been called, in which case it returns nil. If |
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.
pedantic: but if I were to read this doc, I would assume it is expected for me to be able to call this even after MarkSettled has been called. However, that results in an ERROR log.
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.
WAI but insufficiently documented (and since updated). We could debate whether it should be WARN vs ERROR, but it definitely needs to be something because it points to improper usage in the build-verify-accept loop.
Co-authored-by: Stephen Buttolph <stephen@avalabs.org> Signed-off-by: Arran Schlosberg <519948+ARR4N@users.noreply.github.com>
Introduces the
blocks.Blocktype (and associated helpers), which satisfies theadaptor.BlockPropertiesinterface introduced in #7. While the motivation of specific functionality may not be clear in isolation, context can be garnered from the prototype code (f79aff0) and how it uses this package insaexecand the primary SAE implementation.Recommended review order:
block.go- general scaffolding and constructionsnow.go- implementation ofadaptor.BlockPropertiesmethodsexecution.go- transition from Accepted to Executedsettlement.go- transition from Executed to Settled; and also inspection of existing/hypothetical settlement (for block building)db.go- database functionality used by the above, co-located for shared logicblockspackageTests can be reviewed either immediately after their respective non-test file, or batched at the end. Review the
cmputilsandsaetestadditions before reviewing any tests.Closes #12.