Skip to content

Conversation

@not-reed
Copy link
Contributor

Description

Added a HealthCheckService to monitor web3 connections and ensure clients are connected to the correct chain. The service runs periodic checks (currently set at 1-second intervals) to verify that the public client, wallet client, and injected client are all connected to the expected blockchain.

The service:

  • Starts automatically when the iframe app initializes
  • Compares the connected chain IDs against the expected chain
  • Logs warnings when mismatches are detected
  • Includes TODOs for future improvements like error correction and UI feedback

This is a first step toward improving connection reliability and providing better feedback when chain mismatches occur.

Toggle Checklist

Checklist

Basics

  • B1. I have applied the proper label & proper branch name (e.g. norswap/build-system-caching).
  • B2. This PR is not so big that it should be split & addresses only one concern.
  • B3. The PR targets the lowest branch it can (ideally master).

Reminder: PR review guidelines

Correctness

  • C1. Builds and passes tests.
  • C2. The code is properly parameterized & compatible with different environments (e.g. local,
    testnet, mainnet, standalone wallet, ...).
  • C3. I have manually tested my changes & connected features.

< INDICATE BROWSER, DEMO APP & OTHER ENV DETAILS USED FOR TESTING HERE >

< INDICATE TESTED SCENARIOS (USER INTERFACE INTERACTION, CODE FLOWS) HERE >

  • C4. I have performed a thorough self-review of my code after submitting the PR,
    and have updated the code & comments accordingly.

Architecture & Documentation

  • D1. I made it easy to reason locally about the code, by (1) using proper abstraction boundaries,
    (2) commenting these boundaries correctly, (3) adding inline comments for context when needed.
  • D2. All public-facing APIs are documented in the docs.
    Public APIS and meaningful (non-local) internal APIs are properly documented in code comments.
  • D3. If appropriate, the general architecture of the code is documented in a code comment or
    in a Markdown document.
  • D4. An appropriate Changeset has been generated (and committed) with make changeset for
    breaking and meaningful changes in packages (not required for cleanups & refactors).

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented May 13, 2025

Deploying happychain with  Cloudflare Pages  Cloudflare Pages

Latest commit: d7d32cc
Status: ✅  Deploy successful!
Preview URL: https://b2e44740.happychain.pages.dev
Branch Preview URL: https://not-reed-add-healthcheckserv.happychain.pages.dev

View logs

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@not-reed not-reed force-pushed the not-reed/Add_HealthCheckService_to_monitor_web3_connections branch from 34cd00e to 15965c6 Compare May 14, 2025 15:51
@norswap norswap added the draft Not ready for review label May 16, 2025
@not-reed not-reed force-pushed the not-reed/Add_HealthCheckService_to_monitor_web3_connections branch 9 times, most recently from 92220bb to 17b624e Compare May 22, 2025 21:52
@not-reed not-reed force-pushed the not-reed/Add_HealthCheckService_to_monitor_web3_connections branch 6 times, most recently from d34cc6c to 98bf590 Compare May 28, 2025 12:38
@not-reed not-reed force-pushed the not-reed/Add_HealthCheckService_to_monitor_web3_connections branch 10 times, most recently from 7e9f01b to 93b180e Compare June 9, 2025 22:45
@not-reed not-reed force-pushed the not-reed/Add_HealthCheckService_to_monitor_web3_connections branch from 93b180e to ca577ca Compare June 10, 2025 18:37
@not-reed not-reed force-pushed the not-reed/Add_HealthCheckService_to_monitor_web3_connections branch 12 times, most recently from db33c9a to 5389d0d Compare June 18, 2025 18:46
@not-reed not-reed force-pushed the not-reed/Add_HealthCheckService_to_monitor_web3_connections branch 5 times, most recently from 754093d to 9bc5a01 Compare June 23, 2025 19:56
@not-reed not-reed force-pushed the not-reed/Add_HealthCheckService_to_monitor_web3_connections branch from 9bc5a01 to d7d32cc Compare June 24, 2025 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

draft Not ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants