Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AVAX] Merge Cortina 17 (v1.10.17) #358

Draft
wants to merge 97 commits into
base: evlekht/new-dev-c19
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
c174c62
Return log levels from admin.SetLoggerLevel (#2250)
StephenButtolph Nov 2, 2023
11f1b55
feat(api) : Peers function to return the PrimaryAlias of the chainID …
DoTheBestToGetTheBest Nov 2, 2023
437ade8
Switch to using require.TestingT interface in SenderTest struct (#2258)
marun Nov 3, 2023
e4cb2cd
Cleanup `ipcs` `Socket` test (#2257)
Nov 3, 2023
cec1cd1
Require poll metrics to be registered (#2260)
StephenButtolph Nov 3, 2023
aaed8f3
Track all subnet validator sets in the validator manager (#2253)
StephenButtolph Nov 4, 2023
a8db08e
e2e: Make NewWallet and NewEthclient regular functions (#2262)
marun Nov 6, 2023
558d8fb
Fix typos in docs (#2261)
vuittont60 Nov 6, 2023
e710899
Remove Token constants information from keys (#2197)
dboehm-avalabs Nov 6, 2023
10bd428
Remove unused `UnsortedEquals` function (#2264)
dhrubabasu Nov 6, 2023
7490a92
Document p2p package (#2254)
joshua-kim Nov 6, 2023
cdcfb5b
Use extended public key to derive ledger addresses (#2246)
felipemadero Nov 7, 2023
1faec38
`merkledb` -- rename nit (#2267)
Nov 7, 2023
52f93c8
`merkledb` -- fix nil check in test (#2268)
Nov 7, 2023
683fcfa
Add read-only database flag (`--db-read-only`) (#2266)
Nov 7, 2023
22f3c89
`merkledb` -- remove unneeded var declarations (#2269)
Nov 8, 2023
1329a59
Add fuzz test for `NewIteratorWithStartAndPrefix` (#1992)
Nov 8, 2023
93d88c0
Return if element was deleted from `Hashmap` (#2271)
dhrubabasu Nov 8, 2023
fc95834
`mempool.NewMempool` -> `mempool.New` (#2276)
dhrubabasu Nov 8, 2023
aba404e
e2e: Refactor suite setup and helpers to tests/fixture/e2e for reuse …
marun Nov 8, 2023
bcd4a94
Cleanup platformvm mempool errs (#2278)
dhrubabasu Nov 8, 2023
c94ff4e
MerkleDB:Naming and comments cleanup (#2274)
dboehm-avalabs Nov 8, 2023
ebaf9d4
Move `DropExpiredStakerTxs` to platformvm mempool (#2279)
dhrubabasu Nov 8, 2023
151621f
Cleanup `ids.NodeID` usage (#2280)
abi87 Nov 9, 2023
e3f1212
Genesis validators cleanup (#2282)
abi87 Nov 9, 2023
094ce50
Remove Lazy Initialize on Node (#1384)
joshua-kim Nov 9, 2023
86201ae
Remove sentinel node from MerkleDB proofs (#2106)
dboehm-avalabs Nov 9, 2023
b8746de
Embed `noop` handler for all unhandled messages (#2288)
dhrubabasu Nov 10, 2023
baf0ef7
`merkledb` -- Add `Clearer` interface (#2277)
Nov 13, 2023
7f70fcf
Simplify get server creation (#2285)
StephenButtolph Nov 13, 2023
eb21b42
Move management of platformvm preferred block to `executor.Manager` (…
dhrubabasu Nov 14, 2023
72d2fae
Add `recentTxsLock` to platform `network` struct (#2294)
dhrubabasu Nov 14, 2023
29f86e9
e2e: More fixture refinement in support of coreth integration testing…
marun Nov 14, 2023
5dff153
Add `VerifyTx` to `executor.Manager` (#2293)
dhrubabasu Nov 14, 2023
d00b67f
Simplify avalanche bootstrapping (#2286)
StephenButtolph Nov 15, 2023
44f3aba
Replace unique slices with sets in the engine interface (#2317)
StephenButtolph Nov 15, 2023
dcc6ea8
Use zap.Stringer rather than zap.Any (#2320)
StephenButtolph Nov 15, 2023
e8ef4ad
Move `AddUnverifiedTx` logic to `network.IssueTx` (#2310)
dhrubabasu Nov 15, 2023
01a1bbe
Remove `AddUnverifiedTx` from `Builder` (#2311)
dhrubabasu Nov 16, 2023
3d0611c
Remove error from SDK AppGossip handler (#2252)
joshua-kim Nov 16, 2023
6484de4
Rename AppRequestFailed to AppError (#2321)
joshua-kim Nov 16, 2023
348f842
Remove `Network` interface from `Builder` (#2312)
dhrubabasu Nov 16, 2023
f1ec30c
Update `error_code` to be int32 instead of uint32. (#2322)
joshua-kim Nov 16, 2023
043644f
Refactor bootstrapper implementation into consensus (#2300)
StephenButtolph Nov 16, 2023
35fbb3a
Pchain - Cleanup NodeID generation in UTs (#2291)
abi87 Nov 16, 2023
6900e72
nit: loop --> variadic (#2316)
Nov 16, 2023
e7ca38b
Update zap dependency to v1.26.0 (#2325)
Nov 16, 2023
5236d72
Remove useless anon functions (#2326)
StephenButtolph Nov 17, 2023
8520112
Move `network` implementation to separate package (#2296)
dhrubabasu Nov 17, 2023
585424e
Unexport avalanche constant from common package (#2327)
StephenButtolph Nov 17, 2023
fe72c5b
Remove `common.Config` functions (#2328)
StephenButtolph Nov 17, 2023
392b313
Move engine startup into helper function (#2329)
StephenButtolph Nov 17, 2023
4768ed4
Remove bootstrapping retry config (#2301)
StephenButtolph Nov 17, 2023
dbc209c
Export snowman bootstrapper (#2331)
StephenButtolph Nov 17, 2023
a803f38
Remove common.Config from syncer.Config (#2330)
StephenButtolph Nov 17, 2023
40934bb
`platformvm.VM` -- replace `Config` field with `validators.Manager` (…
Nov 17, 2023
b573889
Improve height monitoring (#2347)
StephenButtolph Nov 20, 2023
2b737d5
Cleanup snowman consensus metrics (#2349)
StephenButtolph Nov 21, 2023
f7cc69b
Expand consensus health check (#2354)
StephenButtolph Nov 21, 2023
459f8ba
Reduce the size of the OracleBlock interface (#2355)
StephenButtolph Nov 22, 2023
f2f6d0a
[vms/proposervm] Update Build Heuristic (#2348)
patrick-ogrady Nov 22, 2023
4ce0d67
Use linkedhashmap for P-Chain mempool (#1536)
gyuho Nov 22, 2023
48c541c
Fix P-chain mempool tx count metric (#2361)
StephenButtolph Nov 22, 2023
62df19c
Update versions for v1.10.16 (#2353)
StephenButtolph Nov 23, 2023
6ad31d6
Remove Banff check from mempool verifier (#2360)
dhrubabasu Nov 23, 2023
9353569
Document storage growth in readme (#2364)
StephenButtolph Nov 24, 2023
8d9b93c
Add metric for duration between block timestamp and block acceptance …
StephenButtolph Nov 24, 2023
b1b051a
`vms/platformvm`: Remove unused `withMetrics` txheap (#2373)
dhrubabasu Nov 26, 2023
e04dad8
Move peerTracker from x/sync to network/p2p (#2356)
joshua-kim Nov 26, 2023
79e572d
Avoid closing stdout and stderr during log close (#2372)
felipemadero Nov 27, 2023
42161aa
`vms/platformvm`: Adjust `Diff.Apply` signature (#2368)
dhrubabasu Nov 27, 2023
b9ab41a
Add option to provide BLS keys to validators in the genesis (#2371)
felipemadero Nov 27, 2023
3a424d0
Remove `engine.GetVM` (#2374)
StephenButtolph Nov 27, 2023
9ad213c
`vms/platformvm`: Consolidate `state` pkg mocks (#2370)
dhrubabasu Nov 27, 2023
590ad12
Remove common bootstrapper (#2297)
StephenButtolph Nov 27, 2023
6e52922
`vms/platformvm`: Move `toEngine` channel to mempool (#2333)
dhrubabasu Nov 28, 2023
d7e7ff5
`vms/avm`: Rename `states` pkg to `state` (#2381)
dhrubabasu Nov 28, 2023
be422a0
Implement generic bimap (#2383)
StephenButtolph Nov 28, 2023
02ae8d9
Unexport RequestID from snowman engine (#2384)
StephenButtolph Nov 28, 2023
21c14b1
Add metric to track the stake weight of block providers (#2376)
StephenButtolph Nov 29, 2023
6ed238c
Add block source metrics to monitor gossip (#2386)
StephenButtolph Nov 29, 2023
1dddf30
Rename `D` to `Durango` (#2389)
dhrubabasu Nov 29, 2023
56c2ad9
Replace periodic push accepted gossip with pull preference gossip for…
StephenButtolph Nov 29, 2023
c5169a3
MerkleDB Remove ID from Node to reduce size and removal channel creat…
dboehm-avalabs Nov 29, 2023
0da5bcc
Remove method `CappedList` from `set.Set` (#2395)
Nov 29, 2023
96d451d
Periodically PullGossip only from connected validators (#2399)
StephenButtolph Nov 29, 2023
907b34c
Update bootstrap IPs (#2396)
StephenButtolph Nov 30, 2023
0ab2046
Rename `testnet` fixture to `tmpnet` (#2307)
marun Nov 30, 2023
de3b16c
Add `p2p.Network` component (#2283)
joshua-kim Nov 30, 2023
9b85141
`vms/platformvm`: Move `GetRewardUTXOs`, `GetSubnets`, and `GetChains…
dhrubabasu Nov 30, 2023
be1a2ad
Add more descriptive formatted error (#2403)
aaronbuchwald Dec 1, 2023
7623ffd
Update versions for v1.10.17 (#2394)
StephenButtolph Dec 2, 2023
8757890
[AVAX] Intermediate Merge Cortina 16 (v1.10.16)
evlekht Jul 24, 2024
9d26ea9
[AVAX] Post Merge fixes for Cortina 16 (v1.10.16)
evlekht Mar 8, 2024
162094a
[AVAX] Intermediate Merge Cortina 17 (v1.10.17)
evlekht Jul 24, 2024
bb67029
[AVAX] Post Merge fixes for Cortina 17 (v1.10.17)
evlekht Mar 12, 2024
77ad800
tmp ci for review
evlekht Jul 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Tests

on:
pull_request:
branches: [chain4travel, dev]
branches: [chain4travel, dev, evlekht/new-dev-c19]
workflow_dispatch:
merge_group:
types: [checks_requested]
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
run: ./scripts/build.sh -r
- name: Run e2e tests with existing network
shell: bash
run: E2E_SERIAL=1 ./scripts/tests.e2e.persistent.sh
run: E2E_SERIAL=1 ./scripts/tests.e2e.existing.sh
Upgrade:
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ The minimum recommended hardware specification for nodes connected to Mainnet is

- CPU: Equivalent of 8 AWS vCPU
- RAM: 16 GiB
- Storage: 512 GiB
- Storage: 1 TiB
- Nodes running for very long periods of time or nodes with custom configurations may observe higher storage requirements.
- OS: Ubuntu 20.04/22.04 or macOS >= 12
- Network: Reliable IPv4 or IPv6 network connection, with an open public port.

Expand Down
18 changes: 10 additions & 8 deletions api/admin/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2022-2024, Chain4Travel AG. All rights reserved.
// Copyright (C) 2022, Chain4Travel AG. All rights reserved.
//
// This file is a derived work, based on ava-labs code whose
// original notices appear below.
Expand Down Expand Up @@ -35,7 +35,7 @@ type Client interface {
GetChainAliases(ctx context.Context, chainID string, options ...rpc.Option) ([]string, error)
Stacktrace(context.Context, ...rpc.Option) error
LoadVMs(context.Context, ...rpc.Option) (map[ids.ID][]string, map[ids.ID]string, error)
SetLoggerLevel(ctx context.Context, loggerName, logLevel, displayLevel string, options ...rpc.Option) error
SetLoggerLevel(ctx context.Context, loggerName, logLevel, displayLevel string, options ...rpc.Option) (map[string]LogAndDisplayLevels, error)
GetLoggerLevel(ctx context.Context, loggerName string, options ...rpc.Option) (map[string]LogAndDisplayLevels, error)
GetConfig(ctx context.Context, options ...rpc.Option) (interface{}, error)
GetNodeSigner(ctx context.Context, _ string, options ...rpc.Option) (*GetNodeSignerReply, error)
Expand Down Expand Up @@ -111,7 +111,7 @@ func (c *client) SetLoggerLevel(
logLevel,
displayLevel string,
options ...rpc.Option,
) error {
) (map[string]LogAndDisplayLevels, error) {
var (
logLevelArg logging.Level
displayLevelArg logging.Level
Expand All @@ -120,29 +120,31 @@ func (c *client) SetLoggerLevel(
if len(logLevel) > 0 {
logLevelArg, err = logging.ToLevel(logLevel)
if err != nil {
return err
return nil, err
}
}
if len(displayLevel) > 0 {
displayLevelArg, err = logging.ToLevel(displayLevel)
if err != nil {
return err
return nil, err
}
}
return c.requester.SendRequest(ctx, "admin.setLoggerLevel", &SetLoggerLevelArgs{
res := &LoggerLevelReply{}
err = c.requester.SendRequest(ctx, "admin.setLoggerLevel", &SetLoggerLevelArgs{
Secret: Secret{c.secret},
LoggerName: loggerName,
LogLevel: &logLevelArg,
DisplayLevel: &displayLevelArg,
}, &api.EmptyReply{}, options...)
}, res, options...)
return res.LoggerLevels, err
}

func (c *client) GetLoggerLevel(
ctx context.Context,
loggerName string,
options ...rpc.Option,
) (map[string]LogAndDisplayLevels, error) {
res := &GetLoggerLevelReply{}
res := &LoggerLevelReply{}
err := c.requester.SendRequest(ctx, "admin.getLoggerLevel", &GetLoggerLevelArgs{
Secret: Secret{c.secret},
LoggerName: loggerName,
Expand Down
74 changes: 46 additions & 28 deletions api/admin/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ func (mc *mockClient) SendRequest(_ context.Context, _ string, _ interface{}, re
case *LoadVMsReply:
response := mc.response.(*LoadVMsReply)
*p = *response
case *GetLoggerLevelReply:
response := mc.response.(*GetLoggerLevelReply)
case *LoggerLevelReply:
response := mc.response.(*LoggerLevelReply)
*p = *response
case *interface{}:
response := mc.response.(*interface{})
Expand Down Expand Up @@ -212,54 +212,72 @@ func TestReloadInstalledVMs(t *testing.T) {

func TestSetLoggerLevel(t *testing.T) {
type test struct {
name string
logLevel string
displayLevel string
serviceErr error
clientErr error
name string
logLevel string
displayLevel string
serviceResponse map[string]LogAndDisplayLevels
serviceErr error
clientErr error
}
tests := []test{
{
name: "Happy path",
logLevel: "INFO",
displayLevel: "INFO",
serviceErr: nil,
clientErr: nil,
serviceResponse: map[string]LogAndDisplayLevels{
"Happy path": {LogLevel: logging.Info, DisplayLevel: logging.Info},
},
serviceErr: nil,
clientErr: nil,
},
{
name: "Service errors",
logLevel: "INFO",
displayLevel: "INFO",
serviceErr: errTest,
clientErr: errTest,
name: "Service errors",
logLevel: "INFO",
displayLevel: "INFO",
serviceResponse: nil,
serviceErr: errTest,
clientErr: errTest,
},
{
name: "Invalid log level",
logLevel: "invalid",
displayLevel: "INFO",
serviceErr: nil,
clientErr: logging.ErrUnknownLevel,
name: "Invalid log level",
logLevel: "invalid",
displayLevel: "INFO",
serviceResponse: nil,
serviceErr: nil,
clientErr: logging.ErrUnknownLevel,
},
{
name: "Invalid display level",
logLevel: "INFO",
displayLevel: "invalid",
serviceErr: nil,
clientErr: logging.ErrUnknownLevel,
name: "Invalid display level",
logLevel: "INFO",
displayLevel: "invalid",
serviceResponse: nil,
serviceErr: nil,
clientErr: logging.ErrUnknownLevel,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
require := require.New(t)

c := client{
requester: NewMockClient(&api.EmptyReply{}, tt.serviceErr),
requester: NewMockClient(
&LoggerLevelReply{
LoggerLevels: tt.serviceResponse,
},
tt.serviceErr,
),
}
err := c.SetLoggerLevel(
res, err := c.SetLoggerLevel(
context.Background(),
"",
tt.logLevel,
tt.displayLevel,
)
require.ErrorIs(t, err, tt.clientErr)
require.ErrorIs(err, tt.clientErr)
if tt.clientErr != nil {
return
}
require.Equal(tt.serviceResponse, res)
})
}
}
Expand Down Expand Up @@ -296,7 +314,7 @@ func TestGetLoggerLevel(t *testing.T) {

c := client{
requester: NewMockClient(
&GetLoggerLevelReply{
&LoggerLevelReply{
LoggerLevels: tt.serviceResponse,
},
tt.serviceErr,
Expand Down
93 changes: 47 additions & 46 deletions api/admin/service.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2022-2024, Chain4Travel AG. All rights reserved.
// Copyright (C) 2022, Chain4Travel AG. All rights reserved.
//
// This file is a derived work, based on ava-labs code whose
// original notices appear below.
Expand Down Expand Up @@ -265,14 +265,22 @@ func (a *Admin) Stacktrace(_ *http.Request, args *Secret, _ *api.EmptyReply) err
return perms.WriteFile(stacktraceFile, stacktrace, perms.ReadWrite)
}

// See SetLoggerLevel
type SetLoggerLevelArgs struct {
Secret
LoggerName string `json:"loggerName"`
LogLevel *logging.Level `json:"logLevel"`
DisplayLevel *logging.Level `json:"displayLevel"`
}

type LogAndDisplayLevels struct {
LogLevel logging.Level `json:"logLevel"`
DisplayLevel logging.Level `json:"displayLevel"`
}

type LoggerLevelReply struct {
LoggerLevels map[string]LogAndDisplayLevels `json:"loggerLevels"`
}

// SetLoggerLevel sets the log level and/or display level for loggers.
// If len([args.LoggerName]) == 0, sets the log/display level of all loggers.
// Otherwise, sets the log/display level of the loggers named in that argument.
Expand All @@ -282,7 +290,7 @@ type SetLoggerLevelArgs struct {
// Sets the display level of these loggers to args.LogLevel.
// If args.DisplayLevel == nil, doesn't set the display level of these loggers.
// If args.DisplayLevel != nil, must be a valid string representation of a log level.
func (a *Admin) SetLoggerLevel(_ *http.Request, args *SetLoggerLevelArgs, _ *api.EmptyReply) error {
func (a *Admin) SetLoggerLevel(_ *http.Request, args *SetLoggerLevelArgs, reply *LoggerLevelReply) error {
a.Log.Debug("API called",
zap.String("service", "admin"),
zap.String("method", "setLoggerLevel"),
Expand All @@ -298,14 +306,7 @@ func (a *Admin) SetLoggerLevel(_ *http.Request, args *SetLoggerLevelArgs, _ *api
a.lock.Lock()
defer a.lock.Unlock()

var loggerNames []string
if len(args.LoggerName) > 0 {
loggerNames = []string{args.LoggerName}
} else {
// Empty name means all loggers
loggerNames = a.LogFactory.GetLoggerNames()
}

loggerNames := a.getLoggerNames(args.LoggerName)
for _, name := range loggerNames {
if args.LogLevel != nil {
if err := a.LogFactory.SetLogLevel(name, *args.LogLevel); err != nil {
Expand All @@ -318,27 +319,19 @@ func (a *Admin) SetLoggerLevel(_ *http.Request, args *SetLoggerLevelArgs, _ *api
}
}
}
return nil
}

type LogAndDisplayLevels struct {
LogLevel logging.Level `json:"logLevel"`
DisplayLevel logging.Level `json:"displayLevel"`
var err error
reply.LoggerLevels, err = a.getLogLevels(loggerNames)
return err
}

// See GetLoggerLevel
type GetLoggerLevelArgs struct {
Secret
LoggerName string `json:"loggerName"`
}

// See GetLoggerLevel
type GetLoggerLevelReply struct {
LoggerLevels map[string]LogAndDisplayLevels `json:"loggerLevels"`
}

// GetLogLevel returns the log level and display level of all loggers.
func (a *Admin) GetLoggerLevel(_ *http.Request, args *GetLoggerLevelArgs, reply *GetLoggerLevelReply) error {
func (a *Admin) GetLoggerLevel(_ *http.Request, args *GetLoggerLevelArgs, reply *LoggerLevelReply) error {
a.Log.Debug("API called",
zap.String("service", "admin"),
zap.String("method", "getLoggerLevels"),
Expand All @@ -348,30 +341,11 @@ func (a *Admin) GetLoggerLevel(_ *http.Request, args *GetLoggerLevelArgs, reply
a.lock.RLock()
defer a.lock.RUnlock()

reply.LoggerLevels = make(map[string]LogAndDisplayLevels)
var loggerNames []string
// Empty name means all loggers
if len(args.LoggerName) > 0 {
loggerNames = []string{args.LoggerName}
} else {
loggerNames = a.LogFactory.GetLoggerNames()
}
loggerNames := a.getLoggerNames(args.LoggerName)

for _, name := range loggerNames {
logLevel, err := a.LogFactory.GetLogLevel(name)
if err != nil {
return err
}
displayLevel, err := a.LogFactory.GetDisplayLevel(name)
if err != nil {
return err
}
reply.LoggerLevels[name] = LogAndDisplayLevels{
LogLevel: logLevel,
DisplayLevel: displayLevel,
}
}
return nil
var err error
reply.LoggerLevels, err = a.getLogLevels(loggerNames)
return err
}

// GetConfig returns the config that the node was started with.
Expand Down Expand Up @@ -419,6 +393,33 @@ func (a *Admin) LoadVMs(r *http.Request, args *Secret, reply *LoadVMsReply) erro
return err
}

func (a *Admin) getLoggerNames(loggerName string) []string {
if len(loggerName) == 0 {
// Empty name means all loggers
return a.LogFactory.GetLoggerNames()
}
return []string{loggerName}
}

func (a *Admin) getLogLevels(loggerNames []string) (map[string]LogAndDisplayLevels, error) {
loggerLevels := make(map[string]LogAndDisplayLevels)
for _, name := range loggerNames {
logLevel, err := a.LogFactory.GetLogLevel(name)
if err != nil {
return nil, err
}
displayLevel, err := a.LogFactory.GetDisplayLevel(name)
if err != nil {
return nil, err
}
loggerLevels[name] = LogAndDisplayLevels{
LogLevel: logLevel,
DisplayLevel: displayLevel,
}
}
return loggerLevels, nil
}

// See GetNodeSigner
type GetNodeSignerReply struct {
PrivateKey string `json:"privateKey"`
Expand Down
13 changes: 11 additions & 2 deletions api/info/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ type PeersArgs struct {
type Peer struct {
peer.Info

Benched []ids.ID `json:"benched"`
Benched []string `json:"benched"`
}

// PeersReply are the results from calling Peers
Expand All @@ -244,9 +244,18 @@ func (i *Info) Peers(_ *http.Request, args *PeersArgs, reply *PeersReply) error
peers := i.networking.PeerInfo(args.NodeIDs)
peerInfo := make([]Peer, len(peers))
for index, peer := range peers {
benchedIDs := i.benchlist.GetBenched(peer.ID)
benchedAliases := make([]string, len(benchedIDs))
for idx, id := range benchedIDs {
alias, err := i.chainManager.PrimaryAlias(id)
if err != nil {
return fmt.Errorf("failed to get primary alias for chain ID %s: %w", id, err)
}
benchedAliases[idx] = alias
}
peerInfo[index] = Peer{
Info: peer,
Benched: i.benchlist.GetBenched(peer.ID),
Benched: benchedAliases,
}
}

Expand Down
Loading