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

State changes outport #6429

Merged
merged 30 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0310268
added state changes collector to hostDriver.
cristure Sep 2, 2024
682e417
some fixes.
cristure Sep 2, 2024
f6bff48
migrated stateChanges to proto structure in mx-chain-core-go.
cristure Sep 5, 2024
a57053e
moved all the state changes in mx-chain-core-go.
cristure Sep 6, 2024
f8c9ba5
fixed nil pointer reference.
cristure Sep 6, 2024
09802ae
moved collected state changes in outport block.
cristure Sep 6, 2024
28f38a8
update core-go.
cristure Sep 6, 2024
f492061
commit go.sum.
cristure Sep 9, 2024
1623567
Merge remote-tracking branch 'refs/remotes/origin/feat/state-changes'…
cristure Sep 9, 2024
b4b49d6
update dependencies.
cristure Sep 9, 2024
4869c40
Merge remote-tracking branch 'origin/state-changes-read-operations' i…
cristure Sep 9, 2024
291f6c0
fix after merge.
cristure Sep 9, 2024
2250354
fix version and imports.
cristure Sep 9, 2024
62d2326
fix some tests.
cristure Sep 9, 2024
c860684
fix broken import.
cristure Sep 9, 2024
c482523
another round of tests fixed.
cristure Sep 9, 2024
30d5dd9
fix linter.
cristure Sep 9, 2024
9d983f1
fixes after review.
cristure Sep 10, 2024
776d2b1
fix missing argument.
cristure Sep 10, 2024
1f90b5d
fixes after review.
cristure Sep 12, 2024
e774eea
revert due to failing test.
cristure Sep 12, 2024
494a7b3
fix failing test.
cristure Sep 12, 2024
4b971e2
fix more tests.
cristure Sep 12, 2024
676c5a5
cosmetic changes.
cristure Sep 13, 2024
d892b5e
added test for new method and minor fixes.
cristure Sep 13, 2024
8bd428b
update mx-chain-es-indexer
cristure Sep 13, 2024
6a8dc41
revert variables.sh
cristure Sep 13, 2024
0ffca72
improved readability.
cristure Sep 13, 2024
43e7cb8
fixes after review.
cristure Sep 17, 2024
260b7b4
bumped mx-chain-core-go version.
cristure Sep 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions factory/processing/blockProcessorCreator.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import (

"github.com/multiversx/mx-chain-core-go/core"
dataBlock "github.com/multiversx/mx-chain-core-go/data/block"
logger "github.com/multiversx/mx-chain-logger-go"
vmcommon "github.com/multiversx/mx-chain-vm-common-go"
"github.com/multiversx/mx-chain-vm-common-go/parsers"

"github.com/multiversx/mx-chain-go/common"
"github.com/multiversx/mx-chain-go/config"
"github.com/multiversx/mx-chain-go/dataRetriever"
Expand Down Expand Up @@ -43,9 +47,6 @@ import (
"github.com/multiversx/mx-chain-go/state/syncer"
"github.com/multiversx/mx-chain-go/storage/txcache"
"github.com/multiversx/mx-chain-go/vm"
logger "github.com/multiversx/mx-chain-logger-go"
vmcommon "github.com/multiversx/mx-chain-vm-common-go"
"github.com/multiversx/mx-chain-vm-common-go/parsers"
)

type blockProcessorAndVmFactories struct {
Expand Down Expand Up @@ -1059,6 +1060,7 @@ func (pcf *processComponentsFactory) createOutportDataProvider(
MbsStorer: mbsStorer,
EnableEpochsHandler: pcf.coreData.EnableEpochsHandler(),
ExecutionOrderGetter: pcf.txExecutionOrderHandler,
StateChangesCollector: pcf.state.StateChangesCollector(),
})
}

Expand Down
3 changes: 2 additions & 1 deletion factory/status/statusComponents.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
outportCore "github.com/multiversx/mx-chain-core-go/data/outport"
factoryMarshalizer "github.com/multiversx/mx-chain-core-go/marshal/factory"
indexerFactory "github.com/multiversx/mx-chain-es-indexer-go/process/factory"
logger "github.com/multiversx/mx-chain-logger-go"

