Commit 49762e7f authored by Ethen Pociask's avatar Ethen Pociask

[epociask/debug] Debugging bridge processor

parent 0086b6dd
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "go",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/indexer/cmd/indexer",
"mode": "debug",
"env": {
"INDEXER_CONFIG": "/Users/ethen.pociask@coinbase.com/coinbase/indexer.toml"
},
"args": [
"index"
]
}
]
}
...@@ -8,6 +8,7 @@ import ( ...@@ -8,6 +8,7 @@ import (
"github.com/ethereum-optimism/optimism/indexer/bigint" "github.com/ethereum-optimism/optimism/indexer/bigint"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"gorm.io/gorm" "gorm.io/gorm"
) )
...@@ -200,6 +201,7 @@ func (db *blocksDB) LatestObservedEpoch(fromL1Height *big.Int, maxL1Range uint64 ...@@ -200,6 +201,7 @@ func (db *blocksDB) LatestObservedEpoch(fromL1Height *big.Int, maxL1Range uint64
result := db.gorm.Where(l1QueryFilter).Order("timestamp DESC").Take(&l1Header) result := db.gorm.Where(l1QueryFilter).Order("timestamp DESC").Take(&l1Header)
if result.Error != nil { if result.Error != nil {
if errors.Is(result.Error, gorm.ErrRecordNotFound) { if errors.Is(result.Error, gorm.ErrRecordNotFound) {
log.Warn("Could not fetch latest L1 block header in bridge processor")
return nil, nil return nil, nil
} }
return nil, result.Error return nil, result.Error
...@@ -211,6 +213,7 @@ func (db *blocksDB) LatestObservedEpoch(fromL1Height *big.Int, maxL1Range uint64 ...@@ -211,6 +213,7 @@ func (db *blocksDB) LatestObservedEpoch(fromL1Height *big.Int, maxL1Range uint64
result = db.gorm.Where("timestamp <= ?", toTimestamp).Order("timestamp DESC").Take(&l2Header) result = db.gorm.Where("timestamp <= ?", toTimestamp).Order("timestamp DESC").Take(&l2Header)
if result.Error != nil { if result.Error != nil {
if errors.Is(result.Error, gorm.ErrRecordNotFound) { if errors.Is(result.Error, gorm.ErrRecordNotFound) {
log.Warn("Could not fetch latest L2 block header in bridge processor")
return nil, nil return nil, nil
} }
return nil, result.Error return nil, result.Error
...@@ -233,6 +236,7 @@ func (db *blocksDB) LatestObservedEpoch(fromL1Height *big.Int, maxL1Range uint64 ...@@ -233,6 +236,7 @@ func (db *blocksDB) LatestObservedEpoch(fromL1Height *big.Int, maxL1Range uint64
result := query.Take(&epoch) result := query.Take(&epoch)
if result.Error != nil { if result.Error != nil {
if errors.Is(result.Error, gorm.ErrRecordNotFound) { if errors.Is(result.Error, gorm.ErrRecordNotFound) {
log.Warn("Could not fetch latest observed epoch in bridge processor")
return nil, nil return nil, nil
} }
return nil, result.Error return nil, result.Error
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment