Extra fields in outport driver structures#7653
Extra fields in outport driver structures#7653miiu96 merged 8 commits intofeat/supernova-async-execfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends outport handling to support unexecutable transactions in the driver structures for header v3 blocks and aligns dependency versions with corresponding core and indexer changes.
Changes:
- Cache and propagate unexecutable transaction hashes from execution results into the outport transaction pool, and clean them from the tx pool when no longer needed.
- Adjust outport pool creation so that for header v3 blocks regular transactions are not added at header time but are instead associated with per-execution-result pools.
- Bump
mx-chain-core-goandmx-chain-es-indexer-goto versions that support the new outport structures and behavior.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
process/block/baseProcess.go |
Hoists the cacheID computation out of the loop in cleanupUnexecutableTxsFromPool, keeping behavior the same while avoiding repeated ShardCacherIdentifier calls. |
outport/process/outportDataProvider.go |
Adds addInPoolUnexecutableTransactions, wires it into execution-result processing, and updates createPool to return an empty pool for header v3 so unexecuted txs are not pre-added. |
outport/process/outportDataProvider_test.go |
Extends existing tests to seed the new unexecutable-tx cache entries and adds focused tests for addInPoolUnexecutableTransactions behavior and error handling. |
go.mod |
Updates mx-chain-core-go and mx-chain-es-indexer-go requirements to newer pseudo-versions that include unexecutable-transaction support. |
go.sum |
Synchronizes checksums with the updated go.mod dependency versions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| func (odp *outportDataProvider) createPool(rewardsTxs map[string]data.TransactionHandler) (*outportcore.TransactionPool, error) { | ||
| func (odp *outportDataProvider) createPool(rewardsTxs map[string]data.TransactionHandler, header data.HeaderHandler) (*outportcore.TransactionPool, error) { | ||
| if header.IsHeaderV3() { | ||
| // transactions will be indexer after execution |
There was a problem hiding this comment.
Comment text contains a grammatical error: "transactions will be indexer after execution" should be "transactions will be indexed after execution".
| // transactions will be indexer after execution | |
| // transactions will be indexed after execution |
| func (odp *outportDataProvider) createPool(rewardsTxs map[string]data.TransactionHandler, header data.HeaderHandler) (*outportcore.TransactionPool, error) { | ||
| if header.IsHeaderV3() { | ||
| // transactions will be indexer after execution | ||
| return &outportcore.TransactionPool{}, nil | ||
| } | ||
|
|
There was a problem hiding this comment.
The new createPool behavior for header v3 (returning an empty TransactionPool when header.IsHeaderV3() is true) is not covered by tests; adding a test that exercises PrepareOutportSaveBlockData with a v3 header and asserts that the returned TransactionPool does not contain regular transactions would help ensure this path behaves as intended.
| } | ||
| tx, ok := txI.(*transaction.Transaction) | ||
| if !ok { | ||
| log.Warn("addInPoolUnexecutableTransactions - cannot cast object from ache to transaction", "txHash", txHash, "type", fmt.Sprintf("%T", txI)) |
There was a problem hiding this comment.
Typo in log message: "cannot cast object from ache to transaction" should read "cannot cast object from cache to transaction" to clearly indicate the source of the casted value.
| log.Warn("addInPoolUnexecutableTransactions - cannot cast object from ache to transaction", "txHash", txHash, "type", fmt.Sprintf("%T", txI)) | |
| log.Warn("addInPoolUnexecutableTransactions - cannot cast object from cache to transaction", "txHash", txHash, "type", fmt.Sprintf("%T", txI)) |
# Conflicts: # go.mod # go.sum
Reasoning behind the pull request
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?