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
e5ba9b1d
Unverified
Commit
e5ba9b1d
authored
Jan 14, 2022
by
Conner Fromknecht
Committed by
GitHub
Jan 14, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2006 from cfromknecht/clear-state-batch-pending-tx
fix(batch-submitter): clear state root batches
parents
5599aed1
9fe09f70
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
pink-frogs-report.md
.changeset/pink-frogs-report.md
+5
-0
run-batch-submitter.ts
packages/batch-submitter/src/exec/run-batch-submitter.ts
+9
-8
No files found.
.changeset/pink-frogs-report.md
0 → 100644
View file @
e5ba9b1d
---
'
@eth-optimism/batch-submitter'
:
patch
---
Properly clear state root batch txs on startup
packages/batch-submitter/src/exec/run-batch-submitter.ts
View file @
e5ba9b1d
...
@@ -430,20 +430,21 @@ export const run = async () => {
...
@@ -430,20 +430,21 @@ export const run = async () => {
// Loops infinitely!
// Loops infinitely!
const
loop
=
async
(
const
loop
=
async
(
func
:
()
=>
Promise
<
TransactionReceipt
>
func
:
()
=>
Promise
<
TransactionReceipt
>
,
signer
:
Signer
):
Promise
<
void
>
=>
{
):
Promise
<
void
>
=>
{
// Clear all pending transactions
// Clear all pending transactions
if
(
clearPendingTxs
)
{
if
(
clearPendingTxs
)
{
try
{
try
{
const
pendingTxs
=
await
s
equencerS
igner
.
getTransactionCount
(
'
pending
'
)
const
pendingTxs
=
await
signer
.
getTransactionCount
(
'
pending
'
)
const
latestTxs
=
await
s
equencerS
igner
.
getTransactionCount
(
'
latest
'
)
const
latestTxs
=
await
signer
.
getTransactionCount
(
'
latest
'
)
if
(
pendingTxs
>
latestTxs
)
{
if
(
pendingTxs
>
latestTxs
)
{
logger
.
info
(
logger
.
info
(
'
Detected pending transactions. Clearing all transactions!
'
'
Detected pending transactions. Clearing all transactions!
'
)
)
for
(
let
i
=
latestTxs
;
i
<
pendingTxs
;
i
++
)
{
for
(
let
i
=
latestTxs
;
i
<
pendingTxs
;
i
++
)
{
const
response
=
await
s
equencerS
igner
.
sendTransaction
({
const
response
=
await
signer
.
sendTransaction
({
to
:
await
s
equencerS
igner
.
getAddress
(),
to
:
await
signer
.
getAddress
(),
value
:
0
,
value
:
0
,
nonce
:
i
,
nonce
:
i
,
})
})
...
@@ -456,7 +457,7 @@ export const run = async () => {
...
@@ -456,7 +457,7 @@ export const run = async () => {
logger
.
debug
(
'
empty transaction data
'
,
{
logger
.
debug
(
'
empty transaction data
'
,
{
data
:
response
.
data
,
data
:
response
.
data
,
})
})
await
s
equencerS
igner
.
provider
.
waitForTransaction
(
await
signer
.
provider
.
waitForTransaction
(
response
.
hash
,
response
.
hash
,
requiredEnvVars
.
NUM_CONFIRMATIONS
requiredEnvVars
.
NUM_CONFIRMATIONS
)
)
...
@@ -508,10 +509,10 @@ export const run = async () => {
...
@@ -508,10 +509,10 @@ export const run = async () => {
// Run batch submitters in two seperate infinite loops!
// Run batch submitters in two seperate infinite loops!
if
(
requiredEnvVars
.
RUN_TX_BATCH_SUBMITTER
)
{
if
(
requiredEnvVars
.
RUN_TX_BATCH_SUBMITTER
)
{
loop
(()
=>
txBatchSubmitter
.
submitNextBatch
())
loop
(()
=>
txBatchSubmitter
.
submitNextBatch
()
,
sequencerSigner
)
}
}
if
(
requiredEnvVars
.
RUN_STATE_BATCH_SUBMITTER
)
{
if
(
requiredEnvVars
.
RUN_STATE_BATCH_SUBMITTER
)
{
loop
(()
=>
stateBatchSubmitter
.
submitNextBatch
())
loop
(()
=>
stateBatchSubmitter
.
submitNextBatch
()
,
proposerSigner
)
}
}
if
(
config
.
bool
(
'
run-metrics-server
'
,
env
.
RUN_METRICS_SERVER
===
'
true
'
))
{
if
(
config
.
bool
(
'
run-metrics-server
'
,
env
.
RUN_METRICS_SERVER
===
'
true
'
))
{
...
...
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