-
Notifications
You must be signed in to change notification settings - Fork 632
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
refactor: remove header signature verification from epoch manager #12467
base: stefan/em_sig_ver
Are you sure you want to change the base?
Conversation
|
||
/// This function requires that the previous block of `header` has been processed. | ||
/// If not, it returns EpochError::MissingBlock. | ||
pub fn verify_header_signature_with_epoch_manager( |
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.
nit: let's make it verify_block_header_signature_with_epoch_manager
epoch_manager.get_block_producer_info(header.epoch_id(), header.height())?; | ||
match epoch_manager.get_block_info(header.prev_hash()) { | ||
Ok(block_info) => Ok(verify_header_signature(header, block_producer, block_info)), | ||
Err(_) => return Err(EpochError::MissingBlock(*header.prev_hash()).into()), |
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.
nit: you do not need return
here
block_producer: ValidatorStake, | ||
block_info: Arc<BlockInfo>, | ||
) -> bool { | ||
if block_info.slashed().contains_key(block_producer.account_id()) { |
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.
I would rather just remove this function and push the functionality inline to verify_header_signature_with_epoch_manager
.
It's not trivial to imagine this function should be checking slashed block producer from block info of previous block.
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.
+1, this slashing check is annoying and useless at this point, would be great to remove it
No description provided.