Skip to content

Include network_id in subscription stream response#5579

Merged
bthomee merged 6 commits intoXRPLF:developfrom
ckeshava:networkIDValStream
Jul 23, 2025
Merged

Include network_id in subscription stream response#5579
bthomee merged 6 commits intoXRPLF:developfrom
ckeshava:networkIDValStream

Conversation

@ckeshava
Copy link
Copy Markdown
Collaborator

High Level Overview of Change

This PR aims to include network_id value inside the validations and the ledger subscription stream. This helps downstream consumers disambiguate between different XRPL networks. Appropriate unit tests have been updated to this effect.

The benefits of this feature have been voiced in this Issue Description. As a concrete example, the proposed change will remove a lot of cruft from the technical design of Validator-History-Service (VHS).

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Performance (increase or change in throughput and/or latency)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

API Impact

  • Public API: New feature (new methods and/or new fields)
    New field (network_id) has been added to two of the subscription streams. This is not a breaking change. None of the existing API surface is impacted by this PR.

  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)

  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)

  • Peer protocol change (must be backward compatible or bump the peer protocol version)

I do not expect any significant changes to the performance. This change only adds a new field into the WebSocket stream API.

Appropriate tests have been updated in this PR. I don't see the need for any future work (or) additional tests.

However, should this PR be approved, we will need to update the documentation of the subscribe command to reflect the new response fields.

ckeshava added 2 commits July 17, 2025 16:08
…is commit also includes unit tests to validate the response fields
… Update unit tests to validate response of ledger-subscription-stream
@ckeshava ckeshava requested a review from a team July 18, 2025 05:12
@ckeshava ckeshava changed the title Network id val stream Include network_id in subscription stream response Jul 18, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.8%. Comparing base (433eeab) to head (f57fbb1).
Report is 2 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #5579   +/-   ##
=======================================
  Coverage     78.8%   78.8%           
=======================================
  Files          814     814           
  Lines        71163   71205   +42     
  Branches      8354    8333   -21     
=======================================
+ Hits         56042   56105   +63     
+ Misses       15121   15100   -21     
Files with missing lines Coverage Δ
src/xrpld/app/misc/NetworkOPs.cpp 70.4% <100.0%> (+<0.1%) ⬆️

... and 9 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@godexsoft godexsoft left a comment

Choose a reason for hiding this comment

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

Looks good. Here is an issue in Clio that will implement this in the future: XRPLF/clio#2350

@bthomee bthomee requested a review from a1q123456 July 18, 2025 16:21
Copy link
Copy Markdown
Contributor

@PeterChen13579 PeterChen13579 left a comment

Choose a reason for hiding this comment

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

👍

@ckeshava
Copy link
Copy Markdown
Collaborator Author

Thanks for the quick review guys 🙇‍♂️

Copy link
Copy Markdown
Contributor

@a1q123456 a1q123456 left a comment

Choose a reason for hiding this comment

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

LGTM

@ckeshava
Copy link
Copy Markdown
Collaborator Author

Thanks for the reviews 🙇‍♂️ @a1q123456 @godexsoft @PeterChen13579

@ckeshava
Copy link
Copy Markdown
Collaborator Author

Hello, I'd prefer this to be the commit message:

Fix #4783 : Include network_id data in the `validations` stream. This commit also includes unit tests to validate the response fields

- Include network_id inside `ledger` subscription stream; Update unit tests to validate response of ledger-subscription-stream

@bthomee bthomee enabled auto-merge (squash) July 23, 2025 17:25
@bthomee bthomee merged commit 60e340d into XRPLF:develop Jul 23, 2025
3 checks passed
ximinez added a commit that referenced this pull request Jul 24, 2025
…to ximinez/lending-refactoring-3

* XRPLF/ximinez/lending-refactoring-2:
  refactor: Update rocksdb (#5568)
  Switch instrumentation workflow to use dependencies (#5607)
  chore: Rename conan profile to `default` (#5599)
  Include `network_id` in validations and subscription stream responses (#5579)
  Add support for `DomainID` in `MPTokenIssuance` transactions (#5509)
  chore: Remove unused code after flow cross retirement (#5575)
  Remove obsolete owner pays fee feature and XRPL_ABANDON stanza (#5550)
  refactor: Makes HashRouter flags more type-safe (#5371)
  Fix clang-format CI job (#5598)
This was referenced Aug 27, 2025
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.

5 participants