Skip to content

Commit

Permalink
Resolve all conflicts under erigon-lib: TODO - re-run codegen for eri…
Browse files Browse the repository at this point in the history
…gon-lib
  • Loading branch information
mininny committed Aug 10, 2024
1 parent adf9119 commit 763e030
Show file tree
Hide file tree
Showing 28 changed files with 26 additions and 966 deletions.
9 changes: 1 addition & 8 deletions erigon-lib/chain/chain_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ type Config struct {
Aura *AuRaConfig `json:"aura,omitempty"`
Bor BorConfig `json:"-"`
BorJSON json.RawMessage `json:"bor,omitempty"`
<<<<<<< HEAD

// For not pruning the logs of these contracts
// For deposit contract logs are needed by CL to validate/produce blocks.
Expand All @@ -104,8 +103,6 @@ type Config struct {

// Optimism config
Optimism *OptimismConfig `json:"optimism,omitempty"`
=======
>>>>>>> v3.0.0-alpha1
}

type BorConfig interface {
Expand All @@ -131,11 +128,7 @@ func (o *OptimismConfig) String() string {
func (c *Config) String() string {
engine := c.getEngine()

<<<<<<< HEAD
configString := fmt.Sprintf("{ChainID: %v, Homestead: %v, DAO: %v, Tangerine Whistle: %v, Spurious Dragon: %v, Byzantium: %v, Constantinople: %v, Petersburg: %v, Istanbul: %v, Muir Glacier: %v, Berlin: %v, London: %v, Arrow Glacier: %v, Gray Glacier: %v, Terminal Total Difficulty: %v, Merge Netsplit: %v, Shanghai: %v, Cancun: %v, Prague: %v, Osaka: %v, Engine: %v, NoPruneContracts: %v}",
=======
return fmt.Sprintf("{ChainID: %v, Homestead: %v, DAO: %v, Tangerine Whistle: %v, Spurious Dragon: %v, Byzantium: %v, Constantinople: %v, Petersburg: %v, Istanbul: %v, Muir Glacier: %v, Berlin: %v, London: %v, Arrow Glacier: %v, Gray Glacier: %v, Terminal Total Difficulty: %v, Merge Netsplit: %v, Shanghai: %v, Cancun: %v, Prague: %v, Osaka: %v, Engine: %v}",
>>>>>>> v3.0.0-alpha1
configString := fmt.Sprintf("{ChainID: %v, Homestead: %v, DAO: %v, Tangerine Whistle: %v, Spurious Dragon: %v, Byzantium: %v, Constantinople: %v, Petersburg: %v, Istanbul: %v, Muir Glacier: %v, Berlin: %v, London: %v, Arrow Glacier: %v, Gray Glacier: %v, Terminal Total Difficulty: %v, Merge Netsplit: %v, Shanghai: %v, Cancun: %v, Prague: %v, Osaka: %v, Engine: %v}",
c.ChainID,
c.HomesteadBlock,
c.DAOForkBlock,
Expand Down
11 changes: 3 additions & 8 deletions erigon-lib/chain/networkname/network_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,14 @@ const (
GnosisChainName = "gnosis"
BorE2ETestChain2ValName = "bor-e2e-test-2Val"
ChiadoChainName = "chiado"
<<<<<<< HEAD

Test = "test"

OPDevnetChainName = "op-devnet"
OPMainnetChainName = "op-mainnet"

LegacyOPDevnetChainName = "optimism-devnet"
LegacyOPMainnetChainName = "optimism-mainnet"
=======
Test = "test"
>>>>>>> v3.0.0-alpha1
)

var All = []string{
Expand All @@ -50,7 +48,7 @@ var All = []string{
BorDevnetChainName,
GnosisChainName,
ChiadoChainName,
<<<<<<< HEAD
Test,
OPDevnetChainName,
}

Expand All @@ -63,7 +61,4 @@ func HandleLegacyName(name string) string {
default:
return name
}
=======
Test,
>>>>>>> v3.0.0-alpha1
}
7 changes: 0 additions & 7 deletions erigon-lib/diagnostics/block_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,7 @@ func (d *DiagnosticClient) runBlockExecutionListener(rootCtx context.Context) {
case <-rootCtx.Done():
return
case info := <-ch:
<<<<<<< HEAD
d.mu.Lock()
d.syncStats.BlockExecution = info
d.mu.Unlock()

=======
d.BlockExecution.SetData(info)
>>>>>>> v3.0.0-alpha1
if d.syncStats.SyncFinished {
return
}
Expand Down
36 changes: 0 additions & 36 deletions erigon-lib/diagnostics/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package diagnostics
import (
"context"
"net/http"
<<<<<<< HEAD
"os"
"os/signal"
"path/filepath"
Expand All @@ -30,23 +29,10 @@ import (
"github.com/c2h5oh/datasize"
"golang.org/x/sync/semaphore"

"github.com/ledgerwatch/erigon-lib/common"
"github.com/ledgerwatch/erigon-lib/kv"
"github.com/ledgerwatch/erigon-lib/kv/mdbx"
"github.com/ledgerwatch/log/v3"
=======
"path/filepath"
"sync"
"time"

"github.com/c2h5oh/datasize"
"golang.org/x/sync/semaphore"

"github.com/erigontech/erigon-lib/common"
"github.com/erigontech/erigon-lib/kv"
"github.com/erigontech/erigon-lib/kv/mdbx"
"github.com/erigontech/erigon-lib/log/v3"
>>>>>>> v3.0.0-alpha1
)

type DiagnosticClient struct {
Expand Down Expand Up @@ -74,25 +60,14 @@ type DiagnosticClient struct {
webseedsList []string
}

<<<<<<< HEAD
func NewDiagnosticClient(ctx context.Context, metricsMux *http.ServeMux, dataDirPath string, speedTest bool) (*DiagnosticClient, error) {
=======
func NewDiagnosticClient(ctx context.Context, metricsMux *http.ServeMux, dataDirPath string, speedTest bool, webseedsList []string) (*DiagnosticClient, error) {
>>>>>>> v3.0.0-alpha1
dirPath := filepath.Join(dataDirPath, "diagnostics")
db, err := createDb(ctx, dirPath)
if err != nil {
return nil, err
}

<<<<<<< HEAD
hInfo := ReadSysInfo(db)
ss := ReadSyncStages(db)
snpdwl := ReadSnapshotDownloadInfo(db)
snpidx := ReadSnapshotIndexingInfo(db)
=======
hInfo, ss, snpdwl, snpidx, snpfd := ReadSavedData(db)
>>>>>>> v3.0.0-alpha1

return &DiagnosticClient{
ctx: ctx,
Expand All @@ -104,23 +79,16 @@ func NewDiagnosticClient(ctx context.Context, metricsMux *http.ServeMux, dataDir
syncStats: SyncStatistics{
SnapshotDownload: snpdwl,
SnapshotIndexing: snpidx,
<<<<<<< HEAD
=======
SnapshotFillDB: snpfd,
>>>>>>> v3.0.0-alpha1
},
hardwareInfo: hInfo,
snapshotFileList: SnapshoFilesList{},
bodies: BodiesInfo{},
resourcesUsage: ResourcesUsage{
MemoryUsage: []MemoryStats{},
},
<<<<<<< HEAD
peersStats: NewPeerStats(1000), // 1000 is the limit of peers; TODO: make it configurable through a flag
=======
peersStats: NewPeerStats(1000), // 1000 is the limit of peers; TODO: make it configurable through a flag
webseedsList: webseedsList,
>>>>>>> v3.0.0-alpha1
}, nil
}

Expand Down Expand Up @@ -155,10 +123,6 @@ func (d *DiagnosticClient) Setup() {
d.setupResourcesUsageDiagnostics(rootCtx)
d.setupSpeedtestDiagnostics(rootCtx)
d.runSaveProcess(rootCtx)
<<<<<<< HEAD
d.runStopNodeListener(rootCtx)
=======
>>>>>>> v3.0.0-alpha1

//d.logDiagMsgs()

Expand Down
19 changes: 0 additions & 19 deletions erigon-lib/diagnostics/entities.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,7 @@ type PeerStatisticMsgUpdate struct {
type SyncStatistics struct {
SnapshotDownload SnapshotDownloadStatistics `json:"snapshotDownload"`
SnapshotIndexing SnapshotIndexingStatistics `json:"snapshotIndexing"`
<<<<<<< HEAD
BlockExecution BlockExecutionStatistics `json:"blockExecution"`
=======
SnapshotFillDB SnapshotFillDBStatistics `json:"snapshotFillDB"`
>>>>>>> v3.0.0-alpha1
SyncFinished bool `json:"syncFinished"`
}

Expand Down Expand Up @@ -156,20 +152,6 @@ type SnapshotSegmentIndexingFinishedUpdate struct {
SegmentName string `json:"segmentName"`
}

<<<<<<< HEAD
type BlockExecutionStatistics struct {
From uint64 `json:"from"`
To uint64 `json:"to"`
BlockNumber uint64 `json:"blockNumber"`
BlkPerSec float64 `json:"blkPerSec"`
TxPerSec float64 `json:"txPerSec"`
MgasPerSec float64 `json:"mgasPerSec"`
GasState float64 `json:"gasState"`
Batch uint64 `json:"batch"`
Alloc uint64 `json:"alloc"`
Sys uint64 `json:"sys"`
TimeElapsed float64 `json:"timeElapsed"`
=======
type SnapshotFillDBStatistics struct {
Stages []SnapshotFillDBStage `json:"stages"`
}
Expand All @@ -183,7 +165,6 @@ type SnapshotFillDBStage struct {
type SnapshotFillDBStageUpdate struct {
Stage SnapshotFillDBStage `json:"stage"`
TimeElapsed float64 `json:"timeElapsed"`
>>>>>>> v3.0.0-alpha1
}

type SnapshoFilesList struct {
Expand Down
4 changes: 0 additions & 4 deletions erigon-lib/diagnostics/resources_usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ func (d *DiagnosticClient) runMemoryStatsListener(rootCtx context.Context) {
return
case info := <-ch:
d.resourcesUsageMutex.Lock()
<<<<<<< HEAD
info.StageIndex = d.getCurrentSyncIdxs()
=======
info.StageIndex = d.GetCurrentSyncIdxs()
>>>>>>> v3.0.0-alpha1
d.resourcesUsage.MemoryUsage = append(d.resourcesUsage.MemoryUsage, info)
d.resourcesUsageMutex.Unlock()
}
Expand Down
Loading

0 comments on commit 763e030

Please sign in to comment.