Skip to content

chore: upgrading to [upcoming] fuels @ 0.100.4 #512

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

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
e759eda
Using a temporary PR tag from `fuels`
arboleya Apr 15, 2025
a4f2a04
Adding an internal registry for resolving non-official tags
arboleya Apr 15, 2025
07e689b
Upgrading `fuel-core`, `forc` and the Faucet
arboleya Apr 15, 2025
defcfa9
Upgrading `sway-standards` and `sway-libs`
arboleya Apr 15, 2025
065fe21
Migrating Sway deprecations and breaking-changes
arboleya Apr 15, 2025
60d42d0
Using max JS safe number for the Genesis Wallet initial balance
arboleya Apr 15, 2025
2ced2fa
Increasing the dispense amount in Faucet
arboleya Apr 15, 2025
b1e7afc
Fixing tests: adding enough funds
arboleya Apr 15, 2025
31da941
Fixing tests: addressing flakiness with proper `launchTestNode` usage
arboleya Apr 15, 2025
19f2263
Fixing tests: resolving flakiness in `tranferMaxBalance` utility
arboleya Apr 15, 2025
161b853
Lintfix: types must come first
arboleya Apr 15, 2025
c02f2bc
Lintfix: root level await
arboleya Apr 15, 2025
6890522
Lintfix: property names must be camelCased
arboleya Apr 15, 2025
80d4893
Fixing `Get Coins` button to work with local Faucet
arboleya Apr 15, 2025
ce8cec3
Fixing generation script for EVM/SVM Predicates
arboleya Apr 15, 2025
2188f6e
Updating `TxIdencoders` file during EVM predicate re-generation
arboleya Apr 15, 2025
74f99f1
Git-ignoring local `.history` directory
arboleya Apr 15, 2025
58ac660
Updating lockfile
arboleya Apr 15, 2025
7c8d400
Tidying up
arboleya Apr 15, 2025
7705c8d
Adding changeset
arboleya Apr 15, 2025
96a1866
Updating Fuel Core and Forc versions in CI workflow, plus lint-fixing
arboleya Apr 15, 2025
dac66ab
Removing unused imports
arboleya Apr 16, 2025
0542b67
DRY
arboleya Apr 16, 2025
f294265
Update .changeset/late-knives-kneel.md
arboleya Apr 16, 2025
92df216
Using scoped-registry so as not to mess with other things
arboleya Apr 16, 2025
619cbf2
Updating lock file
arboleya Apr 16, 2025
d411e37
Undoing custom registry configs
arboleya Apr 16, 2025
d86a5eb
Rolling back custom registry for now
arboleya Apr 16, 2025
f3454e0
Update packages/common/scripts/versions.ts
arboleya Apr 16, 2025
163346e
Merge branch 'main' into aa/feat/upgrading-stack-via-sdk-assemble-tx
arboleya Apr 22, 2025
5a12069
Merge branch 'main' into aa/feat/upgrading-stack-via-sdk-assemble-tx
LuizAsFight Apr 22, 2025
311bc99
chore: remove changesets before release to PR on aws registry
LuizAsFight Apr 22, 2025
4db98a8
chore
LuizAsFight Apr 22, 2025
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
18 changes: 18 additions & 0 deletions .changeset/late-knives-kneel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
"@fuel-connectors/burner-wallet-connector": patch
"@fuel-connectors/fuel-development-wallet": patch
"@fuel-connectors/walletconnect-connector": patch
"@fuel-connectors/solana-connector": patch
"@fuel-connectors/evm-predicates": patch
"@fuel-connectors/evm-connector": patch
"@fuel-connectors/fuelet-wallet": patch
"@fuel-connectors/fuel-wallet": patch
"@fuels/connectors": patch
"@fuel-connectors/bako-safe": patch
"@e2e-tests/runner": patch
"@fuel-connectors/common": patch
"@fuels/react": patch
"docs": patch
---

