Skip to content

Add forward-compatibilty test and fix for using old client on new node#3281

Merged
xgreenx merged 9 commits into
masterfrom
bugfix/always-return-v1-consensus-params
Apr 28, 2026
Merged

Add forward-compatibilty test and fix for using old client on new node#3281
xgreenx merged 9 commits into
masterfrom
bugfix/always-return-v1-consensus-params

Conversation

@MitchTurner
Copy link
Copy Markdown
Contributor

@MitchTurner MitchTurner commented Apr 24, 2026

Linked Issues/PRs

Description

We are addressing a problem with forward-compatibility in our fuel-core client. We have recently added new consensus parameter versions and if users haven't updated their client to support the new parameters, it is just going to error. We want to prevent this from happening with the following changes:

This PR does two things

  1. It changes the way that the graphql server handles requests for consensus parameters. If you ask for params but don't specify any V2 parameters, then it will assume you are querying from a client that only supports V1 params and will convert V2 parameters to V1 before returning
  2. Change the way the client works so if it receives unsupported consensus parameters in the future, it will emit and error and convert to the latest consensus parameter version optimistically.

Checklist

  • Breaking changes are clearly marked as such in the PR description and changelog
  • New behavior is reflected in tests
  • The specification matches the implemented behavior (link update PR if changes are needed)

Before requesting review

  • I have reviewed the code myself
  • I have created follow-up issues caused by this PR and linked them here

After merging, notify other teams

[Add or remove entries as needed]

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 24, 2026

PR Summary

Medium Risk
Changes GraphQL responses and client-side decoding of consensus parameters to tolerate unknown/future versions by downgrading shapes/values, which can affect consensus-parameter interpretation across versions. Risk is mitigated by added unit/integration tests but touches core chain-parameter plumbing used by many clients.

Overview
Improves forward compatibility for consensusParameters across mismatched client/node versions.

On the GraphQL server, consensus_params_for_selection inspects the query Lookahead and, when V2-only fields aren’t requested, returns a legacy-compatible shape by downgrading ScriptParameters to V1 and GasCosts from V7 to a V6-compatible representation (filling legacy-only fields with defaults). This behavior is applied to both the chain query and the upgrades query.

On the client, decoding of consensus parameters is changed so Unknown (future) enum variants no longer hard-error; instead it logs a warning and optimistically degrades to the latest locally-supported conversion for TxParameters, PredicateParameters, ScriptParameters, ContractParameters, FeeParameters, GasCosts, and ConsensusParameters (including legacy fragments). Adds targeted tests for unknown-version degradation and server-side downgrade behavior, plus new version-compatibility snapshot config and dev-deps for the forkless-upgrade test harness.

Reviewed by Cursor Bugbot for commit 8b93a69. Bugbot is set up for automated code reviews on this repo. Configure here.

@MitchTurner MitchTurner self-assigned this Apr 24, 2026
@MitchTurner MitchTurner marked this pull request as ready for review April 26, 2026 18:52
@MitchTurner MitchTurner requested review from a team, Dentosal and xgreenx as code owners April 26, 2026 18:52
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 469766f. Configure here.

Comment thread crates/fuel-core/src/schema/chain.rs
@xgreenx xgreenx merged commit 18d7a89 into master Apr 28, 2026
71 of 72 checks passed
@xgreenx xgreenx deleted the bugfix/always-return-v1-consensus-params branch April 28, 2026 21:53
@github-actions github-actions Bot mentioned this pull request Apr 30, 2026
xgreenx added a commit that referenced this pull request Apr 30, 2026
## Version v0.48.1

### Changed
- [3243](#3243): Migrating
from standard Debian slim base Docker images to GCR Distroless images.
- [3255](#3255): Adds client &
server support for the existing protobuf HTTP-based remote RPC block
accessor.
- [3259](#3259): Bump wasmtime
to 0.43.1

### Fixed
- [3258](#3258): Fix
backward-compatiblity of GraphQL queries for pre-0.48.0 versions
- [3261](#3261): Fix PoA
leader deadlock after reconciliation import where `ensure_synced()`
blocked forever because `execute_and_commit` marked reconciliation
blocks as `Source::Network`, causing the SyncTask to transition to
`NotSynced`.
- [3264](#3264): Rollback
stale preconfirmations in the mempool when the canonical block at that
height omits the preconfirmed transactions, restoring spent inputs and
removing dependent transactions.
- [3269](#3269): Fix PoA
reconciliation deadlock when the same block exists on all Redis nodes
but with different epochs. `unreconciled_blocks` now groups votes by
`block_id` only (tracking max epoch as tiebreaker), so identical blocks
written during re-promotion storms count toward quorum.
- [3272](#3272): Improve
performance of redis block publish by making more parallel and
optimizing the lua code
- [3278](#3278): Fix mainnet
block-production hang when a single ElastiCache leader-lock node enters
a half-alive state. Bumps `redis` to 1.2 (the older 0.27 client did not
apply the connect timeout to the post-connect handshake pipeline) and
short-circuits `publish_block_on_all_nodes` on quorum so a stuck
per-node thread can no longer wedge the publish path.
- [3281](#3281): Add
forward-compatibility for old clients and new fuel-core

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants