Update history repository#7365
Conversation
|
|
||
| cachedIntermediateTxsMap, ok := cachedIntermediateTxs.(map[block.Type]map[string]data.TransactionHandler) | ||
| if !ok { | ||
| return make(map[string]data.TransactionHandler), make(map[string]data.TransactionHandler), nil |
There was a problem hiding this comment.
why not some type assertion error?
| } | ||
| cachedLogsSlice, ok := cachedLogs.([]*data.LogData) | ||
| if !ok { | ||
| return []*data.LogData{}, nil |
| return &block.Body{MiniBlocks: miniBlocks}, nil | ||
| } | ||
|
|
||
| func extractMiniBlocksHeaderHandlersFromExecResult( |
There was a problem hiding this comment.
perhaps add a todo to reuse the method that was moved into common here: #7337
| func TestGetIntermediateTxs(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| t.Run("getIntermediateTxs cannot find in cache", func(t *testing.T) { |
There was a problem hiding this comment.
these inner tests can have t.Parallel()
There was a problem hiding this comment.
added for all testcases
| } | ||
|
|
||
| // cleanup intra shard mini-blocks | ||
| bp.dataPool.MiniBlocks().Remove(headerHash) |
There was a problem hiding this comment.
it this correct? calling it with the header hash for the miniblocks cache?
There was a problem hiding this comment.
Yes, because on line 841 in file shardBlockProposal.go I save a slice on intra shard miniblocks with key header hash. Also refactored the part with cleanup, moved in another place.
| func TestRecordHeaderV3(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| t.Run("record block v3 should work no execution results", func(t *testing.T) { |
There was a problem hiding this comment.
parallel run for inner tests?
| executionResultHeaderHash := baseExecutionResult.GetHeaderHash() | ||
| // cleanup all intra shard miniblocks | ||
| bp.dataPool.MiniBlocks().Remove(executionResultHeaderHash) | ||
| // cleanup all log events | ||
| bp.dataPool.PostProcessTransactions().Remove(common.PrepareLogEventsKey(executionResultHeaderHash)) |
There was a problem hiding this comment.
maybe we can extract this into a separate function, and call it from CommitBlock, to have it called explicitly
- there is already
cleanupPoolsfunction that might be correlated with this
| intraMiniBlocks := sp.txCoordinator.GetCreatedInShardMiniBlocks() | ||
| err = sp.cacheIntraShardMiniBlocks(headerHash, intraMiniBlocks) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
|
|
||
| err = sp.cacheExecutedMiniBlocks(sanitizedBodyAfterExecution, miniBlockHeaderHandlers) |
There was a problem hiding this comment.
so intra shard miniblocks are not included in the call from L846?
There was a problem hiding this comment.
no because, there are cached miniblocks from sanitezedBody
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?