Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

feat(frontend): Expose whole pools list #661

Merged
merged 19 commits into from
Aug 18, 2021
Merged

feat(frontend): Expose whole pools list #661

merged 19 commits into from
Aug 18, 2021

Conversation

shelegdmitriy
Copy link
Contributor

@shelegdmitriy shelegdmitriy commented Jun 15, 2021

Particulary resolves #646

Test Plan:

  • Manualy check validators metrics;
  • Update existing tests

@shelegdmitriy shelegdmitriy requested a review from frol June 15, 2021 13:37
@shelegdmitriy shelegdmitriy self-assigned this Jun 15, 2021
@render
Copy link

render bot commented Jun 15, 2021

@shelegdmitriy shelegdmitriy force-pushed the feat/expose_pools_list branch from ed92d43 to f7d342a Compare June 25, 2021 08:09
@shelegdmitriy shelegdmitriy marked this pull request as ready for review June 25, 2021 12:14
@shelegdmitriy shelegdmitriy force-pushed the feat/expose_pools_list branch from 2cccbcb to 8dad62e Compare June 25, 2021 12:17
@shelegdmitriy shelegdmitriy force-pushed the feat/expose_pools_list branch 3 times, most recently from f1b5627 to 852601f Compare July 21, 2021 07:25
@shelegdmitriy shelegdmitriy force-pushed the feat/expose_pools_list branch 2 times, most recently from 4640b54 to ef21314 Compare July 29, 2021 07:53
@frol
Copy link
Collaborator

frol commented Jul 29, 2021

The table does not fit and has a horizontal scroll

image

Ideas:

  1. Shrink the Stake column by only showing NEAR amounts without any fractional part
  2. Shrink some other columns

The page is super slow

I feel it does too much re-renders, my browser (Firefox) is barely responsive on the page.

The telemetry data is missing

image

Add a tooltip to the flags to display the country name

It is not realistic that people would know all the flags by heart.

@shelegdmitriy
Copy link
Contributor Author

@frol Hey Vlad! I have finished issues above except of "The telemetry data is missing" because it wasn't reproduced. On my local machine all data is available

@shelegdmitriy shelegdmitriy force-pushed the feat/expose_pools_list branch from 493cf64 to a7ccb82 Compare August 2, 2021 14:26
@frol
Copy link
Collaborator

frol commented Aug 2, 2021

"The telemetry data is missing"

Oh, my bad, indeed 🤦

@shelegdmitriy shelegdmitriy force-pushed the feat/expose_pools_list branch 2 times, most recently from 16366d9 to f01e7da Compare August 5, 2021 09:13
@frol
Copy link
Collaborator

frol commented Aug 6, 2021

@shelegdmitriy The page performance is now reasonable, great job!

We need to address the following:

  • Display staked values truncated to the whole NEAR amount [no fractional part]
  • Fix the validators that have no status:
    image
  • Fix unit tests (it seems that we just need to update the snapshot)
  • Check if e2e tests pass on your local machine since nodes list test cannot pass on CI since you updated the backend

