From c938011c1bab98936b25a3502477cd046ee317ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 23 Nov 2023 14:08:00 +0200 Subject: [PATCH 01/11] Add mandos test for paymaster --- test/paymaster/output/paymaster.wasm | Bin 0 -> 4286 bytes .../test_forward_call_wegld.scen.json | 179 ++++++++++++++++++ 2 files changed, 179 insertions(+) create mode 100755 test/paymaster/output/paymaster.wasm create mode 100644 test/paymaster/scenarios/test_forward_call_wegld.scen.json diff --git a/test/paymaster/output/paymaster.wasm b/test/paymaster/output/paymaster.wasm new file mode 100755 index 0000000000000000000000000000000000000000..2e8d56eec55427d940d533140fe965f88471e0ff GIT binary patch literal 4286 zcmai1O>7)V6@FFKJ<~Hiwktm*j^o`_&zfb-CL{~N2`hwLPMqvdl8s1MaX_*sGi}FX zd&cf*C$WS)4lz*<9NT|z)*>BZtiwmUz@vC@5V}&|1cUI5u&HZs$zyT8G%32 zc!tM7w*R~z@V6$(isdRzNir0U@B&q3MsEz9BOn?qH_|BWkA;;?An5{_4`eTrS@h7D zk>R0y+I|e-#54+rAObd!9_F`8;CP9wUarasmMZLMipTc9)w&JR1jFEtd*hiqNiroX z5HD?|Wj$Sl4y#)e6n=w+8VD^}bJ?5bP}-yV#VUI#nUCy`K~mZ9XRt=Qp$;g76{8v7 zixE3|VoG}K0wNIpNC=hN=TDHFhS#N8c);#|-gvqc6)Z(cVZwT?YS9$l8WP602w%l` zMq%hIeHoS-za}eH#SW^0gKF17%)mj2Ek>$BAsc4oz!r#dt`5OM_=6B1*HNAjD3ZEj z>2hc|;wP$5t!q%}>1e-{@OJ}`6e6yW&GQfOK*S%+)E@5eaQoBZgPBoB-QIpS@?a)- zxWf~{Bg`=Y<53=ikLfjxu^glGk9Kx;&Zz*A64#LjobuU&cW%5fx`Pjde|EPMw5dPdS>XHLKgTZ00J?D>BynhFJp)-k8|klIDFBk zA|EfF{!&zMY>p19LL9yi#J!*aDA=Gf4Es|uz+1s7u!d2*zP}hU6uELjRRYVz7$f~< zNM=+S2{J!C{S_mOD_Oi%A~ut;f&~B@4ZudbV8aZ+7XDmFvDL3Yhlk8n1dxh!EsVsboOO0iZDK1B!FTl6wFpcL4=a45+ZgPkd&Ct;)Ia^3_`GU!Pot~9tjo=Q>Z zA@S-G76_nnr~4^{9 z#w4#X9)lP`V6Es3nOHJ@Bw=HQ>HonUB4BDgLQ^#`P~w%{H445s_hjy#bX}wGo^bAE zQF~8Fe_xHm0U){R0l8J5$H7%^%OT&D(BATA*u%Wt`scl8Zv!Zx)Vbpq&;W{1ei$vz z^*MA0eTrSeHrFzq8=0bOC2}B-paYnw$d50gEU zpjbee?6TH&IYR0Y{VAEsY3yaM&T=m8Giu@GBupyc8{mufSCiY=?0_$XuqJneJ~kyk z0DL(+Pw;C>Q}U@m;)U*z?tnGKI2=L|>bS?%+@*^#POtPm*P#@wQ$#INTl|DSC zKZl@}7&Z!DsgL0GRUD;ocp98F1|x%QTc5z+IQ+A}MIny6!-&+c=%Xmj#lZm`hcFz7 zPS`~~I>rh3Nbt!-5i&-OYuL4-hZ2R%7nXmBdVaGs&A8EN#wO;QvZ+nJX3|c_EW~$B zpQFnJ+^;qVl)Fi%y=dAStGD9BbQT5^yZ1uem;1M?{QA82wLiX^U5ej{8)m89jPIGw zM#}PV@m`E?)teBU)HltFyBIfd6-?rl`evNW)p6;*c{@&Gv(z Date: Thu, 23 Nov 2023 14:14:41 +0200 Subject: [PATCH 02/11] Paymaster wasm now uses async call --- test/paymaster/output/paymaster.wasm | Bin 4286 -> 7509 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/test/paymaster/output/paymaster.wasm b/test/paymaster/output/paymaster.wasm index 2e8d56eec55427d940d533140fe965f88471e0ff..b339e8384f4482b8fde6e9245942f3a9ec366d15 100755 GIT binary patch literal 7509 zcma)BTWlNIc|MmRInt2UvDe*|Wo>h2;!UK~UMucKcI8c1M_$?M_}aBL^+N!OCdU#f ziIhpomm)B=wXtyfv?z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f4Es|uz+1s7u!d2*zP}hU6uELjRRYVz7$f~< zNM=+S2{J!C{S_mOD_Oi%A~ut;f&~B@4ZudbV8aZ+7XDmFvDL3Yhlk8n1dxh!EsVsboOO0iZDK1B!FTl6wFpcL4=a45+ZgPkd&Ct;)Ia^3_`GU!Pot~9tjo=Q>Z zA@S-G76_nnr~4^{9 z#w4#X9)lP`V6Es3nOHJ@Bw=HQ>HonUB4BDgLQ^#`P~w%{H445s_hjy#bX}wGo^bAE zQF~8Fe_xHm0U){R0l8J5$H7%^%OT&D(BATA*u%Wt`scl8Zv!Zx)Vbpq&;W{1ei$vz z^*MA0eTrSeHrFzq8=0bOC2}B-paYnw$d50gEU zpjbee?6TH&IYR0Y{VAEsY3yaM&T=m8Giu@GBupyc8{mufSCiY=?0_$XuqJneJ~kyk z0DL(+Pw;C>Q}U@m;)U*z?tnGKI2=L|>bS?%+@*^#POtPm*P#@wQ$#INTl|DSC zKZl@}7&Z!DsgL0GRUD;ocp98F1|x%QTc5z+IQ+A}MIny6!-&+c=%Xmj#lZm`hcFz7 zPS`~~I>rh3Nbt!-5i&-OYuL4-hZ2R%7nXmBdVaGs&A8EN#wO;QvZ+nJX3|c_EW~$B zpQFnJ+^;qVl)Fi%y=dAStGD9BbQT5^yZ1uem;1M?{QA82wLiX^U5ej{8)m89jPIGw zM#}PV@m`E?)teBU)HltFyBIfd6-?rl`evNW)p6;*c{@&Gv(z Date: Thu, 23 Nov 2023 15:50:57 +0200 Subject: [PATCH 03/11] fixed back transfers on callBack. --- .../json/scenariosContracts_test.go | 7 ++++++ vmhost/contexts/managedType.go | 24 +++++++++++++++---- vmhost/hostCore/execution.go | 1 + vmhost/interface.go | 1 + 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/integrationTests/json/scenariosContracts_test.go b/integrationTests/json/scenariosContracts_test.go index d1b83a964..826e630f7 100644 --- a/integrationTests/json/scenariosContracts_test.go +++ b/integrationTests/json/scenariosContracts_test.go @@ -119,3 +119,10 @@ func TestCAttestation(t *testing.T) { Run(). CheckNoError() } + +func TestRustPaymaster(t *testing.T) { + ScenariosTest(t). + Folder("paymaster/scenarios"). + Run(). + CheckNoError() +} diff --git a/vmhost/contexts/managedType.go b/vmhost/contexts/managedType.go index 37baf4ad3..edeb84c8f 100644 --- a/vmhost/contexts/managedType.go +++ b/vmhost/contexts/managedType.go @@ -5,6 +5,7 @@ import ( "crypto/elliptic" "encoding/binary" "errors" + "github.com/multiversx/mx-chain-core-go/data/vm" "io" basicMath "math" "math/big" @@ -139,7 +140,7 @@ func (context *managedTypesContext) InitState() { // PushState appends the values map to the state stack func (context *managedTypesContext) PushState() { newBigIntState, newBigFloatState, newEcState, newmBufferState, newmMapState := context.clone() - newTransfers := context.cloneBackTransfers() + newTransfers := cloneBackTransfers(context.managedTypesValues.backTransfers) context.managedTypesStack = append(context.managedTypesStack, managedTypesState{ bigIntValues: newBigIntState, bigFloatValues: newBigFloatState, @@ -150,6 +151,21 @@ func (context *managedTypesContext) PushState() { }) } +// PopBackTransferIfAsyncCallBack copies the back transfer from the top of the stack in case of callbacks +func (context *managedTypesContext) PopBackTransferIfAsyncCallBack(vmInput *vmcommon.ContractCallInput) { + if vmInput.CallType != vm.AsynchronousCallBack { + return + } + + managedTypesStackLen := len(context.managedTypesStack) + if managedTypesStackLen == 0 { + return + } + + prevState := context.managedTypesStack[managedTypesStackLen-1] + context.managedTypesValues.backTransfers = cloneBackTransfers(prevState.backTransfers) +} + // PopSetActiveState removes the latest entry from the state stack and sets it as the current values map func (context *managedTypesContext) PopSetActiveState() { managedTypesStackLen := len(context.managedTypesStack) @@ -797,7 +813,7 @@ func (context *managedTypesContext) AddValueOnlyBackTransfer(value *big.Int) { // GetBackTransfers returns all ESDT transfers and accumulated value as well, will clean accumulated values func (context *managedTypesContext) GetBackTransfers() ([]*vmcommon.ESDTTransfer, *big.Int) { - clonedTransfers := context.cloneBackTransfers() + clonedTransfers := cloneBackTransfers(context.managedTypesValues.backTransfers) context.managedTypesValues.backTransfers = backTransfers{ ESDTTransfers: make([]*vmcommon.ESDTTransfer, 0), CallValue: big.NewInt(0), @@ -806,9 +822,7 @@ func (context *managedTypesContext) GetBackTransfers() ([]*vmcommon.ESDTTransfer return clonedTransfers.ESDTTransfers, clonedTransfers.CallValue } -func (context *managedTypesContext) cloneBackTransfers() backTransfers { - currentBackTransfers := context.managedTypesValues.backTransfers - +func cloneBackTransfers(currentBackTransfers backTransfers) backTransfers { newBackTransfers := backTransfers{ ESDTTransfers: make([]*vmcommon.ESDTTransfer, len(currentBackTransfers.ESDTTransfers)), CallValue: big.NewInt(0).Set(currentBackTransfers.CallValue), diff --git a/vmhost/hostCore/execution.go b/vmhost/hostCore/execution.go index 3e21ce743..1eb04379e 100644 --- a/vmhost/hostCore/execution.go +++ b/vmhost/hostCore/execution.go @@ -448,6 +448,7 @@ func (host *vmHost) executeOnDestContextNoBuiltinFunction(input *vmcommon.Contra managedTypes, _, metering, output, runtime, async, storage := host.GetContexts() managedTypes.PushState() managedTypes.InitState() + managedTypes.PopBackTransferIfAsyncCallBack(input) output.PushState() output.CensorVMOutput() diff --git a/vmhost/interface.go b/vmhost/interface.go index e7edee399..03655d904 100644 --- a/vmhost/interface.go +++ b/vmhost/interface.go @@ -218,6 +218,7 @@ type ManagedTypesContext interface { GetBackTransfers() ([]*vmcommon.ESDTTransfer, *big.Int) AddValueOnlyBackTransfer(value *big.Int) AddBackTransfers(transfers []*vmcommon.ESDTTransfer) + PopBackTransferIfAsyncCallBack(vmInput *vmcommon.ContractCallInput) } // OutputContext defines the functionality needed for interacting with the output context From 72fc32c135147631c743f3e0ed91cb1520998975 Mon Sep 17 00:00:00 2001 From: robertsasu Date: Fri, 24 Nov 2023 11:57:14 +0200 Subject: [PATCH 04/11] fixed back transfers on callBack. --- vmhost/contexts/instanceTracker.go | 23 +++++++----- vmhost/contexts/instanceTracker_test.go | 26 +++++++------- vmhost/contexts/runtime.go | 47 ++++++++++++++++--------- 3 files changed, 59 insertions(+), 37 deletions(-) diff --git a/vmhost/contexts/instanceTracker.go b/vmhost/contexts/instanceTracker.go index 042a5c766..a9277fdfa 100644 --- a/vmhost/contexts/instanceTracker.go +++ b/vmhost/contexts/instanceTracker.go @@ -2,6 +2,7 @@ package contexts import ( "bytes" + "errors" "fmt" "github.com/multiversx/mx-chain-core-go/core/check" @@ -15,6 +16,8 @@ var _ vmhost.InstanceTracker = (*instanceTracker)(nil) type instanceCacheLevel int +var errTooManyInstances = errors.New("too many instances") + const ( // Warm indicates that the instance to track is a warm instance Warm instanceCacheLevel = iota @@ -178,27 +181,27 @@ func (tracker *instanceTracker) TrackedInstances() map[string]executor.Instance // UseWarmInstance attempts to retrieve a warm instance for the given codeHash // and to set it as active; returns false if not possible -func (tracker *instanceTracker) UseWarmInstance(codeHash []byte, newCode bool) bool { +func (tracker *instanceTracker) UseWarmInstance(codeHash []byte, newCode bool) (bool, error) { instance, ok := tracker.GetWarmInstance(codeHash) if !ok { - return false + return false, nil } ok = instance.Reset() if !ok { tracker.warmInstanceCache.Remove(codeHash) - return false + return false, nil } if newCode { // A warm instance was found, but newCode == true, meaning this is an // upgrade; the old warm instance must be cleaned tracker.ForceCleanInstance(false) - return false + return false, nil } - tracker.SetNewInstance(instance, Warm) - return true + err := tracker.SetNewInstance(instance, Warm) + return true, err } // ForceCleanInstance cleans the active instance and evicts it from the @@ -237,7 +240,6 @@ func (tracker *instanceTracker) ForceCleanInstance(bypassWarmAndStackChecks bool // SaveAsWarmInstance saves the active instance into the internal warm instance cache func (tracker *instanceTracker) SaveAsWarmInstance() { lenCacheBeforeSaving := tracker.warmInstanceCache.Len() - codeHashInWarmCache := tracker.warmInstanceCache.Has(tracker.codeHash) if codeHashInWarmCache { @@ -289,13 +291,18 @@ func (tracker *instanceTracker) GetCodeSize() uint64 { } // SetNewInstance sets the given instance as active and tracks its creation -func (tracker *instanceTracker) SetNewInstance(instance executor.Instance, cacheLevel instanceCacheLevel) { +func (tracker *instanceTracker) SetNewInstance(instance executor.Instance, cacheLevel instanceCacheLevel) error { tracker.ReplaceInstance(instance) tracker.cacheLevel = cacheLevel if cacheLevel != Warm { tracker.updateNumRunningInstances(+1) } tracker.instances[instance.ID()] = instance + + if len(tracker.instances) >= tracker.warmInstanceCache.MaxSize()-1 { + return errTooManyInstances + } + return nil } // ReplaceInstance replaces the currently active instance with the given one diff --git a/vmhost/contexts/instanceTracker_test.go b/vmhost/contexts/instanceTracker_test.go index 373a7d439..0aaf4b152 100644 --- a/vmhost/contexts/instanceTracker_test.go +++ b/vmhost/contexts/instanceTracker_test.go @@ -17,7 +17,7 @@ func TestInstanceTracker_TrackInstance(t *testing.T) { AlreadyClean: false, } - iTracker.SetNewInstance(newInstance, Bytecode) + _ = iTracker.SetNewInstance(newInstance, Bytecode) iTracker.codeHash = []byte("testinst") require.False(t, iTracker.IsCodeHashOnTheStack(iTracker.codeHash)) @@ -38,7 +38,7 @@ func TestInstanceTracker_InitState(t *testing.T) { require.Equal(t, 0, iTracker.numRunningInstances) for i := 0; i < 5; i++ { - iTracker.SetNewInstance(mock.NewInstanceMock(nil), Bytecode) + _ = iTracker.SetNewInstance(mock.NewInstanceMock(nil), Bytecode) } require.Equal(t, 5, iTracker.numRunningInstances) @@ -63,7 +63,7 @@ func TestInstanceTracker_GetWarmInstance(t *testing.T) { testData := []string{"warm1", "bytecode1", "bytecode2", "warm2"} for _, codeHash := range testData { - iTracker.SetNewInstance(mock.NewInstanceMock([]byte(codeHash)), Bytecode) + _ = iTracker.SetNewInstance(mock.NewInstanceMock([]byte(codeHash)), Bytecode) iTracker.codeHash = []byte(codeHash) if strings.Contains(codeHash, "warm") { iTracker.SaveAsWarmInstance() @@ -95,7 +95,7 @@ func TestInstanceTracker_UseWarmInstance(t *testing.T) { testData := []string{"warm1", "bytecode1", "warm2", "bytecode2"} for _, codeHash := range testData { - iTracker.SetNewInstance(mock.NewInstanceMock([]byte(codeHash)), Bytecode) + _ = iTracker.SetNewInstance(mock.NewInstanceMock([]byte(codeHash)), Bytecode) iTracker.codeHash = []byte(codeHash) if strings.Contains(codeHash, "warm") { @@ -106,7 +106,7 @@ func TestInstanceTracker_UseWarmInstance(t *testing.T) { require.Equal(t, []byte("bytecode2"), iTracker.CodeHash()) for _, codeHash := range testData { - ok := iTracker.UseWarmInstance([]byte(codeHash), false) + ok, _ := iTracker.UseWarmInstance([]byte(codeHash), false) if strings.Contains(codeHash, "warm") { require.True(t, ok) @@ -124,7 +124,7 @@ func TestInstanceTracker_IsCodeHashOnStack_Ok(t *testing.T) { testData := []string{"alpha", "beta", "alpha", "active"} for i, codeHash := range testData { - iTracker.SetNewInstance(mock.NewInstanceMock([]byte(codeHash)), Bytecode) + _ = iTracker.SetNewInstance(mock.NewInstanceMock([]byte(codeHash)), Bytecode) iTracker.codeHash = []byte(codeHash) if i < 2 || codeHash == "active" { iTracker.SaveAsWarmInstance() @@ -157,7 +157,7 @@ func TestInstanceTracker_PopSetActiveSelfScenario(t *testing.T) { testData := []string{"alpha", "alpha", "alpha", "alpha", "active"} for i, codeHash := range testData { - iTracker.SetNewInstance(mock.NewInstanceMock([]byte(codeHash)), Bytecode) + _ = iTracker.SetNewInstance(mock.NewInstanceMock([]byte(codeHash)), Bytecode) iTracker.codeHash = []byte(codeHash) if i == 0 || codeHash == "active" { iTracker.SaveAsWarmInstance() @@ -187,7 +187,7 @@ func TestInstanceTracker_PopSetActiveSimpleScenario(t *testing.T) { testData := []string{"alpha", "beta", "alpha", "beta", "active"} for i, codeHash := range testData { - iTracker.SetNewInstance(mock.NewInstanceMock([]byte(codeHash)), Bytecode) + _ = iTracker.SetNewInstance(mock.NewInstanceMock([]byte(codeHash)), Bytecode) iTracker.codeHash = []byte(codeHash) if i < 2 || codeHash == "active" { iTracker.SaveAsWarmInstance() @@ -226,7 +226,7 @@ func TestInstanceTracker_PopSetActiveComplexScenario(t *testing.T) { testData := []string{"alpha", "beta", "gamma", "beta", "gamma", "delta", "alpha", "active"} for i, codeHash := range testData { - iTracker.SetNewInstance(mock.NewInstanceMock([]byte(codeHash)), Bytecode) + _ = iTracker.SetNewInstance(mock.NewInstanceMock([]byte(codeHash)), Bytecode) iTracker.codeHash = []byte(codeHash) if i < 3 || codeHash == "delta" || codeHash == "active" { iTracker.SaveAsWarmInstance() @@ -255,7 +255,7 @@ func TestInstanceTracker_PopSetActiveWarmOnlyScenario(t *testing.T) { testData := []string{"alpha", "beta", "gamma", "delta", "active"} for _, codeHash := range testData { - iTracker.SetNewInstance(mock.NewInstanceMock([]byte(codeHash)), Bytecode) + _ = iTracker.SetNewInstance(mock.NewInstanceMock([]byte(codeHash)), Bytecode) iTracker.codeHash = []byte(codeHash) iTracker.SaveAsWarmInstance() @@ -283,7 +283,7 @@ func TestInstanceTracker_ForceCleanInstanceWithBypass(t *testing.T) { testData := []string{"warm1", "bytecode1"} for _, codeHash := range testData { - iTracker.SetNewInstance(mock.NewInstanceMock([]byte(codeHash)), Bytecode) + _ = iTracker.SetNewInstance(mock.NewInstanceMock([]byte(codeHash)), Bytecode) iTracker.codeHash = []byte(codeHash) if strings.Contains(codeHash, "warm") { @@ -298,7 +298,7 @@ func TestInstanceTracker_ForceCleanInstanceWithBypass(t *testing.T) { iTracker.ForceCleanInstance(true) require.Nil(t, iTracker.instance) - iTracker.UseWarmInstance([]byte("warm1"), false) + _, _ = iTracker.UseWarmInstance([]byte("warm1"), false) require.NotNil(t, iTracker.instance) iTracker.ForceCleanInstance(true) @@ -312,7 +312,7 @@ func TestInstanceTracker_DoubleForceClean(t *testing.T) { iTracker, err := NewInstanceTracker() require.Nil(t, err) - iTracker.SetNewInstance(mock.NewInstanceMock(nil), Bytecode) + _ = iTracker.SetNewInstance(mock.NewInstanceMock(nil), Bytecode) require.NotNil(t, iTracker.instance) require.Equal(t, 1, iTracker.numRunningInstances) diff --git a/vmhost/contexts/runtime.go b/vmhost/contexts/runtime.go index e2c0a04cd..f2da057d8 100644 --- a/vmhost/contexts/runtime.go +++ b/vmhost/contexts/runtime.go @@ -152,12 +152,18 @@ func (context *runtimeContext) StartWasmerInstance(contract []byte, gasLimit uin logRuntime.Trace("code was new", "new", newCode) }() - warmInstanceUsed := context.useWarmInstanceIfExists(gasLimit, newCode) + warmInstanceUsed, err := context.useWarmInstanceIfExists(gasLimit, newCode) + if err != nil { + return err + } if warmInstanceUsed { return nil } - compiledCodeUsed := context.makeInstanceFromCompiledCode(gasLimit, newCode) + compiledCodeUsed, err := context.makeInstanceFromCompiledCode(gasLimit, newCode) + if err != nil { + return err + } if compiledCodeUsed { return nil } @@ -165,17 +171,17 @@ func (context *runtimeContext) StartWasmerInstance(contract []byte, gasLimit uin return context.makeInstanceFromContractByteCode(contract, gasLimit, newCode) } -func (context *runtimeContext) makeInstanceFromCompiledCode(gasLimit uint64, newCode bool) bool { +func (context *runtimeContext) makeInstanceFromCompiledCode(gasLimit uint64, newCode bool) (bool, error) { codeHash := context.iTracker.CodeHash() if newCode || len(codeHash) == 0 { - return false + return false, nil } blockchain := context.host.Blockchain() found, compiledCode := blockchain.GetCompiledCode(codeHash) if !found { logRuntime.Trace("instance creation", "code", "cached compilation", "error", "compiled code was not found") - return false + return false, nil } gasSchedule := context.host.Metering().GasSchedule() @@ -191,10 +197,13 @@ func (context *runtimeContext) makeInstanceFromCompiledCode(gasLimit uint64, new newInstance, err := context.vmExecutor.NewInstanceFromCompiledCodeWithOptions(compiledCode, options) if err != nil { logRuntime.Error("instance creation", "from", "cached compilation", "error", err) - return false + return false, nil } - context.iTracker.SetNewInstance(newInstance, Precompiled) + err = context.iTracker.SetNewInstance(newInstance, Precompiled) + if err != nil { + return false, err + } context.verifyCode = false context.saveWarmInstance() @@ -202,7 +211,7 @@ func (context *runtimeContext) makeInstanceFromCompiledCode(gasLimit uint64, new "id", context.iTracker.Instance().ID(), "codeHash", context.iTracker.codeHash, ) - return true + return true, nil } func (context *runtimeContext) makeInstanceFromContractByteCode(contract []byte, gasLimit uint64, newCode bool) error { @@ -223,7 +232,10 @@ func (context *runtimeContext) makeInstanceFromContractByteCode(contract []byte, return err } - context.iTracker.SetNewInstance(newInstance, Bytecode) + err = context.iTracker.SetNewInstance(newInstance, Bytecode) + if err != nil { + return err + } if newCode || len(context.iTracker.CodeHash()) == 0 { codeHash := context.hasher.Compute(string(contract)) @@ -249,23 +261,26 @@ func (context *runtimeContext) makeInstanceFromContractByteCode(contract []byte, return nil } -func (context *runtimeContext) useWarmInstanceIfExists(gasLimit uint64, newCode bool) bool { +func (context *runtimeContext) useWarmInstanceIfExists(gasLimit uint64, newCode bool) (bool, error) { if !WarmInstancesEnabled { - return false + return false, nil } codeHash := context.iTracker.CodeHash() if newCode || len(codeHash) == 0 { - return false + return false, nil } if context.isContractOrCodeHashOnTheStack() { - return false + return false, nil } - ok := context.iTracker.UseWarmInstance(codeHash, newCode) + ok, err := context.iTracker.UseWarmInstance(codeHash, newCode) + if err != nil { + return false, err + } if !ok { - return false + return false, nil } context.SetPointsUsed(0) @@ -273,7 +288,7 @@ func (context *runtimeContext) useWarmInstanceIfExists(gasLimit uint64, newCode context.SetRuntimeBreakpointValue(vmhost.BreakpointNone) context.verifyCode = false logRuntime.Trace("start instance", "from", "warm", "id", context.iTracker.Instance().ID()) - return true + return true, nil } // GetSCCode returns the SC code of the current SC. From 78ecab4e42c960053424aee72c11e42230cf0d43 Mon Sep 17 00:00:00 2001 From: robertsasu Date: Fri, 24 Nov 2023 11:59:39 +0200 Subject: [PATCH 05/11] goimports --- vmhost/contexts/managedType.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vmhost/contexts/managedType.go b/vmhost/contexts/managedType.go index edeb84c8f..40e26aa0b 100644 --- a/vmhost/contexts/managedType.go +++ b/vmhost/contexts/managedType.go @@ -5,12 +5,12 @@ import ( "crypto/elliptic" "encoding/binary" "errors" - "github.com/multiversx/mx-chain-core-go/data/vm" "io" basicMath "math" "math/big" "github.com/multiversx/mx-chain-core-go/core/check" + "github.com/multiversx/mx-chain-core-go/data/vm" logger "github.com/multiversx/mx-chain-logger-go" vmcommon "github.com/multiversx/mx-chain-vm-common-go" "github.com/multiversx/mx-chain-vm-go/math" From 071ae47774a36cbad0a5853a1228780dcea7a57a Mon Sep 17 00:00:00 2001 From: robertsasu Date: Fri, 24 Nov 2023 15:53:28 +0200 Subject: [PATCH 06/11] use constant and safer code --- vmhost/contexts/instanceTracker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vmhost/contexts/instanceTracker.go b/vmhost/contexts/instanceTracker.go index a9277fdfa..f0fef8238 100644 --- a/vmhost/contexts/instanceTracker.go +++ b/vmhost/contexts/instanceTracker.go @@ -299,7 +299,7 @@ func (tracker *instanceTracker) SetNewInstance(instance executor.Instance, cache } tracker.instances[instance.ID()] = instance - if len(tracker.instances) >= tracker.warmInstanceCache.MaxSize()-1 { + if len(tracker.instances) >= warmCacheSize-1 { return errTooManyInstances } return nil From 174096f8f8a739d67ee1d56b8861c093e081efe3 Mon Sep 17 00:00:00 2001 From: Sorin Stanculeanu Date: Tue, 12 Dec 2023 11:42:11 +0200 Subject: [PATCH 07/11] updated vm-common --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 3311666c2..374474bf2 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/multiversx/mx-chain-crypto-go v1.2.8 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-vm-common-go v1.5.8 + github.com/multiversx/mx-chain-vm-common-go v1.5.9-0.20231212092756-29652e452730 github.com/multiversx/mx-components-big-int v1.0.0 github.com/pelletier/go-toml v1.9.3 github.com/stretchr/testify v1.8.1 diff --git a/go.sum b/go.sum index 3ba9f5532..9b955a8bd 100644 --- a/go.sum +++ b/go.sum @@ -89,8 +89,8 @@ github.com/multiversx/mx-chain-logger-go v1.0.13 h1:eru/TETo0MkO4ZTnXsQDKf4PBRpA github.com/multiversx/mx-chain-logger-go v1.0.13/go.mod h1:MZJhTAtZTJxT+yK2EHc4ZW3YOHUc1UdjCD0iahRNBZk= github.com/multiversx/mx-chain-scenario-go v1.2.1 h1:9eC6VcOEAKRRKZ7EbSWPLzCdNIMWwuNBtAZlgR4cSMA= github.com/multiversx/mx-chain-scenario-go v1.2.1/go.mod h1:EuZY7DpNFHVNSxJR8dKE1z2I8gBYfEFFPSwNUOXptqE= -github.com/multiversx/mx-chain-vm-common-go v1.5.8 h1:IRHB9/DasGrK5HU8TVeeLrEWt7tcb9zfnzHRLa6KES8= -github.com/multiversx/mx-chain-vm-common-go v1.5.8/go.mod h1:sqkKMCnwkWl8DURdb9q7pctK8IANghdHY1KJLE0ox2c= +github.com/multiversx/mx-chain-vm-common-go v1.5.9-0.20231212092756-29652e452730 h1:wLLvxHPOfF73N7aJZF2ad14Zbb03wx1Km1NkmU/4SYY= +github.com/multiversx/mx-chain-vm-common-go v1.5.9-0.20231212092756-29652e452730/go.mod h1:sqkKMCnwkWl8DURdb9q7pctK8IANghdHY1KJLE0ox2c= 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/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= From 77d32301035b0d0f2b3550470833b0bd65920a22 Mon Sep 17 00:00:00 2001 From: Sorin Stanculeanu Date: Tue, 12 Dec 2023 13:15:34 +0200 Subject: [PATCH 08/11] updated vm-common --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 374474bf2..70f01ee8e 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/multiversx/mx-chain-crypto-go v1.2.8 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-vm-common-go v1.5.9-0.20231212092756-29652e452730 + github.com/multiversx/mx-chain-vm-common-go v1.5.9-0.20231212111351-4580d85be731 github.com/multiversx/mx-components-big-int v1.0.0 github.com/pelletier/go-toml v1.9.3 github.com/stretchr/testify v1.8.1 diff --git a/go.sum b/go.sum index 9b955a8bd..7061ce645 100644 --- a/go.sum +++ b/go.sum @@ -89,8 +89,8 @@ github.com/multiversx/mx-chain-logger-go v1.0.13 h1:eru/TETo0MkO4ZTnXsQDKf4PBRpA github.com/multiversx/mx-chain-logger-go v1.0.13/go.mod h1:MZJhTAtZTJxT+yK2EHc4ZW3YOHUc1UdjCD0iahRNBZk= github.com/multiversx/mx-chain-scenario-go v1.2.1 h1:9eC6VcOEAKRRKZ7EbSWPLzCdNIMWwuNBtAZlgR4cSMA= github.com/multiversx/mx-chain-scenario-go v1.2.1/go.mod h1:EuZY7DpNFHVNSxJR8dKE1z2I8gBYfEFFPSwNUOXptqE= -github.com/multiversx/mx-chain-vm-common-go v1.5.9-0.20231212092756-29652e452730 h1:wLLvxHPOfF73N7aJZF2ad14Zbb03wx1Km1NkmU/4SYY= -github.com/multiversx/mx-chain-vm-common-go v1.5.9-0.20231212092756-29652e452730/go.mod h1:sqkKMCnwkWl8DURdb9q7pctK8IANghdHY1KJLE0ox2c= +github.com/multiversx/mx-chain-vm-common-go v1.5.9-0.20231212111351-4580d85be731 h1:9d1CaERpbMZHAPWEwNkudNC5q5OPKhNOCR78Z5X2kF4= +github.com/multiversx/mx-chain-vm-common-go v1.5.9-0.20231212111351-4580d85be731/go.mod h1:sqkKMCnwkWl8DURdb9q7pctK8IANghdHY1KJLE0ox2c= 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/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= From fab45d27280b3d0dbb5f28b452ac80d3118727d6 Mon Sep 17 00:00:00 2001 From: Sorin Stanculeanu Date: Wed, 13 Dec 2023 12:06:15 +0200 Subject: [PATCH 09/11] proper vm-common tag --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 70f01ee8e..7fcc27d8c 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/multiversx/mx-chain-crypto-go v1.2.8 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-vm-common-go v1.5.9-0.20231212111351-4580d85be731 + github.com/multiversx/mx-chain-vm-common-go v1.5.9 github.com/multiversx/mx-components-big-int v1.0.0 github.com/pelletier/go-toml v1.9.3 github.com/stretchr/testify v1.8.1 diff --git a/go.sum b/go.sum index 7061ce645..de0c8e638 100644 --- a/go.sum +++ b/go.sum @@ -89,8 +89,8 @@ github.com/multiversx/mx-chain-logger-go v1.0.13 h1:eru/TETo0MkO4ZTnXsQDKf4PBRpA github.com/multiversx/mx-chain-logger-go v1.0.13/go.mod h1:MZJhTAtZTJxT+yK2EHc4ZW3YOHUc1UdjCD0iahRNBZk= github.com/multiversx/mx-chain-scenario-go v1.2.1 h1:9eC6VcOEAKRRKZ7EbSWPLzCdNIMWwuNBtAZlgR4cSMA= github.com/multiversx/mx-chain-scenario-go v1.2.1/go.mod h1:EuZY7DpNFHVNSxJR8dKE1z2I8gBYfEFFPSwNUOXptqE= -github.com/multiversx/mx-chain-vm-common-go v1.5.9-0.20231212111351-4580d85be731 h1:9d1CaERpbMZHAPWEwNkudNC5q5OPKhNOCR78Z5X2kF4= -github.com/multiversx/mx-chain-vm-common-go v1.5.9-0.20231212111351-4580d85be731/go.mod h1:sqkKMCnwkWl8DURdb9q7pctK8IANghdHY1KJLE0ox2c= +github.com/multiversx/mx-chain-vm-common-go v1.5.9 h1:PnGimbMScV5WXFjumzAmcAcnWrw5e9PQABuIcKKUgZw= +github.com/multiversx/mx-chain-vm-common-go v1.5.9/go.mod h1:sqkKMCnwkWl8DURdb9q7pctK8IANghdHY1KJLE0ox2c= 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/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= From 964359cb8dd33a4e44ba462c7fa1bf228c392af2 Mon Sep 17 00:00:00 2001 From: Sorin Stanculeanu Date: Thu, 28 Dec 2023 08:41:04 +0200 Subject: [PATCH 10/11] updated vm-common-go --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 0a6a3a623..849d9e5fa 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/multiversx/mx-chain-logger-go v1.0.14-0.20231129101244-c44fa1c79b03 github.com/multiversx/mx-chain-scenario-go v1.2.2-0.20231129113427-ad3056f45296 github.com/multiversx/mx-chain-storage-go v1.0.14-0.20231129103407-a506e0debdd4 - github.com/multiversx/mx-chain-vm-common-go v1.5.9-0.20231129110322-d07a35163513 + github.com/multiversx/mx-chain-vm-common-go v1.5.10-0.20231228063156-8a06a0d170c5 github.com/multiversx/mx-components-big-int v1.0.0 github.com/pelletier/go-toml v1.9.3 github.com/stretchr/testify v1.8.1 diff --git a/go.sum b/go.sum index c5dedc444..58a55a607 100644 --- a/go.sum +++ b/go.sum @@ -91,8 +91,8 @@ github.com/multiversx/mx-chain-scenario-go v1.2.2-0.20231129113427-ad3056f45296 github.com/multiversx/mx-chain-scenario-go v1.2.2-0.20231129113427-ad3056f45296/go.mod h1:WocyahfHCC3oGILEVdRe7I4/+q/TLCORoTo1X4wGmF4= github.com/multiversx/mx-chain-storage-go v1.0.14-0.20231129103407-a506e0debdd4 h1:TvjyE4/jNoTewu/MPNi3TltxDuIWuvzrRufhgPW+W78= github.com/multiversx/mx-chain-storage-go v1.0.14-0.20231129103407-a506e0debdd4/go.mod h1:ioCT2oHQ+TyHQYpgjxzlUdy7dCdv56+w5HnBg9z96eY= -github.com/multiversx/mx-chain-vm-common-go v1.5.9-0.20231129110322-d07a35163513 h1:3Hm3MVIpiu4+j+aHiDOYBJBiQC62nF/rHHRJ8YIFOL4= -github.com/multiversx/mx-chain-vm-common-go v1.5.9-0.20231129110322-d07a35163513/go.mod h1:vgmpc/YegaUMAImR+WZ+kpJgv9qYF31oL12vVx/46i4= +github.com/multiversx/mx-chain-vm-common-go v1.5.10-0.20231228063156-8a06a0d170c5 h1:G7Aho0VAS9zNHKcRfeWXcbXf2PgnPHSW7EI2zEiyyvg= +github.com/multiversx/mx-chain-vm-common-go v1.5.10-0.20231228063156-8a06a0d170c5/go.mod h1:vgmpc/YegaUMAImR+WZ+kpJgv9qYF31oL12vVx/46i4= 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/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= From d4fdbb806ad771d19d97c6815cf7e841468f74f7 Mon Sep 17 00:00:00 2001 From: Sorin Stanculeanu Date: Thu, 28 Dec 2023 09:12:21 +0200 Subject: [PATCH 11/11] updated vm-common-go to latest --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 849d9e5fa..ad3752e83 100644 --- a/go.mod +++ b/go.mod @@ -8,12 +8,12 @@ require ( github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 github.com/gogo/protobuf v1.3.2 github.com/mitchellh/mapstructure v1.5.0 - github.com/multiversx/mx-chain-core-go v1.2.19-0.20231129100534-356aa234f4ff + github.com/multiversx/mx-chain-core-go v1.2.19-0.20231214115026-a1e7279b14f1 github.com/multiversx/mx-chain-crypto-go v1.2.10-0.20231129101537-ef355850e34b github.com/multiversx/mx-chain-logger-go v1.0.14-0.20231129101244-c44fa1c79b03 github.com/multiversx/mx-chain-scenario-go v1.2.2-0.20231129113427-ad3056f45296 github.com/multiversx/mx-chain-storage-go v1.0.14-0.20231129103407-a506e0debdd4 - github.com/multiversx/mx-chain-vm-common-go v1.5.10-0.20231228063156-8a06a0d170c5 + github.com/multiversx/mx-chain-vm-common-go v1.5.10-0.20231228070003-ae14e1e0adfa github.com/multiversx/mx-components-big-int v1.0.0 github.com/pelletier/go-toml v1.9.3 github.com/stretchr/testify v1.8.1 diff --git a/go.sum b/go.sum index 58a55a607..6935e7741 100644 --- a/go.sum +++ b/go.sum @@ -81,8 +81,8 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/multiversx/mx-chain-core-go v1.2.19-0.20231129100534-356aa234f4ff h1:Iss44e+2C4vGtQ5sU3lOqDQ+dxvwlO+Z3mSbC8T1J64= -github.com/multiversx/mx-chain-core-go v1.2.19-0.20231129100534-356aa234f4ff/go.mod h1:B5zU4MFyJezmEzCsAHE9YNULmGCm2zbPHvl9hazNxmE= +github.com/multiversx/mx-chain-core-go v1.2.19-0.20231214115026-a1e7279b14f1 h1:8rz1ZpRAsWVxSEBy7PJIUStQMKiHs3I4mvpRmHUpsbI= +github.com/multiversx/mx-chain-core-go v1.2.19-0.20231214115026-a1e7279b14f1/go.mod h1:B5zU4MFyJezmEzCsAHE9YNULmGCm2zbPHvl9hazNxmE= github.com/multiversx/mx-chain-crypto-go v1.2.10-0.20231129101537-ef355850e34b h1:TIE6it719ZIW0E1bFgPAgE+U3zPSkPfAloFYEIeOL3U= github.com/multiversx/mx-chain-crypto-go v1.2.10-0.20231129101537-ef355850e34b/go.mod h1:Ap6p7QZFtwPlb++OvCG+85BfuZ+bLP/JtQp6EwjWJsI= github.com/multiversx/mx-chain-logger-go v1.0.14-0.20231129101244-c44fa1c79b03 h1:krjJTyN9jrFTK0goMGFdgvJGy6bYSqe8EtI/HCceUmU= @@ -91,8 +91,8 @@ github.com/multiversx/mx-chain-scenario-go v1.2.2-0.20231129113427-ad3056f45296 github.com/multiversx/mx-chain-scenario-go v1.2.2-0.20231129113427-ad3056f45296/go.mod h1:WocyahfHCC3oGILEVdRe7I4/+q/TLCORoTo1X4wGmF4= github.com/multiversx/mx-chain-storage-go v1.0.14-0.20231129103407-a506e0debdd4 h1:TvjyE4/jNoTewu/MPNi3TltxDuIWuvzrRufhgPW+W78= github.com/multiversx/mx-chain-storage-go v1.0.14-0.20231129103407-a506e0debdd4/go.mod h1:ioCT2oHQ+TyHQYpgjxzlUdy7dCdv56+w5HnBg9z96eY= -github.com/multiversx/mx-chain-vm-common-go v1.5.10-0.20231228063156-8a06a0d170c5 h1:G7Aho0VAS9zNHKcRfeWXcbXf2PgnPHSW7EI2zEiyyvg= -github.com/multiversx/mx-chain-vm-common-go v1.5.10-0.20231228063156-8a06a0d170c5/go.mod h1:vgmpc/YegaUMAImR+WZ+kpJgv9qYF31oL12vVx/46i4= +github.com/multiversx/mx-chain-vm-common-go v1.5.10-0.20231228070003-ae14e1e0adfa h1:xdDeUC4yOfiUwctkYioYMjjigBZoZo5RZq1e5WoCVRs= +github.com/multiversx/mx-chain-vm-common-go v1.5.10-0.20231228070003-ae14e1e0adfa/go.mod h1:7jjGRykSfLeMs6iQdszlE0lGK2xp9/cctiVdeKbQLLM= 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/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=