Skip to content

Commit

Permalink
Merge pull request #241 from arda-org/dev
Browse files Browse the repository at this point in the history
dev into main
  • Loading branch information
lcswillems authored Nov 30, 2024
2 parents 0ae016f + a8ab02c commit 8120244
Show file tree
Hide file tree
Showing 70 changed files with 795 additions and 554 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
deploy:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

permissions:
contents: read
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
build-and-test:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: Checkout
Expand Down Expand Up @@ -41,21 +41,19 @@ jobs:
- name: Build xsuite
run: pnpm build-xsuite

- name: Add xSuite Rust key in env
run: echo "XSUITE_RUST=$(pnpm xsuite install-rust-key)" >> $GITHUB_ENV
- name: Install Rust
run: |
pnpm xsuite install-rust
echo "RUST_KEY=$(pnpm xsuite install-rust-key)" >> $GITHUB_ENV
- name: Cache Rust
uses: actions/cache@v4
with:
path: |
~/.rustup/toolchains
~/.cargo
target
key: ${{ runner.os }}-rust-${{ env.XSUITE_RUST }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-rust-

- name: Install Rust
run: pnpm xsuite install-rust
~/.cargo/
target/
key: rust-${{ runner.os }}-${{ env.RUST_KEY }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: rust-${{ runner.os }}-

- name: Test xsuite
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release-scenexec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
build:
strategy:
matrix:
os: [ubuntu-20.04, macos-12]
os: [ubuntu-22.04, macos-12]
include:
- os: ubuntu-20.04
- os: ubuntu-22.04
wasmer_lib: libwasmer_linux_amd64.so
wasmer2_lib: libvmexeccapi.so
flags: -ldflags "-extldflags '-Wl,-rpath,\$ORIGIN'"
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:

strategy:
matrix:
os: [ubuntu-20.04, macos-12]
os: [ubuntu-22.04, macos-12]

runs-on: ${{ matrix.os }}

Expand All @@ -75,7 +75,7 @@ jobs:

release:
needs: test
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- name: Download binaries
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-xsuite-fullsimulnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
build:
strategy:
matrix:
os: [macos-12, ubuntu-20.04]
os: [macos-12, ubuntu-22.04]

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:

strategy:
matrix:
os: [macos-12, ubuntu-20.04]
os: [macos-12, ubuntu-22.04]

runs-on: ${{ matrix.os }}

Expand All @@ -63,7 +63,7 @@ jobs:
publish:
needs: test

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: Checkout
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-xsuite-lightsimulnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
build:
strategy:
matrix:
os: [macos-12, ubuntu-20.04]
os: [macos-12, ubuntu-22.04]

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:

strategy:
matrix:
os: [macos-12, ubuntu-20.04]
os: [macos-12, ubuntu-22.04]

runs-on: ${{ matrix.os }}

Expand All @@ -63,7 +63,7 @@ jobs:
publish:
needs: test

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-xsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
build-and-publish:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: Checkout
Expand Down
89 changes: 52 additions & 37 deletions website/app/data-converter/pageClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
defaultSystem,
Clipboard,
Input,
NativeSelect,
NativeSelect as ChakraNativeSelect,
Button,
Link,
} from "@chakra-ui/react";
Expand All @@ -31,7 +31,7 @@ import React, {
import { FaPlus, FaArrowLeft, FaArrowRight, FaArrowDown } from "react-icons/fa";
import { FaXmark } from "react-icons/fa6";
import { LuClipboard } from "react-icons/lu";
import { e, d, B64 } from "xsuite/data";
import { e, d, B64, mainnetMvxProxyUrl } from "xsuite/data";
import { Proxy } from "xsuite/proxy";

export default function PageClient() {
Expand All @@ -47,9 +47,10 @@ export default function PageClient() {
const DataConverter = () => {
const converters = useConverters();
const [address, setAddress] = useState("");
const [proxyUrl, setProxyUrl] = useState(mainnetMvxProxyUrl);
const query = useQuery({
queryKey: ["address", address],
queryFn: () => proxy.getSerializableAccount(address),
queryKey: ["proxyUrl", proxyUrl, "address", address],
queryFn: () => new Proxy(proxyUrl).getSerializableAccount(address),
});
const addressMainnetState = JSON.stringify(query.data, null, 2);

Expand Down Expand Up @@ -78,12 +79,19 @@ const DataConverter = () => {
))}
</Box>
<Box mb="8" />
<Heading>Get address mainnet state</Heading>
<Heading>Get address state</Heading>
<Box mb="8" />
<Input
placeholder="Address"
value={address}
onChange={(e) => setAddress(e.currentTarget.value)}
/>
<Box mb="4" />
<Input
placeholder="Proxy URL"
value={proxyUrl}
onChange={(e) => setProxyUrl(e.currentTarget.value)}
/>
<Box mb="8" />
<Clipboard.Root value={addressMainnetState}>
<Clipboard.Trigger asChild>
Expand Down Expand Up @@ -157,21 +165,18 @@ const ConverterBox = ({
<Box mb="4" />
<Box display="flex" gap="3" alignItems="center">
Type
<NativeSelect.Root>
<NativeSelect.Field
value={inputType}
onChange={(e) =>
onChangeState({ inputType: e.currentTarget.value as any })
}
>
{Object.entries(dataTypes).map(([value, name]) => (
<option key={value} value={value}>
{name}
</option>
))}
</NativeSelect.Field>
<NativeSelect.Indicator />
</NativeSelect.Root>
<NativeSelect
value={inputType}
onChange={(e) =>
onChangeState({ inputType: e.currentTarget.value as any })
}
>
{Object.entries(dataTypes).map(([value, name]) => (
<option key={value} value={value}>
{name}
</option>
))}
</NativeSelect>
</Box>
<Box mb="3" />
<Box>
Expand Down Expand Up @@ -202,21 +207,18 @@ const ConverterBox = ({
<Box mb="3" />
<Box display="flex" gap="3" alignItems="center">
Type
<NativeSelect.Root>
<NativeSelect.Field
value={outputType}
onChange={(e) =>
onChangeState({ outputType: e.currentTarget.value as any })
}
>
{Object.entries(dataTypes).map(([value, name]) => (
<option key={value} value={value}>
{name}
</option>
))}
</NativeSelect.Field>
<NativeSelect.Indicator />
</NativeSelect.Root>
<NativeSelect
value={outputType}
onChange={(e) =>
onChangeState({ outputType: e.currentTarget.value as any })
}
>
{Object.entries(dataTypes).map(([value, name]) => (
<option key={value} value={value}>
{name}
</option>
))}
</NativeSelect>
</Box>
<Box mb="3" />
<Box>
Expand All @@ -235,6 +237,21 @@ const ConverterBox = ({
);
};

const NativeSelect = ({
value,
onChange,
children,
...props
}: Omit<ChakraNativeSelect.RootProps, "value" | "onChange" | "children"> &
Pick<ChakraNativeSelect.FieldProps, "value" | "onChange" | "children">) => {
return (
<ChakraNativeSelect.Root {...props}>
<ChakraNativeSelect.Field {...{ value, onChange, children }} />
<ChakraNativeSelect.Indicator />
</ChakraNativeSelect.Root>
);
};

const useConverters = () => {
const [states, setStates] = useLocalStorage<ConverterState[]>(
"converterStates",
Expand Down Expand Up @@ -390,8 +407,6 @@ const genId = () => Math.random();

const queryClient = new QueryClient();

const proxy = Proxy.newMainnet();

const dataTypes = {
hex: "Hex",
base64: "Base64",
Expand Down
2 changes: 1 addition & 1 deletion website/pages/interact-contract.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const loadWallet = () => world.newWalletFromFile("wallet.json");
const program = new Command();
```

Here we define the `world` object using `World.new()` which takes the `proxyUrl`, `chainId` and `gasPrice` as arguments. Using the `envChain` utility we can easily get the appropriate `publicProxyUrl` (i.e. https://devnet-gateway.multiversx.com/ for Devnet) and chain `id` depending on the current `CHAIN` environment variable value that is set in the `scripts` section of our `package.json` file.
Here we define the `world` object using `World.new()` which takes the `proxyUrl`, `chainId` and `gasPrice` as arguments. Using the `envChain` utility we can easily get the appropriate `mvxProxyUrl` (i.e. https://devnet-gateway.multiversx.com/ for Devnet) and chain `id` depending on the current `CHAIN` environment variable value that is set in the `scripts` section of our `package.json` file.

We then declare the function `loadWallet` to load a wallet from a `.json` file using the `world.newWalletFromFile()` function. The reason we don't call this directly is that we will get a password prompt after running this function, and we only want to trigger that after `commander` handles our custom command.

Expand Down
Binary file modified xsuite-fullsimulnet-darwin-amd64/bin/libvmexeccapi.dylib
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion xsuite-fullsimulnet-darwin-amd64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xsuite/full-simulnet-darwin-amd64",
"version": "0.0.15",
"version": "0.0.17",
"os": [
"darwin"
],
Expand Down
Binary file modified xsuite-fullsimulnet-linux-amd64/bin/libvmexeccapi.so
Binary file not shown.
Binary file modified xsuite-fullsimulnet-linux-amd64/bin/libwasmer_linux_amd64.so
Binary file not shown.
2 changes: 1 addition & 1 deletion xsuite-fullsimulnet-linux-amd64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xsuite/full-simulnet-linux-amd64",
"version": "0.0.15",
"version": "0.0.17",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion xsuite-fullsimulnet/build-binary.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ if (process.env.CI) {
]);
}

await $`GOBIN="$(pwd)" go install -ldflags ${argv.ldflags} github.com/multiversx/mx-chain-simulator-go/cmd/chainsimulator@v1.7.13-patch2-fix1`;
await $`GOBIN="$(pwd)" go install -ldflags ${argv.ldflags} github.com/multiversx/mx-chain-simulator-go/cmd/chainsimulator@v1.8.4-fix1`;
await $`mv ./chainsimulator ../xsuite-fullsimulnet-${argv.os}-${argv.arch}/bin/fsproxy`;
12 changes: 10 additions & 2 deletions xsuite-fullsimulnet/config/node/config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -672,15 +672,23 @@
TimeOutForSCExecutionInMilliseconds = 10000 # 10 seconds = 10000 milliseconds
WasmerSIGSEGVPassthrough = false # must be false for release
WasmVMVersions = [
{ StartEpoch = 0, Version = "v1.5" }, # TODO: set also the RoundActivations.DisableAsyncCallV1 accordingly
{ StartEpoch = 0, Version = "v1.4" },
{ StartEpoch = 1, Version = "v1.5" }, # TODO: set also the RoundActivations.DisableAsyncCallV1 accordingly
]
TransferAndExecuteByUserAddresses = [ # TODO: set real contract addresses for all shards
"erd1qqqqqqqqqqqqqpgqr46jrxr6r2unaqh75ugd308dwx5vgnhwh47qtvepe3", #shard 0
]

[VirtualMachine.Querying]
NumConcurrentVMs = 1
TimeOutForSCExecutionInMilliseconds = 10000 # 10 seconds = 10000 milliseconds
WasmerSIGSEGVPassthrough = false # must be false for release
WasmVMVersions = [
{ StartEpoch = 0, Version = "v1.5" }, # TODO: set also the RoundActivations.DisableAsyncCallV1 accordingly
{ StartEpoch = 0, Version = "v1.4" },
{ StartEpoch = 1, Version = "v1.5" }, # TODO: set also the RoundActivations.DisableAsyncCallV1 accordingly
]
TransferAndExecuteByUserAddresses = [ # TODO: set real contract addresses for all shards
"erd1qqqqqqqqqqqqqpgqr46jrxr6r2unaqh75ugd308dwx5vgnhwh47qtvepe3",
]

[VirtualMachine.GasConfig]
Expand Down
24 changes: 24 additions & 0 deletions xsuite-fullsimulnet/config/node/config/enableEpochs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,30 @@
# AlwaysMergeContextsInEEIEnableEpoch represents the epoch in which the EEI will always merge the contexts
AlwaysMergeContextsInEEIEnableEpoch = 1

# UseGasBoundedShouldFailExecutionEnableEpoch represents the epoch when use bounded gas function should fail execution in case of error
UseGasBoundedShouldFailExecutionEnableEpoch = 1

# DynamicESDTEnableEpoch represents the epoch when dynamic NFT feature is enabled
DynamicESDTEnableEpoch = 4

# EGLDInMultiTransferEnableEpoch represents the epoch when EGLD in multitransfer is enabled
EGLDInMultiTransferEnableEpoch = 4

# CryptoOpcodesV2EnableEpoch represents the epoch when BLSMultiSig, Secp256r1 and other opcodes are enabled
CryptoOpcodesV2EnableEpoch = 4

# UnjailCleanupEnableEpoch represents the epoch when the cleanup of the unjailed nodes is enabled
UnJailCleanupEnableEpoch = 4

# FixRelayedBaseCostEnableEpoch represents the epoch when the fix for relayed base cost will be enabled
FixRelayedBaseCostEnableEpoch = 4

# MultiESDTNFTTransferAndExecuteByUserEnableEpoch represents the epoch when enshrined sovereign cross chain opcodes are enabled
MultiESDTNFTTransferAndExecuteByUserEnableEpoch = 9999999

# FixRelayedMoveBalanceToNonPayableSCEnableEpoch represents the epoch when the fix for relayed move balance to non payable sc will be enabled
FixRelayedMoveBalanceToNonPayableSCEnableEpoch = 4

# BLSMultiSignerEnableEpoch represents the activation epoch for different types of BLS multi-signers
BLSMultiSignerEnableEpoch = [
{ EnableEpoch = 0, Type = "no-KOSK" },
Expand Down
2 changes: 1 addition & 1 deletion xsuite-fullsimulnet/config/node/config/external.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

# URL for the WebSocket client/server connection
# This value represents the IP address and port number that the WebSocket client or server will use to establish a connection.
URL = "127.0.0.1:22111"
URL = "ws://127.0.0.1:22111"

# After a message will be sent it will wait for an ack message if this flag is enabled
WithAcknowledge = true
Expand Down
Loading

0 comments on commit 8120244

Please sign in to comment.