Skip to content

Conversation

@ssd04
Copy link
Contributor

@ssd04 ssd04 commented Dec 24, 2025

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?

@ssd04 ssd04 self-assigned this Dec 24, 2025
// sleepTime defines the time in milliseconds between each iteration made in syncBlocks method
const sleepTime = 50 * time.Millisecond
const minimumProcessWaitTime = time.Millisecond * 100
const DefaultTimeToWaitForRequestedData = 5 * time.Minute
Copy link
Collaborator

Choose a reason for hiding this comment

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

not needed as exported

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


// sync all txs into pools

err = boot.txSyncer.SyncTransactionsFor(miniBlocks, header.GetEpoch(), ctx)
Copy link
Collaborator

Choose a reason for hiding this comment

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

here ctx is reused but already canceled on L1062

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right, updated

return err
}

_, err = boot.txSyncer.GetTransactions()
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this call needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

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 adds synchronization of transactions and miniblocks during the bootstrap process to ensure all necessary data is available before block processing begins.

  • Creates transaction and miniblock syncers during bootstrap initialization
  • Adds synchronization logic to fetch miniblocks and transactions for headers during the bootstrap preparation phase
  • Updates test expectations to account for additional RegisterHandler calls from the new miniblock syncer

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
process/sync/baseSync.go Adds new syncers (miniBlocksSyncer and txSyncer), implements syncMiniBlocksAndTxsForHeader method to sync miniblocks and transactions, modifies prepareForSyncIfNeeded to optionally sync transactions
process/sync/shardblock.go Calls createTxSyncer during ShardBootstrap initialization
process/sync/metablock.go Calls createTxSyncer during MetaBootstrap initialization
process/sync/shardblock_test.go Adds UnsignedTransactionUnit storer to test setup, updates expected RegisterHandler call count from 2 to 3, improves error checking

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


// sync all txs into pools

err = boot.txSyncer.SyncTransactionsFor(miniBlocks, header.GetEpoch(), ctx)
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

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

The context is being used after it has been cancelled. The context is created and cancelled before calling SyncTransactionsFor on line 1074. This will cause the transaction sync operation to fail immediately since it receives an already-cancelled context. A new context should be created for the SyncTransactionsFor call, or the cancel should be deferred until after both sync operations complete.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

}

if withTxs {
err = boot.syncMiniBlocksAndTxsForHeader(currentHeader)
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

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

Incorrect header passed to syncMiniBlocksAndTxsForHeader. The function is being called with currentHeader instead of hdr, which is the header being processed in the loop. This will cause the wrong header's miniblocks and transactions to be synced.

Suggested change
err = boot.syncMiniBlocksAndTxsForHeader(currentHeader)
err = boot.syncMiniBlocksAndTxsForHeader(hdr)

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

@AdoAdoAdo AdoAdoAdo left a comment

Choose a reason for hiding this comment

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

no other comments besides the existing ones.

sstanculeanu
sstanculeanu previously approved these changes Dec 29, 2025
AdoAdoAdo
AdoAdoAdo previously approved these changes Dec 29, 2025
Base automatically changed from fix-meta-bootstrap-sync to feat/supernova-async-exec December 29, 2025 16:14
@sstanculeanu sstanculeanu dismissed stale reviews from AdoAdoAdo and themself December 29, 2025 16:14

The base branch was changed.

@codecov
Copy link

codecov bot commented Dec 29, 2025

Codecov Report

❌ Patch coverage is 61.53846% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.66%. Comparing base (410de51) to head (49af3c3).
⚠️ Report is 59 commits behind head on feat/supernova-async-exec.

Files with missing lines Patch % Lines
process/sync/baseSync.go 65.21% 9 Missing and 7 partials ⚠️
process/sync/metablock.go 33.33% 1 Missing and 1 partial ⚠️
process/sync/shardblock.go 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@                      Coverage Diff                      @@
##           feat/supernova-async-exec    #7582      +/-   ##
=============================================================
- Coverage                      77.73%   77.66%   -0.07%     
=============================================================
  Files                            875      874       -1     
  Lines                         120400   120635     +235     
=============================================================
+ Hits                           93591    93694     +103     
- Misses                         20662    20768     +106     
- Partials                        6147     6173      +26     

☔ View full report in Codecov by Sentry.
📢 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.

@sstanculeanu sstanculeanu marked this pull request as ready for review December 29, 2025 16:33
@sstanculeanu sstanculeanu merged commit 3652641 into feat/supernova-async-exec Dec 29, 2025
10 of 12 checks passed
@sstanculeanu sstanculeanu deleted the fix-missing-txs-at-bootstrap branch December 29, 2025 16:33
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