Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev into main #241

Merged
merged 27 commits into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b20d474
Add fetcher option to proxy to override the fetcher
lcswillems Nov 13, 2024
834d82a
Release xsuite@0.0.93
lcswillems Nov 13, 2024
c5c4654
Use stable toolchain
lcswillems Nov 16, 2024
3a89605
Fix paths
lcswillems Nov 16, 2024
8b2ac2e
Merge pull request #236 from arda-org/use-stable
lcswillems Nov 16, 2024
c30c8f5
Release xsuite@0.0.94
lcswillems Nov 16, 2024
8a6feb3
Integrate Spica v1.8.4
lcswillems Nov 21, 2024
6b68361
Merge pull request #227 from arda-org/upgrade-to-node-1.8
lcswillems Nov 21, 2024
ca02273
Release @xsuite/full-simulnet@0.0.16 @xsuite/light-simulnet@0.0.33 xs…
lcswillems Nov 21, 2024
e3345db
Add NativeSelect helper component
lcswillems Nov 21, 2024
f76130d
Expose node URLs
lcswillems Nov 24, 2024
59c9216
Merge pull request #237 from arda-org/expose-node-urls
lcswillems Nov 24, 2024
b60f836
Release xsuite@0.0.96
lcswillems Nov 24, 2024
0368656
Fix libs + only use local dir
lcswillems Nov 26, 2024
7189323
Merge pull request #238 from arda-org/fix-libs
lcswillems Nov 26, 2024
3abb2e2
Fix build commands
lcswillems Nov 26, 2024
6cd22ec
Release @xsuite/full-simulnet@0.0.17 @xsuite/light-simulnet@0.0.35 xs…
lcswillems Nov 26, 2024
73d0170
Remove esbuild target
lcswillems Nov 28, 2024
2bbabaa
Merge pull request #239 from arda-org/remove-esbuild-target-setting
lcswillems Nov 28, 2024
b4fb85c
Remove unnecessary library
lcswillems Nov 28, 2024
9ed9342
Simplify index.js
lcswillems Nov 28, 2024
31d9bcc
Add getNodeUrls
lcswillems Nov 29, 2024
52ce24f
Release xsuite@0.0.98
lcswillems Nov 29, 2024
6f4d8a8
Add getNodeUrl + more fixes in tests
lcswillems Nov 29, 2024
be0af45
Release xsuite@0.0.99
lcswillems Nov 29, 2024
9303354
Allow to customize the proxy URL
lcswillems Nov 30, 2024
a8ab02c
Release xsuite@0.0.100
lcswillems Nov 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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