From dfa3752c1d49aab05c2886a4f4de3e3e409e0fb9 Mon Sep 17 00:00:00 2001 From: Iuga Mihai Date: Tue, 24 Oct 2023 16:10:28 +0300 Subject: [PATCH 1/7] change owner from sc --- .../asyncCallWithChangeOwner_test.go | 65 ++++++++++++++++++ .../txsFee/testdata/changeOwner/contract.wasm | Bin 0 -> 3535 bytes 2 files changed, 65 insertions(+) create mode 100644 integrationTests/vm/txsFee/multiShard/asyncCallWithChangeOwner_test.go create mode 100755 integrationTests/vm/txsFee/testdata/changeOwner/contract.wasm diff --git a/integrationTests/vm/txsFee/multiShard/asyncCallWithChangeOwner_test.go b/integrationTests/vm/txsFee/multiShard/asyncCallWithChangeOwner_test.go new file mode 100644 index 00000000000..c839a77a37c --- /dev/null +++ b/integrationTests/vm/txsFee/multiShard/asyncCallWithChangeOwner_test.go @@ -0,0 +1,65 @@ +package multiShard + +import ( + "encoding/hex" + "math/big" + "testing" + + "github.com/multiversx/mx-chain-go/config" + "github.com/multiversx/mx-chain-go/integrationTests" + "github.com/multiversx/mx-chain-go/integrationTests/vm" + "github.com/multiversx/mx-chain-go/integrationTests/vm/txsFee/utils" + vmcommon "github.com/multiversx/mx-chain-vm-common-go" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestDoChangeOwnerCrossShardFromAContract(t *testing.T) { + if testing.Short() { + t.Skip("cannot run with -race -short; requires Wasm VM fix") + } + + enableEpochs := config.EnableEpochs{ + DynamicGasCostForDataTrieStorageLoadEnableEpoch: integrationTests.UnreachableEpoch, + } + + testContextSource, err := vm.CreatePreparedTxProcessorWithVMsMultiShard(0, enableEpochs) + require.Nil(t, err) + defer testContextSource.Close() + + pathToContract := "../testdata/changeOwner/contract.wasm" + firstContract, firstOwner := utils.DoDeployWithCustomParams(t, testContextSource, pathToContract, big.NewInt(100000000000), 15000, nil) + + utils.CleanAccumulatedIntermediateTransactions(t, testContextSource) + testContextSource.TxFeeHandler.CreateBlockStarted(getZeroGasAndFees()) + testContextSource.TxsLogsProcessor.Clean() + + require.Equal(t, uint32(0), testContextSource.ShardCoordinator.ComputeId(firstContract)) + require.Equal(t, uint32(0), testContextSource.ShardCoordinator.ComputeId(firstOwner)) + + testContextSecondContract, err := vm.CreatePreparedTxProcessorWithVMsMultiShard(1, enableEpochs) + require.Nil(t, err) + defer testContextSecondContract.Close() + + pathToContract = "../testdata/first/output/first.wasm" + secondSCAddress, _ := utils.DoDeployWithCustomParams(t, testContextSecondContract, pathToContract, big.NewInt(100000000000), 15000, nil) + require.Equal(t, uint32(1), testContextSource.ShardCoordinator.ComputeId(secondSCAddress)) + + gasPrice := uint64(10) + gasLimit := uint64(5000000) + dataField := append([]byte("change_owner"), []byte("@"+hex.EncodeToString(secondSCAddress))...) + dataField = append(dataField, []byte("@"+hex.EncodeToString(firstOwner))...) + tx := vm.CreateTransaction(1, big.NewInt(0), firstOwner, firstContract, gasPrice, gasLimit, dataField) + + // execute on the sender shard + retCode, err := testContextSource.TxProcessor.ProcessTransaction(tx) + require.Equal(t, vmcommon.Ok, retCode) + require.Nil(t, err) + + // TODO here should be generated a smart contract results cross shard to call the ChangeOwnerAddress built in function + intermediateTxs := testContextSource.GetIntermediateTransactions(t) + assert.Equal(t, 1, len(intermediateTxs)) + + logs := testContextSource.TxsLogsProcessor.GetAllCurrentLogs() + require.NotNil(t, logs) +} diff --git a/integrationTests/vm/txsFee/testdata/changeOwner/contract.wasm b/integrationTests/vm/txsFee/testdata/changeOwner/contract.wasm new file mode 100755 index 0000000000000000000000000000000000000000..748ee9085247c6554a8b203d7fb6ac8ec7eeea47 GIT binary patch literal 3535 zcmai1O>7)V6@FFSJ=5d%PsK6G*m07Y*(B?*7#3K0MfT#dV`rnyI;%K=yqaX|Hp6q_6)N%I$j(xKbJM14_8v(d7#j|l z-CdhB$m6k7J8=>>ZR2JdCp|3wYTW7DmA7rZpII8=6_d|tE$wBtM?pT3tFE`2N!(dU z({4(FCyqC5w$|TSS-*Vqz-%u^5cQ6%^^aP=Vl$IA`#Uzta$suc78BQO(#*D~!0RV+ z+XrihcFV&ku=sk~YPNvq=G(8wy{#djXSNvsdZ$&l6gjBFnf0ujf(Cxs-2cSEjLnY3 ztcH$EZ!f7Y$DIxpT@*S0aL;3o!`$vn8-VGS{8g+ z^gRkhF_gaW!$K&CYmt9}C&(+D@CL%{?}yQV%r_sq*SmNX`=!E;-RY)#lKfWE%II^Y z9xA40o1F&DPdPcpcdOUy+gjG$wh4W{)ace44kmqJw7wN5Of8yOSVU|J+@47FZxtpfB1!+dx##jD~mPWPDQFJUv0AE_L ze;G}ZDy;a66OsAperV3CB1Ox9%`jC6fU0El6@Sru7qchTY!!-HvPCjK!H}1WpF9YS za-s?-LReFzMl`KD!;i6UnhnEiu3mvQbMV`Tq4rK0-voH6N;G<~U{;-q#)oWyKMY4> zpa))o`y?j+>4}gD(K#VBCsoz=7Xe$S$ow5}MgX>m)yRaD1GE1)oF}RZ#LBV}mx#>2 zA0ZFOothpM(J(8s5hsBe7QIU}1*B7Lq`B%j4q^U081Rv@3z#aqse*bDj?U|XDpg>x zBD_T%!hqkd`q%wMD8flu7kCIC<#shtqkyI5oGe%WUn=3URP{LD-m`prhxx{g%Xit~ z(*g2*LBi)eO~Ezm2Ik$5U92vQ?Kj4dK@+yMhrgg*_0$}Ip{V9ib$Eop#>{AstJ<%K zQ7__gm6OQ>5(6kGb@5Z@b2c`E zS^-*q`24^=06H~6(aNVb0&*WrhKOo=@JNYu25rodiR>1f{-r6%@@n$OLW4qVOpPUnBDju4`E zrvjK70HNw}xZq?Mo*0IQeS_(P@IWBKgD3S_idG7?D{6TP8wA}1 zQ+bo=E5)5psB#pNI)=u7mfPcLBh*<#=I7{xMRi8K6#du}<6M-FXuB%T{r3vA!9iO;yDy zWqwVl!+9!H3d~ecDdvP>%gvKlDe+5I(9Gvapvv%~3i^ck2t8J-S@S2?`uT)GUmMGt z1~-SQ#{{Fm)eDF|;HUXBPJ)siRT}c&AQyGy+X`KyA%lUqpC7~I5+q#;-vjp(>I}A|FyDhbj&xQlo|>-sY7&5g z*TgvXw}3d_Hc}l2DJR@fH8rC?gUWbuM!n>K!^tm%@VN>W+pY+XVLg}0FJV`yGw|>s zq!PSIb+Y2+xda%fb4%x|l9^O9d{*)T?lZ^>=K|lSa=th{hZHe8&i4T^nl5@_&LmTW zNRH41wj47@*?Nv6k8lW(`GcbYXMXfo>7za40{4+vb~mo;eBm;UMrwP#czB=I4O{Ov zthRhZ*K-#y>CJvp&syC?H@dc`lWwNtdfo13ny>77H@~aiOS?%^C;gq#exoVa%$tu-spCC{0KOF-P&!YF+jx$kgmf(EAH^Z z9+}@f2qPiL{1NYO3HkJ?yJD_&lhuCGY~AkI<)zy4wd?D*Zmisn8^Dytd%ENPfAFSR zzIqENy11CeIRia+SFT~mU6zNViM^L!OzT^%PNUYVA1u$(zTJ#FJ-Ztxt-9{k>-{vf N4dTma Date: Wed, 25 Oct 2023 14:06:32 +0300 Subject: [PATCH 2/7] new enabled epoch flag and extend semi-integration test --- cmd/node/config/enableEpochs.toml | 3 ++ common/enablers/enableEpochsHandler.go | 1 + common/enablers/epochFlags.go | 7 +++ common/interface.go | 1 + config/epochConfig.go | 1 + go.mod | 2 +- go.sum | 4 +- .../asyncCallWithChangeOwner_test.go | 45 ++++++++++++++++--- .../enableEpochsHandlerStub.go | 9 ++++ 9 files changed, 63 insertions(+), 10 deletions(-) diff --git a/cmd/node/config/enableEpochs.toml b/cmd/node/config/enableEpochs.toml index c291679b181..57172298c3e 100644 --- a/cmd/node/config/enableEpochs.toml +++ b/cmd/node/config/enableEpochs.toml @@ -281,6 +281,9 @@ # NFTStopCreateEnableEpoch represents the epoch when NFT stop create feature is enabled NFTStopCreateEnableEpoch = 3 + # ChangeOwnerAddressCrossShardThroughSCEnableEpoch represents the epoch when the change owner address built in function will work also through a smart contract call cross shard + ChangeOwnerAddressCrossShardThroughSCEnableEpoch = 3 + # BLSMultiSignerEnableEpoch represents the activation epoch for different types of BLS multi-signers BLSMultiSignerEnableEpoch = [ { EnableEpoch = 0, Type = "no-KOSK" }, diff --git a/common/enablers/enableEpochsHandler.go b/common/enablers/enableEpochsHandler.go index 844d513d9f4..7e5ea0bc18e 100644 --- a/common/enablers/enableEpochsHandler.go +++ b/common/enablers/enableEpochsHandler.go @@ -131,6 +131,7 @@ func (handler *enableEpochsHandler) EpochConfirmed(epoch uint32, _ uint64) { handler.setFlagValue(epoch >= handler.enableEpochsConfig.SCProcessorV2EnableEpoch, handler.scProcessorV2Flag, "scProcessorV2Flag", epoch, handler.enableEpochsConfig.SCProcessorV2EnableEpoch) handler.setFlagValue(epoch >= handler.enableEpochsConfig.DynamicGasCostForDataTrieStorageLoadEnableEpoch, handler.dynamicGasCostForDataTrieStorageLoadFlag, "dynamicGasCostForDataTrieStorageLoadFlag", epoch, handler.enableEpochsConfig.DynamicGasCostForDataTrieStorageLoadEnableEpoch) handler.setFlagValue(epoch >= handler.enableEpochsConfig.NFTStopCreateEnableEpoch, handler.nftStopCreateFlag, "nftStopCreateFlag", epoch, handler.enableEpochsConfig.NFTStopCreateEnableEpoch) + handler.setFlagValue(epoch >= handler.enableEpochsConfig.ChangeOwnerAddressCrossShardThroughSCEnableEpoch, handler.changeOwnerAddressCrossShardThroughSCFlag, "changeOwnerAddressCrossShardThroughSCFlag", epoch, handler.enableEpochsConfig.ChangeOwnerAddressCrossShardThroughSCEnableEpoch) } func (handler *enableEpochsHandler) setFlagValue(value bool, flag *atomic.Flag, flagName string, epoch uint32, flagEpoch uint32) { diff --git a/common/enablers/epochFlags.go b/common/enablers/epochFlags.go index 93133010473..2b0ca8d884c 100644 --- a/common/enablers/epochFlags.go +++ b/common/enablers/epochFlags.go @@ -103,6 +103,7 @@ type epochFlagsHolder struct { fixDelegationChangeOwnerOnAccountFlag *atomic.Flag dynamicGasCostForDataTrieStorageLoadFlag *atomic.Flag nftStopCreateFlag *atomic.Flag + changeOwnerAddressCrossShardThroughSCFlag *atomic.Flag } func newEpochFlagsHolder() *epochFlagsHolder { @@ -205,6 +206,7 @@ func newEpochFlagsHolder() *epochFlagsHolder { fixDelegationChangeOwnerOnAccountFlag: &atomic.Flag{}, dynamicGasCostForDataTrieStorageLoadFlag: &atomic.Flag{}, nftStopCreateFlag: &atomic.Flag{}, + changeOwnerAddressCrossShardThroughSCFlag: &atomic.Flag{}, } } @@ -750,3 +752,8 @@ func (holder *epochFlagsHolder) IsDynamicGasCostForDataTrieStorageLoadEnabled() func (holder *epochFlagsHolder) NFTStopCreateEnabled() bool { return holder.nftStopCreateFlag.IsSet() } + +// IsChangeOwnerAddressCrossShardThroughSCEnabled return true if the changeOwnerAddressCrossShardThroughSCFlag is enabled +func (holder *epochFlagsHolder) IsChangeOwnerAddressCrossShardThroughSCEnabled() bool { + return holder.changeOwnerAddressCrossShardThroughSCFlag.IsSet() +} diff --git a/common/interface.go b/common/interface.go index bd543086c09..52cdce6aefe 100644 --- a/common/interface.go +++ b/common/interface.go @@ -396,6 +396,7 @@ type EnableEpochsHandler interface { IsDynamicGasCostForDataTrieStorageLoadEnabled() bool FixDelegationChangeOwnerOnAccountEnabled() bool NFTStopCreateEnabled() bool + IsChangeOwnerAddressCrossShardThroughSCEnabled() bool IsInterfaceNil() bool } diff --git a/config/epochConfig.go b/config/epochConfig.go index 649966b5a6c..bbdfe39284e 100644 --- a/config/epochConfig.go +++ b/config/epochConfig.go @@ -106,6 +106,7 @@ type EnableEpochs struct { FixDelegationChangeOwnerOnAccountEnableEpoch uint32 DynamicGasCostForDataTrieStorageLoadEnableEpoch uint32 NFTStopCreateEnableEpoch uint32 + ChangeOwnerAddressCrossShardThroughSCEnableEpoch uint32 BLSMultiSignerEnableEpoch []MultiSignerConfig } diff --git a/go.mod b/go.mod index 9f5aa96dcd9..3fcc9780b35 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/multiversx/mx-chain-logger-go v1.0.13 github.com/multiversx/mx-chain-scenario-go v1.2.1 github.com/multiversx/mx-chain-storage-go v1.0.13 - github.com/multiversx/mx-chain-vm-common-go v1.5.5 + github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20231025104250-d24edf1e19ae github.com/multiversx/mx-chain-vm-go v1.5.16 github.com/multiversx/mx-chain-vm-v1_2-go v1.2.61 github.com/multiversx/mx-chain-vm-v1_3-go v1.3.62 diff --git a/go.sum b/go.sum index b5149a6dfc5..fc34aaafbab 100644 --- a/go.sum +++ b/go.sum @@ -398,8 +398,8 @@ github.com/multiversx/mx-chain-scenario-go v1.2.1 h1:9eC6VcOEAKRRKZ7EbSWPLzCdNIM github.com/multiversx/mx-chain-scenario-go v1.2.1/go.mod h1:EuZY7DpNFHVNSxJR8dKE1z2I8gBYfEFFPSwNUOXptqE= github.com/multiversx/mx-chain-storage-go v1.0.13 h1:i41VPDJZ0pn5gf18zTXrac5xeiolUOztNuzL3wEXRuI= github.com/multiversx/mx-chain-storage-go v1.0.13/go.mod h1:sJ2q49tgjxNpMpsHysjABqCAB0FLBmDblbjBkQ8XfmA= -github.com/multiversx/mx-chain-vm-common-go v1.5.5 h1:NoG73lvcHSeUcoFlYybG8ceGuJ6KptD3QJjUNEnGDVk= -github.com/multiversx/mx-chain-vm-common-go v1.5.5/go.mod h1:sqkKMCnwkWl8DURdb9q7pctK8IANghdHY1KJLE0ox2c= +github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20231025104250-d24edf1e19ae h1:+W8kDrGgdeuuS9l8a0PZ7HMbdNnH5zkQ5KE1XAryiSc= +github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20231025104250-d24edf1e19ae/go.mod h1:sqkKMCnwkWl8DURdb9q7pctK8IANghdHY1KJLE0ox2c= github.com/multiversx/mx-chain-vm-go v1.5.16 h1:vBahY/aRe03yRlBPUu/hV+cNTx3MiVLYF+q9Uca+dfU= github.com/multiversx/mx-chain-vm-go v1.5.16/go.mod h1:F5OoQjCuYNr1hYWvwZKCcWYQir3+r2QVBxQux/eo0Ak= github.com/multiversx/mx-chain-vm-v1_2-go v1.2.61 h1:7c3VRhr5JDu7qs3AkmKQu7DzWGGIoiHfSIMrzw3x5Ao= diff --git a/integrationTests/vm/txsFee/multiShard/asyncCallWithChangeOwner_test.go b/integrationTests/vm/txsFee/multiShard/asyncCallWithChangeOwner_test.go index c839a77a37c..aac3723f294 100644 --- a/integrationTests/vm/txsFee/multiShard/asyncCallWithChangeOwner_test.go +++ b/integrationTests/vm/txsFee/multiShard/asyncCallWithChangeOwner_test.go @@ -3,14 +3,15 @@ package multiShard import ( "encoding/hex" "math/big" + "strings" "testing" + "github.com/multiversx/mx-chain-core-go/core" "github.com/multiversx/mx-chain-go/config" "github.com/multiversx/mx-chain-go/integrationTests" "github.com/multiversx/mx-chain-go/integrationTests/vm" "github.com/multiversx/mx-chain-go/integrationTests/vm/txsFee/utils" vmcommon "github.com/multiversx/mx-chain-vm-common-go" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -20,13 +21,17 @@ func TestDoChangeOwnerCrossShardFromAContract(t *testing.T) { } enableEpochs := config.EnableEpochs{ - DynamicGasCostForDataTrieStorageLoadEnableEpoch: integrationTests.UnreachableEpoch, + DynamicGasCostForDataTrieStorageLoadEnableEpoch: integrationTests.UnreachableEpoch, + ChangeOwnerAddressCrossShardThroughSCEnableEpoch: 0, } testContextSource, err := vm.CreatePreparedTxProcessorWithVMsMultiShard(0, enableEpochs) require.Nil(t, err) defer testContextSource.Close() + // STEP 1 + // deploy first contract (this contract has a function that will call the `ChangeOwnerAddress` built-in function) + // on shard 0 pathToContract := "../testdata/changeOwner/contract.wasm" firstContract, firstOwner := utils.DoDeployWithCustomParams(t, testContextSource, pathToContract, big.NewInt(100000000000), 15000, nil) @@ -41,25 +46,51 @@ func TestDoChangeOwnerCrossShardFromAContract(t *testing.T) { require.Nil(t, err) defer testContextSecondContract.Close() + // STEP 2 + // deploy the second contract on shard 1 pathToContract = "../testdata/first/output/first.wasm" - secondSCAddress, _ := utils.DoDeployWithCustomParams(t, testContextSecondContract, pathToContract, big.NewInt(100000000000), 15000, nil) + secondSCAddress, deployer := utils.DoDeployWithCustomParams(t, testContextSecondContract, pathToContract, big.NewInt(100000000000), 15000, nil) require.Equal(t, uint32(1), testContextSource.ShardCoordinator.ComputeId(secondSCAddress)) + // STEP 3 + // change the owner of the second contract -- the new owner will be the first contract gasPrice := uint64(10) + txData := []byte(core.BuiltInFunctionChangeOwnerAddress + "@" + hex.EncodeToString(firstContract)) + tx := vm.CreateTransaction(1, big.NewInt(0), deployer, secondSCAddress, gasPrice, 1000, txData) + returnCode, err := testContextSecondContract.TxProcessor.ProcessTransaction(tx) + require.Nil(t, err) + require.Equal(t, vmcommon.Ok, returnCode) + _, err = testContextSecondContract.Accounts.Commit() + require.Nil(t, err) + utils.CheckOwnerAddr(t, testContextSecondContract, secondSCAddress, firstContract) + + // STEP 3 + // call `change_owner` function from the first contract gasLimit := uint64(5000000) dataField := append([]byte("change_owner"), []byte("@"+hex.EncodeToString(secondSCAddress))...) dataField = append(dataField, []byte("@"+hex.EncodeToString(firstOwner))...) - tx := vm.CreateTransaction(1, big.NewInt(0), firstOwner, firstContract, gasPrice, gasLimit, dataField) + tx = vm.CreateTransaction(1, big.NewInt(0), firstOwner, firstContract, gasPrice, gasLimit, dataField) - // execute on the sender shard retCode, err := testContextSource.TxProcessor.ProcessTransaction(tx) require.Equal(t, vmcommon.Ok, retCode) require.Nil(t, err) - // TODO here should be generated a smart contract results cross shard to call the ChangeOwnerAddress built in function intermediateTxs := testContextSource.GetIntermediateTransactions(t) - assert.Equal(t, 1, len(intermediateTxs)) + require.Equal(t, 1, len(intermediateTxs)) + + expectedDataField := core.BuiltInFunctionChangeOwnerAddress + "@" + hex.EncodeToString(firstOwner) + require.True(t, strings.HasPrefix(string(intermediateTxs[0].GetData()), expectedDataField)) logs := testContextSource.TxsLogsProcessor.GetAllCurrentLogs() require.NotNil(t, logs) + + // STEP 4 + // executed results smart contract results of the shard1 where the second contract was deployed + testContextSecondContract.TxsLogsProcessor.Clean() + utils.ProcessSCRResult(t, testContextSecondContract, intermediateTxs[0], vmcommon.Ok, nil) + utils.CheckOwnerAddr(t, testContextSecondContract, secondSCAddress, firstOwner) + + logs = testContextSecondContract.TxsLogsProcessor.GetAllCurrentLogs() + require.NotNil(t, logs) + require.Equal(t, core.BuiltInFunctionChangeOwnerAddress, string(logs[0].GetLogEvents()[0].GetIdentifier())) } diff --git a/testscommon/enableEpochsHandlerMock/enableEpochsHandlerStub.go b/testscommon/enableEpochsHandlerMock/enableEpochsHandlerStub.go index 47bc57cd31e..8b8cb4e0b40 100644 --- a/testscommon/enableEpochsHandlerMock/enableEpochsHandlerStub.go +++ b/testscommon/enableEpochsHandlerMock/enableEpochsHandlerStub.go @@ -132,6 +132,7 @@ type EnableEpochsHandlerStub struct { FixDelegationChangeOwnerOnAccountEnabledField bool IsDynamicGasCostForDataTrieStorageLoadEnabledField bool IsNFTStopCreateEnabledField bool + IsChangeOwnerAddressCrossShardThroughSCEnabledField bool } // ResetPenalizedTooMuchGasFlag - @@ -1133,6 +1134,14 @@ func (stub *EnableEpochsHandlerStub) NFTStopCreateEnabled() bool { return stub.IsNFTStopCreateEnabledField } +// IsChangeOwnerAddressCrossShardThroughSCEnabled - +func (stub *EnableEpochsHandlerStub) IsChangeOwnerAddressCrossShardThroughSCEnabled() bool { + stub.RLock() + defer stub.RUnlock() + + return stub.IsChangeOwnerAddressCrossShardThroughSCEnabledField +} + // IsInterfaceNil - func (stub *EnableEpochsHandlerStub) IsInterfaceNil() bool { return stub == nil From 5766b21cc5905387db660f37d2a2bfb31750b486 Mon Sep 17 00:00:00 2001 From: Iuga Mihai Date: Wed, 25 Oct 2023 14:54:59 +0300 Subject: [PATCH 3/7] update vm go --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 3fcc9780b35..a5a61c3d0e6 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/multiversx/mx-chain-scenario-go v1.2.1 github.com/multiversx/mx-chain-storage-go v1.0.13 github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20231025104250-d24edf1e19ae - github.com/multiversx/mx-chain-vm-go v1.5.16 + github.com/multiversx/mx-chain-vm-go v1.5.17-0.20231025114923-cc9dde7ff309 github.com/multiversx/mx-chain-vm-v1_2-go v1.2.61 github.com/multiversx/mx-chain-vm-v1_3-go v1.3.62 github.com/multiversx/mx-chain-vm-v1_4-go v1.4.88 diff --git a/go.sum b/go.sum index fc34aaafbab..057694c212f 100644 --- a/go.sum +++ b/go.sum @@ -400,8 +400,8 @@ github.com/multiversx/mx-chain-storage-go v1.0.13 h1:i41VPDJZ0pn5gf18zTXrac5xeio github.com/multiversx/mx-chain-storage-go v1.0.13/go.mod h1:sJ2q49tgjxNpMpsHysjABqCAB0FLBmDblbjBkQ8XfmA= github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20231025104250-d24edf1e19ae h1:+W8kDrGgdeuuS9l8a0PZ7HMbdNnH5zkQ5KE1XAryiSc= github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20231025104250-d24edf1e19ae/go.mod h1:sqkKMCnwkWl8DURdb9q7pctK8IANghdHY1KJLE0ox2c= -github.com/multiversx/mx-chain-vm-go v1.5.16 h1:vBahY/aRe03yRlBPUu/hV+cNTx3MiVLYF+q9Uca+dfU= -github.com/multiversx/mx-chain-vm-go v1.5.16/go.mod h1:F5OoQjCuYNr1hYWvwZKCcWYQir3+r2QVBxQux/eo0Ak= +github.com/multiversx/mx-chain-vm-go v1.5.17-0.20231025114923-cc9dde7ff309 h1:NWhUD87WqZtUbEqocvbBrqMMlfAirzMu56YuLJH5sJ4= +github.com/multiversx/mx-chain-vm-go v1.5.17-0.20231025114923-cc9dde7ff309/go.mod h1:pSLANhxTDnEoclJ8FQh5EzKiyT/W2vPogkScaNcNmng= github.com/multiversx/mx-chain-vm-v1_2-go v1.2.61 h1:7c3VRhr5JDu7qs3AkmKQu7DzWGGIoiHfSIMrzw3x5Ao= github.com/multiversx/mx-chain-vm-v1_2-go v1.2.61/go.mod h1:bQFh+KuUIEBmCfKJ0qVN2+DbRRbAqW0huKfHpiTbyEE= github.com/multiversx/mx-chain-vm-v1_3-go v1.3.62 h1:rQaWRbrQwrEhSN0ZEQQ0JAbttgi+OrMf/CLziWpRUCA= From 049809bb4c70859bd1d555fdc962689202c7fc62 Mon Sep 17 00:00:00 2001 From: Iuga Mihai Date: Wed, 25 Oct 2023 15:14:31 +0300 Subject: [PATCH 4/7] fix unit tests --- sharding/mock/enableEpochsHandlerMock.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sharding/mock/enableEpochsHandlerMock.go b/sharding/mock/enableEpochsHandlerMock.go index 8516a318510..d5e925262d6 100644 --- a/sharding/mock/enableEpochsHandlerMock.go +++ b/sharding/mock/enableEpochsHandlerMock.go @@ -9,6 +9,11 @@ type EnableEpochsHandlerMock struct { IsFixOldTokenLiquidityFlagEnabledField bool } +// IsChangeOwnerAddressCrossShardThroughSCEnabled - +func (mock *EnableEpochsHandlerMock) IsChangeOwnerAddressCrossShardThroughSCEnabled() bool { + return false +} + // BlockGasAndFeesReCheckEnableEpoch returns 0 func (mock *EnableEpochsHandlerMock) BlockGasAndFeesReCheckEnableEpoch() uint32 { return 0 From 82bac446194f7cad37d08db3f0804c50d85c6039 Mon Sep 17 00:00:00 2001 From: Iuga Mihai Date: Thu, 26 Oct 2023 10:15:38 +0300 Subject: [PATCH 5/7] fixes after review --- config/tomlConfig_test.go | 4 ++++ go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config/tomlConfig_test.go b/config/tomlConfig_test.go index 1b0c20cb147..a844be408c0 100644 --- a/config/tomlConfig_test.go +++ b/config/tomlConfig_test.go @@ -828,6 +828,9 @@ func TestEnableEpochConfig(t *testing.T) { # NFTStopCreateEnableEpoch represents the epoch when NFT stop create feature is enabled NFTStopCreateEnableEpoch = 89 + # ChangeOwnerAddressCrossShardThroughSCEnableEpoch represents the epoch when the change owner address built in function will work also through a smart contract call cross shard + ChangeOwnerAddressCrossShardThroughSCEnableEpoch = 90 + # MaxNodesChangeEnableEpoch holds configuration for changing the maximum number of nodes and the enabling epoch MaxNodesChangeEnableEpoch = [ { EpochEnable = 44, MaxNumNodes = 2169, NodesToShufflePerShard = 80 }, @@ -937,6 +940,7 @@ func TestEnableEpochConfig(t *testing.T) { FixDelegationChangeOwnerOnAccountEnableEpoch: 87, ScToScLogEventEnableEpoch: 88, NFTStopCreateEnableEpoch: 89, + ChangeOwnerAddressCrossShardThroughSCEnableEpoch: 90, MaxNodesChangeEnableEpoch: []MaxNodesChangeConfig{ { EpochEnable: 44, diff --git a/go.mod b/go.mod index a5a61c3d0e6..198cfa18425 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/multiversx/mx-chain-logger-go v1.0.13 github.com/multiversx/mx-chain-scenario-go v1.2.1 github.com/multiversx/mx-chain-storage-go v1.0.13 - github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20231025104250-d24edf1e19ae + github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20231025141330-60c8247a3ade github.com/multiversx/mx-chain-vm-go v1.5.17-0.20231025114923-cc9dde7ff309 github.com/multiversx/mx-chain-vm-v1_2-go v1.2.61 github.com/multiversx/mx-chain-vm-v1_3-go v1.3.62 diff --git a/go.sum b/go.sum index 057694c212f..795bb2195a5 100644 --- a/go.sum +++ b/go.sum @@ -398,8 +398,8 @@ github.com/multiversx/mx-chain-scenario-go v1.2.1 h1:9eC6VcOEAKRRKZ7EbSWPLzCdNIM github.com/multiversx/mx-chain-scenario-go v1.2.1/go.mod h1:EuZY7DpNFHVNSxJR8dKE1z2I8gBYfEFFPSwNUOXptqE= github.com/multiversx/mx-chain-storage-go v1.0.13 h1:i41VPDJZ0pn5gf18zTXrac5xeiolUOztNuzL3wEXRuI= github.com/multiversx/mx-chain-storage-go v1.0.13/go.mod h1:sJ2q49tgjxNpMpsHysjABqCAB0FLBmDblbjBkQ8XfmA= -github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20231025104250-d24edf1e19ae h1:+W8kDrGgdeuuS9l8a0PZ7HMbdNnH5zkQ5KE1XAryiSc= -github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20231025104250-d24edf1e19ae/go.mod h1:sqkKMCnwkWl8DURdb9q7pctK8IANghdHY1KJLE0ox2c= +github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20231025141330-60c8247a3ade h1:Ug3P6JCSmMKZohhnpz5x4RsNs78MJgX+kgBAyQ6s0PU= +github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20231025141330-60c8247a3ade/go.mod h1:sqkKMCnwkWl8DURdb9q7pctK8IANghdHY1KJLE0ox2c= github.com/multiversx/mx-chain-vm-go v1.5.17-0.20231025114923-cc9dde7ff309 h1:NWhUD87WqZtUbEqocvbBrqMMlfAirzMu56YuLJH5sJ4= github.com/multiversx/mx-chain-vm-go v1.5.17-0.20231025114923-cc9dde7ff309/go.mod h1:pSLANhxTDnEoclJ8FQh5EzKiyT/W2vPogkScaNcNmng= github.com/multiversx/mx-chain-vm-v1_2-go v1.2.61 h1:7c3VRhr5JDu7qs3AkmKQu7DzWGGIoiHfSIMrzw3x5Ao= From 1b86927b7b7b22b5e1af74c773abb433ddf828a4 Mon Sep 17 00:00:00 2001 From: Iuga Mihai Date: Thu, 26 Oct 2023 10:58:51 +0300 Subject: [PATCH 6/7] latest version --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 198cfa18425..ab3d2d09c5e 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/multiversx/mx-chain-logger-go v1.0.13 github.com/multiversx/mx-chain-scenario-go v1.2.1 github.com/multiversx/mx-chain-storage-go v1.0.13 - github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20231025141330-60c8247a3ade + github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20231026074956-dc87e69ac18a github.com/multiversx/mx-chain-vm-go v1.5.17-0.20231025114923-cc9dde7ff309 github.com/multiversx/mx-chain-vm-v1_2-go v1.2.61 github.com/multiversx/mx-chain-vm-v1_3-go v1.3.62 diff --git a/go.sum b/go.sum index 795bb2195a5..01e68604c6c 100644 --- a/go.sum +++ b/go.sum @@ -398,8 +398,8 @@ github.com/multiversx/mx-chain-scenario-go v1.2.1 h1:9eC6VcOEAKRRKZ7EbSWPLzCdNIM github.com/multiversx/mx-chain-scenario-go v1.2.1/go.mod h1:EuZY7DpNFHVNSxJR8dKE1z2I8gBYfEFFPSwNUOXptqE= github.com/multiversx/mx-chain-storage-go v1.0.13 h1:i41VPDJZ0pn5gf18zTXrac5xeiolUOztNuzL3wEXRuI= github.com/multiversx/mx-chain-storage-go v1.0.13/go.mod h1:sJ2q49tgjxNpMpsHysjABqCAB0FLBmDblbjBkQ8XfmA= -github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20231025141330-60c8247a3ade h1:Ug3P6JCSmMKZohhnpz5x4RsNs78MJgX+kgBAyQ6s0PU= -github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20231025141330-60c8247a3ade/go.mod h1:sqkKMCnwkWl8DURdb9q7pctK8IANghdHY1KJLE0ox2c= +github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20231026074956-dc87e69ac18a h1:SPhGTV4nb6qarq83SRNGCaX8PXZJ36ntZQZNi95yY9g= +github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20231026074956-dc87e69ac18a/go.mod h1:sqkKMCnwkWl8DURdb9q7pctK8IANghdHY1KJLE0ox2c= github.com/multiversx/mx-chain-vm-go v1.5.17-0.20231025114923-cc9dde7ff309 h1:NWhUD87WqZtUbEqocvbBrqMMlfAirzMu56YuLJH5sJ4= github.com/multiversx/mx-chain-vm-go v1.5.17-0.20231025114923-cc9dde7ff309/go.mod h1:pSLANhxTDnEoclJ8FQh5EzKiyT/W2vPogkScaNcNmng= github.com/multiversx/mx-chain-vm-v1_2-go v1.2.61 h1:7c3VRhr5JDu7qs3AkmKQu7DzWGGIoiHfSIMrzw3x5Ao= From 906ff281ff952f1537f93bdfe458420f44e178c9 Mon Sep 17 00:00:00 2001 From: Iuga Mihai Date: Fri, 27 Oct 2023 12:24:10 +0300 Subject: [PATCH 7/7] go mod tidy --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index ab3d2d09c5e..8f32d663f1a 100644 --- a/go.mod +++ b/go.mod @@ -20,8 +20,8 @@ require ( github.com/multiversx/mx-chain-logger-go v1.0.13 github.com/multiversx/mx-chain-scenario-go v1.2.1 github.com/multiversx/mx-chain-storage-go v1.0.13 - github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20231026074956-dc87e69ac18a - github.com/multiversx/mx-chain-vm-go v1.5.17-0.20231025114923-cc9dde7ff309 + github.com/multiversx/mx-chain-vm-common-go v1.5.7 + github.com/multiversx/mx-chain-vm-go v1.5.18 github.com/multiversx/mx-chain-vm-v1_2-go v1.2.61 github.com/multiversx/mx-chain-vm-v1_3-go v1.3.62 github.com/multiversx/mx-chain-vm-v1_4-go v1.4.88 diff --git a/go.sum b/go.sum index 01e68604c6c..f1656c727c6 100644 --- a/go.sum +++ b/go.sum @@ -398,10 +398,10 @@ github.com/multiversx/mx-chain-scenario-go v1.2.1 h1:9eC6VcOEAKRRKZ7EbSWPLzCdNIM github.com/multiversx/mx-chain-scenario-go v1.2.1/go.mod h1:EuZY7DpNFHVNSxJR8dKE1z2I8gBYfEFFPSwNUOXptqE= github.com/multiversx/mx-chain-storage-go v1.0.13 h1:i41VPDJZ0pn5gf18zTXrac5xeiolUOztNuzL3wEXRuI= github.com/multiversx/mx-chain-storage-go v1.0.13/go.mod h1:sJ2q49tgjxNpMpsHysjABqCAB0FLBmDblbjBkQ8XfmA= -github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20231026074956-dc87e69ac18a h1:SPhGTV4nb6qarq83SRNGCaX8PXZJ36ntZQZNi95yY9g= -github.com/multiversx/mx-chain-vm-common-go v1.5.6-0.20231026074956-dc87e69ac18a/go.mod h1:sqkKMCnwkWl8DURdb9q7pctK8IANghdHY1KJLE0ox2c= -github.com/multiversx/mx-chain-vm-go v1.5.17-0.20231025114923-cc9dde7ff309 h1:NWhUD87WqZtUbEqocvbBrqMMlfAirzMu56YuLJH5sJ4= -github.com/multiversx/mx-chain-vm-go v1.5.17-0.20231025114923-cc9dde7ff309/go.mod h1:pSLANhxTDnEoclJ8FQh5EzKiyT/W2vPogkScaNcNmng= +github.com/multiversx/mx-chain-vm-common-go v1.5.7 h1:GiT2MWG2aCQX59iOk5waB+z7XSLHH7N5xO8b91j6L6s= +github.com/multiversx/mx-chain-vm-common-go v1.5.7/go.mod h1:sqkKMCnwkWl8DURdb9q7pctK8IANghdHY1KJLE0ox2c= +github.com/multiversx/mx-chain-vm-go v1.5.18 h1:jLgB/9vcqkQz+2P/lFYIfrubDT5gErn+ioPd74+nga8= +github.com/multiversx/mx-chain-vm-go v1.5.18/go.mod h1:uZ4uinTCa2r3UT1WwbGg6yMq5HLeivHnFemmPG/4V+o= github.com/multiversx/mx-chain-vm-v1_2-go v1.2.61 h1:7c3VRhr5JDu7qs3AkmKQu7DzWGGIoiHfSIMrzw3x5Ao= github.com/multiversx/mx-chain-vm-v1_2-go v1.2.61/go.mod h1:bQFh+KuUIEBmCfKJ0qVN2+DbRRbAqW0huKfHpiTbyEE= github.com/multiversx/mx-chain-vm-v1_3-go v1.3.62 h1:rQaWRbrQwrEhSN0ZEQQ0JAbttgi+OrMf/CLziWpRUCA=