Skip to content

Commit aa392de

Browse files
authored
Merge pull request #975 from multiversx/merge-main-into-feat-16-oct
Merge main into feat 16 oct
2 parents ed43cb5 + 05006fc commit aa392de

File tree

404 files changed

+49263
-18114
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

404 files changed

+49263
-18114
lines changed

.github/workflows/build-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ jobs:
1111
test:
1212
strategy:
1313
matrix:
14-
go-version: [1.20.7]
14+
go-version: [1.23.6]
1515
os: [ubuntu-latest, macos-13]
1616
runs-on: ${{ matrix.os }}
1717
steps:
1818
- name: Install Go
19-
uses: actions/setup-go@v2
19+
uses: actions/setup-go@v5
2020
with:
2121
go-version: ${{ matrix.go-version }}
2222
- name: Checkout code
23-
uses: actions/checkout@v2
23+
uses: actions/checkout@v4
2424

2525
- name: Test (Linux)
2626
if: runner.os == 'Linux'

.github/workflows/code-coverage.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ jobs:
1616
name: Build
1717
steps:
1818
- name: Set up Go 1.x
19-
uses: actions/setup-go@v2
19+
uses: actions/setup-go@v5
2020
with:
21-
go-version: 1.20.7
21+
go-version: 1.23.6
2222
id: go
2323

2424
- name: Check out code into the Go module directory
25-
uses: actions/checkout@v2
25+
uses: actions/checkout@v4
2626

