Skip to content

Support Fermi HF - #96

Merged
yoshidan merged 14 commits into
mainfrom
bep590
Nov 27, 2025
Merged

yoshidan merged 14 commits into
mainfrom
bep590

Conversation

@yoshidan

@yoshidan yoshidan commented Nov 8, 2025 •

Copy link
Copy Markdown
Contributor
  • Modify verify_finalzied with k_ancestor_generation_depth to follow Fermi HF
  • Bump up lcp to v0.2.17
  • Fix code by newer clippy version
  • Update CI

Signed-off-by: yoshidan <naohiro.y@gmail.com>
Signed-off-by: yoshidan <naohiro.y@gmail.com>
Signed-off-by: yoshidan <naohiro.y@gmail.com>
Signed-off-by: yoshidan <naohiro.y@gmail.com>
Signed-off-by: yoshidan <naohiro.y@gmail.com>
Signed-off-by: yoshidan <naohiro.y@gmail.com>
Signed-off-by: yoshidan <naohiro.y@gmail.com>
Signed-off-by: yoshidan <naohiro.y@gmail.com>
Signed-off-by: yoshidan <naohiro.y@gmail.com>
Signed-off-by: yoshidan <naohiro.y@gmail.com>
@yoshidan
yoshidan requested review from 3100 and siburu November 13, 2025 09:14
Signed-off-by: yoshidan <naohiro.y@gmail.com>
Signed-off-by: yoshidan <naohiro.y@gmail.com>
@yoshidan yoshidan changed the title Support Fermi Support Fermi HF Nov 13, 2025
@3100
3100 requested a review from Copilot November 25, 2025 11:30

Copilot AI left a comment

Copy link
Copy Markdown

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 adds support for the Fermi Hard Fork (HF) by introducing the k_ancestor_generation_depth parameter to the finalization verification logic. The parameter allows for a configurable depth when searching for valid child/grandchild attestation relationships, enabling more flexible block finalization rules. Additionally, the PR updates dependencies (LCP from v0.2.12 to v0.2.17), applies modern Rust idioms as required by newer clippy versions, and modernizes the CI workflow.

Key Changes:

  • Added k_ancestor_generation_depth field to ForkSpec and ETHHeader structures to support Fermi HF finalization rules
  • Refactored verify_finalized() to use nested loops with distance checking based on k_ancestor_generation_depth
  • Renamed set_boundary_epochs() to assign_fork_spec() for better clarity and consistency

Reviewed changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
proto/definitions/ibc/lightclients/parlia/v1/parlia.proto Added k_ancestor_generation_depth field to ForkSpec message
proto/src/prost/ibc.lightclients.parlia.v1.rs Regenerated Rust code from proto with new field
light-client/src/header/eth_headers.rs Rewrote verify_finalized() with nested loops and k_ancestor_generation_depth constraint
light-client/src/header/eth_header.rs Added k_ancestor_generation_depth field and renamed method to assign_fork_spec()
light-client/src/fork_spec.rs Added k_ancestor_generation_depth to ForkSpec struct with comment typo fix
light-client/src/fixture/mod.rs Renamed method calls and added Fermi fork spec fixtures
light-client/src/misc.rs Applied clippy suggestions (ok_or, div_ceil)
light-client/src/errors.rs Updated Display implementations to use modern string interpolation
light-client/Cargo.toml Updated LCP dependency to v0.2.17 and bumped version to 0.4.0
.github/workflows/ci.yaml Modernized CI workflow with updated actions and added cargo-machete
rust-toolchain Updated toolchain from nightly-2024-09-05 to nightly-2025-05-01

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

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Comment thread light-client/src/header/eth_headers.rs Outdated
for j in (i + 1)..self.all.len() - 1 {
let child = &self.all[j];

// Ensure the relation between child and finalized is collect

Copilot AI Nov 25, 2025

Copy link

Choose a reason for hiding this comment

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

Typo in comment: "collect" should be "correct"

Suggested change
// Ensure the relation between child and finalized is collect
// Ensure the relation between child and finalized is correct

Copilot uses AI. Check for mistakes.
Comment thread light-client/src/header/eth_headers.rs Outdated
break;
}

// Ensure the relation between grand child and child is collect

Copilot AI Nov 25, 2025

Copy link

Choose a reason for hiding this comment

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

Typo in comment: "collect" should be "correct"

Suggested change
// Ensure the relation between grand child and child is collect
// Ensure the relation between grand child and child is correct

Copilot uses AI. Check for mistakes.
Comment thread light-client/src/header/eth_headers.rs Outdated
for j in (i + 1)..self.all.len() - 1 {
let child = &self.all[j];

// Ensure the relation between child and finalized is collect

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// Ensure the relation between child and finalized is collect
// Ensure the relation between child and finalized is correct

There are several other similar typos.

@3100 3100 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Accurately follows BEP-590 and looks functionally good.

Signed-off-by: yoshidan <naohiro.y@gmail.com>
@yoshidan
yoshidan merged commit 610ab92 into main Nov 27, 2025
1 check passed
@yoshidan
yoshidan deleted the bep590 branch November 27, 2025 00:43
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