diff --git a/go.mod b/go.mod index ce20bf18..22ddad1b 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/multiversx/mx-chain-core-go v1.2.21 github.com/multiversx/mx-chain-crypto-go v1.2.12 github.com/multiversx/mx-chain-logger-go v1.0.15 - github.com/multiversx/mx-chain-vm-common-go v1.5.14-0.20240729085843-b5bdcbe337f9 + github.com/multiversx/mx-chain-vm-common-go v1.5.14-0.20240802080126-92fc435bbbef github.com/multiversx/mx-components-big-int v1.0.0 github.com/pelletier/go-toml v1.9.3 github.com/stretchr/testify v1.8.3 diff --git a/go.sum b/go.sum index c680c2b4..67ccaca4 100644 --- a/go.sum +++ b/go.sum @@ -71,8 +71,8 @@ github.com/multiversx/mx-chain-crypto-go v1.2.12 h1:zWip7rpUS4CGthJxfKn5MZfMfYPj github.com/multiversx/mx-chain-crypto-go v1.2.12/go.mod h1:HzcPpCm1zanNct/6h2rIh+MFrlXbjA5C8+uMyXj3LI4= github.com/multiversx/mx-chain-logger-go v1.0.15 h1:HlNdK8etyJyL9NQ+6mIXyKPEBo+wRqOwi3n+m2QIHXc= github.com/multiversx/mx-chain-logger-go v1.0.15/go.mod h1:t3PRKaWB1M+i6gUfD27KXgzLJJC+mAQiN+FLlL1yoGQ= -github.com/multiversx/mx-chain-vm-common-go v1.5.14-0.20240729085843-b5bdcbe337f9 h1:8njAzsFUUAMkj7TxTT0Zco5h6LzCvTcZMioHYtySNyc= -github.com/multiversx/mx-chain-vm-common-go v1.5.14-0.20240729085843-b5bdcbe337f9/go.mod h1:OSvFbzdWThfRbLZbUsEr7bikBSaLrPJQ2iUm9jw9nXQ= +github.com/multiversx/mx-chain-vm-common-go v1.5.14-0.20240802080126-92fc435bbbef h1:6fxfLOgKwZ2Rn5MIl9TMaeYmyPigC2XQRCASC4P0PHQ= +github.com/multiversx/mx-chain-vm-common-go v1.5.14-0.20240802080126-92fc435bbbef/go.mod h1:OSvFbzdWThfRbLZbUsEr7bikBSaLrPJQ2iUm9jw9nXQ= github.com/multiversx/mx-components-big-int v1.0.0 h1:Wkr8lSzK2nDqixOrrBa47VNuqdhV1m/aJhaP1EMaiS8= github.com/multiversx/mx-components-big-int v1.0.0/go.mod h1:maIEMgHlNE2u78JaDD0oLzri+ShgU4okHfzP3LWGdQM= github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ= diff --git a/ipc/nodepart/part.go b/ipc/nodepart/part.go index a75ba8e4..fc0e93c3 100644 --- a/ipc/nodepart/part.go +++ b/ipc/nodepart/part.go @@ -5,7 +5,7 @@ import ( "os" "time" - "github.com/multiversx/mx-chain-vm-common-go" + vmcommon "github.com/multiversx/mx-chain-vm-common-go" "github.com/multiversx/mx-chain-vm-v1_3-go/ipc/common" "github.com/multiversx/mx-chain-vm-v1_3-go/ipc/marshaling" ) @@ -13,7 +13,7 @@ import ( // NodePart is the endpoint that implements the message loop on Node's side type NodePart struct { Messenger *NodeMessenger - blockchain vmcommon.BlockchainHook + blockchain vmcommon.LegacyBlockchainHook Repliers []common.MessageReplier config Config } @@ -22,7 +22,7 @@ type NodePart struct { func NewNodePart( input *os.File, output *os.File, - blockchain vmcommon.BlockchainHook, + blockchain vmcommon.LegacyBlockchainHook, config Config, marshalizer marshaling.Marshalizer, ) (*NodePart, error) { diff --git a/ipc/nodepart/vmDriver.go b/ipc/nodepart/vmDriver.go index 962f67fe..78a44fc1 100644 --- a/ipc/nodepart/vmDriver.go +++ b/ipc/nodepart/vmDriver.go @@ -9,7 +9,7 @@ import ( logger "github.com/multiversx/mx-chain-logger-go" "github.com/multiversx/mx-chain-logger-go/pipes" - "github.com/multiversx/mx-chain-vm-common-go" + vmcommon "github.com/multiversx/mx-chain-vm-common-go" "github.com/multiversx/mx-chain-vm-v1_3-go/ipc/common" "github.com/multiversx/mx-chain-vm-v1_3-go/ipc/marshaling" ) @@ -20,7 +20,7 @@ var _ vmcommon.VMExecutionHandler = (*VMDriver)(nil) // VMDriver manages the execution of the VM process type VMDriver struct { - blockchainHook vmcommon.BlockchainHook + blockchainHook vmcommon.LegacyBlockchainHook vmArguments common.VMArguments config Config logsMarshalizer marshaling.Marshalizer @@ -52,7 +52,7 @@ type VMDriver struct { // NewVMDriver creates a new driver func NewVMDriver( - blockchainHook vmcommon.BlockchainHook, + blockchainHook vmcommon.LegacyBlockchainHook, vmArguments common.VMArguments, config Config, ) (*VMDriver, error) { diff --git a/ipc/tests/vmPart_test.go b/ipc/tests/vmPart_test.go index d007198e..d464ff33 100644 --- a/ipc/tests/vmPart_test.go +++ b/ipc/tests/vmPart_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/multiversx/mx-chain-core-go/core" - "github.com/multiversx/mx-chain-vm-common-go" + vmcommon "github.com/multiversx/mx-chain-vm-common-go" "github.com/multiversx/mx-chain-vm-common-go/builtInFunctions" "github.com/multiversx/mx-chain-vm-v1_3-go/config" "github.com/multiversx/mx-chain-vm-v1_3-go/ipc/common" @@ -61,7 +61,7 @@ func doContractRequest( t *testing.T, tag string, request common.MessageHandler, - blockchain vmcommon.BlockchainHook, + blockchain vmcommon.LegacyBlockchainHook, ) (common.MessageHandler, error) { files := createTestFiles(t, tag) var response common.MessageHandler diff --git a/ipc/vmpart/blockchainGateway.go b/ipc/vmpart/blockchainGateway.go index 97f5e260..5f8790aa 100644 --- a/ipc/vmpart/blockchainGateway.go +++ b/ipc/vmpart/blockchainGateway.go @@ -2,12 +2,13 @@ package vmpart import ( "errors" + "github.com/multiversx/mx-chain-core-go/data/esdt" - "github.com/multiversx/mx-chain-vm-common-go" + vmcommon "github.com/multiversx/mx-chain-vm-common-go" "github.com/multiversx/mx-chain-vm-v1_3-go/ipc/common" ) -var _ vmcommon.BlockchainHook = (*BlockchainHookGateway)(nil) +var _ vmcommon.LegacyBlockchainHook = (*BlockchainHookGateway)(nil) // BlockchainHookGateway forwards requests to the actual hook type BlockchainHookGateway struct { diff --git a/mock/context/blockChainHookStub.go b/mock/context/blockChainHookStub.go index aa66e4a8..330771d4 100644 --- a/mock/context/blockChainHookStub.go +++ b/mock/context/blockChainHookStub.go @@ -5,10 +5,10 @@ import ( "math/big" "github.com/multiversx/mx-chain-core-go/data/esdt" - "github.com/multiversx/mx-chain-vm-common-go" + vmcommon "github.com/multiversx/mx-chain-vm-common-go" ) -var _ vmcommon.BlockchainHook = (*BlockchainHookStub)(nil) +var _ vmcommon.LegacyBlockchainHook = (*BlockchainHookStub)(nil) // BlockchainHookStub is used in tests to check that interface methods were called type BlockchainHookStub struct { diff --git a/mock/world/worldCallbacks.go b/mock/world/worldCallbacks.go index 64233dd0..3636fc34 100644 --- a/mock/world/worldCallbacks.go +++ b/mock/world/worldCallbacks.go @@ -5,13 +5,14 @@ import ( "encoding/hex" "errors" "fmt" - vmcommon "github.com/multiversx/mx-chain-vm-common-go" "math/big" + vmcommon "github.com/multiversx/mx-chain-vm-common-go" + "github.com/multiversx/mx-chain-core-go/data/esdt" ) -var _ vmcommon.BlockchainHook = (*MockWorld)(nil) +var _ vmcommon.LegacyBlockchainHook = (*MockWorld)(nil) // ErrBuiltinFuncWrapperNotInitialized means that the builtin function wrapper was used before initialization. var ErrBuiltinFuncWrapperNotInitialized = errors.New("builtin function not found or container not initialized") diff --git a/testcommon/testInitializer_inputs.go b/testcommon/testInitializer_inputs.go index c2fc4589..757f2848 100644 --- a/testcommon/testInitializer_inputs.go +++ b/testcommon/testInitializer_inputs.go @@ -325,7 +325,7 @@ func DefaultTestVMWithWorldMock(tb testing.TB) (vmhost.VMHost, *worldmock.MockWo } // DefaultTestVM creates a host configured with a configured blockchain hook -func DefaultTestVM(tb testing.TB, blockchain vmcommon.BlockchainHook) vmhost.VMHost { +func DefaultTestVM(tb testing.TB, blockchain vmcommon.LegacyBlockchainHook) vmhost.VMHost { gasSchedule := customGasSchedule if gasSchedule == nil { gasSchedule = config.MakeGasMapForTests() @@ -352,7 +352,7 @@ func DefaultTestVM(tb testing.TB, blockchain vmcommon.BlockchainHook) vmhost.VMH func DefaultTestVMWithGasSchedule( tb testing.TB, - blockchain vmcommon.BlockchainHook, + blockchain vmcommon.LegacyBlockchainHook, customGasSchedule config.GasScheduleMap, wasmerSIGSEGVPassthrough bool, ) vmhost.VMHost { diff --git a/vmhost/contexts/blockchain.go b/vmhost/contexts/blockchain.go index efe0d0f0..898d3f3a 100644 --- a/vmhost/contexts/blockchain.go +++ b/vmhost/contexts/blockchain.go @@ -5,7 +5,7 @@ import ( "github.com/multiversx/mx-chain-core-go/data/esdt" logger "github.com/multiversx/mx-chain-logger-go" - "github.com/multiversx/mx-chain-vm-common-go" + vmcommon "github.com/multiversx/mx-chain-vm-common-go" "github.com/multiversx/mx-chain-vm-v1_3-go/vmhost" ) @@ -13,14 +13,14 @@ var log = logger.GetOrCreate("vm/blockchainContext") type blockchainContext struct { host vmhost.VMHost - blockChainHook vmcommon.BlockchainHook + blockChainHook vmcommon.LegacyBlockchainHook stateStack []int } // NewBlockchainContext creates a new blockchainContext func NewBlockchainContext( host vmhost.VMHost, - blockChainHook vmcommon.BlockchainHook, + blockChainHook vmcommon.LegacyBlockchainHook, ) (*blockchainContext, error) { context := &blockchainContext{ diff --git a/vmhost/contexts/storage.go b/vmhost/contexts/storage.go index c853f138..23c01419 100644 --- a/vmhost/contexts/storage.go +++ b/vmhost/contexts/storage.go @@ -15,7 +15,7 @@ var logStorage = logger.GetOrCreate("vm/storage") type storageContext struct { host vmhost.VMHost - blockChainHook vmcommon.BlockchainHook + blockChainHook vmcommon.LegacyBlockchainHook address []byte stateStack [][]byte protectedKeyPrefix []byte @@ -25,7 +25,7 @@ type storageContext struct { // NewStorageContext creates a new storageContext func NewStorageContext( host vmhost.VMHost, - blockChainHook vmcommon.BlockchainHook, + blockChainHook vmcommon.LegacyBlockchainHook, protectedKeyPrefix []byte, ) (*storageContext, error) { if len(protectedKeyPrefix) == 0 { diff --git a/vmhost/hostCore/host.go b/vmhost/hostCore/host.go index f3dbb7ce..fe95ddea 100644 --- a/vmhost/hostCore/host.go +++ b/vmhost/hostCore/host.go @@ -51,7 +51,7 @@ type vmHost struct { // NewVMHost creates a new VM vmHost func NewVMHost( - blockChainHook vmcommon.BlockchainHook, + blockChainHook vmcommon.LegacyBlockchainHook, hostParameters *vmhost.VMHostParameters, ) (vmhost.VMHost, error) { if check.IfNil(hostParameters.EnableEpochsHandler) {