Repository navigation
Explorer server: Add logs when receiving ledgerClosed messages and log rippled client state every 60 seconds - #1233
Merged
pdp2121 merged 1 commit intoAug 30, 2025
Conversation
…g rippled client state every 60 seconds
kuan121
marked this pull request as ready for review
August 27, 2025 19:36
Patel-Raj11
approved these changes
Aug 27, 2025
pdp2121
approved these changes
Aug 30, 2025
pdp2121
deleted the
add-rippled-client-state-and-ledger-closed-message-logs
branch
August 30, 2025 00:01
pdp2121
pushed a commit
that referenced
this pull request
Oct 8, 2025
…g rippled client state every 60 seconds (#1233) ## High Level Overview of Change Two changes 1. Log a message each time a ledgerClosed message is received. 2. Every 60 seconds, log the current state of the rippled client created via [xrpl-client](https://github.com/XRPL-Labs/xrpl-client). ### Context of Change Although rare, we’ve observed that the Explorer server stops processing new ledger data—specifically, [this log line](https://github.com/ripple/explorer/blob/staging/server/lib/streams.js#L119) is not printed. As a result, the [metrics API endpoint](https://github.com/ripple/explorer/blob/staging/server/routes/v1/index.js#L12) begins serving stale data. The root cause is currently unclear; it could be due to a dropped WebSocket connection to the Clio host or the Clio host not sending any `ledgerClosed` messages. Importantly, during the incident, the Explorer backend remains up and responsive, continuing to serve API requests such as /health and /metrics ([code reference](https://github.com/ripple/explorer/blob/staging/server/routes/v1/index.js#L11-L12)). The new logs will help us confirm the root cause if either of the above suspicions is correct, or rule them out if not. ### Type of Change <!-- Please check relevant options, delete irrelevant ones. --> - [ ] 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) - [ ] Tests (You added tests for code that already exists, or your new feature included in this PR) - [ ] Documentation Updates - [ ] Translation Updates - [ ] Release ### Codebase Modernization <!-- In an effort to modernize the codebase, you should convert the files that you work with to React Hooks and TypeScript, and update tests to use the React Testing Library instead of Enzyme. If this is not possible (e.g. it's too many changes, touching too many files, etc.) please explain why here. --> - [ ] Updated files to React Hooks - [ ] Updated files to TypeScript - [ ] Updated tests to React Testing Library ## Before / After N/A ## Test Plan Manually test the changes by running `npm run build && npm start` and confirm that logs are printed as expected. An example of state log is ``` [2025-08-27T19:32:33.456Z] INFO: rippled/12345 on MacBook: Rippled client: { state: { online: true, latencyMs: { last: 80, avg: 81.3, secAgo: 2.181999921798706 }, server: { version: '', uptime: 1294403, publicKey: '', networkId: 0, uri: 'wss://s2.ripple.com:51233' }, ledger: { last: 98451664, validated: '32570-98451664', count: 98419094 }, fee: { last: 12, avg: 12, secAgo: 2.181999921798706 }, reserve: { base: 1, owner: 0.2 }, secLastContact: 1.8569998741149902 } } ```
pdp2121
pushed a commit
that referenced
this pull request
Oct 8, 2025
…g rippled client state every 60 seconds (#1233) ## High Level Overview of Change Two changes 1. Log a message each time a ledgerClosed message is received. 2. Every 60 seconds, log the current state of the rippled client created via [xrpl-client](https://github.com/XRPL-Labs/xrpl-client). ### Context of Change Although rare, we’ve observed that the Explorer server stops processing new ledger data—specifically, [this log line](https://github.com/ripple/explorer/blob/staging/server/lib/streams.js#L119) is not printed. As a result, the [metrics API endpoint](https://github.com/ripple/explorer/blob/staging/server/routes/v1/index.js#L12) begins serving stale data. The root cause is currently unclear; it could be due to a dropped WebSocket connection to the Clio host or the Clio host not sending any `ledgerClosed` messages. Importantly, during the incident, the Explorer backend remains up and responsive, continuing to serve API requests such as /health and /metrics ([code reference](https://github.com/ripple/explorer/blob/staging/server/routes/v1/index.js#L11-L12)). The new logs will help us confirm the root cause if either of the above suspicions is correct, or rule them out if not. ### Type of Change <!-- Please check relevant options, delete irrelevant ones. --> - [ ] 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) - [ ] Tests (You added tests for code that already exists, or your new feature included in this PR) - [ ] Documentation Updates - [ ] Translation Updates - [ ] Release ### Codebase Modernization <!-- In an effort to modernize the codebase, you should convert the files that you work with to React Hooks and TypeScript, and update tests to use the React Testing Library instead of Enzyme. If this is not possible (e.g. it's too many changes, touching too many files, etc.) please explain why here. --> - [ ] Updated files to React Hooks - [ ] Updated files to TypeScript - [ ] Updated tests to React Testing Library ## Before / After N/A ## Test Plan Manually test the changes by running `npm run build && npm start` and confirm that logs are printed as expected. An example of state log is ``` [2025-08-27T19:32:33.456Z] INFO: rippled/12345 on MacBook: Rippled client: { state: { online: true, latencyMs: { last: 80, avg: 81.3, secAgo: 2.181999921798706 }, server: { version: '', uptime: 1294403, publicKey: '', networkId: 0, uri: 'wss://s2.ripple.com:51233' }, ledger: { last: 98451664, validated: '32570-98451664', count: 98419094 }, fee: { last: 12, avg: 12, secAgo: 2.181999921798706 }, reserve: { base: 1, owner: 0.2 }, secLastContact: 1.8569998741149902 } } ```
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
High Level Overview of Change
Two changes
Context of Change
Although rare, we’ve observed that the Explorer server stops processing new ledger data—specifically, this log line is not printed. As a result, the metrics API endpoint begins serving stale data. The root cause is currently unclear; it could be due to a dropped WebSocket connection to the Clio host or the Clio host not sending any
ledgerClosedmessages. Importantly, during the incident, the Explorer backend remains up and responsive, continuing to serve API requests such as /health and /metrics (code reference).The new logs will help us confirm the root cause if either of the above suspicions is correct, or rule them out if not.
Type of Change
Codebase Modernization
Before / After
N/A
Test Plan
Manually test the changes by running
npm run build && npm startand confirm that logs are printed as expected. An example of state log is