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

Move peerTracker from x/sync to network/p2p #2356

Merged
merged 11 commits into from
Nov 26, 2023
Merged

Move peerTracker from x/sync to network/p2p #2356

merged 11 commits into from
Nov 26, 2023

Conversation

joshua-kim
Copy link
Contributor

@joshua-kim joshua-kim commented Nov 22, 2023

Why this should be merged

Client.SendAppRequestAny can use this to route state sync requests to a bandwidth-preferred peer. This help us consolidate all of our blocking client implementations under the p2p.Client. We will need this in the future to migrate all state-sync clients.

How this works

Moves the file. Currently unused but will be integrated in a future pr.

How this was tested

Copied @darioush's tests for this struct from subnet-evm.

Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
@joshua-kim joshua-kim self-assigned this Nov 22, 2023
@joshua-kim joshua-kim added the networking This involves networking label Nov 22, 2023
return rand.Float64() < newPeerProbability // #nosec G404
}

// TODO get rid of minVersion
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe minVersion is no longer needed because all nodes support state sync now

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only for C-chain. I'd keep it in anticipation of P-chain and X-chain state sync

Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
@joshua-kim joshua-kim marked this pull request as draft November 22, 2023 06:53
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
@joshua-kim joshua-kim marked this pull request as ready for review November 22, 2023 06:59
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
network/p2p/peer_tracker.go Outdated Show resolved Hide resolved
Copy link
Contributor

@abi87 abi87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only nits

"github.com/ava-labs/avalanchego/utils/set"
"github.com/ava-labs/avalanchego/version"

safemath "github.com/ava-labs/avalanchego/utils/math"
)

