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

chore!: upgrade fuel core to 0.28.0 #2491

Merged
merged 39 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
4c4ff3c
chore: bumped versions
petertonysmith94 Jun 10, 2024
f502e9b
chore: added devnet URL
petertonysmith94 Jun 10, 2024
c318f3e
ci: removed redundant env
petertonysmith94 Jun 10, 2024
b5a107b
chore: removed redundant `FUEL_TESTNET_NETWORK_URL` e2e env
petertonysmith94 Jun 10, 2024
431f51f
chore: removed redundant `TEST_WALLET_ADDRESS`
petertonysmith94 Jun 10, 2024
3ebef10
chore: allowed for two networks in the e2e's
petertonysmith94 Jun 10, 2024
8b52548
chore: updates operations
petertonysmith94 Jun 10, 2024
412884c
chore: added alocDependentCost
petertonysmith94 Jun 10, 2024
2661c3f
chore: added version to Header
petertonysmith94 Jun 10, 2024
4f00297
chore: fix incorrect test network
petertonysmith94 Jun 10, 2024
ab300f9
chore: ensure we don't connect to the live network
petertonysmith94 Jun 10, 2024
077b69f
chore: added Block.version
petertonysmith94 Jun 10, 2024
c234d19
chore: added `gasPrice` to the dryRun
petertonysmith94 Jun 10, 2024
f967b68
chore: point e2e test to devnet
petertonysmith94 Jun 10, 2024
f10a67d
chore: changeset
petertonysmith94 Jun 10, 2024
89667c8
ci: added missing envs
petertonysmith94 Jun 10, 2024
1861e13
chore: removed `FUEL_` prefix from network urls
petertonysmith94 Jun 11, 2024
2a77256
chore: removed type from network urls
petertonysmith94 Jun 11, 2024
d9cd0e9
chore: added ability to run e2e against multiple networks
petertonysmith94 Jun 11, 2024
33f2f0a
chore: revert back to skipping when private key missing
petertonysmith94 Jun 11, 2024
ad84110
chore: linting
petertonysmith94 Jun 11, 2024
d917bf9
chore: reconfigured the e2e transaction tests
petertonysmith94 Jun 11, 2024
32bb825
Merge branch 'master' into ps/chore/upgrade-fuel-core-to-0.28.0
petertonysmith94 Jun 11, 2024
859fd63
Merge branch 'master' of github.com:FuelLabs/fuels-ts into ps/chore/u…
petertonysmith94 Jun 11, 2024
162df8d
chore: address el nits
petertonysmith94 Jun 11, 2024
576a96c
chore: added `txIds` for `testnet`
petertonysmith94 Jun 11, 2024
68653fb
Merge branch 'master' into ps/chore/upgrade-fuel-core-to-0.28.0
petertonysmith94 Jun 11, 2024
c116b52
chore: combine e2e assets and script
petertonysmith94 Jun 11, 2024
cc30e36
Merge branch 'ps/chore/upgrade-fuel-core-to-0.28.0' of github.com:Fue…
petertonysmith94 Jun 11, 2024
5c42df7
chore: added all network URLS
petertonysmith94 Jun 12, 2024
a0e0e41
chore: removed redundant env
petertonysmith94 Jun 12, 2024
6fe0d24
chore: fixed chain config
petertonysmith94 Jun 12, 2024
54e16f0
Merge branch 'master' into ps/chore/upgrade-fuel-core-to-0.28.0
Torres-ssf Jun 12, 2024
ade86bd
Merge branch 'master' of https://github.com/FuelLabs/fuels-ts into ps…
petertonysmith94 Jun 13, 2024
5443cb6
Merge branch 'master' into ps/chore/upgrade-fuel-core-to-0.28.0
petertonysmith94 Jun 13, 2024
eabcf07
Merge branch 'master' into ps/chore/upgrade-fuel-core-to-0.28.0
petertonysmith94 Jun 13, 2024
c1ededd
Merge branch 'master' into ps/chore/upgrade-fuel-core-to-0.28.0
petertonysmith94 Jun 13, 2024
80d0ed7
chore: added missing testnet test case
petertonysmith94 Jun 13, 2024
9630525
Merge branch 'master' into ps/chore/upgrade-fuel-core-to-0.28.0
petertonysmith94 Jun 13, 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
7 changes: 7 additions & 0 deletions .changeset/breezy-hounds-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@fuel-ts/versions": patch
"@fuel-ts/account": patch
"fuels": patch
---

chore: upgrade fuel core to `0.28.0`
6 changes: 6 additions & 0 deletions .fuel-core/configs/chainConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@
"wqmm": 10,
"xor": 2,
"xori": 2,
"alloc": {
"LightOperation": {
"base": "2",
"unitsPerGas": "214"
}
},
Torres-ssf marked this conversation as resolved.
Show resolved Hide resolved
"call": {
"LightOperation": {
"base": 18190,
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@ jobs:
- name: Run Isolated Tests
run: pnpm test:e2e
env:
FUEL_NETWORK_URL: https://testnet.fuel.network/v1/graphql
FUEL_TESTNET_NETWORK_URL: https://testnet.fuel.network/v1/graphql
TEST_WALLET_PVT_KEY: ${{ secrets.TEST_WALLET_PVT_KEY }}
TEST_WALLET_ADDRESS: ${{ secrets.TEST_WALLET_ADDRESS }}
TESTNET_WALLET_PVT_KEY: ${{ secrets.TESTNET_WALLET_PVT_KEY }}
DEVNET_WALLET_PVT_KEY: ${{ secrets.DEVNET_WALLET_PVT_KEY }}
PUBLISHED_NPM_VERSION: ${{ steps.release.outputs.published_version }}

create-fuels-template-integration:
Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ And changing the below variables:
```sh
FUEL_NETWORK_URL=https://testnet.fuel.network/v1/graphql
TEST_WALLET_PVT_KEY=0x...
TEST_WALLET_ADDRESS=fuel...
```

<!-- TODO: add/fix block explorer URL after testnet support- Checking Wallet Balance: https://fuellabs.github.io/block-explorer-v2/beta-5/?#/address/fuel1x33ajpj0jy5p2wcqqu45e32r75zrwfeh6hwqfv5un670rv4p0mns58enjg -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import {
* @group browser
*/
describe('Getting started', () => {
beforeAll(() => {
beforeAll(async () => {
// Avoids using the actual network.
vi.spyOn(Provider, 'create').mockImplementationOnce(() => Provider.create(FUEL_NETWORK_URL));
const mockProvider = await Provider.create(FUEL_NETWORK_URL);
vi.spyOn(Provider, 'create').mockResolvedValue(mockProvider);
arboleya marked this conversation as resolved.
Show resolved Hide resolved
});

it('can connect to a local network', async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import type { WalletLocked, WalletUnlocked } from 'fuels';
import { FUEL_NETWORK_URL, HDWallet, Provider, Wallet } from 'fuels';
import { FUEL_NETWORK_URL, FUEL_TESTNET_NETWORK_URL, HDWallet, Provider, Wallet } from 'fuels';

/**
* @group node
*/
describe(__filename, () => {
beforeAll(async () => {
// Avoids using the actual network.
const mockProvider = await Provider.create(FUEL_NETWORK_URL);
vi.spyOn(Provider, 'create').mockResolvedValue(mockProvider);
});

it('should generate a new wallet just fine', () => {
// #region instantiating-wallets-1
const unlockedWallet: WalletUnlocked = Wallet.generate();
Expand Down Expand Up @@ -100,7 +106,7 @@ describe(__filename, () => {
const myWallet = Wallet.fromAddress(address);

// #region instantiating-wallets-9
const provider = await Provider.create('https://testnet.fuel.network/v1/graphql');
const provider = await Provider.create(FUEL_TESTNET_NETWORK_URL);

myWallet.connect(provider);
// #endregion instantiating-wallets-9
Expand Down
2 changes: 1 addition & 1 deletion internal/fuel-core/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.27.0
0.28.0
5 changes: 5 additions & 0 deletions packages/account/src/configs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ describe('Configs', () => {
expect(configs.FUEL_NETWORK_URL).toBe('http://127.0.0.1:4000/v1/graphql');
});

it('exports FUEL_DEVNET_NETWORK_URL', async () => {
const configs = await import('./configs');
expect(configs.FUEL_DEVNET_NETWORK_URL).toBe('https://devnet.fuel.network/v1/graphql');
arboleya marked this conversation as resolved.
Show resolved Hide resolved
});

it('exports FUEL_TESTNET_NETWORK_URL', async () => {
const configs = await import('./configs');
expect(configs.FUEL_TESTNET_NETWORK_URL).toBe('https://testnet.fuel.network/v1/graphql');
Expand Down
1 change: 1 addition & 0 deletions packages/account/src/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export const FUEL_NETWORK_URL: string =
? process?.env?.FUEL_NETWORK_URL || 'http://127.0.0.1:4000/v1/graphql'
: 'http://127.0.0.1:4000/v1/graphql';

export const FUEL_DEVNET_NETWORK_URL: string = 'https://devnet.fuel.network/v1/graphql';
arboleya marked this conversation as resolved.
Show resolved Hide resolved
export const FUEL_TESTNET_NETWORK_URL: string = 'https://testnet.fuel.network/v1/graphql';
16 changes: 16 additions & 0 deletions packages/account/src/providers/fuel-core-schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ input BalanceFilterInput {
}

type Block {
version: BlockVersion!
id: BlockId!
height: U32!
header: Header!
Expand Down Expand Up @@ -89,6 +90,10 @@ type BlockEdge {

scalar BlockId

enum BlockVersion {
V1
}

"""
Breakpoint, defined as a tuple of contract ID and relative PC offset inside it
"""
Expand Down Expand Up @@ -436,6 +441,7 @@ type GasCosts {
wqmm: U64!
xor: U64!
xori: U64!
alocDependentCost: DependentCost!
call: DependentCost!
ccp: DependentCost!
croo: DependentCost!
Expand Down Expand Up @@ -493,6 +499,11 @@ type Genesis {
}

type Header {
"""
Version of the header
"""
version: HeaderVersion!

"""
Hash of the header
"""
Expand Down Expand Up @@ -559,6 +570,10 @@ type Header {
applicationHash: Bytes32!
}

enum HeaderVersion {
V1
}

Torres-ssf marked this conversation as resolved.
Show resolved Hide resolved
type HeavyOperation {
base: U64!
gasPerUnit: U64!
Expand Down Expand Up @@ -739,6 +754,7 @@ type Mutation {
dryRun(
txs: [HexString!]!
utxoValidation: Boolean
gasPrice: U64
petertonysmith94 marked this conversation as resolved.
Show resolved Hide resolved
): [DryRunTransactionExecutionStatus!]!

"""
Expand Down
17 changes: 15 additions & 2 deletions packages/account/src/providers/operations.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ fragment messageProofFragment on MessageProof {
proofIndex
}
messageBlockHeader {
version
id
daHeight
consensusParametersVersion
Expand All @@ -227,6 +228,7 @@ fragment messageProofFragment on MessageProof {
applicationHash
}
commitBlockHeader {
version
id
daHeight
consensusParametersVersion
Expand Down Expand Up @@ -393,6 +395,9 @@ fragment GasCostsFragment on GasCosts {
wqmm
xor
xori
alocDependentCost {
...DependentCostFragment
}
call {
...DependentCostFragment
}
Expand Down Expand Up @@ -772,8 +777,16 @@ query getRelayedTransactionStatus(
}
}

mutation dryRun($encodedTransactions: [HexString!]!, $utxoValidation: Boolean) {
dryRun(txs: $encodedTransactions, utxoValidation: $utxoValidation) {
mutation dryRun(
$encodedTransactions: [HexString!]!
$utxoValidation: Boolean
$gasPrice: U64
) {
dryRun(
txs: $encodedTransactions
utxoValidation: $utxoValidation
gasPrice: $gasPrice
) {
...dryRunTransactionExecutionStatusFragment
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/account/src/providers/provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('Provider', () => {

const version = await provider.getVersion();

expect(version).toEqual('0.27.0');
expect(version).toEqual('0.28.0');
});

it('can call()', async () => {
Expand Down
5 changes: 5 additions & 0 deletions packages/account/test/fixtures/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ export const MOCK_CHAIN: GqlChainInfoFragment = {
wqmm: '3',
xor: '1',
xori: '1',
alocDependentCost: {
type: 'LightOperation',
base: '2',
unitsPerGas: '214',
},
Torres-ssf marked this conversation as resolved.
Show resolved Hide resolved
call: {
type: 'LightOperation',
base: '144',
Expand Down
7 changes: 6 additions & 1 deletion packages/account/test/fixtures/messageProof.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { Address } from '@fuel-ts/address';
import { bn } from '@fuel-ts/math';

import type { GqlGetMessageProofQuery } from '../../src/providers/__generated__/operations';
import {
GqlHeaderVersion,
type GqlGetMessageProofQuery,
} from '../../src/providers/__generated__/operations';
import type { MessageProof } from '../../src/providers/message';

export const MESSAGE_PROOF_RAW_RESPONSE: GqlGetMessageProofQuery['messageProof'] = {
Expand All @@ -20,6 +23,7 @@ export const MESSAGE_PROOF_RAW_RESPONSE: GqlGetMessageProofQuery['messageProof']
proofIndex: '432',
},
messageBlockHeader: {
version: GqlHeaderVersion.V1,
id: '0x864b55089878bf7009d2ff64cbeeeeb75fcd73768785dcb75d54180e7fbaab7b',
daHeight: '0',
transactionsCount: '2',
Expand All @@ -35,6 +39,7 @@ export const MESSAGE_PROOF_RAW_RESPONSE: GqlGetMessageProofQuery['messageProof']
messageOutboxRoot: '0x8817eb3173bc39ae465def50f978153fd84ea4badbe3a4e26486ba7f1bcd0579',
},
commitBlockHeader: {
version: GqlHeaderVersion.V1,
id: '0xe4dfe8fc1b5de2c669efbcc5e4c0a61db175d1b2f03e3cd46ed4396e76695c5b',
daHeight: '0',
transactionsCount: '2',
Expand Down
6 changes: 6 additions & 0 deletions packages/fuel-gauge/src/doc-examples.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ const ADDRESS_BYTES = new Uint8Array([
describe('Doc Examples', () => {
let baseAssetId: string;

beforeAll(async () => {
// Avoids using the actual network.
const mockProvider = await Provider.create(FUEL_NETWORK_URL);
vi.spyOn(Provider, 'create').mockResolvedValue(mockProvider);
});

beforeAll(async () => {
const provider = await Provider.create(FUEL_NETWORK_URL);
baseAssetId = provider.getBaseAssetId();
Expand Down
31 changes: 25 additions & 6 deletions packages/fuel-gauge/src/e2e-script.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
/* eslint-disable no-console */
import { Provider, TransactionType, WalletUnlocked } from 'fuels';
import {
FUEL_DEVNET_NETWORK_URL,
FUEL_TESTNET_NETWORK_URL,
Provider,
TransactionType,
WalletUnlocked,
} from 'fuels';

import { getScript } from './utils';

const networks = {
devnet: {
networkUrl: FUEL_DEVNET_NETWORK_URL,
privateKey: process.env.DEVNET_WALLET_PVT_KEY,
},
testnet: {
networkUrl: FUEL_TESTNET_NETWORK_URL,
privateKey: process.env.TESTNET_WALLET_PVT_KEY,
},
} as const;

/**
* @group node
* @group e2e
Expand All @@ -12,19 +29,22 @@ describe('Live Script Test', () => {
const UPGRADE_TX_ID = '0xe2c03044fe708e9b112027881baf9f892e6b64a630a629998922c1cab918c094';
const UPLOAD_TX_ID = '0x94bc2a189b8211796c8fe5b9c6b67624fe97d2007e104bf1b30739944f43bd73';

const selectedNetwork: keyof typeof networks = 'devnet';
petertonysmith94 marked this conversation as resolved.
Show resolved Hide resolved
arboleya marked this conversation as resolved.
Show resolved Hide resolved
let provider: Provider;
let wallet: WalletUnlocked;
let shouldSkip: boolean;

beforeAll(async () => {
if (!process.env.TEST_WALLET_PVT_KEY || !process.env.FUEL_TESTNET_NETWORK_URL) {
const network = networks[selectedNetwork];

if (!network.privateKey) {
console.log('Skipping live Fuel Node test');
shouldSkip = true;
return;
}

provider = await Provider.create(process.env.FUEL_TESTNET_NETWORK_URL);
wallet = new WalletUnlocked(process.env.TEST_WALLET_PVT_KEY, provider);
provider = await Provider.create(network.networkUrl);
wallet = new WalletUnlocked(network.privateKey, provider);
});

it('can use script against live Fuel Node', async () => {
Expand All @@ -47,8 +67,7 @@ describe('Live Script Test', () => {
console.error((e as Error).message);
console.warn(`
not enough coins to fit the target?
- add assets: https://faucet-testnet.fuel.network/
- check balance: https://app.fuel.network/account/${address}/assets/
danielbate marked this conversation as resolved.
Show resolved Hide resolved
- add assets: https://faucet-${selectedNetwork}.fuel.network/
petertonysmith94 marked this conversation as resolved.
Show resolved Hide resolved
- bech32 address: ${address}
`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@
"wqmm": 11,
"xor": 2,
"xori": 2,
"alloc": {
"LightOperation": {
"base": "2",
"unitsPerGas": "214"
}
},
"call": {
"LightOperation": {
"base": 21687,
Expand Down
6 changes: 6 additions & 0 deletions packages/utils/src/utils/defaultSnapshots/chainConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@
"wqmm": 10,
"xor": 2,
"xori": 2,
"alloc": {
"LightOperation": {
"base": "2",
"unitsPerGas": "214"
}
},
"call": {
"LightOperation": {
"base": 18190,
Expand Down
2 changes: 1 addition & 1 deletion packages/versions/src/lib/getBuiltinVersions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export function getBuiltinVersions() {
return {
FORC: '0.60.0',
FUEL_CORE: '0.27.0',
FUEL_CORE: '0.28.0',
FUELS: '0.89.2',
};
}
Loading