Skip to content

Conversation

@lucca30
Copy link
Contributor

@lucca30 lucca30 commented Feb 3, 2026

Description

Isolating the feature from original PR: #2031

Changes

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • Changes only for a subset of nodes

Breaking changes

Please complete this section if any breaking changes have been made, otherwise delete it

Nodes audience

In case this PR includes changes that must be applied only to a subset of nodes, please specify how you handled it (e.g. by adding a flag with a default value...)

Checklist

  • I have added at least 2 reviewer or the whole pos-v1 team
  • I have added sufficient documentation in code
  • I will be resolving comments - if any - by pushing each fix in a separate commit and linking the commit hash in the comment reply
  • Created a task in Jira and informed the team for implementation in Erigon client (if applicable)
  • Includes RPC methods changes, and the Notion documentation has been updated

Cross repository changes

  • This PR requires changes to heimdall
    • In case link the PR here:
  • This PR requires changes to matic-cli
    • In case link the PR here:

Testing

  • I have added unit tests
  • I have added tests to CI
  • I have tested this code manually on local environment
  • I have tested this code manually on remote devnet using express-cli
  • I have tested this code manually on amoy
  • I have created new e2e tests into express-cli

Manual tests

Please complete this section with the steps you performed if you ran manual tests for this functionality, otherwise delete it

Additional comments

Please post additional comments in this section if you have them, otherwise delete it

@claude
Copy link

claude bot commented Feb 3, 2026

Code Review

Bug: Missing empty signer guard at consensus/bor/bor.go:1094

The call to GetSignerSuccessionNumber at line 1094 is not guarded for empty signer, unlike the earlier call at lines 1044-1051 which checks if currentSigner.signer != (common.Address{}).

When currentSigner.signer is an empty address (e.g., on a non-mining node or misconfigured node), GetSignerSuccessionNumber will return UnauthorizedSignerError, causing Prepare() to fail.

Suggested fix: Wrap lines 1094-1101 with the same guard pattern used earlier:

if currentSigner.signer != (common.Address{}) {
    successionNumber, err := snap.GetSignerSuccessionNumber(currentSigner.signer)
    if err != nil {
        return err
    }

    // Wait before start the block production if needed (previously this wait was on Seal)
    if c.config.IsBhilai(header.Number) && successionNumber == 0 && waitOnPrepare {
        <-time.After(delay)
    }
}

Checked for bugs and CLAUDE.md compliance.

@lucca30 lucca30 requested a review from a team February 3, 2026 19:07
Copy link
Contributor

@cffls cffls left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks! Could you pull in the latest CI fix from develop?

@cffls
Copy link
Contributor

cffls commented Feb 3, 2026

Also, looks like this integration test failed: https://github.com/0xPolygon/bor/actions/runs/21642843860/job/62387000004?pr=2034#step:7:4364

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 3, 2026

@claude
Copy link

claude bot commented Feb 3, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

❌ Patch coverage is 65.30612% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.65%. Comparing base (9f770c2) to head (dc53c3d).

Files with missing lines Patch % Lines
consensus/bor/bor.go 70.45% 9 Missing and 4 partials ⚠️
consensus/beacon/consensus.go 0.00% 2 Missing ⚠️
consensus/clique/clique.go 0.00% 1 Missing ⚠️
consensus/ethash/consensus.go 0.00% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (65.30%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2034      +/-   ##
===========================================
+ Coverage    49.59%   49.65%   +0.06%     
===========================================
  Files          873      873              
  Lines       150507   150537      +30     
===========================================
+ Hits         74639    74755     +116     
+ Misses       70831    70721     -110     
- Partials      5037     5061      +24     
Files with missing lines Coverage Δ
miner/worker.go 66.56% <100.00%> (-0.96%) ⬇️
consensus/clique/clique.go 41.11% <0.00%> (ø)
consensus/ethash/consensus.go 38.12% <0.00%> (ø)
consensus/beacon/consensus.go 11.35% <0.00%> (ø)
consensus/bor/bor.go 48.09% <70.45%> (+13.72%) ⬆️

... and 18 files with indirect coverage changes

Files with missing lines Coverage Δ
miner/worker.go 66.56% <100.00%> (-0.96%) ⬇️
consensus/clique/clique.go 41.11% <0.00%> (ø)
consensus/ethash/consensus.go 38.12% <0.00%> (ø)
consensus/beacon/consensus.go 11.35% <0.00%> (ø)
consensus/bor/bor.go 48.09% <70.45%> (+13.72%) ⬆️

... and 18 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

for {
block := nodes[0].BlockChain().CurrentBlock()
if block.Number.Uint64() >= 14 {
if block.Number.Uint64() >= 15 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for fixing the test! However, I failed to understand why it is required to make this change. We haven't changed anything regarding the Rio HF number in the test, right?

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