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
428173cb
Commit
428173cb
authored
Mar 28, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-chain-ops: lint fix
parent
05702b54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
main.go
op-chain-ops/cmd/rollover/main.go
+10
-6
No files found.
op-chain-ops/cmd/rollover/main.go
View file @
428173cb
...
@@ -177,11 +177,11 @@ func main() {
...
@@ -177,11 +177,11 @@ func main() {
log
.
Info
(
"Waiting for CanonicalTransactionChain"
)
log
.
Info
(
"Waiting for CanonicalTransactionChain"
)
wg
.
Add
(
1
)
wg
.
Add
(
1
)
go
waitForTotalElements
(
wg
,
ctc
,
clients
.
L2Client
)
go
waitForTotalElements
(
&
wg
,
ctc
,
clients
.
L2Client
)
log
.
Info
(
"Waiting for StateCommitmentChain"
)
log
.
Info
(
"Waiting for StateCommitmentChain"
)
wg
.
Add
(
1
)
wg
.
Add
(
1
)
go
waitForTotalElements
(
wg
,
scc
,
clients
.
L2Client
)
go
waitForTotalElements
(
&
wg
,
scc
,
clients
.
L2Client
)
wg
.
Wait
()
wg
.
Wait
()
log
.
Info
(
"All batches have been submitted"
)
log
.
Info
(
"All batches have been submitted"
)
...
@@ -204,21 +204,25 @@ type RollupContract interface {
...
@@ -204,21 +204,25 @@ type RollupContract interface {
}
}
// waitForTotalElements will poll to see
// waitForTotalElements will poll to see
func
waitForTotalElements
(
wg
sync
.
WaitGroup
,
contract
RollupContract
,
client
*
ethclient
.
Client
)
error
{
func
waitForTotalElements
(
wg
*
sync
.
WaitGroup
,
contract
RollupContract
,
client
*
ethclient
.
Client
)
{
defer
wg
.
Done
()
defer
wg
.
Done
()
for
{
for
{
bn
,
err
:=
client
.
BlockNumber
(
context
.
Background
())
bn
,
err
:=
client
.
BlockNumber
(
context
.
Background
())
if
err
!=
nil
{
if
err
!=
nil
{
return
err
log
.
Error
(
"cannot fetch blocknumber"
,
"error"
,
err
)
time
.
Sleep
(
3
*
time
.
Second
)
continue
}
}
totalElements
,
err
:=
contract
.
GetTotalElements
(
&
bind
.
CallOpts
{})
totalElements
,
err
:=
contract
.
GetTotalElements
(
&
bind
.
CallOpts
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
err
log
.
Error
(
"cannot fetch total elements"
,
"error"
,
err
)
time
.
Sleep
(
3
*
time
.
Second
)
continue
}
}
if
totalElements
.
Uint64
()
==
bn
{
if
totalElements
.
Uint64
()
==
bn
{
return
nil
return
}
}
log
.
Info
(
"Waiting for elements to be submitted"
,
"count"
,
totalElements
.
Uint64
()
-
bn
,
"height"
,
bn
,
"total-elements"
,
totalElements
.
Uint64
())
log
.
Info
(
"Waiting for elements to be submitted"
,
"count"
,
totalElements
.
Uint64
()
-
bn
,
"height"
,
bn
,
"total-elements"
,
totalElements
.
Uint64
())
...
...
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