Skip to content

Commit

Permalink
Merge pull request #5632 from multiversx/vm1.5.12
Browse files Browse the repository at this point in the history
new vm 1.5.12
  • Loading branch information
iulianpascalau authored Oct 12, 2023
2 parents 692ed00 + aa7e3b6 commit 315b007
Show file tree
Hide file tree
Showing 102 changed files with 525 additions and 201 deletions.
Binary file modified cmd/assessment/testdata/fibonacci.wasm
Binary file not shown.
56 changes: 56 additions & 0 deletions cmd/assessment/testdata/fibonacci.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
(module
(type (;0;) (func (param i64) (result i32)))
(type (;1;) (func (param i32)))
(type (;2;) (func (param i32) (result i64)))
(type (;3;) (func (param i64) (result i64)))
(type (;4;) (func))
(import "env" "bigIntNew" (func (;0;) (type 0)))
(import "env" "bigIntGetCallValue" (func (;1;) (type 1)))
(import "env" "bigIntGetInt64" (func (;2;) (type 2)))
(import "env" "bigIntFinishUnsigned" (func (;3;) (type 1)))
(func (;4;) (type 3) (param i64) (result i64)
block ;; label = @1
block ;; label = @2
block ;; label = @3
local.get 0
i64.const 1
i64.gt_u
br_if 0 (;@3;)
local.get 0
i32.wrap_i64
br_table 2 (;@1;) 1 (;@2;) 2 (;@1;)
end
local.get 0
i64.const -1
i64.add
call 4
local.get 0
i64.const -2
i64.add
call 4
i64.add
return
end
i64.const 1
local.set 0
end
local.get 0)
(func (;5;) (type 4)
(local i32)
i64.const 0
call 0
local.tee 0
call 1
local.get 0
call 2
call 4
call 0
call 3)
(func (;6;) (type 4)
return)
(table (;0;) 1 1 funcref)
(memory (;0;) 2)
(global (;0;) (mut i32) (i32.const 66560))
(export "memory" (memory 0))
(export "_main" (func 5))
(export "init" (func 6)))
Binary file modified genesis/process/testdata/answer.wasm
100644 → 100755
Binary file not shown.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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.5
github.com/multiversx/mx-chain-vm-go v1.5.10
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
github.com/multiversx/mx-chain-vm-v1_4-go v1.4.88
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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.5 h1:NoG73lvcHSeUcoFlYybG8ceGuJ6KptD3QJjUNEnGDVk=
github.com/multiversx/mx-chain-vm-common-go v1.5.5/go.mod h1:sqkKMCnwkWl8DURdb9q7pctK8IANghdHY1KJLE0ox2c=
github.com/multiversx/mx-chain-vm-go v1.5.10 h1:9pw8GmTQ6ld2l+au5VfSi/CpXU9Id2l3QgUJumVT5sI=
github.com/multiversx/mx-chain-vm-go v1.5.10/go.mod h1:F5OoQjCuYNr1hYWvwZKCcWYQir3+r2QVBxQux/eo0Ak=
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=
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=
Expand Down
14 changes: 7 additions & 7 deletions integrationTests/multiShard/smartContract/scCallingSC_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func TestSCCallingIntraShard(t *testing.T) {

// deploy the smart contracts
firstSCAddress := putDeploySCToDataPool(
"./testdata/first/first.wasm",
"./testdata/first/output/first.wasm",
firstSCOwner,
0,
big.NewInt(50),
Expand All @@ -88,7 +88,7 @@ func TestSCCallingIntraShard(t *testing.T) {
)
//000000000000000005005d3d53b5d0fcf07d222170978932166ee9f3972d3030
secondSCAddress := putDeploySCToDataPool(
"./testdata/second/second.wasm",
"./testdata/second/output/second.wasm",
secondSCOwner,
0,
big.NewInt(50),
Expand Down Expand Up @@ -414,7 +414,7 @@ func TestSCCallingInCrossShard(t *testing.T) {

// deploy the smart contracts
firstSCAddress := putDeploySCToDataPool(
"./testdata/first/first.wasm",
"./testdata/first/output/first.wasm",
firstSCOwner,
0,
big.NewInt(50),
Expand All @@ -424,7 +424,7 @@ func TestSCCallingInCrossShard(t *testing.T) {
)
//000000000000000005005d3d53b5d0fcf07d222170978932166ee9f3972d3030
secondSCAddress := putDeploySCToDataPool(
"./testdata/second/second.wasm",
"./testdata/second/output/second.wasm",
secondSCOwner,
0,
big.NewInt(50),
Expand Down Expand Up @@ -643,7 +643,7 @@ func TestSCCallingInCrossShardDelegationMock(t *testing.T) {

// deploy the smart contracts
delegateSCAddress := putDeploySCToDataPool(
"./testdata/delegate-mock/delegate.wasm",
"./testdata/delegate-mock/output/delegate.wasm",
delegateSCOwner,
0,
big.NewInt(50),
Expand Down Expand Up @@ -922,7 +922,7 @@ func TestSCNonPayableIntraShardErrorShouldProcessBlock(t *testing.T) {

// deploy the smart contracts
_ = putDeploySCToDataPool(
"./testdata/first/first.wasm",
"./testdata/first/output/first.wasm",
firstSCOwner,
0,
big.NewInt(50),
Expand All @@ -932,7 +932,7 @@ func TestSCNonPayableIntraShardErrorShouldProcessBlock(t *testing.T) {
)
//000000000000000005005d3d53b5d0fcf07d222170978932166ee9f3972d3030
secondSCAddress := putDeploySCToDataPool(
"./testdata/second/second.wasm",
"./testdata/second/output/second.wasm",
secondSCOwner,
0,
big.NewInt(50),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,38 @@ void int64finish(i64 value);
int getArgument(int argumentIndex, byte *argument);
void asyncCall(byte *destination, byte *value, byte *data, int length);

byte callValue[32] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
byte receiver[32] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
byte callValue[32] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
byte receiver[32] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
byte data[11] = "testfunc@01";

void callBuiltin() {
void init()
{
}

void callBuiltin()
{
byte key[5] = "test1";
int64storageStore(key, 5, 255);

getArgument(0, receiver);
asyncCall(receiver, callValue, data, 11);
}

void callBack() {
void callBack()
{
byte key[5] = "test2";
int64storageStore(key, 5, 254);
}

void testValue1() {
void testValue1()
{
byte key[5] = "test1";
i64 test1 = int64storageLoad(key, 5);
int64finish(test1);
}

void testValue2() {
void testValue2()
{
byte key[5] = "test2";
i64 test1 = int64storageLoad(key, 5);
int64finish(test1);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
init
callBuiltin
callBack
testValue1
Expand Down

This file was deleted.

Binary file modified integrationTests/multiShard/smartContract/testdata/callBuiltin/output/callBuiltin.wasm
100644 → 100755
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ byte stakingSc[32] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
byte callValue[32] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
byte data[270] = "stake@01@aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@ffff";

void init()
{
}

void delegate()
{
i64 stake = int64getArgument(0);
Expand All @@ -31,7 +35,8 @@ void sendToStaking()
asyncCall(stakingSc, callValue, data, 270);
}

void callBack() {
void callBack()
{
}

void _main(void)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
init
delegate
sendToStaking
Binary file not shown.
Binary file modified integrationTests/multiShard/smartContract/testdata/delegate-mock/output/delegate.wasm
100644 → 100755
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
init
callMe
numCalled
callBack
Binary file not shown.
Binary file modified integrationTests/multiShard/smartContract/testdata/first/output/first.wasm
100644 → 100755
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ void asyncCall(byte *destination, byte *value, byte *data, int length);
byte zero[32] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
byte firstScAddress[32] = {0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 93, 61, 83, 181, 208, 252, 240, 125, 34, 33, 112, 151, 137, 50, 22, 110, 233, 243, 151, 45, 48, 48};

void init()
{
}

void doSomething()
{
asyncCall(firstScAddress, zero, (byte*)"callMe@01", sizeof("callMe@01") - 1);
asyncCall(firstScAddress, zero, (byte *)"callMe@01", sizeof("callMe@01") - 1);
}

void callBack() {
void callBack()
{
}

void _main(void)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
init
doSomething
callBack
Binary file not shown.
Binary file modified integrationTests/multiShard/softfork/testdata/answer.wasm
100644 → 100755
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func TestESDTMultiTransferWithWrongArgumentsSFT(t *testing.T) {

senderNode := net.NodesSharded[0][0]
owner := senderNode.OwnAccount
forwarder := net.DeployNonpayableSC(owner, "../../testdata/execute.wasm")
forwarder := net.DeployNonpayableSC(owner, "../../testdata/execute/output/execute.wasm")
vaultOtherShard := net.DeployNonpayableSC(net.NodesSharded[1][0].OwnAccount, "../../testdata/vault.wasm")

ESDTMultiTransferWithWrongArgumentsSFT_RunStepsAndAsserts(t, net, senderNode, senderNode.OwnAccount, forwarder, vaultOtherShard)
Expand Down Expand Up @@ -276,7 +276,7 @@ func TestESDTMultiTransferWithWrongArgumentsFungible(t *testing.T) {

senderNode := net.NodesSharded[0][0]
owner := senderNode.OwnAccount
forwarder := net.DeployNonpayableSC(owner, "../../testdata/execute.wasm")
forwarder := net.DeployNonpayableSC(owner, "../../testdata/execute/output/execute.wasm")
vaultOtherShard := net.DeploySCWithInitArgs(net.NodesSharded[1][0].OwnAccount, "../../testdata/contract.wasm", false, []byte{10})

ESDTMultiTransferWithWrongArgumentsFungible_RunStepsAndAsserts(t, net, senderNode, senderNode.OwnAccount, forwarder, vaultOtherShard)
Expand Down
Binary file removed integrationTests/vm/esdt/testdata/execute.wasm
Binary file not shown.
Loading

0 comments on commit 315b007

Please sign in to comment.