Skip to content

fix disabled config verification - #7963

Merged
AdoAdoAdo merged 1 commit into
feat/testnet-fixesfrom
fix-config-validation-disabled-activation
Aug 18, 2026
Merged

fix disabled config verification#7963
AdoAdoAdo merged 1 commit into
feat/testnet-fixesfrom
fix-config-validation-disabled-activation

Conversation

@AdoAdoAdo

Copy link
Copy Markdown
Contributor

Reasoning behind the pull request

Proposed changes

Testing procedure

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?

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 tightens configuration validation around chain-parameters-by-epoch, addressing cases where validation could be bypassed or behave incorrectly (notably for disabled Supernova configurations and for in-place slice mutation during sorting).

Changes:

  • Avoid mutating the caller-provided ChainParametersByEpoch slice by sorting a defensive copy inside NewChainParametersHolder.
  • Reject duplicate EnableEpoch entries in chain parameters with a dedicated error (ErrDuplicateChainParametersEpoch) and add coverage for this.
  • Make Supernova round-duration coherence checks order-independent by validating RoundDuration changes relative to epoch 0 prior to activation.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
sharding/errors.go Adds a dedicated error for duplicate chain-parameters epochs.
sharding/chainParametersHolder.go Sorts a copied slice (no caller mutation) and validates unique epochs in chain-parameters config.
sharding/chainParametersHolder_test.go Adds tests for duplicate epochs, non-mutation of input slice, and updates ordering expectations.
factory/core/coreComponents.go Refactors/centralizes round-duration validation to be order-independent and applied consistently.
factory/core/coreComponents_test.go Updates and expands tests to cover disabled-supernova round-duration scenarios irrespective of ordering.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread sharding/errors.go
@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.72%. Comparing base (6b3e91d) to head (101d48c).

Additional details and impacted files
@@                 Coverage Diff                 @@
##           feat/testnet-fixes    #7963   +/-   ##
===================================================
  Coverage               77.71%   77.72%           
===================================================
  Files                     892      892           
  Lines                  129059   129078   +19     
===================================================
+ Hits                   100304   100330   +26     
+ Misses                  22203    22195    -8     
- Partials                 6552     6553    +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AdoAdoAdo
AdoAdoAdo merged commit ef3a866 into feat/testnet-fixes Aug 18, 2026
13 checks passed
@AdoAdoAdo
AdoAdoAdo deleted the fix-config-validation-disabled-activation branch August 18, 2026 08:53
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.

4 participants