Upgrading to [upcoming] `fuels` @ `0.100.4`
1 change: 1 addition & 0 deletions .github/workflows/pr-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
- name: Release PR version
id: release
run: |
rm -f .changeset/*.md
pnpm changeset:next
pnpm changeset version --snapshot pr-${{ github.event.pull_request.number }}
changetsets=$(pnpm changeset publish --tag pr-${{ github.event.pull_request.number }})
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ concurrency:
cancel-in-progress: true

env:
FORC_VERSION: 0.66.5
CORE_VERSION: 0.40.2
FORC_VERSION: 0.67.0
CORE_VERSION: 0.43.0

jobs:
tests-vitest:
name: Vitest Tests
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v3

- name: Setup Node
uses: FuelLabs/github-actions/setups/node@master
with:
node-version: 20.11.0
pnpm-version: 9.5.0

- uses: FuelLabs/github-actions/setups/docker@master
with:
username: ${{ github.repository_owner }}
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
- name: Run PNPM install
id: pnpm-cache
run: pnpm install --frozen-lockfile

- name: Copy .env file for E2E Tests
run: cp e2e-tests/runner/.env.example e2e-tests/runner/.env

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

- name: Run build:connectors
run: pnpm build:connectors

- uses: ./.github/workflows/setup-rust

- name: Verify Forc and Fuel-Core
Expand Down Expand Up @@ -147,4 +147,3 @@ jobs:
run: xvfb-run --auto-servernum -- pnpm --filter @e2e-tests/runner test:e2e
env:
VITE_MASTER_WALLET_MNEMONIC: ${{ secrets.VITE_MASTER_WALLET_MNEMONIC }}

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ yarn-error.log*
.DS_Store
.zed

# Local history
*.history

# Sway
**/out/release

Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
save-exact = true
enable-pre-post-scripts = true
registry=https://npm-packages.fuel.network
20 changes: 5 additions & 15 deletions Forc.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[[package]]
name = "core"
source = "path+from-root-6A8836696D55BC6E"

[[package]]
name = "counter"
source = "member"
Expand All @@ -11,7 +7,7 @@ dependencies = ["std"]
name = "custom_asset"
source = "member"
dependencies = [
"standards git+https://github.com/FuelLabs/sway-standards?tag=v0.4.1#0a6f3ba0bce036a0ce61f15ed4480c71af32d3aa",
"standards",
"std",
"sway_libs",
]
Expand All @@ -28,23 +24,17 @@ dependencies = ["std"]

[[package]]
name = "standards"
source = "git+https://github.com/FuelLabs/sway-standards?tag=v0.4.1#0a6f3ba0bce036a0ce61f15ed4480c71af32d3aa"
dependencies = ["std"]

[[package]]
name = "standards"
source = "git+https://github.com/FuelLabs/sway-standards?tag=v0.4.3#6f63eb7dff2458a7d976184e565b5cbf26f61da2"
source = "git+https://github.com/FuelLabs/sway-standards?tag=v0.7.0#7d35df95e0b96dc8ad188ab169fbbeeac896aae8"
dependencies = ["std"]

[[package]]
name = "std"
source = "git+https://github.com/fuellabs/sway?tag=v0.66.5#94a066652468b4afa3bd396dacef482ed590976b"
dependencies = ["core"]
source = "git+https://github.com/fuellabs/sway?tag=v0.67.0#d821dcb0c7edb1d6e2a772f5a1ccefe38902eaec"

[[package]]
name = "sway_libs"
source = "git+https://github.com/FuelLabs/sway-libs?tag=v0.21.0#6a227ed34c86fe1ebd334dbdfeccf66c43e3915b"
source = "git+https://github.com/FuelLabs/sway-libs?tag=v0.25.1#00569f811eae256a522c0e592522ea638815b362"
dependencies = [
"standards git+https://github.com/FuelLabs/sway-standards?tag=v0.4.3#6f63eb7dff2458a7d976184e565b5cbf26f61da2",
"standards",
"std",
]
2 changes: 1 addition & 1 deletion docker/.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PROJECT=fuels-wallet
MIN_GAS_PRICE=1
WALLET_SECRET=0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298
DISPENSE_AMOUNT=2000000
DISPENSE_AMOUNT=2000000000
FUEL_CORE_PORT=4000
FUEL_FAUCET_PORT=4040
FUEL_IP=0.0.0.0
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
WALLET_SECRET_KEY: ${WALLET_SECRET}
DISPENSE_AMOUNT: ${DISPENSE_AMOUNT}
FUEL_NODE_URL: http://${PROJECT:-fuel-node}_fuel-core:4000/v1/graphql
image: ghcr.io/fuellabs/faucet:4f7bec0
image: ghcr.io/fuellabs/faucet:474768d
ports:
- '${FUEL_FAUCET_PORT:-4040}:3000'
links:
Expand Down
8 changes: 4 additions & 4 deletions docker/fuel-core/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# We should be supporting always the same fuel-core version as the fuels (ts-sdk)
# https://github.com/FuelLabs/fuels-ts/blob/master/internal/fuel-core/VERSION
FROM ghcr.io/fuellabs/fuel-core:v0.40.2
FROM ghcr.io/fuellabs/fuel-core:v0.43.0

