Skip to content

Commit b6bf882

Browse files
chore: improves readme (#47)
* chore: improves readme * Update README.md Co-authored-by: José FP <105675159+TucksonDev@users.noreply.github.com> * Update packages/batch-poster-monitor/README.md Co-authored-by: José FP <105675159+TucksonDev@users.noreply.github.com> * Update packages/retryable-monitor/README.md Co-authored-by: José FP <105675159+TucksonDev@users.noreply.github.com> * Update packages/batch-poster-monitor/README.md Co-authored-by: José FP <105675159+TucksonDev@users.noreply.github.com> * Update packages/assertion-monitor/README.md Co-authored-by: José FP <105675159+TucksonDev@users.noreply.github.com> * respond to pr feedback * last tweaks --------- Co-authored-by: José FP <105675159+TucksonDev@users.noreply.github.com>
1 parent 678507c commit b6bf882

File tree

6 files changed

+308
-163
lines changed

6 files changed

+308
-163
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ yarn-error.log
55
dist
66
./*.js
77
.DS_Store
8-
logfile.log
8+
logfile.log
9+
config.json

README.md

Lines changed: 88 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,108 @@
22

33
## Overview
44

5-
This is a monorepo containing a collection of scripts designed for monitoring various aspects of Arbitrum chains. Each package focuses on one particular monitoring task, like monitoring retryables, batch posting, etc.
5+
This monitoring suite helps you track the health and performance of your Arbitrum chains through three specialized monitors:
6+
7+
1. [**Retryable Monitor**](./packages/retryable-monitor/README.md) - Tracks ParentChain->ChildChain message execution and retryable ticket lifecycle
8+
2. [**Batch Poster Monitor**](./packages/batch-poster-monitor/README.md) - Monitors batch posting and data availability
9+
3. [**Assertion Monitor**](./packages/assertion-monitor/README.md) - Monitor assertion creation and validation on Arbitrum chains
10+
11+
Each monitor has its own detailed documentation with technical specifics and implementation details.
12+
13+
## Prerequisites
14+
15+
- Node.js v18 or greater
16+
- Yarn package manager
17+
- Access to Arbitrum chain RPC endpoints
18+
- Access to parent chain RPC endpoints
19+
- Slack workspace for alerts (optional)
620

721
## Installation
822

9-
Ensure you are using Node v18 or greater.
23+
1. Clone and install dependencies:
1024

1125
```bash
26+
git clone https://github.com/OffchainLabs/arbitrum-monitoring.git
27+
cd arbitrum-monitoring
1228
yarn install
1329
```
1430

15-
## Running Monitoring Scripts
31+
## Configuration
32+
33+
### Chain Configuration
34+
35+
1. Copy and edit the config file:
36+
37+
```bash
38+
cp config.example.json config.json
39+
```
40+
41+
2. Configure your chains in `config.json`:
42+
43+
```json
44+
{
45+
"childChains": [
46+
{
47+
"name": "Your Chain Name",
48+
"chainId": 421614,
49+
"parentChainId": 11155111,
50+
"confirmPeriodBlocks": 45818,
51+
"parentRpcUrl": "https://your-parent-chain-rpc",
52+
"orbitRpcUrl": "https://your-chain-rpc",
53+
"ethBridge": {
54+
"bridge": "0x...",
55+
"inbox": "0x...",
56+
"outbox": "0x...",
57+
"rollup": "0x...",
58+
"sequencerInbox": "0x..."
59+
}
60+
}
61+
]
62+
}
63+
```
1664

17-
To run a monitoring tool, navigate to the relevant package folder inside `packages`, and run the desired scripts. Detailed instructions for each script can be found within their respective folders.
65+
### Alert Configuration
1866

19-
### Example
67+
1. Copy and configure the environment file:
2068

2169
```bash
22-
yarn workspace retryable-monitor dev [--options]
70+
cp .env.sample .env
2371
```
2472

25-
This can also be accessed simply from the root-level in this repository by:
73+
2. Set up Slack alerts in `.env` (optional):
2674

2775
```bash
28-
yarn retryable-monitor [--options]
76+
NODE_ENV=CI
77+
RETRYABLE_MONITORING_SLACK_TOKEN=your-slack-token
78+
RETRYABLE_MONITORING_SLACK_CHANNEL=your-slack-channel
79+
BATCH_POSTER_MONITORING_SLACK_TOKEN=your-slack-token
80+
BATCH_POSTER_MONITORING_SLACK_CHANNEL=your-slack-channel
81+
ASSERTION_MONITORING_SLACK_TOKEN=your-slack-token
82+
ASSERTION_MONITORING_SLACK_CHANNEL=your-slack-channel
2983
```
84+
85+
## Usage
86+
87+
All monitors support these base options:
88+
89+
- `--configPath`: Path to configuration file (default: "config.json")
90+
- `--enableAlerting`: Enable Slack alerts (default: false)
91+
92+
### Quick Start Commands
93+
94+
```bash
95+
# Monitor retryable tickets
96+
yarn retryable-monitor [options]
97+
98+
# Monitor batch posting
99+
yarn batch-poster-monitor [options]
100+
101+
# Monitor chain assertions
102+
yarn assertion-monitor [options]
103+
```
104+
105+
See individual monitor READMEs for specific options and features:
106+
107+
- [Retryable Monitor Details](./packages/retryable-monitor/README.md)
108+
- [Batch Poster Monitor Details](./packages/batch-poster-monitor/README.md)
109+
- [Assertion Monitor Details](./packages/assertion-monitor/README.md)

config.example.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"childChains": [
3+
{
4+
"name": "Arbitrum Sepolia",
5+
"chainId": 421614,
6+
"parentChainId": 11155111,
7+
"confirmPeriodBlocks": 45818,
8+
"parentRpcUrl": "https://sepolia.drpc.org",
9+
"orbitRpcUrl": "https://sepolia-rollup.arbitrum.io/rpc",
10+
"explorerUrl": "https://sepolia.arbiscan.io",
11+
"parentExplorerUrl": "https://sepolia.etherscan.io",
12+
"ethBridge": {
13+
"bridge": "0x38f918D0E9F1b721EDaA41302E399fa1B79333a9",
14+
"inbox": "0xaAe29B0366299461418F5324a79Afc425BE5ae21",
15+
"outbox": "0x65f07C7D521164a4d5DaC6eB8Fac8DA067A3B78F",
16+
"rollup": "0x042b2e6c5e99d4c521bd49beed5e99651d9b0cf4",
17+
"sequencerInbox": "0x6c97864CE4bE1C2C8bB6aFe3A115E6D7Dca82E71"
18+
}
19+
},
20+
{
21+
"name": "Xai Testnet",
22+
"chainId": 37714555429,
23+
"parentChainId": 421614,
24+
"confirmPeriodBlocks": 150,
25+
"parentRpcUrl": "https://sepolia-rollup.arbitrum.io/rpc",
26+
"orbitRpcUrl": "https://testnet-v2.xai-chain.net/rpc",
27+
"explorerUrl": "https://testnet-explorer-v2.xai-chain.net/",
28+
"parentExplorerUrl": "https://sepolia.arbiscan.io/",
29+
"ethBridge": {
30+
"bridge": "0x6c7FAC4edC72E86B3388B48979eF37Ecca5027e6",
31+
"inbox": "0x6396825803B720bc6A43c63caa1DcD7B31EB4dd0",
32+
"outbox": "0xc7491a559b416540427f9f112C5c98b1412c5d51",
33+
"rollup": "0xeedE9367Df91913ab149e828BDd6bE336df2c892",
34+
"sequencerInbox": "0x529a2061A1973be80D315770bA9469F3Da40D938"
35+
},
36+
"nativeToken": "0x4e6f41acbfa8eb4a3b25e151834d9a14b49b69d2",
37+
"tokenBridge": {
38+
"parentCustomGateway": "0x04e14E04949D49ae9c551ca8Cc3192310Ce65D88",
39+
"parentErc20Gateway": "0xCcB451C4Df22addCFe1447c58bC6b2f264Bb1256",
40+
"parentGatewayRouter": "0x185b868DBBF41554465fcb99C6FAb9383E15f47A",
41+
"parentMultiCall": "0xA115146782b7143fAdB3065D86eACB54c169d092",
42+
"parentProxyAdmin": "0x022c515aEAb29aaFf82e86A10950cE14eA89C9c5",
43+
"parentWeth": "0x0000000000000000000000000000000000000000",
44+
"parentWethGateway": "0x0000000000000000000000000000000000000000",
45+
"childCustomGateway": "0xea1ce1CC75C948488515A3058E10aa82da40cE8F",
46+
"childErc20Gateway": "0xD840761a09609394FaFA3404bEEAb312059AC558",
47+
"childGatewayRouter": "0x3B8ba769a43f34cdD67a20aF60d08D54C9C8f1AD",
48+
"childMultiCall": "0x5CBd60Ae5Af80A42FA8b0F20ADF95A8879844984",
49+
"childProxyAdmin": "0x7C1BA251d812fb34aF5C2566040C3C30585aFed9",
50+
"childWeth": "0x0000000000000000000000000000000000000000",
51+
"childWethGateway": "0x0000000000000000000000000000000000000000"
52+
}
53+
}
54+
]
55+
}
Lines changed: 46 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,71 @@
11
# Assertion Monitor
22

3-
This tool is designed to monitor assertions on Arbitrum chains. It performs comprehensive monitoring of both BOLD (Bounded Liquidity Delay) and Classic rollup chains, with the following checks:
3+
> For installation and general configuration, see the [main README](../../README.md).
44
5-
## Chain Activity Monitoring
6-
1. Tracks chain activity by monitoring block progression
7-
2. Verifies the latest confirmed block number from the child chain
8-
3. Detects periods of inactivity or stalled chain progress
5+
## Overview
96

10-
## Assertion Creation Monitoring
11-
1. No assertions created in the last 4 hours when there is chain activity
12-
2. Tracks creation events and validates their frequency
13-
3. Alerts when chain activity exists without new assertions
7+
The Assertion Monitor monitors the lifecycle of assertions in both BoLD (Bounded Liquidity Delay) and pre-BoLD rollup chains. [Learn more](https://docs.arbitrum.io/how-arbitrum-works/inside-arbitrum-nitro#arbitrum-rollup-protocol).
148

15-
## Assertion Confirmation Monitoring
16-
1. No assertions confirmed within the chain's confirmation period
17-
2. Tracks unconfirmed assertions and their age
18-
3. Monitors confirmation delays against the chain's configured period
19-
4. Validates the time between creation and confirmation events
9+
## Command-Line Interface
2010

21-
## Alert Types
22-
The monitor generates alerts for the following conditions:
23-
24-
1. Creation Issues:
25-
- No assertion creation events in the last 7 days
26-
- Chain activity detected but no new assertions created in the last 4 hours
27-
28-
2. Confirmation Issues:
29-
- Parent chain confirmation issues - assertions not confirming
30-
- Unconfirmed assertions present
31-
- Assertion age exceeds confirmation period
32-
- Confirmation delay exceeds the configured period
33-
34-
3. Chain State Issues:
35-
- Chain stalled or inactive
36-
- Block synchronization issues
37-
- Validator whitelist status changes
38-
39-
Read more about assertions [here](https://docs.arbitrum.io/how-arbitrum-works/inside-arbitrum-nitro#arbitrum-rollup-protocol).
40-
41-
## Prerequisites
42-
43-
Before using this tool, make sure you have the following installed:
44-
45-
- [Node.js](https://nodejs.org/en)
46-
- [Yarn](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable)
11+
```bash
12+
yarn assertion-monitor [options]
4713

48-
Additionally, ensure that you have added your Arbitrum network configuration to the `config.json` file in the `lib` directory;
14+
Monitor assertion creation and validation on Arbitrum chains
4915

50-
## Installation
16+
Options:
17+
--help Show help [boolean]
18+
--version Show version number [boolean]
19+
--configPath Path to config file [string] [default: "config.json"]
20+
--enableAlerting Enable Slack alerts [boolean] [default: false]
5121

52-
From the root directory of the project, run the following command to install dependencies:
22+
Examples:
23+
yarn assertion-monitor Run with default config
24+
yarn assertion-monitor --enableAlerting Enable Slack notifications
25+
yarn assertion-monitor --configPath=custom.json Use custom config file
5326

54-
```bash
55-
yarn install
27+
Environment Variables:
28+
ASSERTION_MONITORING_SLACK_TOKEN Slack API token for alerts
29+
ASSERTION_MONITORING_SLACK_CHANNEL Slack channel for alerts
5630
```
5731

58-
## Execution
32+
## Monitor Details
5933

60-
### One-off Check
34+
The Assertion Monitor tracks assertions through their lifecycle, implementing distinct strategies for BoLD and pre-BoLD rollup chains.
6135

62-
To find assertion events and display their status for a specific block range, execute the following command:
63-
64-
```bash
65-
yarn dev [--configPath=<CONFIG_PATH>]
66-
```
36+
### Critical Events Monitored
6737

68-
- If `--configPath` is not provided, it defaults to `config.json`.
69-
- This command will identify all assertion events (both creation and confirmation) from the parent chain to your Orbit chain within the specified block range.
38+
The monitor tracks five categories of blockchain events:
7039

71-
### Error Generation and Reporting
40+
- **Creation Events**: Records when new assertions and nodes are created on the chain to verify transaction execution
41+
- **Confirmation Events**: Identifies when assertions are confirmed on the parent chain after challenge periods end
42+
- **Validator Events**: Tracks validator participation metrics including stakes, challenges, and whitelist status
43+
- **Block Events**: Monitors block production rates, finalization timing, and synchronization between chains
44+
- **Chain State**: Analyzes the overall consistency between on-chain state and expected protocol behavior
7245

73-
To enable reporting, use `--enableAlerting` flag.
46+
### Alert Scenarios
7447

75-
This will enable alerts for all the conditions listed above in the Alert Types section.
48+
The monitor triggers alerts when these conditions are detected:
7649

77-
Additionally, you might also want to log these errors to Slack, for which you will need to configure, in the `.env` file:
50+
#### Creation Issues
7851

79-
- `NODE_ENV=CI`
80-
- `ASSERTION_MONITORING_SLACK_TOKEN=<your-slack-token>`
81-
- `ASSERTION_MONITORING_SLACK_CHANNEL=<your-slack-channel-key>`
52+
- No assertion creation events within configured time window
53+
- Chain activity without corresponding recent assertions
54+
- Extended node creation gaps on non-BoLD chains
55+
- Validator participation below required thresholds
8256

83-
Check [Slack integration documentation](https://api.slack.com/quickstart) for more information about getting these auth tokens.
57+
#### Confirmation Issues
8458

85-
## Chain Support
59+
- Parent chain block threshold exceeded
60+
- Assertions stuck in challenge period
61+
- Data inconsistencies between confirmation events and confirmed blocks
62+
- Confirmation events missing despite available creation events
8663

87-
The monitor automatically detects and adapts to different chain types:
64+
#### Other Issues
8865

89-
1. BOLD (Bounded Liquidity Delay) Chains:
90-
- Uses BOLD-specific assertion formats and validation
91-
- Tracks BOLD-specific confirmation processes
92-
- Monitors BOLD genesis assertion hash
66+
- Validator whitelist disabled on pre-BoLD chains
67+
- Base stake below 1 ETH threshold on BoLD chains
68+
- Parent-child chain synchronization anomalies
69+
- State inconsistencies between expected and observed chain state
9370

94-
2. Classic Rollup Chains:
95-
- Uses Classic node creation and confirmation events
96-
- Monitors Classic-specific block validation
97-
- Tracks node confirmation processes
71+
For implementation details and thresholds, see `alerts.ts` and `monitoring.ts`.

0 commit comments

Comments
 (0)