diff --git a/.changeset/swift-dancers-cheat.md b/.changeset/swift-dancers-cheat.md new file mode 100644 index 00000000000..25052e30ea8 --- /dev/null +++ b/.changeset/swift-dancers-cheat.md @@ -0,0 +1,7 @@ +--- +"@fuel-ts/fuel-core": minor +"@fuel-ts/providers": minor +"@fuel-ts/versions": minor +--- + +Upgrading `fuel-core` to `0.22` diff --git a/packages/fuel-core/VERSION b/packages/fuel-core/VERSION index 885415662ff..21574090598 100644 --- a/packages/fuel-core/VERSION +++ b/packages/fuel-core/VERSION @@ -1 +1 @@ -0.21.0 +0.22.0 diff --git a/packages/providers/fuel-core-schema.graphql b/packages/providers/fuel-core-schema.graphql index 9ccc837f996..25983ae2625 100644 --- a/packages/providers/fuel-core-schema.graphql +++ b/packages/providers/fuel-core-schema.graphql @@ -99,7 +99,6 @@ type ChainInfo { name: String! latestBlock: Block! daHeight: U64! - peerCount: Int! consensusParameters: ConsensusParameters! gasCosts: GasCosts! } @@ -280,10 +279,12 @@ input ExcludeInput { } type FailureStatus { + transactionId: TransactionId! block: Block! time: Tai64Timestamp! reason: String! programState: ProgramState + receipts: [Receipt!]! } type FeeParameters { @@ -641,6 +642,7 @@ type NodeInfo { maxTx: U64! maxDepth: U64! nodeVersion: String! + peers: [PeerInfo!]! } scalar Nonce @@ -686,6 +688,38 @@ type PageInfo { endCursor: String } +type PeerInfo { + """ + The libp2p peer id + """ + id: String! + + """ + The advertised multi-addrs that can be used to connect to this peer + """ + addresses: [String!]! + + """ + The self-reported version of the client the peer is using + """ + clientVersion: String + + """ + The last reported height of the peer + """ + blockHeight: U32 + + """ + The last heartbeat from this peer in unix epoch time ms + """ + lastHeartbeatMs: U64! + + """ + The internal fuel p2p reputation of this peer + """ + appScore: Float! +} + type PoAConsensus { """ Gets the signature of the block produced by `PoA` consensus. @@ -995,9 +1029,11 @@ type Subscription { } type SuccessStatus { + transactionId: TransactionId! block: Block! time: Tai64Timestamp! programState: ProgramState + receipts: [Receipt!]! } scalar Tai64Timestamp diff --git a/packages/providers/src/operations.graphql b/packages/providers/src/operations.graphql index 589b24950dc..f154d7fb844 100644 --- a/packages/providers/src/operations.graphql +++ b/packages/providers/src/operations.graphql @@ -386,7 +386,6 @@ fragment chainInfoFragment on ChainInfo { ...blockFragment } daHeight - peerCount consensusParameters { ...consensusParametersFragment } @@ -419,6 +418,14 @@ fragment nodeInfoFragment on NodeInfo { maxTx maxDepth nodeVersion + peers { + id + addresses + clientVersion + blockHeight + lastHeartbeatMs + appScore + } } query getNodeInfo { diff --git a/packages/providers/src/provider.ts b/packages/providers/src/provider.ts index ff68fe19415..5ed43568eee 100644 --- a/packages/providers/src/provider.ts +++ b/packages/providers/src/provider.ts @@ -21,6 +21,7 @@ import type { GqlChainInfoFragmentFragment, GqlGasCosts, GqlGetBlocksQueryVariables, + GqlPeerInfo, } from './__generated__/operations'; import type { Coin } from './coin'; import type { CoinQuantity, CoinQuantityLike } from './coin-quantity'; @@ -95,7 +96,6 @@ type ConsensusParameters = { export type ChainInfo = { name: string; baseChainHeight: BN; - peerCount: number; consensusParameters: ConsensusParameters; gasCosts: GqlGasCosts; latestBlock: { @@ -116,6 +116,7 @@ export type NodeInfo = { maxTx: BN; maxDepth: BN; nodeVersion: string; + peers: GqlPeerInfo[]; }; export type NodeInfoAndConsensusParameters = { @@ -142,7 +143,7 @@ export type TransactionCost = { // #endregion cost-estimation-1 const processGqlChain = (chain: GqlChainInfoFragmentFragment): ChainInfo => { - const { name, daHeight, peerCount, consensusParameters, latestBlock } = chain; + const { name, daHeight, consensusParameters, latestBlock } = chain; const { contractParams, feeParams, predicateParams, scriptParams, txParams, gasCosts } = consensusParameters; @@ -150,7 +151,6 @@ const processGqlChain = (chain: GqlChainInfoFragmentFragment): ChainInfo => { return { name, baseChainHeight: bn(daHeight), - peerCount, consensusParameters: { contractMaxSize: bn(contractParams.contractMaxSize), maxInputs: bn(txParams.maxInputs), @@ -445,6 +445,7 @@ export default class Provider { nodeVersion: nodeInfo.nodeVersion, utxoValidation: nodeInfo.utxoValidation, vmBacktrace: nodeInfo.vmBacktrace, + peers: nodeInfo.peers, }; Provider.nodeInfoCache[this.url] = processedNodeInfo; diff --git a/packages/providers/src/transaction-summary/calculate-transaction-fee.test.ts b/packages/providers/src/transaction-summary/calculate-transaction-fee.test.ts index 077085e77ac..fd3007b8385 100644 --- a/packages/providers/src/transaction-summary/calculate-transaction-fee.test.ts +++ b/packages/providers/src/transaction-summary/calculate-transaction-fee.test.ts @@ -1,5 +1,4 @@ import { bn } from '@fuel-ts/math'; -import { describe } from 'node:test'; import { MOCK_CHAIN } from '../../test/fixtures/chain'; import { diff --git a/packages/providers/test/fixtures/chain.ts b/packages/providers/test/fixtures/chain.ts index fe9c1f6ae5a..ebfd6a5d976 100644 --- a/packages/providers/test/fixtures/chain.ts +++ b/packages/providers/test/fixtures/chain.ts @@ -4,7 +4,6 @@ export const MOCK_CHAIN: GqlChainInfoFragmentFragment = { __typename: 'ChainInfo', name: 'local_testnet', daHeight: '234', - peerCount: 0, consensusParameters: { __typename: 'ConsensusParameters', txParams: { diff --git a/packages/providers/test/fixtures/nodeInfo.ts b/packages/providers/test/fixtures/nodeInfo.ts index f8db3eac7cc..f35097effa0 100644 --- a/packages/providers/test/fixtures/nodeInfo.ts +++ b/packages/providers/test/fixtures/nodeInfo.ts @@ -7,5 +7,6 @@ export const MOCK_NODE_INFO: GqlNodeInfoFragmentFragment = { minGasPrice: '0', maxTx: '4064', maxDepth: '10', - nodeVersion: '0.21.0', + nodeVersion: '0.22.0', + peers: [], }; diff --git a/packages/providers/test/provider.test.ts b/packages/providers/test/provider.test.ts index 32253e5aa4a..0998b35f809 100644 --- a/packages/providers/test/provider.test.ts +++ b/packages/providers/test/provider.test.ts @@ -69,7 +69,7 @@ describe('Provider', () => { const version = await provider.getVersion(); - expect(version).toEqual('0.21.0'); + expect(version).toEqual('0.22.0'); }); it('can call()', async () => { diff --git a/packages/versions/src/lib/getBuiltinVersions.ts b/packages/versions/src/lib/getBuiltinVersions.ts index fc831221bcd..b0ed0dd9ff1 100644 --- a/packages/versions/src/lib/getBuiltinVersions.ts +++ b/packages/versions/src/lib/getBuiltinVersions.ts @@ -1,7 +1,7 @@ export function getBuiltinVersions() { return { FORC: '0.48.1', - FUEL_CORE: '0.21.0', + FUEL_CORE: '0.22.0', FUELS: '0.69.1', }; }