implemented direct sent transactions cache#7527
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## feat/supernova-async-exec #7527 +/- ##
=============================================================
+ Coverage 77.51% 77.52% +0.01%
=============================================================
Files 878 878
Lines 122096 122173 +77
=============================================================
+ Hits 94639 94718 +79
+ Misses 21152 21142 -10
- Partials 6305 6313 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…hain-go into direct-sent-transactions-cache
…-chain-go into direct-sent-transactions-cache
…hain-go into direct-sent-transactions-cache
| return true | ||
| } | ||
|
|
||
| func (sr *subroundBlock) sendDirectSentTransactions( |
There was a problem hiding this comment.
do we need this kind of feature ? The answer is probably yes, as this open up possibilities of private pools, and different mechanics for that.
I wonder whether there is a moment, earlier than this, in which the broadcasting can happen.
There was a problem hiding this comment.
yes, this should cover the private pools scenario
we decided to broadcast these transactions on the leader, with the proposed header.. not sure when can be done earlier
|
|
||
| // Save will save the received data into the cacher | ||
| func (txip *TxInterceptorProcessor) Save(data process.InterceptedData, peerOriginator core.PeerID, _ string) (bool, error) { | ||
| func (txip *TxInterceptorProcessor) Save(data process.InterceptedData, peerOriginator core.PeerID, _ string, broadcastMethod p2p.BroadcastMethod) (bool, error) { |
There was a problem hiding this comment.
can't you find some better method on doing this. Like having broadcast method pushed on interceptor.save does not look good.
Also, we have peerOriginator which is used only for printing out the trace.
There was a problem hiding this comment.
on this interceptor, yes, peerOriginator is only for print.. but it is useful for heartbeat related messages
indeed, having the broadcast method on Save seems odd, but only on Save we know that the intercepted data is valid
…ersx/mx-chain-go into direct-sent-transactions-cache # Conflicts: # process/block/shardblockProposal_test.go
…ersx/mx-chain-go into direct-sent-transactions-cache # Conflicts: # integrationTests/mock/transactionCoordinatorMock.go # process/block/shardblockProposal_test.go # process/block/shardblock_test.go # testscommon/transactionCoordinatorMock.go # update/mock/transactionCoordinatorMock.go
There was a problem hiding this comment.
Pull request overview
This pull request implements a caching mechanism for transactions received via direct send. The feature addresses the issue where direct-sent transactions might not be available on all nodes, by storing them in a dedicated cache and broadcasting them when proposing a block header.
Changes:
- Adds a new
DirectSentTransactionscache to the data pool infrastructure - Implements logic to identify and cache direct-sent intra-shard transactions in
TxInterceptorProcessor - Adds functionality to broadcast cached direct-sent transactions during block proposal (v3 headers only)
- Updates all relevant interfaces, mocks, stubs, and tests
Reviewed changes
Copilot reviewed 60 out of 60 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
process/interceptors/processor/txInterceptorProcessor.go |
Core logic to cache direct-sent transactions and remove them when received via broadcast |
process/coordinator/process.go |
Implements ProposedDirectSentTransactionsToBroadcast to gather and marshal direct-sent transactions for broadcasting |
consensus/spos/bls/v2/subroundBlock.go |
Integrates direct-sent transaction broadcasting into the consensus block proposal flow |
dataRetriever/dataPool/dataPool.go |
Adds DirectSentTransactions cache to the data pool |
process/block/baseProcess.go |
Adds validation for direct-sent cache and proxies coordinator method |
config/config.go |
Adds configuration structure for direct-sent transactions cache |
cmd/node/config/config.toml |
Adds default configuration values (30s span and expiry) |
| Various mock/stub files | Updates to implement new interface methods across test infrastructure |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ersx/mx-chain-go into direct-sent-transactions-cache # Conflicts: # epochStart/bootstrap/process_test.go
bcb671a
3ce7096
into
feat/supernova-async-exec
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:
featbranch created?featbranch merging, do all satellite projects have a proper tag insidego.mod?