Commit 414b2f2
Add OP Stack integration for L2 chain tracking (#433)
* Add OP Stack integration for L2 chain tracking
Implement full OP Stack support to track batches, state roots, deposits,
and withdrawals between custom L2 OP Stack chains and L1.
Features:
- Database models: OpChainConfig, OpBatch, OpOutput, OpDeposit, OpWithdrawal
- Event detection for deposits, outputs, withdrawals, and batches
- Support for both legacy (L2OutputOracle) and modern (DisputeGameFactory) chains
- Background jobs for output finalization and deposit-to-L2 linking
- API endpoints for all OP Stack entities
- Frontend pages: deposits, withdrawals, batches, outputs with detail views
- Transaction lifecycle component showing L2 tx progression
- Settings page for OP Stack configuration
- Shared isTopL1Parent field for both Orbit and OP Stack parent workspaces
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* Fix code review suggestions for OP Stack integration
- Fix unmanagedError(error, req, res) → next in explorers.js
- Use SHA-256 instead of keccak256 for blob versioned hashes (EIP-4844)
- Fix gameType BigNumber conversion in opOutputs.js
- Fix timestamp setter to return Date instead of string
- Update deriveL2TransactionHash to include l1BlockNumber
- Add onDelete/onUpdate behavior to migration foreign keys
- Add DROP TYPE to down migrations for enums
- Add l1TransactionHash lowercase normalization setters
- Fix JSDoc return type in opDeposits.js
- Add sortBy[0].order guard in OpWithdrawals.vue
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* Address additional code review feedback for OP Stack
- Fix computeBlobVersionedHash slicing (handle 0x prefix correctly)
- Add node-fetch import for beacon API calls
- Add try/catch error handling to all parseLog functions
- Add lowercase normalization setters for all address fields in OpChainConfig
- Fix safeUpdate to only validate parentChainId when provided
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* Address code review suggestions for OP Stack
- Fix race condition in batch index assignment using transaction with lock
- Add input validation and sanitization for pagination parameters
- Add named constants for EIP-4844 versioned hash calculations
- Add 404 handling when OP entities are not found
- Add optional chaining for template property access in Vue components
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* Add OP Stack parent workspace and UI improvements
- Add getAvailableOpParents API endpoint for L1 workspace selection
- Add parent workspace dropdown to ExplorerOpSettings component
- Include opConfig in workspace queries for proper data flow
- Add parentChainExplorer and parentWorkspaceId to explorer responses
- Update CLAUDE.md with OP Stack testing documentation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* Add OP Stack L1 transaction filtering in blockSync
- Filter L1 transactions to only OP-relevant contracts when workspace
has opChildConfigs (similar to existing Orbit filtering)
- Include opChildConfigs in initial workspace query to avoid extra DB call
- Reuse loaded opChildConfigs for batch detection instead of re-querying
Contracts filtered: batchInboxAddress, optimismPortalAddress,
l2OutputOracleAddress, disputeGameFactoryAddress, systemConfigAddress
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* Implement OP Stack batch parsing for L2 block range extraction
- Add full batch data parsing with zlib/brotli decompression
- Parse span batch and singular batch formats per OP Stack derivation spec
- Extract L2 block count and calculate block range from timestamps
- Add finalizePendingOpBatches job to confirm batches on safe block
- Add l2BlockTime field to OpChainConfig model
- Fix finalizePendingOrbitBatches to include orbitChildConfigs association
- Fix hex-to-integer conversion for l1BlockNumber in batch creation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* Refactor OP Stack code based on PR review
- Extract sanitizePagination to shared utility in lib/utils.js
- Remove duplicate sanitizePagination from OP API files
- Move timestamp conversion outside loop in blockSync.js
- Add named constants for magic numbers in opBatches.js
- Add logging to batch parsing error handlers
- Move requires to top of opBatches.js to avoid potential circular deps
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* Add OP Stack batch enhancements and deposit/output tracking
- Add dataContainer field to op_batches (in_blob4844 vs in_calldata)
- Add clickable links to parent chain explorer for blob hash, L1 tx, and L1 block
- Implement deposit and output event detection in receiptSync
- Add storeOpDeposit and storeOpOutput jobs for event processing
- Add backfill jobs for historical deposits and outputs
- Add opEvents.js library for OP Stack event parsing
- Update TransactionsList to support opBatchIndex filtering
- Add beaconUrl field to OpChainConfig for blob fetching
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* Fix code review issues for OP Stack integration
- Clean up event signatures: remove dead code, use single computed source
- Lower default backfill batch size from 10000 to 10 for RPC compatibility
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* Refactor OpBatchDetail to match OrbitBatchDetail structure
- Add tabbed interface with Overview and Transactions tabs
- Create OpBatchOverview component with v-list layout
- Create OpBatchTransactions wrapper component
- Add skeleton loader for loading state
- Support URL hash navigation between tabs
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* Add Blocks tab to OP batch detail page
- Add getOpBatchBlocks function to firebase.js
- Add /opBatches/:batchIndex/blocks API endpoint
- Add getOpBatchBlocks method to server.js plugin
- Add opBatchIndex prop to BlockList.vue component
- Create OpBatchBlocks.vue wrapper component
- Add Blocks tab to OpBatchDetail.vue with URL hash support
- Change default blob explorer URL from Etherscan to Blockscout
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* Address code review feedback for OP Stack integration
- Remove unused managedError imports from opDeposits.js and opOutputs.js
- Add pagination to backfillOpBatchBlockRanges job (chunk size 1000)
- Add test for GET /:batchIndex/blocks endpoint
- Add unit tests for OpBatchBlocks and OpBatchOverview components
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* Fix OP dispute game output creation
- Make l2BlockNumber nullable for dispute game outputs (fault proofs
don't include L2 block number in DisputeGameCreated event)
- Fix priority parameter in receiptSync enqueue calls (use integer 1
instead of string 'high')
- Add migration to alter op_outputs.l2BlockNumber column
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* Refactor OpOutputDetail to match OpBatchDetail design
- Create OpOutputOverview component with v-list layout
- Update OpOutputDetail to use tabbed interface with BaseChipGroup
- Add parentChainExplorer to getOpOutput API response
- Add game type labels for dispute games (Cannon, Permissioned Cannon, etc)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* fix backend tests
* update frontend tests
* fix frontend tests
---------
Co-authored-by: Antoine de Chevigné <[email protected]>
Co-authored-by: Claude Opus 4.5 <[email protected]>1 parent d4b3c8f commit 414b2f2
File tree
103 files changed
+9135
-940
lines changed- run
- api
- jobs
- lib
- abis
- migrations
- models
- tests
- api
- jobs
- lib
- mocks/models
- workers
- src
- components
- plugins
- stores
- tests/unit
- components
- __snapshots__
- mocks
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
103 files changed
+9135
-940
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
58 | 72 | | |
59 | 73 | | |
60 | 74 | | |
| |||
186 | 200 | | |
187 | 201 | | |
188 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
189 | 312 | | |
190 | 313 | | |
191 | 314 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| |||
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
61 | 69 | | |
62 | 70 | | |
63 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
0 commit comments