Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(en): Add health checks for EN components #1088

Merged
merged 11 commits into from
Feb 16, 2024

Conversation

slowli
Copy link
Contributor

@slowli slowli commented Feb 15, 2024

What ❔

Adds health checks with intelligent details for most of components run by the external node.

Why ❔

These health checks would allow monitoring what's going on with an EN easier both for humans and machines. The latter could be used in integration tests etc.

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted via zk fmt and zk lint.
  • Spellcheck has been run via zk spellcheck.
  • Linkcheck has been run via zk linkcheck.

Copy link
Contributor Author

@slowli slowli left a comment

Choose a reason for hiding this comment

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

An example of the /health endpoint output for the EN given these changes:

{
  "status": "ready",
  "components": {
    "consistency_checker": {
      "status": "ready",
      "details": {
        "first_checked_batch": 70,
        "last_checked_batch": 80
      }
    },
    "batch_status_updater": {
      "status": "ready",
      "details": {
        "last_committed_l1_batch": 80,
        "last_executed_l1_batch": 80,
        "last_proven_l1_batch": 80
      }
    },
    "http_api": {
      "status": "ready"
    },
    "main_node_http_rpc": {
      "status": "ready"
    },
    "tree": {
      "status": "ready",
      "details": {
        "leaf_count": 24166,
        "mode": "full",
        "next_l1_batch_number": 81,
        "root_hash": "0x40e1bbd383c39c90b9094bbade1040bf7a01cb9f8f892590f5604fe3e0e7d16f",
        "stage": "main_loop"
      }
    },
    "connection_pool": {
      "status": "ready",
      "details": {
        "max_size": 50,
        "pool_size": 11
      }
    },
    "commitment_generator": {
      "status": "ready",
      "details": {
        "l1_batch_number": 80
      }
    },
    "ws_api": {
      "status": "ready"
    },
    "prometheus_exporter": {
      "status": "ready"
    },
    "sync_state": {
      "status": "ready",
      "details": {
        "is_synced": true,
        "local_block": 279,
        "main_node_block": 279
      }
    },
    "reorg_detector": {
      "status": "ready",
      "details": {
        "last_correct_l1_batch": 80,
        "last_correct_miniblock": 279
      }
    }
  }
}

core/lib/health_check/src/lib.rs Outdated Show resolved Hide resolved
@slowli slowli marked this pull request as ready for review February 15, 2024 18:53
popzxc
popzxc previously approved these changes Feb 16, 2024
core/lib/health_check/src/lib.rs Outdated Show resolved Hide resolved
popzxc
popzxc previously approved these changes Feb 16, 2024
perekopskiy
perekopskiy previously approved these changes Feb 16, 2024
@slowli slowli dismissed stale reviews from perekopskiy and popzxc via 40e9695 February 16, 2024 14:57
@slowli slowli added this pull request to the merge queue Feb 16, 2024
Merged via the queue into main with commit 4ea1520 Feb 16, 2024
30 checks passed
@slowli slowli deleted the aov-pla-798-add-health-checks-for-en-components branch February 16, 2024 16:27
RomanBrodetski pushed a commit that referenced this pull request Feb 26, 2024
🤖 I have created a release *beep* *boop*
---


##
[20.8.0](core-v20.7.0...core-v20.8.0)
(2024-02-26)


### Features

* Add more buckets to call tracer
([#1137](#1137))
([dacd8c9](dacd8c9))
* **api:** add a config flag for disabling filter api
([#1078](#1078))
([b486d7e](b486d7e))
* **api:** Create RPC method to return all tokens
([#1103](#1103))
([b538d1a](b538d1a))
* **api:** Implement TxSink abstraction
([#1204](#1204))
([11a34d4](11a34d4))
* **en:** Add health checks for EN components
([#1088](#1088))
([4ea1520](4ea1520))
* **en:** Start health checks early into EN lifecycle
([#1146](#1146))
([f983e80](f983e80))
* **en:** switch to tree light mode
([#1152](#1152))
([ce6c120](ce6c120))
* **en:** Take into account nonce from tx proxy
([#995](#995))
([22099cb](22099cb))
* **healthcheck:** Various healthcheck improvements
([#1166](#1166))
([1e34148](1e34148))
* Integration tests enhancement for L1
([#1209](#1209))
([a1c866c](a1c866c))
* **node_framework:** Support Eth Watch in the framework
([#1145](#1145))
([4f41b68](4f41b68))
* **shared bridge:** preparation for shared bridge migration (server)
([#1012](#1012))
([2a766a7](2a766a7))
* **vlog:** Remove env getters from vlog
([#1077](#1077))
([00d3429](00d3429))
* **vm:** Add new VM folder
([#1208](#1208))
([66cdefc](66cdefc))
* **vm:** integrate new vm version
([#1215](#1215))
([63d1f52](63d1f52))


### Bug Fixes

* **contract-verifier:** Add force_evmla flag
([#1179](#1179))
([e75aa11](e75aa11))
* **contract-verifier:** allow other zksolc settings
([#1174](#1174))
([72c60bd](72c60bd))
* **state-keeper:** Add GasForBatchTip criterion
([#1096](#1096))
([de4d729](de4d729))


### Performance Improvements

* **db:** Improve `get_logs_by_tx_hashes` query
([#1171](#1171))
([0dda7cc](0dda7cc))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

None yet

3 participants