Skip to content

Bootstrap block v3#7337

Merged
AdoAdoAdo merged 21 commits into
feat/supernova-async-execfrom
bootstrap-block-v3
Nov 1, 2025
Merged

Bootstrap block v3#7337
AdoAdoAdo merged 21 commits into
feat/supernova-async-execfrom
bootstrap-block-v3

Conversation

@ssd04

@ssd04 ssd04 commented Oct 13, 2025

Copy link
Copy Markdown
Contributor

Reasoning behind the pull request

  • With headerV3 execution results and last execution rootHash will be available LastExecutionResults on the header
  • On bootstrap, rootHash will have to be taken from LastExecutionResults

Proposed changes

  • Adapt bootstrap process to fetch rootHash based on execution results if header v3

Testing procedure

  • With feat branch

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 Oct 13, 2025
Base automatically changed from sync-block-v3 to feat/supernova-async-exec October 15, 2025 12:01
@ssd04 ssd04 marked this pull request as ready for review October 15, 2025 12:01
sstanculeanu
sstanculeanu previously approved these changes Oct 15, 2025
Comment thread epochStart/bootstrap/process.go Outdated
func (e *epochStartBootstrap) getRootHashToSync(
header data.HeaderHandler,
) []byte {
rootHashToSync := header.GetRootHash()

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.

this is not correct if there are scheduled transactions, should call e.dataSyncerWithScheduled.GetRootHashToSync
so maybe this function can include also line 1210, and remove it from there?

Also metachain does not have scheduled roothash

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

right, missed it

hashDst[string(val.Hash)] = val
miniBlockHeader, ok := val.(*block.MiniBlockHeader)
if !ok {
log.Warn("wrong time assertion for mini block header handler", "err", epochStart.ErrWrongTypeAssertion)

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.

wrong time assertion -> wrong type assertion?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done


for _, val := range metaBlock.MiniBlockHeaders {
isCrossShardDestMe := (val.ReceiverShardID == destId || val.ReceiverShardID == core.AllShardId) && val.SenderShardID != destId
for _, val := range metaBlock.GetMiniBlockHeaderHandlers() {

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.

If the metablock is a metablockV3, the metablock mini-block header handlers of use in shard should be taken from the execution results instead of the ones directly on the metablock (that is the metablock internal proposal).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

changed

@codecov

codecov Bot commented Oct 16, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.42857% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.28%. Comparing base (0767af4) to head (129c05f).
⚠️ Report is 23 commits behind head on feat/supernova-async-exec.

Files with missing lines Patch % Lines
epochStart/bootstrap/process.go 86.17% 8 Missing and 5 partials ⚠️
epochStart/bootstrap/shardStorageHandler.go 83.78% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@                      Coverage Diff                      @@
##           feat/supernova-async-exec    #7337      +/-   ##
=============================================================
+ Coverage                      77.27%   77.28%   +0.01%     
=============================================================
  Files                            867      867              
  Lines                         116598   116704     +106     
=============================================================
+ Hits                           90099    90193      +94     
- Misses                         20553    20559       +6     
- Partials                        5946     5952       +6     

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

Comment on lines +813 to +815
if lastExecutedNonce >= baseHeaderNonce {
return nil
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is this possible?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it should'nt happen, but i've added it as an extra check

Comment thread epochStart/bootstrap/process.go Outdated
Comment on lines +715 to +716
hashesToRequest := make([][]byte, 0, len(meta.GetEpochStartHandler().GetLastFinalizedHeaderHandlers())+1)
shardIds := make([]uint32, 0, len(meta.GetEpochStartHandler().GetLastFinalizedHeaderHandlers())+1)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
hashesToRequest := make([][]byte, 0, len(meta.GetEpochStartHandler().GetLastFinalizedHeaderHandlers())+1)
shardIds := make([]uint32, 0, len(meta.GetEpochStartHandler().GetLastFinalizedHeaderHandlers())+1)
hashesToRequest := make([][]byte, 0)
shardIds := make([]uint32, 0)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

changed

Comment on lines +738 to +740
if meta.GetEpoch() == e.startEpoch+1 {
syncedHeaders[string(meta.GetEpochStartHandler().GetEconomicsHandler().GetPrevEpochStartHash())] = &block.MetaBlock{}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can you add a comment here? not clear for me why it is needed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added comment

Comment thread epochStart/bootstrap/process_test.go Outdated

epochStartProvider, _ := NewEpochStartBootstrap(args)

expErr := errors.New("expected error")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

extract a global var and reuse it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

👍

sstanculeanu
sstanculeanu previously approved these changes Oct 17, 2025
Comment thread epochStart/bootstrap/process.go
Comment thread epochStart/bootstrap/process.go Outdated
Comment thread epochStart/bootstrap/process.go Outdated
Comment thread epochStart/bootstrap/shardStorageHandler.go Outdated
Comment thread epochStart/bootstrap/shardStorageHandler.go Outdated
sstanculeanu
sstanculeanu previously approved these changes Oct 30, 2025
Comment thread common/common.go Outdated
}

if headerShard == MetachainShardId {
metaExecResult, ok := baseExecResult.(data.MetaExecutionResultHandler)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this should be fixed here: #7364 (comment)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

AdoAdoAdo
AdoAdoAdo previously approved these changes Oct 31, 2025
AdoAdoAdo
AdoAdoAdo previously approved these changes Oct 31, 2025
sstanculeanu
sstanculeanu previously approved these changes Oct 31, 2025
@ssd04 ssd04 dismissed stale reviews from sstanculeanu and AdoAdoAdo via 129c05f October 31, 2025 16:57
@AdoAdoAdo AdoAdoAdo merged commit e091d18 into feat/supernova-async-exec Nov 1, 2025
11 checks passed
@AdoAdoAdo AdoAdoAdo deleted the bootstrap-block-v3 branch November 1, 2025 11:21
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