Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion diagnostics/diaglib/entities.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ type ResourcesUsage struct {
type MemoryStats struct {
Alloc uint64 `json:"alloc"`
Sys uint64 `json:"sys"`
OtherFields []interface{}
OtherFields []any
Timestamp time.Time `json:"timestamp"`
StageIndex CurrentSyncStagesIdxs `json:"stageIndex"`
}
Expand Down
2 changes: 1 addition & 1 deletion diagnostics/diaglib/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (p *PeerStats) GetPeers() map[string]PeerStatistics {

func (p *PeerStats) getPeers() map[string]PeerStatistics {
stats := make(map[string]PeerStatistics)
p.peersInfo.Range(func(key, value interface{}) bool {
p.peersInfo.Range(func(key, value any) bool {
loadedKey, ok := key.(string)
if !ok {
log.Debug("Failed to cast key to string", key)
Expand Down
4 changes: 2 additions & 2 deletions diagnostics/diaglib/notifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
)

type DiagMessages struct {
MessageType string `json:"messageType"`
Message interface{} `json:"message"`
MessageType string `json:"messageType"`
Message any `json:"message"`
}

var upgrader = websocket.Upgrader{
Expand Down
4 changes: 2 additions & 2 deletions diagnostics/diaglib/txpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ func (ti SenderInfoUpdate) Type() Type {
}

type TxpoolDiagMessage struct {
Type string `json:"type"`
Message interface{} `json:"message"`
Type string `json:"type"`
Message any `json:"message"`
}

func (d *DiagnosticClient) setupTxPoolDiagnostics(rootCtx context.Context) {
Expand Down
2 changes: 1 addition & 1 deletion diagnostics/diaglib/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func SecondsToHHMMString(seconds uint64) string {
return fmt.Sprintf("%dhrs:%dm", hours, minutes)
}

func ParseData(data []byte, v interface{}) {
func ParseData(data []byte, v any) {
if len(data) == 0 {
return
}
Expand Down
8 changes: 4 additions & 4 deletions diagnostics/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func SetupFlagsAccess(ctx *cli.Context, metricsMux *http.ServeMux) {

metricsMux.HandleFunc("/flags", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
flags := map[string]interface{}{}
flags := map[string]any{}

ctxFlags := map[string]struct{}{}

Expand Down Expand Up @@ -60,9 +60,9 @@ func SetupFlagsAccess(ctx *cli.Context, metricsMux *http.ServeMux) {
_, inCtx := ctxFlags[name]

flags[name] = struct {
Value interface{} `json:"value,omitempty"`
Usage string `json:"usage,omitempty"`
Default bool `json:"default"`
Value any `json:"value,omitempty"`
Usage string `json:"usage,omitempty"`
Default bool `json:"default"`
}{
Value: value,
Usage: usage,
Expand Down
4 changes: 2 additions & 2 deletions diagnostics/mem/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ type VirtualMemStat struct {
}

// Fields converts VirtualMemStat to slice
func (m VirtualMemStat) Fields() []interface{} {
func (m VirtualMemStat) Fields() []any {
typ := reflect.TypeFor[process.MemoryMapsStat]()
val := reflect.ValueOf(m.MemoryMapsStat)

var s []interface{}
var s []any
for i := 0; i < typ.NumField(); i++ {
t := typ.Field(i).Name
if t == "Path" { // always empty for aggregated smap statistics
Expand Down
20 changes: 10 additions & 10 deletions diagnostics/peers.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ type PeerNetworkInfo struct {
}

type PeerResponse struct {
ENR string `json:"enr,omitempty"` // Ethereum Node Record
Enode string `json:"enode"` // Node URL
ID string `json:"id"` // Unique node identifier
Name string `json:"name"` // Name of the node, including client type, version, OS, custom data
ErrorCount int `json:"errorCount"` // Number of errors
LastSeenError string `json:"lastSeenError"` // Last seen error
Type string `json:"type"` // Type of connection
Caps []string `json:"caps"` // Protocols advertised by this peer
Network PeerNetworkInfo `json:"network"`
Protocols map[string]interface{} `json:"protocols"` // Sub-protocol specific metadata fields
ENR string `json:"enr,omitempty"` // Ethereum Node Record
Enode string `json:"enode"` // Node URL
ID string `json:"id"` // Unique node identifier
Name string `json:"name"` // Name of the node, including client type, version, OS, custom data
ErrorCount int `json:"errorCount"` // Number of errors
LastSeenError string `json:"lastSeenError"` // Last seen error
Type string `json:"type"` // Type of connection
Caps []string `json:"caps"` // Protocols advertised by this peer
Network PeerNetworkInfo `json:"network"`
Protocols map[string]any `json:"protocols"` // Sub-protocol specific metadata fields
}

func SetupPeersAccess(ctxclient *cli.Context, metricsMux *http.ServeMux, node *node.ErigonNode, diag *diaglib.DiagnosticClient) {
Expand Down
Loading