Skip to content

HIGH 019 - Add StartRound check#7698

Merged
sstanculeanu merged 1 commit into
ai-audit-findingsfrom
audit-high-019
Feb 11, 2026
Merged

HIGH 019 - Add StartRound check#7698
sstanculeanu merged 1 commit into
ai-audit-findingsfrom
audit-high-019

Conversation

@ssd04

@ssd04 ssd04 commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

Reasoning behind the pull request

  • When node starts, start round and genesis time have to be aligned, for both initial genesis time and for supernova start time
  • Supernova start round and start time have to be set at initial genesis of after, not before

Proposed changes

  • Add additional check for start round for supernova

Testing procedure

  • Standard system test

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@ssd04 ssd04 self-assigned this Feb 11, 2026
@sstanculeanu sstanculeanu merged commit 6374847 into ai-audit-findings Feb 11, 2026
7 checks passed
@sstanculeanu sstanculeanu deleted the audit-high-019 branch February 11, 2026 14:55
@AdoAdoAdo AdoAdoAdo requested a review from Copilot February 12, 2026 08:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds a validation check to ensure that the supernova start round is not lower than the regular start round during node initialization. This prevents configuration mismatches that could occur when a node starts after a hardfork, ensuring proper temporal alignment between genesis time and supernova activation time.

Changes:

  • Added validation in core components factory to check that supernovaStartRound >= startRound
  • Returns descriptive error when validation fails

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

Comment on lines +290 to +295
if supernovaStartRound < startRound {
return nil, fmt.Errorf("supernovaStartRound %d lower then startRound %d",
supernovaStartRound,
startRound,
)
}

Copilot AI Feb 12, 2026

Copy link

Choose a reason for hiding this comment

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

The new validation for supernovaStartRound vs startRound lacks test coverage. Based on the existing test patterns in factory/core/coreComponents_test.go (which includes tests for other validation errors), consider adding a test case that verifies this validation by setting AfterHardFork to true with a StartRound value greater than the SupernovaEnableRound. This would ensure the validation works correctly and prevent regressions.

Copilot uses AI. Check for mistakes.
Comment on lines +291 to 298
return nil, fmt.Errorf("supernovaStartRound %d lower then startRound %d",
supernovaStartRound,
startRound,
)
}

if supernovaGenesisTime.Compare(genesisTime) < 0 {
return nil, fmt.Errorf("supernovaGenesisTime %d lower then genesisTime %d",

Copilot AI Feb 12, 2026

Copy link

Choose a reason for hiding this comment

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

Spelling error: "lower then" should be "lower than". The word "then" refers to time or sequence, while "than" is used for comparisons.

Suggested change
return nil, fmt.Errorf("supernovaStartRound %d lower then startRound %d",
supernovaStartRound,
startRound,
)
}
if supernovaGenesisTime.Compare(genesisTime) < 0 {
return nil, fmt.Errorf("supernovaGenesisTime %d lower then genesisTime %d",
return nil, fmt.Errorf("supernovaStartRound %d lower than startRound %d",
supernovaStartRound,
startRound,
)
}
if supernovaGenesisTime.Compare(genesisTime) < 0 {
return nil, fmt.Errorf("supernovaGenesisTime %d lower than genesisTime %d",

Copilot uses AI. Check for mistakes.
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.

5 participants