-
Notifications
You must be signed in to change notification settings - Fork 5
Add intent field to BlockInfo #412
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
base: main
Are you sure you want to change the base?
Conversation
sandtreader
left a comment
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 - 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, |
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.
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, |
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.
Validate
|
|
||
| let block_info = BlockInfo { | ||
| status: BlockStatus::Immutable, | ||
| intent: BlockIntent::Apply, |
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.
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.
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
Impact / Side effects
When creating new blocks the intent field must be set.
Reviewer notes / Areas to focus
Nothing specific.