Commit a1311977 authored by Joshua Gutow's avatar Joshua Gutow

op-proposer: Increase sendTx timeout

This increase the send transaction timeout while decreasing the transaction
creation timeout. Using idfferent timeouts is better to catch problems because
we expect different steps to take different amounts of time.
parent 60129ad5
......@@ -384,30 +384,31 @@ func (l *L2OutputSubmitter) loop() {
for {
select {
case <-ticker.C:
cCtx, cancel := context.WithTimeout(ctx, 3*time.Minute)
cCtx, cancel := context.WithTimeout(ctx, 30*time.Second)
output, shouldPropose, err := l.FetchNextOutputInfo(cCtx)
cancel()
if err != nil {
l.log.Error("Failed to fetch next output", "err", err)
cancel()
break
}
if !shouldPropose {
cancel()
break
}
cCtx, cancel = context.WithTimeout(ctx, 30*time.Second)
tx, err := l.CreateProposalTx(cCtx, output)
cancel()
if err != nil {
l.log.Error("Failed to create proposal transaction", "err", err)
cancel()
break
}
cCtx, cancel = context.WithTimeout(ctx, 10*time.Minute)
if err := l.SendTransaction(cCtx, tx); err != nil {
l.log.Error("Failed to send proposal transaction", "err", err)
cancel()
break
} else {
cancel()
}
cancel()
case <-l.done:
return
......
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