Skip to content

feat: fermi logic for validator#138

Merged
constwz merged 5 commits intodevelopfrom
feat-fermi-v
Nov 15, 2025
Merged

feat: fermi logic for validator#138
constwz merged 5 commits intodevelopfrom
feat-fermi-v

Conversation

let mut count = 1;
if chain_spec.is_fermi_active_at_timestamp(head.number(), head.timestamp()) {
count = K_ANCESTOR_GENERATION_DEPTH;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

It is recommended to encapsulate this into a function called GetAncestorGenerationDepth in parlia, similar to BSC-geth.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are multiple places where this logic exists and no suitable way to make it a public method is found because of the ChainSpec parameter

@MatusKysel MatusKysel requested a review from Copilot November 5, 2025 12:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements Fermi hardfork changes for the BEP-590 vote attestation mechanism, enabling ancestor block voting across up to 3 generations instead of just the direct parent block.

Key changes:

  • Extends vote attestation to search through up to 3 ancestor generations (K_ANCESTOR_GENERATION_DEPTH) when the Fermi hardfork is active
  • Updates the vote assembly logic to iterate through ancestors until sufficient quorum is reached
  • Adjusts validation logic to check ancestor blocks for attestation target matching

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/consensus/parlia/constants.rs Adds K_ANCESTOR_GENERATION_DEPTH constant and changes MILLISECONDS_UNIT from 250ms to 50ms
src/consensus/parlia/consensus.rs Refactors assemble_vote_attestation to search ancestors for quorum and adds snapshot_provider parameter
src/consensus/parlia/error.rs Adds HeaderNotFound and SnapshotNotFound error variants
src/node/vote_producer.rs Adjusts vote assembly timing calculation to account for K_ANCESTOR_GENERATION_DEPTH
src/node/evm/pre_execution.rs Updates verification to check ancestors up to depth based on Fermi activation, removes get_ancestor_generation_depth method
src/node/miner/util.rs Passes snapshot_provider to assemble_vote_attestation and changes error logging from debug to warn
src/node/evm/assembler.rs Threads snapshot_provider parameter through finalize_new_header calls
src/hardforks/mod.rs Fixes comment incorrectly referencing Maxwell instead of Fermi

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@MatusKysel MatusKysel left a comment

Choose a reason for hiding this comment

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

lgtm

@constwz constwz merged commit ccb5af4 into develop Nov 15, 2025
8 checks passed
constwz added a commit that referenced this pull request Nov 17, 2025
constwz added a commit that referenced this pull request Nov 17, 2025
constwz added a commit that referenced this pull request Nov 17, 2025
constwz added a commit that referenced this pull request Nov 17, 2025
@sysvm sysvm deleted the feat-fermi-v branch November 25, 2025 07:11
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.

7 participants