Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve requesting of missing mini blocks dest me #5176

Merged

Conversation

SebastianMarian
Copy link
Contributor

@SebastianMarian SebastianMarian commented Apr 19, 2023

Reasoning behind the pull request

  • Improved requesting for missing mini blocks with destination in self shard

Proposed changes

Testing procedure

  • All In and after several epochs we should check if we will find these messages multiple times, having printed different hashes which have been requested, all done in the same millisecond(s): transactionCoordinator.requestMissingMiniBlocks: mini block not found and was requested or transactionCoordinator.RequestMiniBlocks: mini block not found and was requested

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?

@codecov
Copy link

codecov bot commented Apr 19, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (8f1aa2d) 80.12% compared to head (01f1386) 80.13%.
Report is 1 commits behind head on rc/v1.6.0.

❗ Current head 01f1386 differs from pull request most recent head fcb9359. Consider uploading reports for the commit fcb9359 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           rc/v1.6.0    #5176   +/-   ##
==========================================
  Coverage      80.12%   80.13%           
==========================================
  Files            708      708           
  Lines          93880    93910   +30     
==========================================
+ Hits           75223    75251   +28     
- Misses         13318    13320    +2     
  Partials        5339     5339           
Files Coverage Δ
process/block/baseProcess.go 73.50% <100.00%> (ø)
process/coordinator/process.go 76.49% <100.00%> (+0.66%) ⬆️

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SebastianMarian SebastianMarian marked this pull request as ready for review April 21, 2023 07:24
@raduchis raduchis self-requested a review April 21, 2023 08:05
@@ -748,6 +749,29 @@ func (tc *transactionCoordinator) CreateMbsAndProcessCrossShardTransactionsDstMe
return createMBDestMeExecutionInfo.miniBlocks, createMBDestMeExecutionInfo.numTxAdded, allMBsProcessed, nil
}

func (tc *transactionCoordinator) requestMissingMiniBlocks(mbsInfo []*data.MiniBlockInfo) {
Copy link
Contributor

Choose a reason for hiding this comment

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

one other problem is to stop requesting transactions after the first miniblock where there are requestedTxs (line 689):
if requestedTxs > 0 { shouldSkipShard[miniBlockInfo.SenderShardID] = true

The requests could be done for all the miniblocks that could be processed in a round.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but this is solved with this new approach by calling requestMissingMiniBlocks above. For all these mbs requested in this method, once they will be received in L1138 -> method func (tc *transactionCoordinator) receivedMiniBlock(key []byte, value interface{}) we will finally know all the tx hashes and request them if missing in L1162 -> numTxsRequested := preproc.RequestTransactionsForMiniBlock(miniBlock). Actually you cannot request txs for the missing mbs as you don't know their hashes. But I can add the txs request for all the miniblocks which are not missing in the same method -> requestMissingMiniBlocks.

@@ -748,6 +749,29 @@ func (tc *transactionCoordinator) CreateMbsAndProcessCrossShardTransactionsDstMe
return createMBDestMeExecutionInfo.miniBlocks, createMBDestMeExecutionInfo.numTxAdded, allMBsProcessed, nil
}

func (tc *transactionCoordinator) requestMissingMiniBlocks(mbsInfo []*data.MiniBlockInfo) {
Copy link
Contributor

Choose a reason for hiding this comment

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

functionality of requestMissingMiniBlocks and RequestMiniBlocks is very similar, could the refactored with a method that gets a list of miniblockHashes and does the request for those and be called from both other methods.

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, will do this refactor

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@iulianpascalau iulianpascalau self-requested a review April 25, 2023 16:15
continue
}

numTxsRequested := preproc.RequestTransactionsForMiniBlock(miniBlock)
Copy link
Contributor

Choose a reason for hiding this comment

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

this will cause the requesting of the missing transactions to be done before the miniblocks are actually requested. This will work as the request handler will whitelist the required data and the interceptors will then accept the missing txs. We should prevent the future disruption of the whitelist mechanisms between the request handler and the interceptors.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually this is the case when some of the mini blocks, from the same header, are already in pool and it requests txs from them, if they are missing.

Copy link
Contributor

Choose a reason for hiding this comment

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

right

@iulianpascalau iulianpascalau merged commit 692ed00 into rc/v1.6.0 Oct 11, 2023
6 checks passed
@iulianpascalau iulianpascalau deleted the improve-requesting-of-missing-miniblocks-dest-me branch October 11, 2023 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants