You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: poller.go
    path of file: ./repos/wormhole/node/pkg/watchers/evm/connectors
    
    the code of the file until where you have to start completion: package connectors

import (
	"context"
	"fmt"
	"math/big"
	"time"

	"github.com/certusone/wormhole/node/pkg/common"
	"github.com/certusone/wormhole/node/pkg/supervisor"

	ethereum "github.com/ethereum/go-ethereum"
	ethEvent "github.com/ethereum/go-ethereum/event"

	"go.uber.org/zap"
)

type PollFinalizer interface {
	IsBlockFinalized(ctx context.Context, block *NewBlock) (bool, error)
}

// FinalizerPollConnector polls for new blocks. It takes a finalizer which will be used to determine when a block is finalized.
type FinalizerPollConnector struct {
	Connector
	Delay     time.Duration
	finalizer PollFinalizer
	blockFeed ethEvent.Feed
	errFeed   ethEvent.Feed
}

func NewFinalizerPollConnector(ctx context.Context, baseConnector Connector, finalizer PollFinalizer, delay time.Duration) (*FinalizerPollConnector, error) {
	if finali
    
func (b *FinalizerPollConnector) run(ctx context.Context, logger *zap.Logger) error {
	prevLatest, err := getLatestBlock(ctx, logger, b.Connector)
	if err != nil {
		return err
	}

	// Initialize the previous finalized block to latest. This is used to determine where to start looking for finalized blocks. We don't actually publish it.
	prevFinalized := &NewBlock{
		Number:   prevLatest.Number,
		Hash:     prevLatest.Hash,
		Finality: Finalized,
	}

	timer := time.NewTimer(b.Delay)
	defer timer.Stop()

	errCount := 0
	for {
		select {
		case <-ctx.Done():
			return ctx.Err()
		case <-timer.C:
			prevLatest, prevFinalized, err = b.pollBlock(ctx, logger, prevLatest, prevFinalized)
			if err != nil {
				errCount++
				logger.Error("polling encountered an error", zap.Int("errCount", errCount), zap.Error(err))
				if errCount > 3 {
					b.errFeed.Send(fmt.Sprint("polling encountered an error: ", err))
					errCount = 0
				}
			} else {
				errCount = 0
			}

			timer.Reset(b.Delay)
		}
	}
}