Skip to content

Conversation

@ssd04
Copy link
Contributor

@ssd04 ssd04 commented Dec 30, 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 30, 2025
sstanculeanu
sstanculeanu previously approved these changes Dec 30, 2025
AdoAdoAdo
AdoAdoAdo previously approved these changes Dec 30, 2025
Base automatically changed from fix-restore-after-process-fail to feat/supernova-async-exec December 30, 2025 15:04
@AdoAdoAdo AdoAdoAdo dismissed stale reviews from sstanculeanu and themself December 30, 2025 15:04

The base branch was changed.

sstanculeanu
sstanculeanu previously approved these changes Dec 30, 2025
AdoAdoAdo
AdoAdoAdo previously approved these changes Dec 30, 2025
@ssd04 ssd04 dismissed stale reviews from AdoAdoAdo and sstanculeanu via 7531362 December 31, 2025 08:22
@codecov
Copy link

codecov bot commented Dec 31, 2025

Codecov Report

❌ Patch coverage is 55.17241% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.69%. Comparing base (592af51) to head (5175705).
⚠️ Report is 1 commits behind head on feat/supernova-async-exec.

Files with missing lines Patch % Lines
process/sync/baseSync.go 54.38% 13 Missing and 13 partials ⚠️
Additional details and impacted files
@@                      Coverage Diff                      @@
##           feat/supernova-async-exec    #7588      +/-   ##
=============================================================
- Coverage                      77.69%   77.69%   -0.01%     
=============================================================
  Files                            875      875              
  Lines                         120898   120945      +47     
=============================================================
+ Hits                           93931    93967      +36     
+ Misses                         20774    20772       -2     
- Partials                        6193     6206      +13     

☔ 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.

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 fixes the transaction pool restoration during bootstrap by ensuring transactions from historical blocks are properly restored to the pool. The key changes simplify the sync preparation logic and add functionality to explicitly save transactions to the pool during bootstrap.

  • Removed the withTxs parameter from prepareForSyncIfNeeded, making transaction syncing unconditional
  • Added new saveProposedTxsToPool and saveTxsToPool methods to restore transactions from storage to the pool for HeaderV3 blocks
  • Improved error message in txcache to include the transaction hash when a transaction is not found

Reviewed changes

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

Show a summary per file
File Description
process/sync/baseSync.go Simplified prepareForSyncIfNeeded by removing withTxs parameter and added new methods to restore transactions to pool from storage during bootstrap
process/sync/baseSync_test.go Added comprehensive test TestBaseBootstrap_SaveProposedTxsToPool covering all transaction types (normal, invalid, smart contract results, rewards, peer)
process/sync/export_test.go Exported SaveProposedTxsToPool method for testing purposes
txcache/blocks.go Enhanced error message to include transaction hash when a transaction is not found in cache
txcache/blocks_test.go Updated test assertion to use require.ErrorIs for proper error wrapping validation

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

TxHashes: [][]byte{[]byte("txHash1")},
Type: block.TxBlock,
},
&block.MiniBlock{
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

Composite literal uses unkeyed fields. This is not idiomatic Go and can break if the struct definition changes. Consider using keyed fields instead.

Copilot uses AI. Check for mistakes.
TxHashes: [][]byte{[]byte("txHash2")},
Type: block.InvalidBlock,
},
&block.MiniBlock{
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

Composite literal uses unkeyed fields. This is not idiomatic Go and can break if the struct definition changes. Consider using keyed fields instead.

Copilot uses AI. Check for mistakes.
TxHashes: [][]byte{[]byte("txHash3")},
Type: block.SmartContractResultBlock,
},
&block.MiniBlock{
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

Composite literal uses unkeyed fields. This is not idiomatic Go and can break if the struct definition changes. Consider using keyed fields instead.

Copilot uses AI. Check for mistakes.
TxHashes: [][]byte{[]byte("txHash4")},
Type: block.RewardsBlock,
},
&block.MiniBlock{
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

Composite literal uses unkeyed fields. This is not idiomatic Go and can break if the struct definition changes. Consider using keyed fields instead.

Copilot uses AI. Check for mistakes.
Comment on lines +545 to +561
TxHashes: [][]byte{[]byte("txHash1")},
Type: block.TxBlock,
},
&block.MiniBlock{
TxHashes: [][]byte{[]byte("txHash2")},
Type: block.InvalidBlock,
},
&block.MiniBlock{
TxHashes: [][]byte{[]byte("txHash3")},
Type: block.SmartContractResultBlock,
},
&block.MiniBlock{
TxHashes: [][]byte{[]byte("txHash4")},
Type: block.RewardsBlock,
},
&block.MiniBlock{
TxHashes: [][]byte{[]byte("txHash5")},
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

Composite literal uses unkeyed fields. This is not idiomatic Go and can break if the struct definition changes. Consider using keyed fields instead.

Suggested change
TxHashes: [][]byte{[]byte("txHash1")},
Type: block.TxBlock,
},
&block.MiniBlock{
TxHashes: [][]byte{[]byte("txHash2")},
Type: block.InvalidBlock,
},
&block.MiniBlock{
TxHashes: [][]byte{[]byte("txHash3")},
Type: block.SmartContractResultBlock,
},
&block.MiniBlock{
TxHashes: [][]byte{[]byte("txHash4")},
Type: block.RewardsBlock,
},
&block.MiniBlock{
TxHashes: [][]byte{[]byte("txHash5")},
TxHashes: [][]byte{0: []byte("txHash1")},
Type: block.TxBlock,
},
&block.MiniBlock{
TxHashes: [][]byte{0: []byte("txHash2")},
Type: block.InvalidBlock,
},
&block.MiniBlock{
TxHashes: [][]byte{0: []byte("txHash3")},
Type: block.SmartContractResultBlock,
},
&block.MiniBlock{
TxHashes: [][]byte{0: []byte("txHash4")},
Type: block.RewardsBlock,
},
&block.MiniBlock{
TxHashes: [][]byte{0: []byte("txHash5")},

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.

4 participants