const (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these consts be a config?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we do want them to be at some point (for example we want to allow people to send app requests either routed entirely randomly or by bandwidth, so we need a way for the caller to tune some of these values).

joshua-kim and others added 2 commits November 22, 2023 12:21
Co-authored-by: Stephen Buttolph <stephen@avalabs.org>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
@StephenButtolph StephenButtolph added this to the v1.10.17 milestone Nov 26, 2023
@StephenButtolph StephenButtolph merged commit e04dad8 into dev Nov 26, 2023
16 checks passed
@StephenButtolph StephenButtolph deleted the peer-tracker branch November 26, 2023 18:13
joshua-kim added a commit that referenced this pull request Nov 29, 2023
commit c5169a3
Author: David Boehm <91908103+dboehm-avalabs@users.noreply.github.com>
Date:   Wed Nov 29 15:34:57 2023 -0500

    MerkleDB Remove ID from Node to reduce size and removal channel creation. (#2324)

    Co-authored-by: Dan Laine <daniel.laine@avalabs.org>

commit 56c2ad9
Author: Stephen Buttolph <stephen@avalabs.org>
Date:   Wed Nov 29 14:35:33 2023 -0500

    Replace periodic push accepted gossip with pull preference gossip for block discovery (#2367)

commit 1dddf30
Author: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com>
Date:   Wed Nov 29 07:16:27 2023 -0800

    Rename `D` to `Durango` (#2389)

commit 6ed238c
Author: Stephen Buttolph <stephen@avalabs.org>
Date:   Wed Nov 29 01:05:16 2023 -0500

    Add block source metrics to monitor gossip (#2386)

commit 21c14b1
Author: Stephen Buttolph <stephen@avalabs.org>
Date:   Tue Nov 28 23:59:51 2023 -0500

    Add metric to track the stake weight of block providers (#2376)

commit 02ae8d9
Author: Stephen Buttolph <stephen@avalabs.org>
Date:   Tue Nov 28 15:10:25 2023 -0500

    Unexport RequestID from snowman engine (#2384)

commit be422a0
Author: Stephen Buttolph <stephen@avalabs.org>
Date:   Tue Nov 28 13:58:45 2023 -0500

    Implement generic bimap (#2383)

commit d7e7ff5
Author: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com>
Date:   Tue Nov 28 10:10:49 2023 -0800

    `vms/avm`: Rename `states` pkg to `state` (#2381)

commit 6e52922
Author: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com>
Date:   Tue Nov 28 07:55:27 2023 -0800

    `vms/platformvm`: Move `toEngine` channel to mempool (#2333)

commit 590ad12
Author: Stephen Buttolph <stephen@avalabs.org>
Date:   Mon Nov 27 16:57:15 2023 -0500

    Remove common bootstrapper (#2297)

commit 9ad213c
Author: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com>
Date:   Mon Nov 27 11:45:03 2023 -0800

    `vms/platformvm`: Consolidate `state` pkg mocks (#2370)

commit 3a424d0
Author: Stephen Buttolph <stephen@avalabs.org>
Date:   Mon Nov 27 13:36:03 2023 -0500

    Remove `engine.GetVM` (#2374)

commit b9ab41a
Author: felipemadero <felipe.madero@avalabs.org>
Date:   Mon Nov 27 14:44:54 2023 -0300

    Add option to provide BLS keys to validators in the genesis (#2371)

commit 42161aa
Author: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com>
Date:   Mon Nov 27 09:07:48 2023 -0800

    `vms/platformvm`: Adjust `Diff.Apply` signature (#2368)

commit 79e572d
Author: felipemadero <felipe.madero@avalabs.org>
Date:   Mon Nov 27 13:43:32 2023 -0300

    Avoid closing stdout and stderr during log close (#2372)

commit e04dad8
Author: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Date:   Sun Nov 26 13:13:56 2023 -0500

    Move peerTracker from x/sync to network/p2p (#2356)

commit b1b051a
Author: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com>
Date:   Sat Nov 25 16:32:05 2023 -0800

    `vms/platformvm`: Remove unused `withMetrics` txheap (#2373)

commit 8d9b93c
Author: Stephen Buttolph <stephen@avalabs.org>
Date:   Fri Nov 24 12:45:51 2023 -0500

    Add metric for duration between block timestamp and block acceptance time (#2366)

commit 9353569
Author: Stephen Buttolph <stephen@avalabs.org>
Date:   Fri Nov 24 11:23:36 2023 -0500

    Document storage growth in readme (#2364)

commit 6ad31d6
Author: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com>
Date:   Wed Nov 22 17:40:43 2023 -0800

    Remove Banff check from mempool verifier (#2360)

commit 62df19c
Author: Stephen Buttolph <stephen@avalabs.org>
Date:   Wed Nov 22 19:47:37 2023 -0500

    Update versions for v1.10.16 (#2353)

commit 48c541c
Author: Stephen Buttolph <stephen@avalabs.org>
Date:   Wed Nov 22 17:46:14 2023 -0500

    Fix P-chain mempool tx count metric (#2361)

commit 4ce0d67
Author: Gyuho Lee <6799218+gyuho@users.noreply.github.com>
Date:   Thu Nov 23 01:39:53 2023 +0800

    Use linkedhashmap for P-Chain mempool (#1536)

    Co-authored-by: dhrubabasu <7675102+dhrubabasu@users.noreply.github.com>
    Co-authored-by: Stephen Buttolph <stephen@avalabs.org>

commit f2f6d0a
Author: Patrick O'Grady <prohb125@gmail.com>
Date:   Tue Nov 21 22:07:24 2023 -0600

    [vms/proposervm] Update Build Heuristic (#2348)

    Co-authored-by: Alberto Benegiamo <alberto.benegiamo@gmail.com>

commit 459f8ba
Author: Stephen Buttolph <stephen@avalabs.org>
Date:   Tue Nov 21 19:24:02 2023 -0500

    Reduce the size of the OracleBlock interface (#2355)

commit f7cc69b
Author: Stephen Buttolph <stephen@avalabs.org>
Date:   Tue Nov 21 17:13:17 2023 -0500

    Expand consensus health check (#2354)

commit 2b737d5
Author: Stephen Buttolph <stephen@avalabs.org>
Date:   Tue Nov 21 13:26:55 2023 -0500

    Cleanup snowman consensus metrics (#2349)

Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
networking This involves networking
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants