Skip to content

Commit 45cc32e

Browse files
authored
chore: upgrade fuel-core to 0.40.4 (#3626)
1 parent 13064a7 commit 45cc32e

File tree

11 files changed

+95
-8
lines changed

11 files changed

+95
-8
lines changed

.changeset/ten-boats-deny.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@internal/fuel-core": patch
3+
"@fuel-ts/versions": patch
4+
"@fuel-ts/account": patch
5+
---
6+
7+
chore: upgrade `fuel-core` to `0.40.4`

apps/create-fuels-counter-guide/fuel-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ channel = "testnet"
33

44
[components]
55
forc = "0.66.6"
6-
fuel-core = "0.40.2"
6+
fuel-core = "0.40.4"

internal/fuel-core/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.40.2
1+
0.40.4

packages/account/src/providers/fuel-core-schema.graphql

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,10 @@ enum ContractParametersVersion {
314314
V1
315315
}
316316

317+
type DaCompressedBlock {
318+
bytes: HexString!
319+
}
320+
317321
union DependentCost = LightOperation | HeavyOperation
318322

319323
type DryRunFailureStatus {
@@ -809,8 +813,11 @@ type NodeInfo {
809813
utxoValidation: Boolean!
810814
vmBacktrace: Boolean!
811815
maxTx: U64!
816+
maxGas: U64!
817+
maxSize: U64!
812818
maxDepth: U64!
813819
nodeVersion: String!
820+
txPoolStats: TxPoolStats!
814821
peers: [PeerInfo!]!
815822
}
816823

@@ -1039,7 +1046,8 @@ type Query {
10391046
"""
10401047
The list of requested assets` coins with asset ids, `target` amount the user
10411048
wants to reach, and the `max` number of coins in the selection. Several
1042-
entries with the same asset id are not allowed.
1049+
entries with the same asset id are not allowed. The result can't contain
1050+
more coins than `max_inputs`.
10431051
"""
10441052
queryPerAsset: [SpendQueryElementInput!]!
10451053

@@ -1048,6 +1056,12 @@ type Query {
10481056
"""
10491057
excludedIds: ExcludeInput
10501058
): [[CoinType!]!]!
1059+
daCompressedBlock(
1060+
"""
1061+
Height of the block
1062+
"""
1063+
height: U32!
1064+
): DaCompressedBlock
10511065
contract(
10521066
"""
10531067
ID of the Contract
@@ -1383,6 +1397,23 @@ enum TxParametersVersion {
13831397

13841398
scalar TxPointer
13851399

1400+
type TxPoolStats {
1401+
"""
1402+
The number of transactions in the pool
1403+
"""
1404+
txCount: U64!
1405+
1406+
"""
1407+
The total size of the transactions in the pool
1408+
"""
1409+
totalSize: U64!
1410+
1411+
"""
1412+
The total gas of the transactions in the pool
1413+
"""
1414+
totalGas: U64!
1415+
}
1416+
13861417
scalar U16
13871418

13881419
scalar U32

packages/account/src/providers/operations.graphql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,12 @@ query getMessages(
730730
}
731731
}
732732

733+
query daCompressedBlock($height: U32!) {
734+
daCompressedBlock(height: $height) {
735+
bytes
736+
}
737+
}
738+
733739
query getMessageProof(
734740
$transactionId: TransactionId!
735741
$nonce: Nonce!

packages/account/src/providers/provider.test.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { expectToThrowFuelError, safeExec } from '@fuel-ts/errors/test-utils';
66
import { BN, bn } from '@fuel-ts/math';
77
import type { Receipt } from '@fuel-ts/transactions';
88
import { InputType, OutputType, ReceiptType } from '@fuel-ts/transactions';
9-
import { DateTime, arrayify, sleep } from '@fuel-ts/utils';
9+
import { DateTime, arrayify, hexlify, sleep } from '@fuel-ts/utils';
1010
import { ASSET_A, ASSET_B } from '@fuel-ts/utils/test-utils';
1111
import { versions } from '@fuel-ts/versions';
1212

@@ -2462,4 +2462,29 @@ describe('Provider', () => {
24622462
code: ErrorCode.SCRIPT_REVERTED,
24632463
});
24642464
});
2465+
2466+
it('can get compressed block bytes', async () => {
2467+
const bytes = hexlify(randomBytes(32));
2468+
2469+
using launched = await setupTestProviderAndWallets();
2470+
const { provider } = launched;
2471+
2472+
// Should return null when block is not found
2473+
let compressed = await provider.daCompressedBlock('1');
2474+
2475+
expect(compressed).toBeNull();
2476+
2477+
vi.spyOn(provider, 'daCompressedBlock').mockImplementationOnce(async () =>
2478+
Promise.resolve({
2479+
bytes,
2480+
})
2481+
);
2482+
2483+
const block = await provider.getBlock('latest');
2484+
compressed = await provider.daCompressedBlock(String(block?.height));
2485+
2486+
expect(compressed).toStrictEqual({ bytes });
2487+
2488+
vi.restoreAllMocks();
2489+
});
24652490
});

packages/account/src/providers/provider.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,6 +1741,24 @@ export default class Provider {
17411741
return { transactions, pageInfo };
17421742
}
17431743

1744+
/**
1745+
* Fetches a compressed block at the specified height.
1746+
*
1747+
* @param height - The height of the block to fetch.
1748+
* @returns The compressed block if available, otherwise `null`.
1749+
*/
1750+
async daCompressedBlock(height: string) {
1751+
const { daCompressedBlock } = await this.operations.daCompressedBlock({
1752+
height,
1753+
});
1754+
1755+
if (!daCompressedBlock) {
1756+
return null;
1757+
}
1758+
1759+
return daCompressedBlock;
1760+
}
1761+
17441762
/**
17451763
* Get deployed contract with the given ID.
17461764
*

packages/create-fuels/test/cli.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ describe('CLI', { timeout: 15_000 }, () => {
8787
expect(toolchain).toEqual({ channel: 'testnet' });
8888
expect(components).toEqual({
8989
forc: '0.66.6',
90-
'fuel-core': '0.40.2',
90+
'fuel-core': '0.40.4',
9191
});
9292
});
9393

packages/versions/src/lib/getBuiltinVersions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { Versions } from './types';
33
export function getBuiltinVersions(): Versions {
44
return {
55
FORC: '0.66.6',
6-
FUEL_CORE: '0.40.2',
6+
FUEL_CORE: '0.40.4',
77
FUELS: '0.98.0',
88
};
99
}

templates/nextjs/fuel-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ channel = "testnet"
33

44
[components]
55
forc = "0.66.6"
6-
fuel-core = "0.40.2"
6+
fuel-core = "0.40.4"

0 commit comments

Comments
 (0)