# dependencies
ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -17,20 +17,20 @@ WORKDIR /fuel

COPY ./genesis_coins.json .

# Fuel Core 0.40.2, needs to be changed when core version is updated
# Fuel Core 0.42.0, needs to be changed when 0.43 is out
RUN git clone \
https://github.com/FuelLabs/chain-configuration.git \
/chain-configuration && \
cd /chain-configuration && \
git checkout b77704477886d4bec04175622143278eceb179b6
git checkout 14b923f6dff7036ccbd3daa058d1ea132dae3fdc

# Copy the base local configuration
RUN cp -R /chain-configuration/local/* ./

# Copy the testnet consensus parameters and state transition bytecode
RUN cp /chain-configuration/upgradelog/ignition-devnet/consensus_parameters/15.json \
./latest_consensus_parameters.json
RUN cp /chain-configuration/upgradelog/ignition-devnet/state_transition_function/21.wasm \
RUN cp /chain-configuration/upgradelog/ignition-devnet/state_transition_function/25.wasm \
./state_transition_bytecode.wasm

# update local state_config with custom genesis coins config
Expand Down
4 changes: 2 additions & 2 deletions docker/fuel-core/genesis_coins.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"owner": "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d",
"amount": 1000000000000,
"amount": 9007199254740991,
"asset_id": "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07",
"tx_id": "0x0000000000000000000000000000000000000000000000000000000000000032",
"output_index": 0,
Expand All @@ -10,7 +10,7 @@
},
{
"owner": "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d",
"amount": 1000000000000,
"amount": 9007199254740991,
"asset_id": "0x0000000000000000000000000000000000000000000000000000000000000001",
"tx_id": "0x0000000000000000000000000000000000000000000000000000000000000033",
"output_index": 0,
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/react-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@tanstack/react-query": "5.35.1",
"@wagmi/connectors": "5.1.7",
"@wagmi/core": "2.13.4",
"fuels": "0.100.0",
"fuels": "pr-3747",
Copy link
Member Author

@arboleya arboleya Apr 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

  1. Replace with the right fuels version after it's released.
  2. Remove custom registry from .npmrc
  3. Double-test things on Testnet (after fuel-core 0.43.0)

"clsx": "2.1.1",
"connectkit": "1.8.2",
"next": "14.2.26",
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/runner/contracts/custom_asset/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ license = "Apache-2.0"
name = "custom_asset"

[dependencies]
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.4.1" }
sway_libs = { git = "https://github.com/FuelLabs/sway-libs", tag = "v0.21.0" }
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.7.0" }
sway_libs = { git = "https://github.com/FuelLabs/sway-libs", tag = "v0.25.1" }
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ test.describe('BurnerWalletConnector', async () => {
const addressElement = await page.locator('css=#address');

const address = await addressElement.getAttribute('data-address');
const amount: BN = bn(100_000_000);
const amount: BN = bn(2_000_000_000);

if (address) {
await seedWallet(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ test.describe('FuelWalletConnector', () => {
let fuelWallet: WalletUnlocked;
let masterWallet: WalletUnlocked;

const depositAmount = '0.0003'; // Should be enough to cover the increment and transfer
const depositAmount = '0.05'; // Should be enough to cover the increment and transfer

const connect: ConnectorFunctions['connect'] = async (page) => {
const connectButton = getButtonByText(page, 'Connect Wallet', true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ test.describe('WalletConnectConnector', () => {
const addressElement = await page.locator('css=#address');

const address = await addressElement.getAttribute('data-address');
const amount: BN = bn(100_000_000);
const amount: BN = bn(2_000_000_000);

if (address) {
await seedWallet(
Expand Down
71 changes: 39 additions & 32 deletions e2e-tests/runner/examples/connectors/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ import type { BrowserContext, Page } from '@playwright/test';
import dotenv from 'dotenv';
import {
type BNInput,
type ChangeTransactionRequestOutput,
Mnemonic,
OutputType,
Provider,
ScriptTransactionRequest,
Wallet,
type WalletUnlocked,
bn,
Expand Down Expand Up @@ -82,36 +85,40 @@ export const transferMaxBalance = async ({
fromWallet: WalletUnlocked;
toWallet: WalletUnlocked;
}) => {
if (!fromWallet || !toWallet) return;

const MAX_ATTEMPTS = 10;
const trySendMax = async (attempt = 1) => {
if (attempt > MAX_ATTEMPTS) return;

try {
const remainingBalance = await fromWallet.getBalance();
const nextSubTry = bn(attempt * 10_000);

if (nextSubTry.lt(remainingBalance)) {
const targetAmount = remainingBalance.sub(nextSubTry);
const amountToSend = targetAmount.gt(0) ? targetAmount : bn(1);

const txResponse = await fromWallet.transfer(
toWallet.address,
amountToSend,
);
await txResponse.waitForResult();
console.log(
`----- Success sending ${amountToSend?.format()} back to ${
toWallet.address
}`,
);
}
} catch (e) {
console.log('error sending remaining balance', e.message);
await trySendMax(attempt + 1);
}
};

await trySendMax();
if (!fromWallet || !toWallet) {
return;
}
const provider = fromWallet.provider;

const {
consensusParameters: {
txParameters: { maxInputs },
},
} = await provider.getChain();

const baseAssetId = await provider.getBaseAssetId();
const { coins } = await fromWallet.getCoins(baseAssetId);

if (coins.length > Number(maxInputs.toString())) {
throw new Error('Impossible to determine maximum spendable amount');
}

const request = new ScriptTransactionRequest();

request.addResources(coins);

await request.estimateAndFund(fromWallet);

const changeOutput = request.outputs.find(
(output) =>
output.type === OutputType.Change && output.assetId === baseAssetId,
) as ChangeTransactionRequestOutput;

changeOutput.to = toWallet.address.toB256();

const tx = await fromWallet.sendTransaction(request, {
estimateTxDependencies: false,
});

await tx.waitForResult();
};
2 changes: 1 addition & 1 deletion e2e-tests/runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"@synthetixio/synpress-cache": "0.0.4",
"dotenv": "16.4.5",
"@phantom/synpress": "4.0.0-alpha.53",
"fuels": "0.100.0"
"fuels": "pr-3747"
}
}
2 changes: 2 additions & 0 deletions e2e-tests/runner/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"compilerOptions": {
"module": "ES2022",
"moduleResolution": "bundler",
"target": "ES2022",
"strict": true
}
}
2 changes: 1 addition & 1 deletion examples/react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@wagmi/connectors": "5.1.7",
"@wagmi/core": "2.13.4",
"clsx": "2.1.1",
"fuels": "0.100.0",
"fuels": "pr-3747",
"react": "18.3.1",
"react-dom": "18.3.1"
},
Expand Down
4 changes: 3 additions & 1 deletion examples/react-app/src/components/faucet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ export interface FaucetProps {
disabled?: boolean;
}
export function Faucet({ address, isSigning, disabled }: FaucetProps) {
const url = `https://faucet-testnet.fuel.network/?address=${address}&autoClose&redirectUrl=${window.location.href}`;
const isLocal = /localhost/.test(window.location.href);
const faucetUrl = isLocal ? 'localhost:4040' : 'faucet-testnet.fuel.network';
const url = `http://${faucetUrl}/?address=${address}&autoClose&redirectUrl=${window.location.href}`;

return (
<a
Expand Down
4 changes: 2 additions & 2 deletions fuel-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
channel = "testnet"

[components]
fuel-core = "0.40.2"
forc = "0.66.5"
fuel-core = "0.43.0"
forc = "0.67.0"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@types/node": "20.12.11",
"@vitest/coverage-v8": "2.1.9",
"compare-versions": "6.1.0",
"fuels": "0.100.0",
"fuels": "pr-3747",
"husky": "9.0.11",
"lint-staged": "15.2.2",
"tsx": "^4.16.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/bako-safe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"socket.io-client": "4.7.2"
},
"peerDependencies": {
"fuels": "0.100.0",
"fuels": "pr-3747",
"socket.io-client": "4.7.2"
},
"devDependencies": {
Expand Down
Loading
Loading