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

Deprecate AnnounceAccounts #10024

Merged
merged 7 commits into from
Nov 6, 2023

Conversation

saketh-are
Copy link
Collaborator

@saketh-are saketh-are commented Oct 28, 2023

AnnounceAccounts is a legacy mechanism supporting Validator AccountId -> PeerId lookups. It was superseded by AccountsData about a year ago and has been awaiting deprecation:

// Find the target peer_id:
// - first look it up in self.accounts_data
// - if missing, fall back to lookup in self.graph.routing_table
// We want to deprecate self.graph.routing_table.account_owner in the next release.
let target = if let Some(peer_id) = peer_id_from_account_data {
metrics::ACCOUNT_TO_PEER_LOOKUPS.with_label_values(&["AccountData"]).inc();
peer_id
} else if let Some(peer_id) = self.account_announcements.get_account_owner(account_id) {
metrics::ACCOUNT_TO_PEER_LOOKUPS.with_label_values(&["AnnounceAccount"]).inc();
peer_id
} else {

By inspecting the ACCOUNT_TO_PEER_LOOKUPS metric for several mainnet validators, I've confirmed that AnnounceAccounts is no longer of use. Additionally, enough release versions have passed since the introduction of AccountsData that we can get rid of AnnounceAccounts entirely at this point (see #8182).

This PR removes all of the client code which has to do with creation and usage of AnnounceAccounts. I plan to send separate PRs removing related fields/types from the network message protocol and deprecating DBCol::AccountAnnouncements (as this PR is large enough already).

@saketh-are saketh-are marked this pull request as ready for review October 30, 2023 13:41
@saketh-are saketh-are requested a review from a team as a code owner October 30, 2023 13:41
@saketh-are saketh-are requested a review from akhi3030 October 30, 2023 13:41
Copy link
Contributor

@VanBarbascu VanBarbascu left a comment

Choose a reason for hiding this comment

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

Copy link
Collaborator

@nagisa nagisa left a comment

Choose a reason for hiding this comment

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

I've confirmed that AccountsData is no longer of use.

Did you mean “AnnounceAccounts is no longer of use”?


Seems quite nice otherwise!

@saketh-are
Copy link
Collaborator Author

I've confirmed that AccountsData is no longer of use.

Did you mean “AnnounceAccounts is no longer of use”?

Thanks, yes, updated.

@saketh-are saketh-are requested a review from nagisa October 30, 2023 16:32
@akhi3030 akhi3030 removed their request for review October 31, 2023 07:47
Copy link
Collaborator

@nagisa nagisa left a comment

Choose a reason for hiding this comment

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

Restamping

@saketh-are saketh-are added this pull request to the merge queue Nov 6, 2023
Merged via the queue into near:master with commit 5f942be Nov 6, 2023
8 of 9 checks passed
@saketh-are saketh-are deleted the deprecate-announce-accounts branch November 6, 2023 13:21
VanBarbascu added a commit to VanBarbascu/nearcore that referenced this pull request Nov 9, 2023
VanBarbascu added a commit that referenced this pull request Nov 9, 2023
VanBarbascu added a commit to VanBarbascu/nearcore that referenced this pull request Nov 10, 2023
github-merge-queue bot pushed a commit that referenced this pull request Nov 10, 2023
This reverts commit 5f942be in order to
fix some integration tests.
 x "pytest sanity/network_drop_package.py --features nightly",
  "pytest sanity/network_drop_package.py",
 x "pytest sanity/proxy_restart.py --features nightly",
  "pytest sanity/proxy_restart.py",
x  "pytest sanity/proxy_simple.py --features nightly",
  "pytest sanity/proxy_simple.py",
x  "pytest sanity/restart.py --features nightly",---Jan
  "pytest sanity/restart.py",---Jan
 x "pytest sanity/sync_ban.py false --features nightly",
  "pytest sanity/sync_ban.py false",
"expensive integration-tests integration_tests
tests::client::block_corruption::check_process_flipped_block_fails
--features nightly",
"expensive integration-tests integration_tests
tests::client::block_corruption::check_process_flipped_block_fails"
  "expensive integration-tests integration_tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants