-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Linked Issues/PRs <!-- List of related issues/PRs --> Related issue: #1897 Closes #2605 See https://www.notion.so/fuellabs/RPC-Consistency-Proposal-V2-13b2f2293f31809bbce0d93a4c28d633 for the proposal specs. This PR implements a variation of the proposal in the link, due to techincal limitations of the HTTP protocol when using graphql subscriptions. for context: Headers cannot be used, the reason being that subscriptions will return multiple graphql responses in a single HTTP response (and therefore have a single `HeaderMap`), while we require that each item in the response has its associated `CURRENT_FUEL_BLOCK_HEIGHT` field. Moreover the Response metadata for subscriptions is returned before the actual response body (as it is standard with HTTP). in the end graphql has a (very undocumented) way to add an `extensions` field to responses, at the same level of `data/errors` field. This does not require to tweak anything at the HTTP level. We will implement an improvement where the server node will wait for a configurable number of blocks before returning a `PRECONDITION FAILED` response, in a follow-up PR. Entrypoint for reviews: - https://github.com/FuelLabs/fuel-core/pull/2473/files#diff-9caf873d3167ab9485e7882d621b5147e98b2478cc6462095b88374e2f914f3aR428 for the graphql handler - https://github.com/FuelLabs/fuel-core/pull/2473/files#diff-9caf873d3167ab9485e7882d621b5147e98b2478cc6462095b88374e2f914f3aR428 for the extension definition ## Manual testing ## TODO: - [x] Tests ## Description <!-- List of detailed changes --> ## Checklist - [ ] ~Breaking changes are clearly marked as such in the PR description and changelog~ - [x] New behavior is reflected in tests - [x] [The specification](https://github.com/FuelLabs/fuel-specs/) matches the implemented behavior (link update PR if changes are needed) ### Before requesting review - [x] 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] - [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/) - [ ] [Sway compiler](https://github.com/FuelLabs/sway/) - [ ] [Platform documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+) (for out-of-organization contributors, the person merging the PR will do this) - [ ] Someone else? --------- Co-authored-by: Mårten Blankfors <[email protected]> Co-authored-by: Green Baneling <[email protected]> Co-authored-by: Rafał Chabowski <[email protected]>
- Loading branch information
1 parent
0c87663
commit f73a12e
Showing
14 changed files
with
782 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.