Skip to content
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

Open
wants to merge 4 commits into
base: stefan/em_sig_ver
Choose a base branch
from

Conversation

stedfn
Copy link
Contributor

@stedfn stedfn commented Nov 15, 2024

No description provided.

@stedfn stedfn self-assigned this Nov 15, 2024
@stedfn stedfn changed the base branch from master to stefan/em_sig_ver November 15, 2024 14:20
@stedfn stedfn marked this pull request as ready for review November 15, 2024 16:08
@stedfn stedfn requested a review from a team as a code owner November 15, 2024 16:08

/// 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(
Copy link
Contributor

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()),
Copy link
Contributor

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()) {
Copy link
Contributor

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.

Copy link
Contributor

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

@stedfn stedfn changed the base branch from stefan/em_sig_ver to master November 20, 2024 13:12
@stedfn stedfn changed the base branch from master to stefan/remove_verify_chunk_header November 20, 2024 13:12
@stedfn stedfn changed the base branch from stefan/remove_verify_chunk_header to stefan/em_sig_ver November 20, 2024 13:13
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.

3 participants