Commit 949916f8 authored by Mark Tyneway's avatar Mark Tyneway

l2geth: better error message for proxying user txs

This commit adds a better error message when there
is an error for proxying user requests to the sequencer.
This allows the change to be relatively backwards compatible
as a good error message is returned when the sequencer url
is not configured.
parent 4d7c5457
---
'@eth-optimism/l2geth': patch
---
Add a better error message for when the sequencer url is not configured when proxying user requests to the sequencer for `eth_sendRawTransaction` when running as a verifier/replica
......@@ -50,7 +50,10 @@ import (
"github.com/tyler-smith/go-bip39"
)
var errOVMUnsupported = errors.New("OVM: Unsupported RPC Method")
var (
errOVMUnsupported = errors.New("OVM: Unsupported RPC Method")
errNoSequencerURL = errors.New("sequencer transaction forwarding not configured")
)
const (
// defaultDialTimeout is default duration the service will wait on
......@@ -1678,7 +1681,11 @@ func (s *PublicTransactionPoolAPI) SendRawTransaction(ctx context.Context, encod
}
if s.b.IsVerifier() {
client, err := dialSequencerClientWithTimeout(ctx, s.b.SequencerClientHttp())
sequencerURL := s.b.SequencerClientHttp()
if sequencerURL == "" {
return common.Hash{}, errNoSequencerURL
}
client, err := dialSequencerClientWithTimeout(ctx, sequencerURL)
if err != nil {
return common.Hash{}, err
}
......
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