"github.com/multiversx/mx-chain-go/common"
"github.com/multiversx/mx-chain-go/common/statistics"
swVersionFactory "github.com/multiversx/mx-chain-go/common/statistics/softwareVersion/factory"
Expand All @@ -23,7 +25,6 @@ import (
"github.com/multiversx/mx-chain-go/process"
"github.com/multiversx/mx-chain-go/sharding"
"github.com/multiversx/mx-chain-go/sharding/nodesCoordinator"
logger "github.com/multiversx/mx-chain-logger-go"
)

type statusComponents struct {
Expand Down
5 changes: 3 additions & 2 deletions genesis/mock/userAccountMock.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import (
"math/big"

"github.com/multiversx/mx-chain-core-go/core"
"github.com/multiversx/mx-chain-core-go/data/stateChange"

"github.com/multiversx/mx-chain-go/common"
"github.com/multiversx/mx-chain-go/state/stateChanges"
)

// ErrNegativeValue -
Expand Down Expand Up @@ -148,7 +149,7 @@ func (uam *UserAccountMock) GetUserName() []byte {
}

// SaveDirtyData -
func (uam *UserAccountMock) SaveDirtyData(_ common.Trie) ([]stateChanges.DataTrieChange, []core.TrieData, error) {
func (uam *UserAccountMock) SaveDirtyData(_ common.Trie) ([]*stateChange.DataTrieChange, []core.TrieData, error) {
return nil, nil, nil
}

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ require (
github.com/klauspost/cpuid/v2 v2.2.5
github.com/mitchellh/mapstructure v1.5.0
github.com/multiversx/mx-chain-communication-go v1.1.0
github.com/multiversx/mx-chain-core-go v1.2.21
github.com/multiversx/mx-chain-core-go v1.2.23-0.20240909105439-e1a7a06d4ac4
github.com/multiversx/mx-chain-crypto-go v1.2.12
github.com/multiversx/mx-chain-es-indexer-go v1.7.5-0.20240807095116-4f2f595e52d9
github.com/multiversx/mx-chain-logger-go v1.0.15
github.com/multiversx/mx-chain-scenario-go v1.4.4
github.com/multiversx/mx-chain-storage-go v1.0.16
github.com/multiversx/mx-chain-storage-go v1.0.17-0.20240909105906-39ad1daf2a4c
github.com/multiversx/mx-chain-vm-common-go v1.5.14-0.20240812082318-afa839968da3
github.com/multiversx/mx-chain-vm-go v1.5.32-0.20240812082514-1f3c25b3171e
github.com/multiversx/mx-chain-vm-v1_2-go v1.2.68
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ github.com/multiversx/concurrent-map v0.1.4 h1:hdnbM8VE4b0KYJaGY5yJS2aNIW9TFFsUY
github.com/multiversx/concurrent-map v0.1.4/go.mod h1:8cWFRJDOrWHOTNSqgYCUvwT7c7eFQ4U2vKMOp4A/9+o=
github.com/multiversx/mx-chain-communication-go v1.1.0 h1:J7bX6HoN3HiHY7cUeEjG8AJWgQDDPcY+OPDOsSUOkRE=
github.com/multiversx/mx-chain-communication-go v1.1.0/go.mod h1:WK6bP4pGEHGDDna/AYRIMtl6G9OA0NByI1Lw8PmOnRM=
github.com/multiversx/mx-chain-core-go v1.2.21 h1:+XVKznPTlUU5EFS1A8chtS8fStW60upRIyF4Pgml19I=
github.com/multiversx/mx-chain-core-go v1.2.21/go.mod h1:B5zU4MFyJezmEzCsAHE9YNULmGCm2zbPHvl9hazNxmE=
github.com/multiversx/mx-chain-core-go v1.2.23-0.20240909105439-e1a7a06d4ac4 h1:omuzhvGYFRAE0UA9UMatgSLTBlANKea0hU/jskzj6pM=
github.com/multiversx/mx-chain-core-go v1.2.23-0.20240909105439-e1a7a06d4ac4/go.mod h1:B5zU4MFyJezmEzCsAHE9YNULmGCm2zbPHvl9hazNxmE=
github.com/multiversx/mx-chain-crypto-go v1.2.12 h1:zWip7rpUS4CGthJxfKn5MZfMfYPjVjIiCID6uX5BSOk=
github.com/multiversx/mx-chain-crypto-go v1.2.12/go.mod h1:HzcPpCm1zanNct/6h2rIh+MFrlXbjA5C8+uMyXj3LI4=
github.com/multiversx/mx-chain-es-indexer-go v1.7.5-0.20240807095116-4f2f595e52d9 h1:VJOigTM9JbjFdy9ICVhsDfM9YQkFqMigAaQCHaM0iwY=
Expand All @@ -397,8 +397,8 @@ github.com/multiversx/mx-chain-logger-go v1.0.15 h1:HlNdK8etyJyL9NQ+6mIXyKPEBo+w
github.com/multiversx/mx-chain-logger-go v1.0.15/go.mod h1:t3PRKaWB1M+i6gUfD27KXgzLJJC+mAQiN+FLlL1yoGQ=
github.com/multiversx/mx-chain-scenario-go v1.4.4 h1:DVE2V+FPeyD/yWoC+KEfPK3jsFzHeruelESfpTlf460=
github.com/multiversx/mx-chain-scenario-go v1.4.4/go.mod h1:kI+TWR3oIEgUkbwkHCPo2CQ3VjIge+ezGTibiSGwMxo=
github.com/multiversx/mx-chain-storage-go v1.0.16 h1:l2lJq+EAN3YwLbjJrnoKfFd1/1Xmo9DcAUECND2obLs=
github.com/multiversx/mx-chain-storage-go v1.0.16/go.mod h1:uM/z7YyqTOD3wgyH8TfapyEl5sb+7x/Jaxne4cfG4HI=
github.com/multiversx/mx-chain-storage-go v1.0.17-0.20240909105906-39ad1daf2a4c h1:1Wmh5iblKtE6S5NBdyPcHcKmiR3C1oF+MNRBVOrmAcc=
github.com/multiversx/mx-chain-storage-go v1.0.17-0.20240909105906-39ad1daf2a4c/go.mod h1:2VWMriwcI0s7kTnKHqJxFQnb0aMswc5KTbHp8MKw3Uk=
github.com/multiversx/mx-chain-vm-common-go v1.5.14-0.20240812082318-afa839968da3 h1:RlHKl5enbGrleB0Aea9TinZLLymS4WvG0/xAt/iRb6E=
github.com/multiversx/mx-chain-vm-common-go v1.5.14-0.20240812082318-afa839968da3/go.mod h1:OSvFbzdWThfRbLZbUsEr7bikBSaLrPJQ2iUm9jw9nXQ=
github.com/multiversx/mx-chain-vm-go v1.5.32-0.20240812082514-1f3c25b3171e h1:BkZtPUAQ9JlATkENydCLxPZ819hjop6laZtmC7Wzqec=
Expand Down
1 change: 1 addition & 0 deletions outport/disabled/disabledOutport.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package disabled

import (
outportcore "github.com/multiversx/mx-chain-core-go/data/outport"

"github.com/multiversx/mx-chain-go/outport"
)

Expand Down
4 changes: 3 additions & 1 deletion outport/factory/hostDriverFactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import (
"github.com/multiversx/mx-chain-communication-go/websocket/data"
"github.com/multiversx/mx-chain-communication-go/websocket/factory"
"github.com/multiversx/mx-chain-core-go/marshal"

logger "github.com/multiversx/mx-chain-logger-go"

"github.com/multiversx/mx-chain-go/config"
"github.com/multiversx/mx-chain-go/outport"
"github.com/multiversx/mx-chain-go/outport/host"
logger "github.com/multiversx/mx-chain-logger-go"
)

type ArgsHostDriverFactory struct {
Expand Down
1 change: 1 addition & 0 deletions outport/factory/outportFactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

outportcore "github.com/multiversx/mx-chain-core-go/data/outport"
indexerFactory "github.com/multiversx/mx-chain-es-indexer-go/process/factory"

"github.com/multiversx/mx-chain-go/outport"
)

Expand Down
3 changes: 3 additions & 0 deletions outport/host/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ var ErrHostIsClosed = errors.New("server is closed")

// ErrNilHost signals that a nil host has been provided
var ErrNilHost = errors.New("nil host provided")

// ErrNilStateChangesCollector signals that a nil state change collector has been provided.
var ErrNilStateChangesCollector = errors.New("nil state changes collector provided")
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not used anywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is used here: state/accountsDB.go:163

1 change: 1 addition & 0 deletions outport/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package outport
import (
outportcore "github.com/multiversx/mx-chain-core-go/data/outport"
"github.com/multiversx/mx-chain-core-go/marshal"

"github.com/multiversx/mx-chain-go/outport/process"
)

Expand Down
1 change: 1 addition & 0 deletions outport/mock/driverStub.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package mock
import (
outportcore "github.com/multiversx/mx-chain-core-go/data/outport"
"github.com/multiversx/mx-chain-core-go/marshal"

"github.com/multiversx/mx-chain-go/testscommon/marshallerMock"
)

Expand Down
5 changes: 4 additions & 1 deletion outport/process/factory/outportDataProviderFactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"github.com/multiversx/mx-chain-core-go/core"
"github.com/multiversx/mx-chain-core-go/hashing"
"github.com/multiversx/mx-chain-core-go/marshal"
vmcommon "github.com/multiversx/mx-chain-vm-common-go"

"github.com/multiversx/mx-chain-go/common"
"github.com/multiversx/mx-chain-go/outport"
"github.com/multiversx/mx-chain-go/outport/process"
Expand All @@ -16,7 +18,6 @@ import (
"github.com/multiversx/mx-chain-go/sharding/nodesCoordinator"
"github.com/multiversx/mx-chain-go/state"
"github.com/multiversx/mx-chain-go/storage"
vmcommon "github.com/multiversx/mx-chain-vm-common-go"
)

// ArgOutportDataProviderFactory holds the arguments needed for creating a new instance of outport.DataProviderOutport
Expand All @@ -37,6 +38,7 @@ type ArgOutportDataProviderFactory struct {
MbsStorer storage.Storer
EnableEpochsHandler common.EnableEpochsHandler
ExecutionOrderGetter common.ExecutionOrderGetter
StateChangesCollector state.StateChangesCollector
}

// CreateOutportDataProvider will create a new instance of outport.DataProviderOutport
Expand Down Expand Up @@ -85,5 +87,6 @@ func CreateOutportDataProvider(arg ArgOutportDataProviderFactory) (outport.DataP
ExecutionOrderHandler: arg.ExecutionOrderGetter,
Hasher: arg.Hasher,
Marshaller: arg.Marshaller,
StateChangesCollector: arg.StateChangesCollector,
})
}
10 changes: 9 additions & 1 deletion outport/process/outportDataProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ import (
"github.com/multiversx/mx-chain-core-go/data/transaction"
"github.com/multiversx/mx-chain-core-go/hashing"
"github.com/multiversx/mx-chain-core-go/marshal"
logger "github.com/multiversx/mx-chain-logger-go"

"github.com/multiversx/mx-chain-go/common"
"github.com/multiversx/mx-chain-go/outport/process/alteredaccounts/shared"
"github.com/multiversx/mx-chain-go/process"
"github.com/multiversx/mx-chain-go/sharding"
"github.com/multiversx/mx-chain-go/sharding/nodesCoordinator"
logger "github.com/multiversx/mx-chain-logger-go"
"github.com/multiversx/mx-chain-go/state"
)

var log = logger.GetOrCreate("outport/process/outportDataProvider")
Expand All @@ -39,6 +41,7 @@ type ArgOutportDataProvider struct {
Marshaller marshal.Marshalizer
Hasher hashing.Hasher
ExecutionOrderHandler common.ExecutionOrderGetter
StateChangesCollector state.StateChangesCollector
}

// ArgPrepareOutportSaveBlockData holds the arguments needed for prepare outport save block data
Expand Down Expand Up @@ -67,6 +70,7 @@ type outportDataProvider struct {
executionOrderHandler common.ExecutionOrderGetter
marshaller marshal.Marshalizer
hasher hashing.Hasher
stateChangesCollector state.StateChangesCollector
}

// NewOutportDataProvider will create a new instance of outportDataProvider
Expand All @@ -83,6 +87,7 @@ func NewOutportDataProvider(arg ArgOutportDataProvider) (*outportDataProvider, e
executionOrderHandler: arg.ExecutionOrderHandler,
marshaller: arg.Marshaller,
hasher: arg.Hasher,
stateChangesCollector: arg.StateChangesCollector,
}, nil
}

