Skip to content

Commit 2ab2881

Browse files
committed
chore: clean up verbose comments in batch-aware changes
1 parent 38450e8 commit 2ab2881

File tree

3 files changed

+1
-15
lines changed

3 files changed

+1
-15
lines changed

packages/assertion-monitor/__test__/monitoring.test.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ describe('Assertion Health Monitoring', () => {
9292
recentConfirmationEvent: null,
9393
isValidatorWhitelistDisabled: false,
9494
isBaseStakeBelowThreshold: false,
95-
// By default, no batches posted (lastBlockIncludedInBatch <= childLatestCreatedBlock)
9695
lastBlockIncludedInBatch: 800n,
9796
}
9897
}
@@ -150,7 +149,6 @@ describe('Assertion Health Monitoring', () => {
150149
timestamp: NOW - BigInt(5 * 60 * 60), // 5 hours ago
151150
number: 900n,
152151
} as Block
153-
// Set batches posted beyond the last asserted block
154152
chainState.lastBlockIncludedInBatch = 1000n
155153

156154
const alerts = await analyzeAssertionEvents(
@@ -168,13 +166,11 @@ describe('Assertion Health Monitoring', () => {
168166

169167
test('should NOT alert when no batches posted (low activity)', async () => {
170168
const chainState = createBaseChainState()
171-
// Set creation event to be older than the recent activity threshold (4 hours)
172169
chainState.childLatestCreatedBlock = {
173170
...chainState.childLatestCreatedBlock!,
174171
timestamp: NOW - BigInt(5 * 60 * 60), // 5 hours ago
175172
number: 900n,
176173
} as Block
177-
// But no batches posted beyond the last asserted block
178174
chainState.lastBlockIncludedInBatch = 800n
179175

180176
const alerts = await analyzeAssertionEvents(
@@ -183,7 +179,6 @@ describe('Assertion Health Monitoring', () => {
183179
true
184180
)
185181

186-
// Should NOT alert - no batches posted means no activity requiring assertions
187182
expect(alerts).not.toContain(CHAIN_ACTIVITY_WITHOUT_ASSERTIONS_ALERT)
188183
})
189184

@@ -320,7 +315,6 @@ describe('Assertion Health Monitoring', () => {
320315
number: 1800n,
321316
} as Block
322317

323-
// Set batches posted beyond the last asserted block
324318
chainState.lastBlockIncludedInBatch = 1900n
325319

326320
// Set values to trigger confirmation delay
@@ -567,7 +561,6 @@ describe('Assertion Health Monitoring', () => {
567561
timestamp: NOW - BigInt(5 * 60 * 60), // 5 hours ago
568562
number: 900n,
569563
} as Block
570-
// Set batches posted beyond the last asserted block
571564
chainState.lastBlockIncludedInBatch = 1000n
572565

573566
const alerts = await analyzeAssertionEvents(
@@ -643,7 +636,6 @@ describe('Assertion Health Monitoring', () => {
643636
timestamp: NOW - BigInt(7 * 24 * 60 * 60), // 7 days ago
644637
number: 900n,
645638
} as Block
646-
// Set batches posted beyond the last asserted block to trigger batch alert
647639
chainState.lastBlockIncludedInBatch = 1000n
648640

649641
const alerts = await analyzeAssertionEvents(
@@ -652,10 +644,7 @@ describe('Assertion Health Monitoring', () => {
652644
false
653645
)
654646

655-
// The implementation will generate other alerts, but not CREATION_EVENT_STUCK_ALERT
656647
expect(alerts).not.toContain(CREATION_EVENT_STUCK_ALERT)
657-
658-
// With batches posted, it should alert about batches without assertions
659648
expect(alerts).toContain(CHAIN_ACTIVITY_WITHOUT_ASSERTIONS_ALERT)
660649
})
661650

@@ -668,7 +657,6 @@ describe('Assertion Health Monitoring', () => {
668657
number: 900n,
669658
} as Block
670659

671-
// Set batches posted beyond the last asserted block
672660
chainState.lastBlockIncludedInBatch = 1000n
673661

674662
// Set parent chain blocks to indicate a delay

packages/assertion-monitor/blockchain.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,6 @@ export const fetchChainState = async ({
387387
isBold
388388
)
389389

390-
// Query last block included in batches from Bridge contract
391-
// Fail safe: if query fails, return undefined (won't trigger batch-related alerts)
392390
let lastBlockIncludedInBatch: bigint | undefined
393391
try {
394392
lastBlockIncludedInBatch = await parentClient.readContract({

packages/assertion-monitor/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@ export interface ChainState {
6363
isBaseStakeBelowThreshold: boolean
6464
searchFromBlock?: bigint
6565
searchToBlock?: bigint
66-
/** Last child chain block number included in a batch (from sequencerReportedSubMessageCount) */
66+
/** Last child block included in a batch */
6767
lastBlockIncludedInBatch?: bigint
6868
}

0 commit comments

Comments
 (0)