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: update internally used chain config #3420

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

Conversation

Dhaiwat10
Copy link
Member

@Dhaiwat10 Dhaiwat10 commented Nov 25, 2024

Summary

This PR updates our internally used chain config to match the one specified here and removes all the state from our default stateConfig.json files.

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)

@Dhaiwat10 Dhaiwat10 added the chore Issue is a chore label Nov 25, 2024
@Dhaiwat10 Dhaiwat10 self-assigned this Nov 25, 2024
Copy link

vercel bot commented Nov 25, 2024

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 Dec 4, 2024 2:06pm
ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 4, 2024 2:06pm
ts-docs-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 4, 2024 2:06pm

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.

@Dhaiwat10 will the differences between the local and ignition chains cause issues here? Consensus parameters version for local is V2 and for ignition (and other configs) it is V1.

@Dhaiwat10
Copy link
Member Author

@petertonysmith94 That's a good point. I'm not really sure which one we are supposed to use. I heard from one of the team members that apparently the local config specified by them hasn't been updated in a long time. I'm not sure why the local is V2 and not mainnet, either.

Gonna try a few things and get back with some more context for our sync.

@Torres-ssf
Copy link
Contributor

Torres-ssf commented Nov 25, 2024

It seems our local test chain config uses settings from the Testnet upgrade number 6

Maybe we should go for either the latest Testnet upgrade (upgrade number 9) or even the lastest Mainet Upgrade

Both of them seem to be using the V2 for consensus_parameters already.

This will require changes only on our side if I am not mistaken, and only on TS types related to test helpers.

It seems that even though these versions are being updated on the chain config JSON for main-net and test-net, fuel-core always resolves them to V1 when returning the response for the graphQL queries. I believe this is due to backward compatibility reasons.

Screenshot 2024-11-25 at 10 57 01 AM Screenshot 2024-11-25 at 10 56 48 AM

@Dhaiwat10
Copy link
Member Author

@Torres-ssf can you check the changes I made and if they make sense?

Copy link

codspeed-hq bot commented Nov 26, 2024

CodSpeed Performance Report

Merging #3420 will not alter performance

Comparing dp/update-chain-config (20ce780) with master (2c60078)

Summary

✅ 18 untouched benchmarks

packages/recipes/src/types/common.d.ts Outdated Show resolved Hide resolved
packages/fuel-gauge/src/utils.ts Outdated Show resolved Hide resolved
packages/fuel-gauge/src/utils.ts Outdated Show resolved Hide resolved
packages/utils/src/utils/types.ts Show resolved Hide resolved
packages/account/src/account.test.ts Show resolved Hide resolved
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.

Quite a number of browser tests that are failing here.

@@ -104,6 +131,7 @@ function getFinalStateConfigJSON({ stateConfig, chainConfig }: SnapshotConfigs)
* @param fuelCorePath - the path to the fuel-core binary. (optional, defaults to 'fuel-core')
* @param loggingEnabled - whether the node should output logs. (optional, defaults to true)
* @param basePath - the base path to use for the temporary folder. (optional, defaults to os.tmpdir())
* @param includeInitialState - whether to initialise the chain with some default initial state. (optional, defaults to false)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be a breaking change? Before we included state by default, granted the param isn't breaking but the change in expectation is? It may need to be default true with a deprecation notice?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah..good point. I'll default it to true for now

Copy link
Contributor

Choose a reason for hiding this comment

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

Even if the default is true, then for this to be a non-breaking change, would we not need to match the current stateConfig.json file contents?

Copy link
Contributor

@danielbate danielbate Dec 4, 2024

Choose a reason for hiding this comment

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

IMO as long as there is some state it is fine, but it's a good point 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

We're removing the state and changing the gas costs (which has broken a number of our tests), so we can't be 💯 that these changes won't break tests for end consumers. I don't see the rush for this to be merged, so I would favour holding off until the next breaking changes release window.

Copy link
Member Author

Choose a reason for hiding this comment

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

While that's a good point @petertonysmith94, it's worth thinking if we can ever be sure if changing the chain config or removing state from the default config can break something for people who might be using them for tests?

The only way we can really be sure is by providing all the state currently present like you said, and phasing it out via a deprecation notice like Dan mentioned.

Thoughts? @FuelLabs/sdk-ts

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for the lack of context here, but why are we adding this new flag includeInitialState?

Is this a required change for this PR? Or can we make this change in a different PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

This new flag had to be added so that there are no breaking changes in the fuels CLI and create fuels since these tools need at least two wallets to be funded by default.

@@ -104,6 +131,7 @@ function getFinalStateConfigJSON({ stateConfig, chainConfig }: SnapshotConfigs)
* @param fuelCorePath - the path to the fuel-core binary. (optional, defaults to 'fuel-core')
* @param loggingEnabled - whether the node should output logs. (optional, defaults to true)
* @param basePath - the base path to use for the temporary folder. (optional, defaults to os.tmpdir())
* @param includeInitialState - whether to initialise the chain with some default initial state. (optional, defaults to false)
Copy link
Contributor

Choose a reason for hiding this comment

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

Even if the default is true, then for this to be a non-breaking change, would we not need to match the current stateConfig.json file contents?

@@ -121,7 +121,7 @@ const nodeWithCustomBaseAssetId = await launchTestNode({
snapshotConfig: {
chainConfig: {
consensus_parameters: {
V1: {
V2: {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a breaking change?

Copy link
Member Author

Choose a reason for hiding this comment

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

Breaking change for the chain config, not for our SDK consumers. I think.

packages/account/src/providers/provider.test.ts Outdated Show resolved Hide resolved
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.

Update internally used Chain Config Remove all state from default stateConfig.json
5 participants