Skip to content

Add head block validation to forkchoice attestation processing#75

Merged
tcoratger merged 2 commits intoleanEthereum:mainfrom
bomanaps:spec/validate-head-forkchoice
Oct 21, 2025
Merged

Add head block validation to forkchoice attestation processing#75
tcoratger merged 2 commits intoleanEthereum:mainfrom
bomanaps:spec/validate-head-forkchoice

Conversation

@bomanaps
Copy link
Copy Markdown
Contributor

🗒️ Description

Add head block validation to forkchoice attestation processing

🔗 Related Issues or PRs

blockblaz/zeam#315 (comment)

✅ Checklist

  • Ran tox checks to avoid unnecessary CI fails:
    uvx --with=tox-uv tox
  • Considered adding appropriate tests for the changes.
  • Considered updating the online docs in the ./docs/ directory.

@bomanaps
Copy link
Copy Markdown
Contributor Author

Opening this PR for discussion, should the spec explicitly require that an attestation’s head.block_root be present in fork choice before validation? it’s not clearly defined in the spec. Would love input on this @g11tech @tcoratger

Copy link
Copy Markdown
Collaborator

@tcoratger tcoratger left a comment

Choose a reason for hiding this comment

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

Looks good to me

@bomanaps
Copy link
Copy Markdown
Contributor Author

Hello @tcoratger, shouldn’t we change these lines to?

# Line 140:
current_slot = Slot(self.time // INTERVALS_PER_SLOT)

# Line 177:
time_slots = self.time // INTERVALS_PER_SLOT

@tcoratger
Copy link
Copy Markdown
Collaborator

Hello @tcoratger, shouldn’t we change these lines to?

# Line 140:
current_slot = Slot(self.time // INTERVALS_PER_SLOT)

# Line 177:
time_slots = self.time // INTERVALS_PER_SLOT

Not sure what you propose here, you want to change these lines for something else?

@bomanaps
Copy link
Copy Markdown
Contributor Author

Hello @tcoratger, shouldn’t we change these lines to?

# Line 140:
current_slot = Slot(self.time // INTERVALS_PER_SLOT)

# Line 177:
time_slots = self.time // INTERVALS_PER_SLOT

Not sure what you propose here, you want to change these lines for something else?

replace SECONDS_PER_INTERVAL with INTERVALS_PER_SLOT. I think we currently calculate slot wrong (4× too high) because self.time is in intervals, not seconds.

@tcoratger
Copy link
Copy Markdown
Collaborator

Ah yes you are right, could you fix this here as well?

@tcoratger tcoratger merged commit 161c049 into leanEthereum:main Oct 21, 2025
9 checks passed
varun-doshi pushed a commit to varun-doshi/leanSpec that referenced this pull request Oct 23, 2025
…thereum#75)

* Add head block validation to forkchoice attestation processing

* Fix slot calculation time unit bug
@unnawut unnawut added the specs Scope: Changes to the specifications label Oct 25, 2025
@unnawut unnawut added this to the pq-devnet-1 milestone Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

specs Scope: Changes to the specifications

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants