From 64fa041ec53f647591d3c16b05fe53a0faea206b Mon Sep 17 00:00:00 2001 From: Moretti Georgiev Date: Tue, 3 Dec 2024 15:24:41 +0200 Subject: [PATCH] fix: replace L1 rpc url in error for getting l1 gas price (#1533) (#1534) --- turbo/jsonrpc/eth_system_zk.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/turbo/jsonrpc/eth_system_zk.go b/turbo/jsonrpc/eth_system_zk.go index 2d2185d3248..ffdce335075 100644 --- a/turbo/jsonrpc/eth_system_zk.go +++ b/turbo/jsonrpc/eth_system_zk.go @@ -6,9 +6,11 @@ import ( "fmt" "math/big" "strconv" + "strings" "time" "github.com/ledgerwatch/erigon-lib/common/hexutil" + "github.com/ledgerwatch/erigon/cmd/utils" "github.com/ledgerwatch/erigon/ethclient" "github.com/ledgerwatch/erigon/zkevm/encoding" "github.com/ledgerwatch/erigon/zkevm/jsonrpc/client" @@ -119,6 +121,10 @@ func (api *APIImpl) l1GasPrice() (*big.Int, error) { } if res.Error != nil { + if strings.Contains(res.Error.Message, api.L1RpcUrl) { + replacement := fmt.Sprintf("<%s>", utils.L1RpcUrlFlag.Name) + res.Error.Message = strings.ReplaceAll(res.Error.Message, api.L1RpcUrl, replacement) + } return nil, fmt.Errorf("RPC error response: %s", res.Error.Message) }