Expand Down Expand Up @@ -134,6 +139,8 @@ func (odp *outportDataProvider) PrepareOutportSaveBlockData(arg ArgPrepareOutpor
return nil, err
}

stateChanges := odp.stateChangesCollector.GetStateChangesForTxs()

return &outportcore.OutportBlockWithHeaderAndBody{
OutportBlock: &outportcore.OutportBlock{
ShardID: odp.shardID,
Expand All @@ -145,6 +152,7 @@ func (odp *outportDataProvider) PrepareOutportSaveBlockData(arg ArgPrepareOutpor
GasPenalized: odp.gasConsumedProvider.TotalGasPenalized(),
MaxGasPerBlock: odp.economicsData.MaxGasLimitPerBlock(odp.shardID),
},
StateChanges: stateChanges,
AlteredAccounts: alteredAccounts,
NotarizedHeadersHashes: arg.NotarizedHeadersHashes,
NumberOfShards: odp.numOfShards,
Expand Down
5 changes: 4 additions & 1 deletion outport/process/outportDataProvider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@ import (
"github.com/multiversx/mx-chain-core-go/data/rewardTx"
"github.com/multiversx/mx-chain-core-go/data/smartContractResult"
"github.com/multiversx/mx-chain-core-go/data/transaction"
"github.com/stretchr/testify/require"

"github.com/multiversx/mx-chain-go/outport/mock"
"github.com/multiversx/mx-chain-go/outport/process/transactionsfee"
"github.com/multiversx/mx-chain-go/state/stateChanges"
"github.com/multiversx/mx-chain-go/testscommon"
commonMocks "github.com/multiversx/mx-chain-go/testscommon/common"
"github.com/multiversx/mx-chain-go/testscommon/enableEpochsHandlerMock"
"github.com/multiversx/mx-chain-go/testscommon/genericMocks"
"github.com/multiversx/mx-chain-go/testscommon/hashingMocks"
"github.com/multiversx/mx-chain-go/testscommon/marshallerMock"
"github.com/multiversx/mx-chain-go/testscommon/shardingMocks"
"github.com/stretchr/testify/require"
)

func createArgOutportDataProvider() ArgOutportDataProvider {
Expand All @@ -45,6 +47,7 @@ func createArgOutportDataProvider() ArgOutportDataProvider {
ExecutionOrderHandler: &commonMocks.TxExecutionOrderHandlerStub{},
Marshaller: &marshallerMock.MarshalizerMock{},
Hasher: &hashingMocks.HasherMock{},
StateChangesCollector: stateChanges.NewStateChangesCollector(),
}
}

Expand Down
1 change: 1 addition & 0 deletions p2p/disabled/networkMessenger.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"time"

"github.com/multiversx/mx-chain-core-go/core"

"github.com/multiversx/mx-chain-go/p2p"
)

Expand Down
5 changes: 4 additions & 1 deletion process/block/metablock.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
"github.com/multiversx/mx-chain-core-go/data"
"github.com/multiversx/mx-chain-core-go/data/block"
"github.com/multiversx/mx-chain-core-go/data/headerVersionData"
logger "github.com/multiversx/mx-chain-logger-go"

"github.com/multiversx/mx-chain-go/common"
"github.com/multiversx/mx-chain-go/common/holders"
"github.com/multiversx/mx-chain-go/dataRetriever"
Expand All @@ -22,7 +24,6 @@ import (
"github.com/multiversx/mx-chain-go/process/block/helpers"
"github.com/multiversx/mx-chain-go/process/block/processedMb"
"github.com/multiversx/mx-chain-go/state"
logger "github.com/multiversx/mx-chain-logger-go"
)

const firstHeaderNonce = uint64(1)
Expand Down Expand Up @@ -635,6 +636,7 @@ func (mp *metaProcessor) indexBlock(
HighestFinalBlockNonce: mp.forkDetector.GetHighestFinalBlockNonce(),
HighestFinalBlockHash: mp.forkDetector.GetHighestFinalBlockHash(),
})

