Skip to content

fix(assertion-monitor): use batch data to prevent false positive alerts#92

Open
douglance wants to merge 3 commits intomainfrom
fix/assertion-monitor-batch-aware
Open

fix(assertion-monitor): use batch data to prevent false positive alerts#92
douglance wants to merge 3 commits intomainfrom
fix/assertion-monitor-batch-aware

Conversation

@douglance
Copy link
Contributor

@douglance douglance commented Jan 21, 2026

Summary

Improve assertion monitoring accuracy by alerting only when batches exist that haven't been asserted, instead of alerting on any block production.

Key insight: Per Arbitrum docs, "if no new batches are posted, no new assertions will be posted." Validators assert batches, not raw blocks.

Changes

  • blockchain.ts: Query sequencerReportedSubMessageCount() from Bridge contract to get last block included in a batch
  • monitoring.ts: Replace block-based check with batch-aware check (lastBlockIncludedInBatch > childLatestCreatedBlock)
  • alerts.ts: Update message to "Batches have been posted but no assertions created"
  • types.ts: Add lastBlockIncludedInBatch field to ChainState
  • Remove redundant "No recent node creation events" alert

Results

Tested against 27 production Orbit chains (parallel run, same chain state):

Metric Before After
Alert noise 2-3 alerts/chain 1-2 alerts/chain
Redundant alerts "No recent node creation events" Removed
True positives Some missed JasmyChain caught (validator 18h behind)

Note: Humanity/Galactica showing healthy is due to portal's rollup address fix (657bc7b2), not this change.

Test plan

  • yarn workspace assertion-monitor build passes
  • yarn workspace assertion-monitor test passes (25 tests)
  • Parallel A/B test against 27 production Orbit chains
  • Verified reduced alert noise
  • Verified new true positive caught (JasmyChain)

Changed assertion monitor to only alert when batches have been posted
but not asserted, instead of alerting on any block production without
recent assertions. This eliminates false positives on low-activity
chains where blocks are produced but no batches are posted.

Changes:
- Query sequencerReportedSubMessageCount() from Bridge contract
- Replace block-based check with batch-aware check
- Remove redundant "No recent node creation events" alert
- Add error handling for batch query (fail-safe to no alert)

Fixes false positives on: Humanity Mainnet, Galactica Mainnet
@douglance douglance force-pushed the fix/assertion-monitor-batch-aware branch from 2ab2881 to 0a41c25 Compare January 22, 2026 12:26
chainState.childLatestCreatedBlock = {
...chainState.childLatestCreatedBlock!,
timestamp: NOW - BigInt(5 * 60 * 60), // 5 hours ago
number: 900n,
Copy link
Contributor

Choose a reason for hiding this comment

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

Where are these 900n and 1000n (just after this) values coming from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

they're just arbitrary for the test.

all that matters is that 900 < 1000.

i added comments in the test code to clarify.

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.

2 participants