Skip to content

Conversation

@ARR4N
Copy link
Collaborator

@ARR4N ARR4N commented Sep 12, 2025

Introduces the blocks.Block type (and associated helpers), which satisfies the adaptor.BlockProperties interface 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 in saexec and the primary SAE implementation.

Recommended review order:

  1. block.go - general scaffolding and construction
  2. snow.go - implementation of adaptor.BlockProperties methods
  3. execution.go - transition from Accepted to Executed
  4. settlement.go - transition from Executed to Settled; and also inspection of existing/hypothetical settlement (for block building)
  5. db.go - database functionality used by the above, co-located for shared logic
  6. Other non-test files in blocks package

Tests can be reviewed either immediately after their respective non-test file, or batched at the end. Review the cmputils and saetest additions before reviewing any tests.

Closes #12.

@ARR4N ARR4N self-assigned this Sep 12, 2025
@ARR4N ARR4N marked this pull request as ready for review September 12, 2025 15:12
ARR4N and others added 7 commits September 16, 2025 20:12
Co-authored-by: Stephen Buttolph <stephen@avalabs.org>
Signed-off-by: Arran Schlosberg <519948+ARR4N@users.noreply.github.com>
)

---------

Co-authored-by: Arran Schlosberg <me@arranschlosberg.com>
Co-authored-by: Stephen Buttolph <stephen@avalabs.org>
Signed-off-by: Arran Schlosberg <519948+ARR4N@users.noreply.github.com>
Comment on lines 89 to 90
// 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
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

ARR4N and others added 2 commits September 26, 2025 08:24
Co-authored-by: Stephen Buttolph <stephen@avalabs.org>
Signed-off-by: Arran Schlosberg <519948+ARR4N@users.noreply.github.com>
@ARR4N ARR4N merged commit eb533e6 into main Sep 26, 2025
11 checks passed
@ARR4N ARR4N deleted the arr4n/blocks branch September 26, 2025 07:34
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.

blocks package production readiness

3 participants