Commit 26bf70ca authored by Joshua Gutow's avatar Joshua Gutow Committed by GitHub

Merge pull request #5142 from ethereum-optimism/jg/txgmr_timeout

op-batcher/proposer: Increase sendTx timeout
parents 6047ee37 2339364a
...@@ -55,7 +55,7 @@ func (t *TransactionManager) SendTransaction(ctx context.Context, data []byte) ( ...@@ -55,7 +55,7 @@ func (t *TransactionManager) SendTransaction(ctx context.Context, data []byte) (
return nil, fmt.Errorf("failed to create tx: %w", err) return nil, fmt.Errorf("failed to create tx: %w", err)
} }
ctx, cancel := context.WithTimeout(ctx, 100*time.Second) // TODO: Select a timeout that makes sense here. ctx, cancel := context.WithTimeout(ctx, 10*time.Minute) // TODO: Select a timeout that makes sense here.
defer cancel() defer cancel()
if receipt, err := t.txMgr.Send(ctx, tx); err != nil { if receipt, err := t.txMgr.Send(ctx, tx); err != nil {
t.log.Warn("unable to publish tx", "err", err, "data_size", len(data)) t.log.Warn("unable to publish tx", "err", err, "data_size", len(data))
......
...@@ -384,30 +384,31 @@ func (l *L2OutputSubmitter) loop() { ...@@ -384,30 +384,31 @@ func (l *L2OutputSubmitter) loop() {
for { for {
select { select {
case <-ticker.C: 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) output, shouldPropose, err := l.FetchNextOutputInfo(cCtx)
cancel()
if err != nil { if err != nil {
l.log.Error("Failed to fetch next output", "err", err)
cancel()
break break
} }
if !shouldPropose { if !shouldPropose {
cancel()
break break
} }
cCtx, cancel = context.WithTimeout(ctx, 30*time.Second)
tx, err := l.CreateProposalTx(cCtx, output) tx, err := l.CreateProposalTx(cCtx, output)
cancel()
if err != nil { if err != nil {
l.log.Error("Failed to create proposal transaction", "err", err) l.log.Error("Failed to create proposal transaction", "err", err)
cancel()
break break
} }
cCtx, cancel = context.WithTimeout(ctx, 10*time.Minute)
if err := l.SendTransaction(cCtx, tx); err != nil { if err := l.SendTransaction(cCtx, tx); err != nil {
l.log.Error("Failed to send proposal transaction", "err", err) l.log.Error("Failed to send proposal transaction", "err", err)
cancel() cancel()
break break
} else {
cancel()
} }
cancel()
case <-l.done: case <-l.done:
return 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