Skip to content

feat: 450ms hard fork#96

Merged
constwz merged 6 commits intodevelopfrom
feat-450ms-hf
Oct 23, 2025
Merged

feat: 450ms hard fork#96
constwz merged 6 commits intodevelopfrom
feat-450ms-hf

Conversation

@constwz
Copy link
Contributor

@constwz constwz commented Oct 15, 2025

@will-2012
Copy link
Contributor

Pls link the related geth-bsc PRs and BEPs.

@will-2012 will-2012 added the R4R label Oct 15, 2025
@MatusKysel MatusKysel requested a review from Copilot October 15, 2025 11:11
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 the Fermi hard fork for the BSC (Binance Smart Chain), scheduled for October 30, 2025. The hard fork includes updates to system contracts, adjustments to attestation validation logic to allow target blocks within 3 ancestor generations, and corresponding configuration changes.

Key changes:

  • Addition of Fermi hard fork definition and activation timestamps across mainnet, testnet, and Rialto networks
  • Implementation of 3-generation ancestor depth for attestation target block validation
  • Updates to system contracts for Fermi hard fork (StakeHub contracts for both mainnet and Rialto)

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/hardforks/bsc.rs Adds Fermi hardfork enum variant, activation timestamps, and SpecId mapping
src/hardforks/mod.rs Adds convenience method to check Fermi activation
src/node/evm/config.rs Updates REVM spec selection to include Fermi check
src/node/evm/pre_execution.rs Implements K_ANCESTOR_GENERATION_DEPTH constant and 3-generation ancestor validation logic
src/consensus/parlia/snapshot.rs Modifies attestation update logic to conditionally apply validation based on Fermi activation
src/chainspec/bsc.rs Updates fork ID test expectation for next fork timestamp
src/system_contracts/mod.rs Adds Fermi to system contract hardfork list and directory mapping
src/system_contracts/fermi/rialto/StakeHubContract Adds compiled StakeHub contract bytecode for Rialto
src/system_contracts/fermi/mainnet/StakeHubContract Adds compiled StakeHub contract bytecode for mainnet

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

self.bsc_fork_activation(BscHardfork::Maxwell).active_at_timestamp(timestamp)
}

/// Convenience method to check if [`BscHardfork::Maxwell`] is active at a given timestamp.
Copy link

Copilot AI Oct 15, 2025

Choose a reason for hiding this comment

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

The documentation comment incorrectly references Maxwell instead of Fermi. Update the comment to: /// Convenience method to check if [BscHardfork::Fermi] is active at a given timestamp.

Suggested change
/// Convenience method to check if [`BscHardfork::Maxwell`] is active at a given timestamp.
/// Convenience method to check if [`BscHardfork::Fermi`] is active at a given timestamp.

Copilot uses AI. Check for mistakes.
}

fn get_ancestor_generation_depth(&self, header: &Header) -> u64 {
if self.spec.is_fermi_active_at_timestamp(header.number(),header.timestamp) {
Copy link

Copilot AI Oct 15, 2025

Choose a reason for hiding this comment

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

Missing space after comma in function call. Add a space after the comma for consistency: is_fermi_active_at_timestamp(header.number(), header.timestamp)

Suggested change
if self.spec.is_fermi_active_at_timestamp(header.number(),header.timestamp) {
if self.spec.is_fermi_active_at_timestamp(header.number(), header.timestamp) {

Copilot uses AI. Check for mistakes.
}
}
snap.update_attestation(next_header, attestation);
snap.update_attestation(chain_spec,next_header, attestation);
Copy link

Copilot AI Oct 15, 2025

Choose a reason for hiding this comment

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

Missing space after comma in function call. Add a space after the comma for consistency: update_attestation(chain_spec, next_header, attestation)

Suggested change
snap.update_attestation(chain_spec,next_header, attestation);
snap.update_attestation(chain_spec, next_header, attestation);

Copilot uses AI. Check for mistakes.
}
.into());
}

Copy link

Copilot AI Oct 15, 2025

Choose a reason for hiding this comment

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

Trailing whitespace should be removed from this line.

Suggested change

Copilot uses AI. Check for mistakes.
(Self::Pascal.boxed(), ForkCondition::Timestamp(1754967081)),
(Self::Lorentz.boxed(), ForkCondition::Timestamp(1754967081)),
(Self::Maxwell.boxed(), ForkCondition::Timestamp(1754967101)),
(Self::Fermi.boxed(), ForkCondition::Timestamp(1761753600)),
Copy link

Copilot AI Oct 15, 2025

Choose a reason for hiding this comment

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

Trailing whitespace after the comma should be removed.

Suggested change
(Self::Fermi.boxed(), ForkCondition::Timestamp(1761753600)),
(Self::Fermi.boxed(), ForkCondition::Timestamp(1761753600)),

Copilot uses AI. Check for mistakes.
@galaio
Copy link
Contributor

galaio commented Oct 15, 2025

Does there miss FERMI_BLOCK_INTERVAL change?

@will-2012
Copy link
Contributor

will-2012 commented Oct 15, 2025

Does there miss FERMI_BLOCK_INTERVAL change?

+1

Pls pay more attention to the following related adaptation:

pub const DEFAULT_BLOCK_INTERVAL: u64 = 3000; // 3000 ms
pub const LORENTZ_BLOCK_INTERVAL: u64 = 1500; // 1500 ms
pub const MAXWELL_BLOCK_INTERVAL: u64 = 750; // 750 ms

@constwz
Copy link
Contributor Author

constwz commented Oct 16, 2025

Pls link the related geth-bsc PRs and BEPs.

done

@constwz
Copy link
Contributor Author

constwz commented Oct 16, 2025

Does there miss FERMI_BLOCK_INTERVAL change?

+1

Pls pay more attention to the following related adaptation:

pub const DEFAULT_BLOCK_INTERVAL: u64 = 3000; // 3000 ms
pub const LORENTZ_BLOCK_INTERVAL: u64 = 1500; // 1500 ms
pub const MAXWELL_BLOCK_INTERVAL: u64 = 750; // 750 ms

fixed

@will-2012
Copy link
Contributor

LGTM, I think once it is confirmed to pass the FERMI QA test, it can be merged. c.c. @graceharuki

@constwz constwz merged commit 7d29150 into develop Oct 23, 2025
8 checks passed
zlacfzy pushed a commit that referenced this pull request Nov 5, 2025
@sysvm sysvm deleted the feat-450ms-hf branch November 6, 2025 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants