removed the fucking vendor files
This commit is contained in:
@@ -11,11 +11,15 @@ import (
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/ethclient"
|
||||
"github.com/ethereum/go-ethereum/rpc"
|
||||
"github.com/fraktal/mev-beta/internal/config"
|
||||
"github.com/fraktal/mev-beta/internal/logger"
|
||||
"github.com/fraktal/mev-beta/internal/ratelimit"
|
||||
"github.com/fraktal/mev-beta/pkg/arbitrum"
|
||||
"github.com/fraktal/mev-beta/pkg/events"
|
||||
"github.com/fraktal/mev-beta/pkg/market"
|
||||
"github.com/fraktal/mev-beta/pkg/orchestrator"
|
||||
"github.com/fraktal/mev-beta/pkg/pools"
|
||||
"github.com/fraktal/mev-beta/pkg/scanner"
|
||||
"golang.org/x/time/rate"
|
||||
)
|
||||
@@ -32,6 +36,7 @@ type ArbitrumMonitor struct {
|
||||
scanner *scanner.MarketScanner
|
||||
pipeline *market.Pipeline
|
||||
fanManager *market.FanManager
|
||||
coordinator *orchestrator.MEVCoordinator
|
||||
limiter *rate.Limiter
|
||||
pollInterval time.Duration
|
||||
running bool
|
||||
@@ -81,6 +86,30 @@ func NewArbitrumMonitor(
|
||||
rateLimiter,
|
||||
)
|
||||
|
||||
// Create event parser and pool discovery
|
||||
eventParser := events.NewEventParser()
|
||||
|
||||
// Create raw RPC client for pool discovery
|
||||
poolRPCClient, err := rpc.Dial(arbCfg.RPCEndpoint)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create RPC client for pool discovery: %w", err)
|
||||
}
|
||||
|
||||
poolDiscovery := pools.NewPoolDiscovery(poolRPCClient, logger)
|
||||
|
||||
// Create MEV coordinator
|
||||
coordinator := orchestrator.NewMEVCoordinator(
|
||||
&config.Config{
|
||||
Arbitrum: *arbCfg,
|
||||
Bot: *botCfg,
|
||||
},
|
||||
logger,
|
||||
eventParser,
|
||||
poolDiscovery,
|
||||
marketMgr,
|
||||
scanner,
|
||||
)
|
||||
|
||||
return &ArbitrumMonitor{
|
||||
config: arbCfg,
|
||||
botConfig: botCfg,
|
||||
@@ -92,6 +121,7 @@ func NewArbitrumMonitor(
|
||||
scanner: scanner,
|
||||
pipeline: pipeline,
|
||||
fanManager: fanManager,
|
||||
coordinator: coordinator,
|
||||
limiter: limiter,
|
||||
pollInterval: time.Duration(botCfg.PollingInterval) * time.Second,
|
||||
running: false,
|
||||
@@ -106,6 +136,11 @@ func (m *ArbitrumMonitor) Start(ctx context.Context) error {
|
||||
|
||||
m.logger.Info("Starting Arbitrum sequencer monitoring...")
|
||||
|
||||
// Start the MEV coordinator pipeline
|
||||
if err := m.coordinator.Start(); err != nil {
|
||||
return fmt.Errorf("failed to start MEV coordinator: %w", err)
|
||||
}
|
||||
|
||||
// Get the latest block to start from
|
||||
if err := m.rateLimiter.WaitForLimit(ctx, m.config.RPCEndpoint); err != nil {
|
||||
return fmt.Errorf("rate limit error: %v", err)
|
||||
@@ -410,12 +445,13 @@ func (m *ArbitrumMonitor) processTransactionReceipt(ctx context.Context, receipt
|
||||
// This is just a stub since we don't have the full transaction data
|
||||
tx := types.NewTransaction(0, common.Address{}, big.NewInt(0), 0, big.NewInt(0), nil)
|
||||
|
||||
// Create a slice with just this transaction
|
||||
transactions := []*types.Transaction{tx}
|
||||
// Process through the new MEV coordinator
|
||||
m.coordinator.ProcessTransaction(tx, receipt, blockNumber, uint64(time.Now().Unix()))
|
||||
|
||||
// Process through the pipeline
|
||||
// Also process through the legacy pipeline for compatibility
|
||||
transactions := []*types.Transaction{tx}
|
||||
if err := m.pipeline.ProcessTransactions(ctx, transactions, blockNumber, uint64(time.Now().Unix())); err != nil {
|
||||
m.logger.Error(fmt.Sprintf("Pipeline processing error for receipt %s: %v", receipt.TxHash.Hex(), err))
|
||||
m.logger.Debug(fmt.Sprintf("Legacy pipeline processing error for receipt %s: %v", receipt.TxHash.Hex(), err))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user