Skip to content

Provider re-requesting chain + node config unnecessarily #3810

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

Open
petertonysmith94 opened this issue Mar 25, 2025 · 0 comments
Open

Provider re-requesting chain + node config unnecessarily #3810

petertonysmith94 opened this issue Mar 25, 2025 · 0 comments
Labels
bug Issue is a bug

Comments

@petertonysmith94
Copy link
Contributor

Summary

We have logic to re-fetch the chain + node info, given the consensus parameters change (indicating a fuel-core update):

const {
consensusParameters: { version: previous },
} = chainInfo;
const {
chain: {
latestBlock: {
header: { consensusParametersVersion: current },
},
},
} = await this.operations.getConsensusParametersVersion();
// old cache? refetch.
if (previous !== current) {
// calling with true to skip cache
await this.fetchChainAndNodeInfo(true);
}

We are comparing two different version definitions, causing re-fetches of the chain info every 1 minute, irrespective of whether the node has been updated.

From the chain

The version from the chain info returns V1 (on mainnet).

query ConsensusParameter {
  chain {
    consensusParameters {
      version
    }
  }
}

From the getConsensusParametersVersion

The version from the chain info returns 5 (on mainnet).

query GetConsensusParametersVersion {
  chain {
    latestBlock {
      header {
        consensusParametersVersion
      }
    }
  }
}
@petertonysmith94 petertonysmith94 added the bug Issue is a bug label Mar 25, 2025 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is a bug
Projects
None yet
Development

No branches or pull requests

1 participant