Skip to content

Refactor AP1 ExtData Checks #1005

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

StephenButtolph
Copy link
Contributor

Why this should be merged

Personally, I find the current code hard to reason about.

  • The current code has multiple cases where AP1 is checked.
  • The pre-AP1 check (which is required even after the chains have advanced past AP1) is only enforced for Fuji and Mainnet, even though all chains really would need this check.
  • The pre-AP1 checks have a control flow based on untrusted data (rather than having the control flow based on trusted data).

How this works

  1. Refactors the pre-AP1 checks to perform validation based on the known extDataHashes rather than based on the claimed extData.
  2. Enforces all non-Fuji/Mainnet chains with pre-AP1 blocks to not have any extData.
  3. Combined both !rules.IsApricotPhase1 cases into a single block.

How this was tested

CI / visual inspection.

Need to be documented?

No.

Need to update RELEASES.md?

No

@StephenButtolph StephenButtolph requested a review from a team as a code owner June 5, 2025 17:42
if !rules.IsApricotPhase1 {
if blockExtender.extDataHashes != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think removal of this what caused UTs to fail as we don't have extDataHashes for UTs.

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