|
4 | 4 | "context" |
5 | 5 | "errors" |
6 | 6 | "fmt" |
7 | | - stdlog "log" |
8 | 7 | "log/slog" |
9 | 8 | "math/big" |
10 | 9 | "runtime/debug" |
@@ -457,7 +456,6 @@ func (l *ReceiptsListener) FetchTransactionReceiptWithFilter(ctx context.Context |
457 | 456 | // it indicates that we have high conviction that the receipt should be available, as the monitor has found |
458 | 457 | // this transaction hash. |
459 | 458 | func (l *ReceiptsListener) fetchTransactionReceipt(ctx context.Context, txnHash common.Hash, forceFetch bool) (*types.Receipt, error) { |
460 | | - stdlog.Printf("ethreceipts: fetchTransactionReceipt %s (forceFetch=%v)", txnHash.String(), forceFetch) |
461 | 459 |
|
462 | 460 | l.fetchSem <- struct{}{} |
463 | 461 |
|
@@ -755,8 +753,6 @@ func (l *ReceiptsListener) processBlocks(blocks ethmonitor.Blocks, subscribers [ |
755 | 753 |
|
756 | 754 | // check each block against each subscriber X filter |
757 | 755 | for _, block := range blocks { |
758 | | - stdlog.Printf("ethreceipts: block[%d] -> filterers %d subscribers %d", block.Block.Number(), len(filterers), len(subscribers)) |
759 | | - |
760 | 756 | // report if the txn was removed |
761 | 757 | reorged := block.Event == ethmonitor.Removed |
762 | 758 |
|
@@ -806,7 +802,7 @@ func (l *ReceiptsListener) processBlocks(blocks ethmonitor.Blocks, subscribers [ |
806 | 802 | }() |
807 | 803 |
|
808 | 804 | // retry pending receipts first |
809 | | - retryCtx, cancel := context.WithTimeout(context.Background(), 3*time.Second) |
| 805 | + retryCtx, cancel := context.WithTimeout(context.Background(), 5*time.Second) |
810 | 806 | sub.retryPendingReceipts(retryCtx) |
811 | 807 | cancel() |
812 | 808 |
|
@@ -882,7 +878,6 @@ func (l *ReceiptsListener) searchFilterOnChain(ctx context.Context, subscriber * |
882 | 878 | return nil |
883 | 879 | } |
884 | 880 | if r == nil { |
885 | | - panic("ethreceipts: unexpected nil receipt with no error") |
886 | 881 | // unable to find the receipt on-chain, lets continue |
887 | 882 | return nil |
888 | 883 | } |
@@ -943,7 +938,7 @@ func (l *ReceiptsListener) isBlockFinal(blockNum *big.Int) bool { |
943 | 938 | } |
944 | 939 |
|
945 | 940 | func (l *ReceiptsListener) latestBlockNum() *big.Int { |
946 | | - // Cache latest block number for up to 3 seconds to avoid hammering monitor.LatestBlockNum() |
| 941 | + // Cache latest block number to avoid hammering monitor.LatestBlockNum() |
947 | 942 | cachedTime := time.Unix(l.latestBlockNumTime.Load(), 0) |
948 | 943 | if time.Since(cachedTime) < l.options.LatestBlockNumCacheTTL { |
949 | 944 | cachedNum := l.latestBlockNumCache.Load() |
|
0 commit comments