2727
- name: Get dependencies
2828
run: |
@@ -33,9 +33,12 @@ jobs:
3333
fi
3434
- name: Run unit tests
3535
run: |
36-
TESTS_TO_RUN=$(go list ./... | grep -v /integrationTests/ | grep -v /fuzz/ | grep -v /mandos-go/json/integrationTests | grep -v /mandos-go/expression/integrationTests)
36+
TESTS_TO_RUN=$(go list ./... | grep -v /integrationTests/ | grep -v /fuzz/)
3737
go test -short -cover -coverprofile=coverage.txt -covermode=atomic -v ${TESTS_TO_RUN}
3838
3939
- name: Upload coverage
40-
run: bash <(curl -s https://codecov.io/bash) -f coverage.txt -y codecov.yml
41-
40+
uses: codecov/codecov-action@v5
41+
with:
42+
fail_ci_if_error: true
43+
files: coverage.txt
44+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/golangci-lint.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ jobs:
1414
name: golangci linter
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/setup-go@v3
17+
- uses: actions/setup-go@v5
1818
with:
19-
go-version: 1.20.7
20-
- uses: actions/checkout@v3
19+
go-version: 1.23.6
20+
- uses: actions/checkout@v4
2121
- name: golangci-lint
22-
uses: golangci/golangci-lint-action@v3
22+
uses: golangci/golangci-lint-action@v6
2323
with:
2424
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
25-
version: v1.53.2
25+
version: v1.64.5
2626

2727
# Optional: working directory, useful for monorepos
2828
# working-directory: somedir

Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,9 @@ endif
1616
cp ./cmd/vmserver/vmserver ${VMSERVER_PATH}
1717

1818
test:
19-
go clean -cache -testcache
20-
VMEXECUTOR="wasmer1" go test ./...
2119
go clean -cache -testcache
2220
VMEXECUTOR="wasmer2" go test ./...
2321

24-
test-w1: clean
25-
VMEXECUTOR="wasmer1" go test ./...
26-
2722
test-w2: clean
2823
VMEXECUTOR="wasmer2" go test ./...
2924

cmd/scenariostest/scenariosTest.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ package main
33
import (
44
scenclibase "github.com/multiversx/mx-chain-scenario-go/clibase"
55
scenio "github.com/multiversx/mx-chain-scenario-go/scenario/io"
6-
76
vmscenario "github.com/multiversx/mx-chain-vm-go/scenario"
8-
"github.com/multiversx/mx-chain-vm-go/wasmer"
97
"github.com/multiversx/mx-chain-vm-go/wasmer2"
108
cli "github.com/urfave/cli/v2"
119
)
@@ -42,9 +40,6 @@ func (*vm15Flags) ParseFlags(cCtx *cli.Context) scenclibase.CLIRunOptions {
4240
}
4341

4442
vmBuilder := vmscenario.NewScenarioVMHostBuilder()
45-
if cCtx.Bool("wasmer1") {
46-
vmBuilder.OverrideVMExecutor = wasmer.ExecutorFactory()
47-
}
4843
if cCtx.Bool("wasmer2") {
4944
vmBuilder.OverrideVMExecutor = wasmer2.ExecutorFactory()
5045
}

codecov.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
ignore:
2-
- "**/*.pb.go" # wildcards accepted
3-
2+
- "**/*.pb.go"
3+
- "**testInitializerInputs.go"
4+
- "**testInitializerVMOutput.go"
5+
- "**hosttest/**"
6+
- "**mock/**"
7+
- "**scenario/**"
8+
- "**test/**"
9+
- "**testcommon/**"
10+
- "**testgen/**"

config/config.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,13 @@
5656
CleanReturnData = 10
5757
DeleteFromReturnData = 10
5858
GetCodeMetadata = 10
59+
GetCodeHash = 10
5960
IsBuiltinFunction = 10
6061
IsReservedFunctionName = 10
62+
GetRoundTime = 10
63+
EpochStartBlockTimeStamp = 10
64+
EpochStartBlockNonce = 10
65+
EpochStartBlockRound = 10
6166

6267
[EthAPICost]
6368
UseGas = 10
@@ -148,6 +153,7 @@
148153
BigFloatAbs = 10
149154
BigFloatSqrt = 10
150155
BigFloatPow = 10
156+
BigFloatPowPerIteration = 10
151157
BigFloatFloor = 10
152158
BigFloatCeil = 10
153159
BigFloatIsInt = 10
@@ -184,6 +190,10 @@
184190
MBufferToBigIntSigned = 10
185191
MBufferFromBigIntUnsigned = 10
186192
MBufferFromBigIntSigned = 10
193+
MBufferToSmallIntUnsigned = 10
194+
MBufferToSmallIntSigned = 10
195+
MBufferFromSmallIntUnsigned = 10
196+
MBufferFromSmallIntSigned = 10
187197
MBufferToBigFloat = 10
188198
MBufferFromBigFloat = 10
189199
MBufferStorageStore = 10
@@ -192,6 +202,13 @@
192202
MBufferFinish = 10
193203
MBufferSetRandom = 10
194204

205+
[ManagedMapAPICost]
206+
ManagedMapNew = 10
207+
ManagedMapPut = 10
208+
ManagedMapGet = 10
209+
ManagedMapRemove = 10
210+
ManagedMapContains = 10
211+
195212
[WASMOpcodeCost]
196213
AtomicFence = 1
197214
AtomicNotify = 1

config/gasCost.go

Lines changed: 100 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -31,58 +31,63 @@ type BaseOperationCost struct {
3131

3232
// BaseOpsAPICost defines the API operations gas cost config structure
3333
type BaseOpsAPICost struct {
34-
GetSCAddress uint64
35-
GetOwnerAddress uint64
36-
IsSmartContract uint64
37-
GetShardOfAddress uint64
38-
GetExternalBalance uint64
39-
GetBlockHash uint64
40-
GetOriginalTxHash uint64
41-
GetCurrentTxHash uint64
42-
GetPrevTxHash uint64
43-
TransferValue uint64
44-
GetArgument uint64
45-
GetFunction uint64
46-
GetNumArguments uint64
47-
StorageStore uint64
48-
StorageLoad uint64
49-
CachedStorageLoad uint64
50-
GetCaller uint64
51-
GetCallValue uint64
52-
Log uint64
53-
Finish uint64
54-
SignalError uint64
55-
GetBlockTimeStamp uint64
56-
GetGasLeft uint64
57-
Int64GetArgument uint64
58-
Int64StorageStore uint64
59-
Int64StorageLoad uint64
60-
Int64Finish uint64
61-
GetStateRootHash uint64
62-
GetBlockNonce uint64
63-
GetBlockEpoch uint64
64-
GetBlockRound uint64
65-
GetBlockRandomSeed uint64
66-
ExecuteOnSameContext uint64
67-
ExecuteOnDestContext uint64
68-
DelegateExecution uint64
69-
ExecuteReadOnly uint64
70-
AsyncCallStep uint64
71-
AsyncCallbackGasLock uint64
72-
CreateAsyncCall uint64
73-
SetAsyncCallback uint64
74-
SetAsyncGroupCallback uint64
75-
SetAsyncContextCallback uint64
76-
GetCallbackClosure uint64
77-
CreateContract uint64
78-
GetReturnData uint64
79-
GetNumReturnData uint64
80-
GetReturnDataSize uint64
81-
CleanReturnData uint64
82-
DeleteFromReturnData uint64
83-
GetCodeMetadata uint64
84-
IsBuiltinFunction uint64
85-
IsReservedFunctionName uint64
34+
GetSCAddress uint64
35+
GetOwnerAddress uint64
36+
IsSmartContract uint64
37+
GetShardOfAddress uint64
38+
GetExternalBalance uint64
39+
GetBlockHash uint64
40+
GetOriginalTxHash uint64
41+
GetCurrentTxHash uint64
42+
GetPrevTxHash uint64
43+
TransferValue uint64
44+
GetArgument uint64
45+
GetFunction uint64
46+
GetNumArguments uint64
47+
StorageStore uint64
48+
StorageLoad uint64
49+
CachedStorageLoad uint64
50+
GetCaller uint64
51+
GetCallValue uint64
52+
Log uint64
53+
Finish uint64
54+
SignalError uint64
55+
GetBlockTimeStamp uint64
56+
GetGasLeft uint64
57+
Int64GetArgument uint64
58+
Int64StorageStore uint64
59+
Int64StorageLoad uint64
60+
Int64Finish uint64
61+
GetStateRootHash uint64
62+
GetBlockNonce uint64
63+
GetBlockEpoch uint64
64+
GetBlockRound uint64
65+
GetBlockRandomSeed uint64
66+
ExecuteOnSameContext uint64
67+
ExecuteOnDestContext uint64
68+
DelegateExecution uint64
69+
ExecuteReadOnly uint64
70+
AsyncCallStep uint64
71+
AsyncCallbackGasLock uint64
72+
CreateAsyncCall uint64
73+
SetAsyncCallback uint64
74+
SetAsyncGroupCallback uint64
75+
SetAsyncContextCallback uint64
76+
GetCallbackClosure uint64
77+
CreateContract uint64
78+
GetReturnData uint64
79+
GetNumReturnData uint64
80+
GetReturnDataSize uint64
81+
CleanReturnData uint64
82+
DeleteFromReturnData uint64
83+
GetCodeMetadata uint64
84+
GetCodeHash uint64
85+
IsBuiltinFunction uint64
86+
IsReservedFunctionName uint64
87+
GetRoundTime uint64
88+
EpochStartBlockTimeStamp uint64
89+
EpochStartBlockNonce uint64
90+
EpochStartBlockRound uint64
8691
}
8792

8893
// DynamicStorageLoadCostCoefficients holds the signed coefficients of the func that will compute the gas cost
@@ -152,24 +157,25 @@ type BigIntAPICost struct {
152157

153158
// BigFloatAPICost defines the big float operations gas cost config structure
154159
type BigFloatAPICost struct {
155-
BigFloatNewFromParts uint64
156-
BigFloatAdd uint64
157-
BigFloatSub uint64
158-
BigFloatMul uint64
159-
BigFloatDiv uint64
160-
BigFloatTruncate uint64
161-
BigFloatNeg uint64
162-
BigFloatClone uint64
163-
BigFloatCmp uint64
164-
BigFloatAbs uint64
165-
BigFloatSqrt uint64
166-
BigFloatPow uint64
167-
BigFloatFloor uint64
168-
BigFloatCeil uint64
169-
BigFloatIsInt uint64
170-
BigFloatSetBigInt uint64
171-
BigFloatSetInt64 uint64
172-
BigFloatGetConst uint64
160+
BigFloatNewFromParts uint64
161+
BigFloatAdd uint64
162+
BigFloatSub uint64
163+
BigFloatMul uint64
164+
BigFloatDiv uint64
165+
BigFloatTruncate uint64
166+
BigFloatNeg uint64
167+
BigFloatClone uint64
168+
BigFloatCmp uint64
169+
BigFloatAbs uint64
170+
BigFloatSqrt uint64
171+
BigFloatPow uint64
172+
BigFloatPowPerIteration uint64
173+
BigFloatFloor uint64
174+
BigFloatCeil uint64
175+
BigFloatIsInt uint64
176+
BigFloatSetBigInt uint64
177+
BigFloatSetInt64 uint64
178+
BigFloatGetConst uint64
173179
}
174180

175181
// CryptoAPICost defines the crypto operations gas cost config structure
@@ -198,26 +204,30 @@ type CryptoAPICost struct {
198204

199205
// ManagedBufferAPICost defines the managed buffer operations gas cost config structure
200206
type ManagedBufferAPICost struct {
201-
MBufferNew uint64
202-
MBufferNewFromBytes uint64
203-
MBufferGetLength uint64
204-
MBufferGetBytes uint64
205-
MBufferGetByteSlice uint64
206-
MBufferCopyByteSlice uint64
207-
MBufferSetBytes uint64
208-
MBufferAppend uint64
209-
MBufferAppendBytes uint64
210-
MBufferToBigIntUnsigned uint64
211-
MBufferToBigIntSigned uint64
212-
MBufferFromBigIntUnsigned uint64
213-
MBufferFromBigIntSigned uint64
214-
MBufferToBigFloat uint64
215-
MBufferFromBigFloat uint64
216-
MBufferStorageStore uint64
217-
MBufferStorageLoad uint64
218-
MBufferGetArgument uint64
219-
MBufferFinish uint64
220-
MBufferSetRandom uint64
207+
MBufferNew uint64
208+
MBufferNewFromBytes uint64
209+
MBufferGetLength uint64
210+
MBufferGetBytes uint64
211+
MBufferGetByteSlice uint64
212+
MBufferCopyByteSlice uint64
213+
MBufferSetBytes uint64
214+
MBufferAppend uint64
215+
MBufferAppendBytes uint64
216+
MBufferToBigIntUnsigned uint64
217+
MBufferToBigIntSigned uint64
218+
MBufferFromBigIntUnsigned uint64
219+
MBufferFromBigIntSigned uint64
220+
MBufferToSmallIntUnsigned uint64
221+
MBufferToSmallIntSigned uint64
222+
MBufferFromSmallIntUnsigned uint64
223+
MBufferFromSmallIntSigned uint64
224+
MBufferToBigFloat uint64
225+
MBufferFromBigFloat uint64
226+
MBufferStorageStore uint64
227+
MBufferStorageLoad uint64
228+
MBufferGetArgument uint64
229+
MBufferFinish uint64
230+
MBufferSetRandom uint64
221231
}
222232

223233
// ManagedMapAPICost defines the managed map operations gas cost config structure

0 commit comments

Comments
 (0)