From 5f8d03f039aca163de081e71c8cb76223078f7a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20B=C4=83ncioiu?= Date: Tue, 12 Nov 2024 17:33:09 +0200 Subject: [PATCH] Fix after self-review. --- dataRetriever/interface.go | 7 ------- factory/processing/blockProcessorCreator.go | 10 ++++------ genesis/process/metaGenesisBlockCreator.go | 3 +-- genesis/process/shardGenesisBlockCreator.go | 5 ++--- integrationTests/vm/wasm/utils.go | 3 +-- 5 files changed, 8 insertions(+), 20 deletions(-) diff --git a/dataRetriever/interface.go b/dataRetriever/interface.go index 71b661457f2..9231dad729c 100644 --- a/dataRetriever/interface.go +++ b/dataRetriever/interface.go @@ -9,7 +9,6 @@ import ( "github.com/multiversx/mx-chain-go/p2p" "github.com/multiversx/mx-chain-go/state" "github.com/multiversx/mx-chain-go/storage" - vmcommon "github.com/multiversx/mx-chain-vm-common-go" ) // ResolverThrottler can monitor the number of the currently running resolver go routines @@ -360,12 +359,6 @@ type PeerAuthenticationPayloadValidator interface { IsInterfaceNil() bool } -// EpochNotifier can notify upon an epoch change -type EpochNotifier interface { - RegisterNotifyHandler(handler vmcommon.EpochSubscriberHandler) - IsInterfaceNil() bool -} - // AccountNonceProvider defines the behavior of a component able to provide the nonce for an account type AccountNonceProvider interface { GetAccountNonce(accountKey []byte) (uint64, error) diff --git a/factory/processing/blockProcessorCreator.go b/factory/processing/blockProcessorCreator.go index 4e2c8d6609b..0721efc6a23 100644 --- a/factory/processing/blockProcessorCreator.go +++ b/factory/processing/blockProcessorCreator.go @@ -260,9 +260,8 @@ func (pcf *processComponentsFactory) newShardBlockProcessor( BadTxForwarder: badTxInterim, EnableRoundsHandler: pcf.coreData.EnableRoundsHandler(), EnableEpochsHandler: pcf.coreData.EnableEpochsHandler(), - // TODO: is this correct? - VMOutputCacher: txcache.NewDisabledCache(), - WasmVMChangeLocker: wasmVMChangeLocker, + VMOutputCacher: txcache.NewDisabledCache(), + WasmVMChangeLocker: wasmVMChangeLocker, } scProcessorProxy, err := processProxy.NewSmartContractProcessorProxy(argsNewScProcessor, pcf.epochNotifier) @@ -590,9 +589,8 @@ func (pcf *processComponentsFactory) newMetaBlockProcessor( BadTxForwarder: badTxForwarder, EnableRoundsHandler: pcf.coreData.EnableRoundsHandler(), EnableEpochsHandler: pcf.coreData.EnableEpochsHandler(), - // TODO: is this correct? - VMOutputCacher: txcache.NewDisabledCache(), - WasmVMChangeLocker: wasmVMChangeLocker, + VMOutputCacher: txcache.NewDisabledCache(), + WasmVMChangeLocker: wasmVMChangeLocker, } scProcessorProxy, err := processProxy.NewSmartContractProcessorProxy(argsNewScProcessor, pcf.epochNotifier) diff --git a/genesis/process/metaGenesisBlockCreator.go b/genesis/process/metaGenesisBlockCreator.go index 70f9b140c2e..f695c274b42 100644 --- a/genesis/process/metaGenesisBlockCreator.go +++ b/genesis/process/metaGenesisBlockCreator.go @@ -458,8 +458,7 @@ func createProcessorsForMetaGenesisBlock(arg ArgsGenesisBlockCreator, enableEpoc EnableEpochsHandler: enableEpochsHandler, IsGenesisProcessing: true, WasmVMChangeLocker: &sync.RWMutex{}, // local Locker as to not interfere with the rest of the components - // TODO: is this correct? - VMOutputCacher: txcache.NewDisabledCache(), + VMOutputCacher: txcache.NewDisabledCache(), } scProcessorProxy, err := processProxy.NewSmartContractProcessorProxy(argsNewSCProcessor, epochNotifier) diff --git a/genesis/process/shardGenesisBlockCreator.go b/genesis/process/shardGenesisBlockCreator.go index d8af36cff49..2347632d2d5 100644 --- a/genesis/process/shardGenesisBlockCreator.go +++ b/genesis/process/shardGenesisBlockCreator.go @@ -526,9 +526,8 @@ func createProcessorsForShardGenesisBlock(arg ArgsGenesisBlockCreator, enableEpo EnableRoundsHandler: enableRoundsHandler, EnableEpochsHandler: enableEpochsHandler, IsGenesisProcessing: true, - // TODO: is this correct? - VMOutputCacher: txcache.NewDisabledCache(), - WasmVMChangeLocker: genesisWasmVMLocker, + VMOutputCacher: txcache.NewDisabledCache(), + WasmVMChangeLocker: genesisWasmVMLocker, } scProcessorProxy, err := processProxy.NewSmartContractProcessorProxy(argsNewScProcessor, epochNotifier) diff --git a/integrationTests/vm/wasm/utils.go b/integrationTests/vm/wasm/utils.go index 53c574d74fc..bfe7b4b7ca9 100644 --- a/integrationTests/vm/wasm/utils.go +++ b/integrationTests/vm/wasm/utils.go @@ -396,8 +396,7 @@ func (context *TestContext) initTxProcessorWithOneSCExecutorWithVMs() { EnableRoundsHandler: context.EnableRoundsHandler, EnableEpochsHandler: context.EnableEpochsHandler, WasmVMChangeLocker: context.WasmVMChangeLocker, - // TODO: is this correct? - VMOutputCacher: txcache.NewDisabledCache(), + VMOutputCacher: txcache.NewDisabledCache(), } context.ScProcessor, err = processProxy.NewTestSmartContractProcessorProxy(argsNewSCProcessor, context.EpochNotifier)