frontend/src/components/nodes/ValidatorMainRow.tsx Outdated Show resolved Hide resolved
frontend/src/components/nodes/ValidatorMainRow.tsx Outdated Show resolved Hide resolved
frontend/src/components/nodes/ValidatorMetadataRow.tsx Outdated Show resolved Hide resolved
frontend/src/components/nodes/ValidatorTelemetryRow.tsx Outdated Show resolved Hide resolved
@shelegdmitriy shelegdmitriy force-pushed the feat/expose_pools_list branch from adf5404 to 72eef76 Compare August 13, 2021 16:10
@shelegdmitriy shelegdmitriy force-pushed the feat/expose_pools_list branch from 277c950 to b7c4efb Compare August 16, 2021 14:36
@@ -101,13 +101,17 @@
"component": {
"nodes": {
"Validators": {
"location": "Location",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to translate

"pending": {
"title": "Đang chờ",
"proposal": {
"title": "Proposal",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to translate title, explain text will be same

Comment on lines 133 to 134
"title": "Idle",
"text": "idle node"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to translate

Comment on lines +139 to +162
"ValidatorTelemetryRow": {
"uptime": {
"title": "Uptime",
"text": "Uptime is estimated by the ratio of the number of produced blocks to the number of expected blocks"
"text": "Uptime is estimated by the ratio of the number of produced blocks to the number of expected blocks.",
"title": "Uptime"
},
"latest_block": {
"title": "Latest block",
"text": "The block height the validation node reported in the most recent telemetry heartbeat."
"latest_produced_block": {
"text": "The block height the validation node reported in the most recent telemetry heartbeat.",
"title": "Latest block"
},
"latest_telemetry_update": {
"title": "Latest Telemetry Update",
"text": "Telemetry is a regular notification coming from the nodes which includes generic information like the latest known block height, and the version of NEAR Protocol agent (nearcore)."
"text": "Telemetry is a regular notification coming from the nodes which includes generic information like the latest known block height, and the version of NEAR Protocol agent (nearcore).",
"title": "Latest Telemetry Update"
},
"node_agent_name": {
"title": "Node Agent Name",
"text": "NEAR Protocol could have multiple implementations, so agent is the name of that implementation, where 'near-rs' is <a href=\"https://github.com/near/nearcore\">the official implementation</a>. "
"text": "NEAR Protocol could have multiple implementations, so agent is the name of that implementation, where 'near-rs' is ${agent_name_url}.",
"url_text": "the official implementation",
"title": "Node Agent Name"
},
"node_agent_version_or_build": {
"title": "Node Agent Version / Build"
},
"warning_tip": "Các node xác thực 1 - ${node_tip_max} đang tích lũy stake trên 33%. Việc ký gửi cho những node xác thực bên dưới sẽ cải thiện tính phân tán cho mạng lưới."
}
},
"ValidatorMetadataRow": {
"pool_info": {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to translate

@@ -101,13 +101,17 @@
"component": {
"nodes": {
"Validators": {
"location": "Location",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to translate

"pending": {
"title": "待定",
"proposal": {
"title": "Proposal",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to translate only title

Comment on lines 132 to 137
"idle": {
"title": "Idle",
"text": "idle node"
}
},
"same_proposed_stake": "same"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to translate

Comment on lines +161 to +172
"ValidatorMetadataRow": {
"pool_info": {
"website": "Web",
"email": "Email",
"twitter": "Twitter",
"discord": "Discord",
"description": "Description"
},
"pool_info_tip": {
"text": "If you are node owner feel free to fill all ${pool_info_url} to promote your own node!",
"url_text": "data"
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to translate

@shelegdmitriy shelegdmitriy force-pushed the feat/expose_pools_list branch from 84620bc to aa1530c Compare August 18, 2021 06:23
Comment on lines 58 to 64
validatorsList.some((validator: N.ValidationNodeInfo, index: number) =>
totalStake &&
validator.cumulativeStakeAmount &&
validator.cumulativeStakeAmount.gt(totalStake.divn(3))
? (validatorsList[index].networkHolder = true)
: false
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's not abuse some here (mutations inside some callback function is a way to shoot your leg). In fact, I don't see a need for this networkHolder flag since you can move this whole condition right to the component render stage.

Boolean(agentVersion) ||
Boolean(agentBuild);

if (isTelemetryAvailable) return null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (isTelemetryAvailable) return null;
if (!isTelemetryAvailable) return null;

: false
);

// console.log(validatorsList);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's clean it up

Copy link
Collaborator

@frol frol left a comment

Choose a reason for hiding this comment

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

@shelegdmitriy Well done! Thanks for improving the code clarity and getting through all the subtle details that are super important for the clear picture and improves visibility of the validators network!

@frol frol merged commit 95604a2 into master Aug 18, 2021
@frol frol deleted the feat/expose_pools_list branch August 18, 2021 18:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validator nodes screen is confusing
2 participants