Skip to content

Commit

Permalink
Merge pull request #836 from multiversx/merge_rc170_into_rc17next1_20…
Browse files Browse the repository at this point in the history
…24.03.21

Merge rc170 into rc17next1 2024.03.21
  • Loading branch information
sstanculeanu authored Mar 22, 2024
2 parents 38ea251 + 3e5a88b commit 22c17d2
Show file tree
Hide file tree
Showing 18 changed files with 100 additions and 83 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build-test-macos-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build and run tests (MacOS ARM64)

on:
push:
branches: [master, rc/*, feat/*]
pull_request:
branches: [master, feat/*, rc/*]
workflow_dispatch:

jobs:
test:
strategy:
matrix:
go-version: [1.20.7]
runs-on: macos-13-xlarge
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Test
run: |
make test-w2
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
go-version: [1.20.7]
os: [ubuntu-latest]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
Expand Down
72 changes: 0 additions & 72 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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.20240129082057-a76d0c995cf2
github.com/multiversx/mx-chain-core-go v1.2.19-0.20240321150532-5960a8922b18
github.com/multiversx/mx-chain-crypto-go v1.2.10-0.20231206065052-38843c1f1479
github.com/multiversx/mx-chain-logger-go v1.0.14-0.20240129144507-d00e967c890c
github.com/multiversx/mx-chain-scenario-go v1.4.3-0.20240212160120-cc32d1580157
github.com/multiversx/mx-chain-storage-go v1.0.15-0.20240129144933-b1c0d642d7f8
github.com/multiversx/mx-chain-vm-common-go v1.5.12-0.20240129145149-4fe61574f566
github.com/multiversx/mx-chain-storage-go v1.0.15-0.20240321150623-3974ec1d6474
github.com/multiversx/mx-chain-vm-common-go v1.5.12-0.20240321152012-f18c2869d6b4
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
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,18 @@ 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.20240129082057-a76d0c995cf2 h1:pFh9bwOTRgW173aHqA8Bmax+jYzLnRyXqRvi5alF7V4=
github.com/multiversx/mx-chain-core-go v1.2.19-0.20240129082057-a76d0c995cf2/go.mod h1:B5zU4MFyJezmEzCsAHE9YNULmGCm2zbPHvl9hazNxmE=
github.com/multiversx/mx-chain-core-go v1.2.19-0.20240321150532-5960a8922b18 h1:hytqre8g+NIHsq/Kxl/lwIykHna57Gv+E38tt4K5A9I=
github.com/multiversx/mx-chain-core-go v1.2.19-0.20240321150532-5960a8922b18/go.mod h1:B5zU4MFyJezmEzCsAHE9YNULmGCm2zbPHvl9hazNxmE=
github.com/multiversx/mx-chain-crypto-go v1.2.10-0.20231206065052-38843c1f1479 h1:beVIhs5ysylwNplQ/bZ0h5DoDlqKNWgpWE/NMHHNmAw=
github.com/multiversx/mx-chain-crypto-go v1.2.10-0.20231206065052-38843c1f1479/go.mod h1:Ap6p7QZFtwPlb++OvCG+85BfuZ+bLP/JtQp6EwjWJsI=
github.com/multiversx/mx-chain-logger-go v1.0.14-0.20240129144507-d00e967c890c h1:QIUOn8FgNRa5cir4BCWHZi/Qcr6Gg0eGNhns4+jy6+k=
github.com/multiversx/mx-chain-logger-go v1.0.14-0.20240129144507-d00e967c890c/go.mod h1:fH/fR/GEBsDjPkBoZDVJMoYo2HhlA7++DP6QfITJ1N8=
github.com/multiversx/mx-chain-scenario-go v1.4.3-0.20240212160120-cc32d1580157 h1:ydzN3f+Y7H0InXuxAcNUSyVc+omNYL8uYtLqVzqaaX4=
github.com/multiversx/mx-chain-scenario-go v1.4.3-0.20240212160120-cc32d1580157/go.mod h1:ndk45i9J9McuCJpTcgiaK4ocd0yhnBBCPrlFwO6GRcs=
github.com/multiversx/mx-chain-storage-go v1.0.15-0.20240129144933-b1c0d642d7f8 h1:/EYv/HGX0OKbeNFt667J0yZRtuJiZH0lEK8YtobuH/c=
github.com/multiversx/mx-chain-storage-go v1.0.15-0.20240129144933-b1c0d642d7f8/go.mod h1:zl1A6teNe39T8yhdZlkX3ckm5aLYrMIJJZ6Ord1E71M=
github.com/multiversx/mx-chain-vm-common-go v1.5.12-0.20240129145149-4fe61574f566 h1:zImJa/r6B5L2OLWbKTn5io53U11PPGDla12H2OaJ9y0=
github.com/multiversx/mx-chain-vm-common-go v1.5.12-0.20240129145149-4fe61574f566/go.mod h1:OUyhCFqZKqUk1uaPsenyPDwO1830SlHNDU7Q7b6CBVI=
github.com/multiversx/mx-chain-storage-go v1.0.15-0.20240321150623-3974ec1d6474 h1:x65Su8ojHwA+NICp9DrSVGLDDcAlW04DafkqCHY1QPE=
github.com/multiversx/mx-chain-storage-go v1.0.15-0.20240321150623-3974ec1d6474/go.mod h1:hnc6H4D5Ge1haRAQ6QHTXhyh+CT2DRiNJ0U0HQYI3DY=
github.com/multiversx/mx-chain-vm-common-go v1.5.12-0.20240321152012-f18c2869d6b4 h1:Xq8R5eRcZDTPYYK7boM2x71XRDifdtP+rgQQhvmJLbg=
github.com/multiversx/mx-chain-vm-common-go v1.5.12-0.20240321152012-f18c2869d6b4/go.mod h1:JqhuZPrx9bAKagTefUXq9y2fhLdCJstnppq2JKAUvFI=
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=
Expand Down
13 changes: 13 additions & 0 deletions integrationTests/json/scenariosDelegation_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package vmjsonintegrationtest

import (
"runtime"
"testing"
)

func TestDelegation_v0_2(t *testing.T) {
if testing.Short() {
t.Skip("not a short test")
}
if runtime.GOARCH == "arm64" {
t.Skip("skipping test on arm64")
}

ScenariosTest(t).
Folder("delegation/v0_2").
Expand All @@ -19,6 +23,9 @@ func TestDelegation_v0_3(t *testing.T) {
if testing.Short() {
t.Skip("not a short test")
}
if runtime.GOARCH == "arm64" {
t.Skip("skipping test on arm64")
}

ScenariosTest(t).
Folder("delegation/v0_3").
Expand All @@ -31,6 +38,9 @@ func TestDelegation_v0_4_genesis(t *testing.T) {
if testing.Short() {
t.Skip("not a short test")
}
if runtime.GOARCH == "arm64" {
t.Skip("skipping test on arm64")
}

ScenariosTest(t).
Folder("delegation/v0_4_genesis").
Expand All @@ -42,6 +52,9 @@ func TestDelegation_v0_5_latest(t *testing.T) {
if testing.Short() {
t.Skip("not a short test")
}
if runtime.GOARCH == "arm64" {
t.Skip("skipping test on arm64")
}

ScenariosTest(t).
Folder("delegation/v0_5_latest").
Expand Down
21 changes: 21 additions & 0 deletions integrationTests/json/scenariosExecutorVersions_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package vmjsonintegrationtest

import (
"runtime"
"testing"

"github.com/multiversx/mx-chain-vm-go/executor"
Expand All @@ -9,20 +10,32 @@ import (
)

func TestCErc20Executors_TwiceW1ThenTwiceW2(t *testing.T) {
if runtime.GOARCH == "arm64" {
t.Skip("skipping test on arm64")
}

testCERC20WithExecutorFactory(t, wasmer.ExecutorFactory())
testCERC20WithExecutorFactory(t, wasmer.ExecutorFactory())
testCERC20WithExecutorFactory(t, wasmer2.ExecutorFactory())
testCERC20WithExecutorFactory(t, wasmer2.ExecutorFactory())
}

func TestCErc20Executors_W1W2W1W2(t *testing.T) {
if runtime.GOARCH == "arm64" {
t.Skip("skipping test on arm64")
}

testCERC20WithExecutorFactory(t, wasmer.ExecutorFactory())
testCERC20WithExecutorFactory(t, wasmer2.ExecutorFactory())
testCERC20WithExecutorFactory(t, wasmer.ExecutorFactory())
testCERC20WithExecutorFactory(t, wasmer2.ExecutorFactory())
}

func TestCErc20Executors_W1W2W2W1W2(t *testing.T) {
if runtime.GOARCH == "arm64" {
t.Skip("skipping test on arm64")
}

testCERC20WithExecutorFactory(t, wasmer.ExecutorFactory())
testCERC20WithExecutorFactory(t, wasmer2.ExecutorFactory())
testCERC20WithExecutorFactory(t, wasmer2.ExecutorFactory())
Expand All @@ -31,12 +44,20 @@ func TestCErc20Executors_W1W2W2W1W2(t *testing.T) {
}

func TestCErc20Executors_W2W1W2(t *testing.T) {
if runtime.GOARCH == "arm64" {
t.Skip("skipping test on arm64")
}

testCERC20WithExecutorFactory(t, wasmer2.ExecutorFactory())
testCERC20WithExecutorFactory(t, wasmer.ExecutorFactory())
testCERC20WithExecutorFactory(t, wasmer2.ExecutorFactory())
}

func TestCErc20Executors_W2W2W1W2(t *testing.T) {
if runtime.GOARCH == "arm64" {
t.Skip("skipping test on arm64")
}

testCERC20WithExecutorFactory(t, wasmer2.ExecutorFactory())
testCERC20WithExecutorFactory(t, wasmer2.ExecutorFactory())
testCERC20WithExecutorFactory(t, wasmer.ExecutorFactory())
Expand Down
10 changes: 10 additions & 0 deletions vmhost/hosttest/bad_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ package hostCoretest

import (
"context"
"runtime"
"testing"
"time"

"github.com/multiversx/mx-chain-vm-go/executor"
contextmock "github.com/multiversx/mx-chain-vm-go/mock/context"
test "github.com/multiversx/mx-chain-vm-go/testcommon"
"github.com/multiversx/mx-chain-vm-go/testcommon/testexecutor"
"github.com/multiversx/mx-chain-vm-go/vmhost"
"github.com/multiversx/mx-chain-vm-go/wasmer"
"github.com/multiversx/mx-chain-vm-go/wasmer2"
Expand Down Expand Up @@ -220,6 +222,10 @@ func TestBadContract_NoPanic_BadGetBlockHash3(t *testing.T) {
}

func TestBadContract_NoPanic_BadRecursive(t *testing.T) {
if runtime.GOOS == "darwin" {
t.Skip("skipping test on darwin")
}

test.BuildInstanceCallTest(t).
WithContracts(
test.CreateInstanceContract(test.ParentAddress).
Expand Down Expand Up @@ -258,6 +264,10 @@ func TestBadContract_NoPanic_NonExistingFunction(t *testing.T) {
}

func TestBadContractExtra_LongIntLoop_Wasmer1(t *testing.T) {
if !testexecutor.IsWasmer1Allowed() {
t.Skip("run exclusively with wasmer1")
}

testBadContractExtraLongIntLoop(t, wasmer.ExecutorFactory())
}

Expand Down
4 changes: 4 additions & 0 deletions vmhost/hosttest/execution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ func TestExecution_DeployNotWASM(t *testing.T) {
}

func TestExecution_DeployWASM_WrongInit_Wasmer1(t *testing.T) {
if !testexecutor.IsWasmer1Allowed() {
t.Skip("run exclusively with wasmer1")
}

testExecutionDeployWASMWrongInit(t, wasmer.ExecutorFactory())
}

Expand Down
9 changes: 9 additions & 0 deletions vmhost/hosttest/panictests/panic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package panictests

import (
"math/big"
"runtime"
"sync"
"testing"
"time"
Expand Down Expand Up @@ -86,6 +87,10 @@ func TestExecution_PanicInGoWithSilentWasmer_SIGFPE(t *testing.T) {
}

func TestTwoPanicsInSuccession(t *testing.T) {
if runtime.GOARCH == "arm64" {
t.Skip("skipping test on arm64")
}

TestExecution_PanicInGoWithSilentWasmer_TimeoutAndSIGSEGV(t)
TestExecution_PanicInGoWithSilentWasmer_TimeoutAndSIGSEGV(t)
}
Expand Down Expand Up @@ -158,6 +163,10 @@ func TestExecution_PanicInGoWithSilentWasmer_TimeoutAndSIGSEGV(t *testing.T) {
}

func TestExecution_MultipleHostsPanicInGoWithSilentWasmer_TimeoutAndSIGSEGV(t *testing.T) {
if runtime.GOARCH == "arm64" {
t.Skip("skipping test on arm64")
}

numParallel := 100
hosts := make([]vmhost.VMHost, numParallel)
blockchains := make([]*mock.BlockchainHookStub, numParallel)
Expand Down
3 changes: 2 additions & 1 deletion wasmer/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package wasmer

// #cgo LDFLAGS: -Wl,-rpath,${SRCDIR} -L${SRCDIR}
// #cgo linux,amd64 LDFLAGS:-lwasmer_linux_amd64
// #cgo linux,arm64 LDFLAGS:-lwasmer_linux_arm64
// #cgo linux,arm64 LDFLAGS:-lwasmer_linux_arm64_shim
// #cgo darwin,amd64 LDFLAGS:-lwasmer_darwin_amd64
// #cgo darwin,arm64 LDFLAGS:-lwasmer_darwin_arm64_shim
// #include "./wasmer.h"
//
import "C"
Expand Down
Binary file added wasmer/libwasmer_darwin_arm64_shim.dylib
Binary file not shown.
Binary file removed wasmer/libwasmer_linux_arm64.so
Binary file not shown.
Binary file added wasmer/libwasmer_linux_arm64_shim.so
Binary file not shown.
4 changes: 4 additions & 0 deletions wasmer/wasmerInstanceValidate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ func getSCCode(fileName string) []byte {
}

func TestFunctionsGuard_Arity(t *testing.T) {
if os.Getenv("VMEXECUTOR") != "wasmer1" {
t.Skip("run exclusively with wasmer1")
}

// Empty imports on purpose.
// We have currently no access to the vmhooks package here, due to cyclic imports.
// Fortunately, imports are not necessary for this test.
Expand Down
2 changes: 2 additions & 0 deletions wasmer2/bridge2.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package wasmer2

// #cgo LDFLAGS: -Wl,-rpath,${SRCDIR} -L${SRCDIR}
// #cgo linux,amd64 LDFLAGS:-lvmexeccapi
// #cgo linux,arm64 LDFLAGS:-lvmexeccapi_arm
// #cgo darwin,amd64 LDFLAGS:-lvmexeccapi
// #cgo darwin,arm64 LDFLAGS:-lvmexeccapi_arm
// #include "./libvmexeccapi.h"
//
import "C"
Expand Down
Binary file added wasmer2/libvmexeccapi_arm.dylib
Binary file not shown.
Binary file added wasmer2/libvmexeccapi_arm.so
Binary file not shown.

0 comments on commit 22c17d2

Please sign in to comment.