Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
573d18c5
Commit
573d18c5
authored
Jul 18, 2023
by
Hamdi Allam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ci failures
parent
18779f6d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
9 deletions
+14
-9
api_test.go
indexer/api/api_test.go
+2
-2
cli.go
indexer/cli/cli.go
+2
-3
indexer.go
indexer/indexer.go
+9
-3
l1_processor.go
indexer/processor/l1_processor.go
+1
-1
No files found.
indexer/api/api_test.go
View file @
573d18c5
...
@@ -21,8 +21,8 @@ const (
...
@@ -21,8 +21,8 @@ const (
)
)
// DepositsByAddress mocks returning deposits by an address
// DepositsByAddress mocks returning deposits by an address
func
(
mbv
*
MockBridgeView
)
DepositsByAddress
(
address
common
.
Address
)
([]
*
database
.
DepositWithTransactionHash
,
error
)
{
func
(
mbv
*
MockBridgeView
)
DepositsByAddress
(
address
common
.
Address
)
([]
*
database
.
DepositWithTransactionHash
es
,
error
)
{
return
[]
*
database
.
DepositWithTransactionHash
{
return
[]
*
database
.
DepositWithTransactionHash
es
{
{
{
Deposit
:
database
.
Deposit
{
Deposit
:
database
.
Deposit
{
GUID
:
uuid
.
MustParse
(
guid1
),
GUID
:
uuid
.
MustParse
(
guid1
),
...
...
indexer/cli/cli.go
View file @
573d18c5
...
@@ -2,7 +2,6 @@ package cli
...
@@ -2,7 +2,6 @@ package cli
import
(
import
(
"context"
"context"
"errors"
"fmt"
"fmt"
"os"
"os"
"os/signal"
"os/signal"
...
@@ -41,11 +40,11 @@ func runIndexer(ctx *cli.Context) error {
...
@@ -41,11 +40,11 @@ func runIndexer(ctx *cli.Context) error {
}
}
signalChannel
:=
make
(
chan
os
.
Signal
,
1
)
signalChannel
:=
make
(
chan
os
.
Signal
,
1
)
indexerCtx
,
indexerCancel
:=
context
.
WithCancel
Cause
(
context
.
Background
())
indexerCtx
,
indexerCancel
:=
context
.
WithCancel
(
context
.
Background
())
signal
.
Notify
(
signalChannel
,
os
.
Interrupt
)
signal
.
Notify
(
signalChannel
,
os
.
Interrupt
)
go
func
()
{
go
func
()
{
<-
signalChannel
<-
signalChannel
indexerCancel
(
errors
.
New
(
"caught interrrupt"
)
)
indexerCancel
()
}()
}()
return
indexer
.
Run
(
indexerCtx
)
return
indexer
.
Run
(
indexerCtx
)
...
...
indexer/indexer.go
View file @
573d18c5
...
@@ -5,6 +5,8 @@ import (
...
@@ -5,6 +5,8 @@ import (
"fmt"
"fmt"
"sync"
"sync"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum-optimism/optimism/indexer/config"
"github.com/ethereum-optimism/optimism/indexer/config"
"github.com/ethereum-optimism/optimism/indexer/database"
"github.com/ethereum-optimism/optimism/indexer/database"
"github.com/ethereum-optimism/optimism/indexer/node"
"github.com/ethereum-optimism/optimism/indexer/node"
...
@@ -14,7 +16,8 @@ import (
...
@@ -14,7 +16,8 @@ import (
// Indexer contains the necessary resources for
// Indexer contains the necessary resources for
// indexing the configured L1 and L2 chains
// indexing the configured L1 and L2 chains
type
Indexer
struct
{
type
Indexer
struct
{
db
*
database
.
DB
db
*
database
.
DB
log
log
.
Logger
L1Processor
*
processor
.
L1Processor
L1Processor
*
processor
.
L1Processor
L2Processor
*
processor
.
L2Processor
L2Processor
*
processor
.
L2Processor
...
@@ -52,6 +55,7 @@ func NewIndexer(cfg config.Config) (*Indexer, error) {
...
@@ -52,6 +55,7 @@ func NewIndexer(cfg config.Config) (*Indexer, error) {
indexer
:=
&
Indexer
{
indexer
:=
&
Indexer
{
db
:
db
,
db
:
db
,
log
:
cfg
.
Logger
,
L1Processor
:
l1Processor
,
L1Processor
:
l1Processor
,
L2Processor
:
l2Processor
,
L2Processor
:
l2Processor
,
}
}
...
@@ -65,14 +69,16 @@ func (i *Indexer) Run(ctx context.Context) error {
...
@@ -65,14 +69,16 @@ func (i *Indexer) Run(ctx context.Context) error {
errCh
:=
make
(
chan
error
)
errCh
:=
make
(
chan
error
)
// If either processor errors out, we stop
// If either processor errors out, we stop
processorCtx
,
cancel
:=
context
.
WithCancel
Cause
(
ctx
)
processorCtx
,
cancel
:=
context
.
WithCancel
(
ctx
)
run
:=
func
(
start
func
(
ctx
context
.
Context
)
error
)
{
run
:=
func
(
start
func
(
ctx
context
.
Context
)
error
)
{
wg
.
Add
(
1
)
wg
.
Add
(
1
)
defer
wg
.
Done
()
defer
wg
.
Done
()
err
:=
start
(
processorCtx
)
err
:=
start
(
processorCtx
)
if
err
!=
nil
{
if
err
!=
nil
{
cancel
(
err
)
i
.
log
.
Error
(
"halting indexer on error"
,
"err"
,
err
)
cancel
()
errCh
<-
err
errCh
<-
err
}
}
}
}
...
...
indexer/processor/l1_processor.go
View file @
573d18c5
...
@@ -310,7 +310,7 @@ func l1BridgeProcessContractEvents(processLog log.Logger, db *database.DB, ethCl
...
@@ -310,7 +310,7 @@ func l1BridgeProcessContractEvents(processLog log.Logger, db *database.DB, ethCl
if
withdrawal
==
nil
{
if
withdrawal
==
nil
{
// This needs to be updated to read from config as well as correctly identify if the CrossDomainMessenger message is a standard
// This needs to be updated to read from config as well as correctly identify if the CrossDomainMessenger message is a standard
// bridge message. This will easier to do once we index passed messages sep
e
rately which will include the right To/From fields
// bridge message. This will easier to do once we index passed messages sep
a
rately which will include the right To/From fields
if
provenWithdrawalEvent
.
From
!=
common
.
HexToAddress
(
"0x4200000000000000000000000000000000000007"
)
||
provenWithdrawalEvent
.
To
!=
l1Contracts
.
L1CrossDomainMessenger
{
if
provenWithdrawalEvent
.
From
!=
common
.
HexToAddress
(
"0x4200000000000000000000000000000000000007"
)
||
provenWithdrawalEvent
.
To
!=
l1Contracts
.
L1CrossDomainMessenger
{
// non-bridge withdrawal
// non-bridge withdrawal
continue
continue
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment