Skip to content

Conversation

@alexwoods
Copy link
Collaborator

Description

This PR adds a new field to BlockInfo - intent. This signals whether the block should be just validated, just applied or both.

Related Issue(s)

Relates to #397.

How was this tested?

The only test for this change is that it doesn't break anything, so this was tested using existing unit tests and by running the service to make sure it still functions.

Checklist

  • My code builds and passes local tests
  • I added/updated tests for my changes, where applicable
  • I updated documentation (if applicable)
  • CI is green for this PR

Impact / Side effects

When creating new blocks the intent field must be set.

Reviewer notes / Areas to focus

Nothing specific.

@alexwoods alexwoods linked an issue Nov 21, 2025 that may be closed by this pull request
@alexwoods alexwoods requested review from sandtreader and shd November 21, 2025 14:20
Copy link
Collaborator

@sandtreader sandtreader left a comment

Choose a reason for hiding this comment

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

Looks good - only comment is whether intent in validator tests ought to set Validate, because once intent is taken account of, they will only operate when it is set.

hex::decode(include_str!("./data/7854823.cbor")).unwrap();
let block_info = BlockInfo {
status: BlockStatus::Immutable,
intent: BlockIntent::Apply,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Given this is a validator, shouldn't this be BlockIntent::Validate?

hex::decode(include_str!("./data/4490511.cbor")).unwrap();
let block_info = BlockInfo {
status: BlockStatus::Immutable,
intent: BlockIntent::Apply,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Validate


let block_info = BlockInfo {
status: BlockStatus::Immutable,
intent: BlockIntent::Apply,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Originally thought this should be configurable but actually it will be consensus which sets the Validate bit if it wants to, so this is fine as is.

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.

Introduce new field to BlockInfo structure

4 participants