Skip to content

Back merge 9.0.4.0 changes into master - #676

Merged
marcos-iov merged 9 commits into
masterfrom
9040-master-merge
Sep 3, 2026
Merged

marcos-iov merged 9 commits into
masterfrom
9040-master-merge

Conversation

@marcos-iov

Copy link
Copy Markdown
Collaborator

Description

Motivation and Context

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • Tests for the changes have been added (for bug fixes / features)
  • Requires Activation Code (Hard Fork)
  • Other information:

Copilot AI balanced review requested due to automatic review settings September 3, 2026 13:06
@marcos-iov
marcos-iov requested a review from a team as a code owner September 3, 2026 13:06
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

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.

🟡 Changes recommended

Bridge-chain traversal is unbounded, and the equal-work boundary lacks regression coverage.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Back-merges 9.0.4 Bitcoin header synchronization changes into master.

Changes:

  • Compares cumulative Bitcoin chain work instead of height.
  • Adds Bridge header retrieval APIs and tests.
  • Updates naming, mocks, logging, and dependency verification.
File summaries
File Description
gradle/verification-metadata.xml Updates RSKj 9.0.4 checksums.
src/main/java/co/rsk/federate/BtcToRskClient.java Implements work-based chain selection.
src/main/java/co/rsk/federate/FederatorSupport.java Adds Bridge header queries.
src/main/java/co/rsk/federate/log/FederateLogger.java Uses renamed height API.
src/test/java/co/rsk/federate/BtcToRskClientTest.java Tests work-based synchronization.
src/test/java/co/rsk/federate/FederatorSupportTest.java Tests header query methods.
src/test/java/co/rsk/federate/log/FederateLoggerTest.java Updates renamed API usage.
src/test/java/co/rsk/federate/mock/SimpleFederatorSupport.java Simplifies the test support implementation.
Review details

Suppressed comments (1)

src/main/java/co/rsk/federate/BtcToRskClient.java:431

  • This branch also runs when cumulative work is equal, so the warning incorrectly reports that the Bridge has more work. Describe it as having “at least as much work” to keep diagnostics accurate for tie cases.
            logger.warn("[updateBridgeBtcBlockchain] Bridge has more work than Federator, so we won't update it.");
  • Files reviewed: 8/8 changed files
  • Comments generated: 2
  • Review effort level: Balanced

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

BigInteger bridgeBitcoinChainWork = calculateBridgeBitcoinChainWork(commonAncestor);
BigInteger bitcoinBestChainWork = bitcoinChainHead.getChainWork();
// Compare total cumulative work
boolean shouldUpdateBridge = bitcoinBestChainWork.compareTo(bridgeBitcoinChainWork) > 0;
Comment on lines +468 to +473
while (!currentHeader.getHash().equals(ancestorHash)) {
BigInteger currentBlockWork = currentHeader.getWork();
cumulativeWorkAboveAncestor = cumulativeWorkAboveAncestor.add(currentBlockWork);

byte[] parentPayloadBytes = federatorSupport.getBridgeBtcBlockchainParentBlockHeaderByHash(currentHeader.getHash());
currentHeader = new Block(params, parentPayloadBytes);
Copilot AI review requested due to automatic review settings September 3, 2026 13:26

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.

🟡 Changes recommended

The unbounded per-block Bridge traversal and equal-work boundary coverage remain unresolved.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@sonarqubecloud

sonarqubecloud Bot commented Sep 3, 2026

Copy link
Copy Markdown

@jeremy-then jeremy-then 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.

LGTM.

@marcos-iov
marcos-iov merged commit 96fcdd9 into master Sep 3, 2026
13 of 14 checks passed
@marcos-iov
marcos-iov deleted the 9040-master-merge branch September 3, 2026 14:18
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