if err != nil {
log.Error("metaProcessor.indexBlock cannot prepare argSaveBlock", "error", err.Error(),
"hash", headerHash, "nonce", metaBlock.GetNonce(), "round", metaBlock.GetRound())
Expand Down Expand Up @@ -1305,6 +1307,7 @@ func (mp *metaProcessor) CommitBlock(

// TODO: Should be sent also validatorInfoTxs alongside rewardsTxs -> mp.validatorInfoCreator.GetValidatorInfoTxs(body) ?
mp.indexBlock(header, headerHash, body, lastMetaBlock, notarizedHeadersHashes, rewardsTxs)
mp.stateChangesCollector.Reset()
mp.recordBlockInHistory(headerHash, headerHandler, bodyHandler)

highestFinalBlockNonce := mp.forkDetector.GetHighestFinalBlockNonce()
Expand Down
7 changes: 5 additions & 2 deletions process/block/metablock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import (
"github.com/multiversx/mx-chain-core-go/core/atomic"
"github.com/multiversx/mx-chain-core-go/data"
"github.com/multiversx/mx-chain-core-go/data/block"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/multiversx/mx-chain-go/common"
"github.com/multiversx/mx-chain-go/dataRetriever"
"github.com/multiversx/mx-chain-go/dataRetriever/blockchain"
Expand All @@ -36,8 +39,6 @@ import (
stateMock "github.com/multiversx/mx-chain-go/testscommon/state"
statusHandlerMock "github.com/multiversx/mx-chain-go/testscommon/statusHandler"
storageStubs "github.com/multiversx/mx-chain-go/testscommon/storage"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func createMockComponentHolders() (
Expand Down Expand Up @@ -919,6 +920,7 @@ func TestMetaProcessor_CommitBlockStorageFailsForHeaderShouldNotReturnError(t *t
return &block.Header{}, []byte("hash"), nil
}
arguments.BlockTracker = blockTrackerMock
arguments.StateChangesCollector = &stateMock.StateChangesCollectorStub{}
mp, _ := blproc.NewMetaProcessor(arguments)

processHandler := arguments.CoreComponents.ProcessStatusHandler()
Expand Down Expand Up @@ -1050,6 +1052,7 @@ func TestMetaProcessor_CommitBlockOkValsShouldWork(t *testing.T) {
resetCountersForManagedBlockSignerCalled = true
},
}
arguments.StateChangesCollector = &stateMock.StateChangesCollectorStub{}

mp, _ := blproc.NewMetaProcessor(arguments)

Expand Down
4 changes: 3 additions & 1 deletion process/block/shardblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"github.com/multiversx/mx-chain-core-go/data"
"github.com/multiversx/mx-chain-core-go/data/block"
"github.com/multiversx/mx-chain-core-go/data/headerVersionData"
logger "github.com/multiversx/mx-chain-logger-go"

"github.com/multiversx/mx-chain-go/common"
"github.com/multiversx/mx-chain-go/common/holders"
"github.com/multiversx/mx-chain-go/dataRetriever"
Expand All @@ -20,7 +22,6 @@ import (
"github.com/multiversx/mx-chain-go/process/block/helpers"
"github.com/multiversx/mx-chain-go/process/block/processedMb"
"github.com/multiversx/mx-chain-go/state"
logger "github.com/multiversx/mx-chain-logger-go"
)

var _ process.BlockProcessor = (*shardProcessor)(nil)
Expand Down Expand Up @@ -1041,6 +1042,7 @@ func (sp *shardProcessor) CommitBlock(

sp.blockChain.SetCurrentBlockHeaderHash(headerHash)
sp.indexBlockIfNeeded(bodyHandler, headerHash, headerHandler, lastBlockHeader)
sp.stateChangesCollector.Reset()
sp.recordBlockInHistory(headerHash, headerHandler, bodyHandler)

lastCrossNotarizedHeader, _, err := sp.blockTracker.GetLastCrossNotarizedHeader(core.MetachainShardId)
Expand Down
1 change: 1 addition & 0 deletions process/transaction/shardProcess.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/multiversx/mx-chain-core-go/data/vm"
"github.com/multiversx/mx-chain-core-go/hashing"
"github.com/multiversx/mx-chain-core-go/marshal"

logger "github.com/multiversx/mx-chain-logger-go"
vmcommon "github.com/multiversx/mx-chain-vm-common-go"

Expand Down
Loading
Loading