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.41.0 #3590

Open
wants to merge 62 commits into
base: master
Choose a base branch
from

Conversation

Torres-ssf
Copy link
Contributor

@Torres-ssf Torres-ssf commented Jan 15, 2025

Release notes

In this release, we:

  • Upgraded fuel-core to 0.41.0

Summary

GraphQL

  • Add amount128 to the responses of the getBalance and getBalances queries.
  • Implement new assetDetails query.
  • Add new scalar SubId.
  • Add new scalar U128.
  • Update nodeInfoFragment with new NodeInfo fields (if needed).
  • Implement the daCompressedBlock query (if needed).

Transaction

  • Add support for the new transaction policy expiration.

Provider

  • Enable pagination for the getBalances method.
  • Consider amount128 in both the getBalance and getBalances methods.
  • Ensure the excludedIds parameter in getResourcesToSpend does not exceed the maximum number of inputs.
  • Adjust the getMessageProof method to conform with the updated MessageProof type, which now requires a non-optional response.
  • Implement the getAssetDetails method.

Docs

  • Document new transaction policy expiration

Breaking Changes

Because of the latest fuel-core changes, TS SDK does not throw the following error messages anymore:

  1. Insufficient Funds
// before
"The account(s) sending the transaction don't have enough funds to cover the transaction."
// after
"Insufficient funds or too many small value coins. Consider combining UTXOs."
  1. Exceeded Coin Limit
// before
"The account retrieving coins has exceeded the maximum number of coins per asset. Please consider combining your coins into a single UTXO."
// after
"Insufficient funds or too many small value coins. Consider combining UTXOs."

Checklist

  • All changes are covered by tests (or not applicable)
  • All changes are documented (or not applicable)
  • I reviewed the entire PR myself (preferably, on GH UI)
  • I described all Breaking Changes (or there's none)

@Torres-ssf Torres-ssf added the chore Issue is a chore label Jan 15, 2025
@Torres-ssf Torres-ssf self-assigned this Jan 15, 2025
Copy link

vercel bot commented Jan 15, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fuels-template ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 7:03pm
ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 7:03pm
ts-docs-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 7:03pm

@petertonysmith94
Copy link
Contributor

Asset related functionality is partially implemented:

@@ -82,7 +82,7 @@ describe('ExampleContract', () => {
() => contractInstance.functions.return_input(1337).simulate(),
new FuelError(
ErrorCode.NOT_ENOUGH_FUNDS,
`The account(s) sending the transaction don't have enough funds to cover the transaction.`
`Insufficient funds or too many small value coins. Consider combining UTXOs.`
Copy link
Member

Choose a reason for hiding this comment

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

Hmm maybe we improve our error docs for this and link it in the message? We should probably offer a way for them to work out whether it's insufficient balance or too many coins.

@@ -753,6 +789,7 @@ export default class Provider {
nodeVersion: nodeInfo.nodeVersion,
utxoValidation: nodeInfo.utxoValidation,
vmBacktrace: nodeInfo.vmBacktrace,
// TODO: should we add `maxGas` and `txPoolStats` to the NodeInfo type?
Copy link
Member

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -2,25 +2,17 @@ import { ErrorCode, FuelError } from '@fuel-ts/errors';
import type { GraphQLError } from 'graphql';

export enum GqlErrorMessage {
NOT_ENOUGH_COINS = 'not enough coins to fit the target',
MAX_COINS_REACHED = 'max number of coins is reached while trying to fit the target',
NOT_ENOUGH_COINS_MAX_COINS = 'the target cannot be met due to no coins available or exceeding the 255 coin limit.',
Copy link
Member

Choose a reason for hiding this comment

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

I thought 255 was configured on chain? Could this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are correct: 1321c22

Copy link
Contributor

@petertonysmith94 petertonysmith94 left a comment

Choose a reason for hiding this comment

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

Lovely work @Torres-ssf 🚀

  • Will will phase out the feature flags, as all the node upgrade to the latest version?
  • With regards to the policy expiration, did we considered the resource cache for the UXTO's with a transaction using the expiration?

"@fuel-ts/account": patch
"@fuel-ts/program": patch
"@fuel-ts/recipes": patch
"@fuel-ts/errors": patch
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"@fuel-ts/errors": patch
"@fuel-ts/errors": patch
"@fuel-ts/contract": patch

@@ -753,6 +789,7 @@ export default class Provider {
nodeVersion: nodeInfo.nodeVersion,
utxoValidation: nodeInfo.utxoValidation,
vmBacktrace: nodeInfo.vmBacktrace,
// TODO: should we add `maxGas` and `txPoolStats` to the NodeInfo type?
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this one for now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -468,6 +479,7 @@ type GasCosts {
wqmm: U64!
xor: U64!
xori: U64!
ecop: U64
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we be adding this to our chain config?

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worthwhile testing the feature flags for:

  • balancePagination
  • amount128

* @param height - The height of the block to fetch.
* @returns The compressed block if available, otherwise `null`.
*/
async daCompressedBlock(height: string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to add a tests around this functionality?

@@ -492,6 +504,7 @@ type GasCosts {
smo: DependentCost!
srwq: DependentCost!
swwq: DependentCost!
epar: DependentCost
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we be adding this to our chain config?

Comment on lines 8 to 13
name: "Release PR to npm"
runs-on: ubuntu-latest
# comment out if:false to enable release PR to npm
if: false
# if: false
permissions: write-all
steps:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remember to uncomment the PR release line

Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
76.93%(-0.11%) 70.43%(-0.21%) 74.82%(-0.28%) 76.93%(-0.11%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 packages/account/src/providers/provider.ts 67.45%
(-1.1%)
57.71%
(-0.75%)
67.67%
(-2.22%)
67.08%
(-1.2%)
🔴 packages/account/src/providers/generated/operations.ts 91.82%
(-2.21%)
100%
(+0%)
75.47%
(-6.16%)
92.44%
(-2.07%)
🔴 packages/account/src/providers/transaction-request/transaction-request.ts 87.5%
(-1.07%)
74.07%
(-4.01%)
84%
(+0%)
87.75%
(-1.06%)
🔴 packages/account/src/providers/utils/handle-gql-error-message.ts 85.71%
(-4.29%)
76.92%
(-6.41%)
80%
(+0%)
82.6%
(-3.76%)
🔴 packages/transactions/src/coders/policy.ts 97.91%
(+0.24%)
95%
(+0.89%)
100%
(+0%)
98%
(+0.23%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Issue is a chore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade fuel-core to 0.41.0 Support Policy Expiration Add pagination support for getBalances
3 participants