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

[sovereign] Proposed epoch start header with last cross chain hash and request it if missing #6680

Open
wants to merge 5 commits into
base: MX-15632-epoch-trigger-unit-tests-import-cycle
Choose a base branch
from

Conversation

mariusmihaic
Copy link
Contributor

@mariusmihaic mariusmihaic commented Dec 16, 2024

Reasoning behind the pull request

Proposed changes

  • Leader now proposes the epoch start header (CreateBlock) containing the epoch start cross chain data(which contains last cross chain notarized data) - the same way shards do it on mainchain.
  • On epoch start block, added mechanism (computeAndRequestEpochStartExtendedHeaderIfMissing) to check if the node has (pool or tracker) the proposed epoch start. If missing, it will request it.
  • checkExtendedShardHeadersValidity :
    -- now only checks extended headers validity for the current block
    -- now checks that the epoch start header does not contain extra extended headers to be processed, and returns error otherwise (ErrReceivedSovereignEpochStartBlockWithExtendedHeaders)

Testing procedure

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@mariusmihaic mariusmihaic self-assigned this Dec 16, 2024
@mariusmihaic mariusmihaic marked this pull request as ready for review December 19, 2024 15:28
"shouldRequestLastCrossChainHeader", shouldRequestLastCrossChainHeader,
)

return missingHeaderInTracker || missingHeaderInPool
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return missingHeaderInTracker || missingHeaderInPool
return shouldRequestLastCrossChainHeader

@@ -865,6 +918,11 @@ func (scbp *sovereignChainBlockProcessor) checkExtendedShardHeadersValidity() er
return nil
}

// we should not have an epoch start block with main chain headers to be processed
if sovereignChainHeader.IsStartOfEpochBlock() {
Copy link
Contributor

Choose a reason for hiding this comment

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

  • The comment and the code are not saying the same thing
  • It's not clear why you return error, isn't this reverting the epoch change block?

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.

2 participants