special: backport old celo geth to latest eth-tracker codebase

This commit is contained in:
2024-11-20 10:20:20 +03:00
parent 0b5af2f938
commit 911f11eb38
25 changed files with 268 additions and 423 deletions

View File

@@ -4,9 +4,9 @@ import (
"context"
"time"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/event"
"github.com/celo-org/celo-blockchain"
"github.com/celo-org/celo-blockchain/core/types"
"github.com/celo-org/celo-blockchain/event"
)
type BlockQueueFn func(uint64) error
@@ -23,7 +23,7 @@ func (s *Syncer) Start() {
s.realtimeSub = event.ResubscribeErr(resubscribeInterval, s.resubscribeFn())
}
func (s *Syncer) receiveRealtimeBlocks(ctx context.Context, fn BlockQueueFn) (ethereum.Subscription, error) {
func (s *Syncer) receiveRealtimeBlocks(ctx context.Context, fn BlockQueueFn) (celo.Subscription, error) {
newHeadersReceiver := make(chan *types.Header, 1)
sub, err := s.ethClient.SubscribeNewHead(ctx, newHeadersReceiver)
s.logg.Info("realtime syncer connected to ws endpoint")

View File

@@ -4,8 +4,8 @@ import (
"context"
"log/slog"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/celo-org/celo-blockchain"
"github.com/celo-org/celo-blockchain/ethclient"
"github.com/grassrootseconomics/eth-tracker/db"
"github.com/grassrootseconomics/eth-tracker/internal/chain"
"github.com/grassrootseconomics/eth-tracker/internal/pool"
@@ -27,7 +27,7 @@ type (
db db.DB
ethClient *ethclient.Client
logg *slog.Logger
realtimeSub ethereum.Subscription
realtimeSub celo.Subscription
pool *pool.Pool
stats *stats.Stats
stopCh chan struct{}