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

Add bls, ip to default validator info; software info now generates on… #995

Merged
merged 6 commits into from
Nov 28, 2018
Merged

Add bls, ip to default validator info; software info now generates on… #995

merged 6 commits into from
Nov 28, 2018

Conversation

dsurnin
Copy link
Contributor

@dsurnin dsurnin commented Nov 26, 2018

…ce on start and later being read from file;

Signed-off-by: dsurnin dmitry.surnin@dsr-corporation.com

…ce on start and later being read from file;

Signed-off-by: dsurnin <dmitry.surnin@dsr-corporation.com>
lampkin-diet
lampkin-diet previously approved these changes Nov 26, 2018
@@ -159,6 +159,10 @@ def all_instances_have_primary(self) -> bool:
def primaries(self) -> dict:
return {r.instId: r.name for r in self._replicas.values()}

@property
def inst_id_by_name(self) -> dict:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add unit tests for this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

methods renamed and tests are added for both name to id and vice versa.

@@ -183,7 +198,10 @@ def __reachable_count(self):
@property
@none_on_fail
def __reachable_list(self):
return sorted(list(self._node.nodestack.conns) + [self._node.name])
inst_by_name = self._node.replicas.inst_id_by_name
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add unit tests for this. It looks like we don't return primary names, but just replica's names.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

@@ -555,12 +584,6 @@ def __node_info(self):
len(self._node.replicas)),
"Replicas_status": self._prepare_for_json(
self.__replicas_status),
"Pool_ledger_size": self._prepare_for_json(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did we remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because of duplication. metircs transaction-count contains the same info but also will include info from all ledgers not just 3 standard.

def test_validator_info_file_pool_fields_valid(looper, info, txnPoolNodesLooper, txnPoolNodeSet, node):
assert info['Pool_info']['Reachable_nodes_count'] == nodeCount
assert info['Pool_info']['Reachable_nodes'] == sorted(list(node.name for node in txnPoolNodeSet))
assert info['Pool_info']['Reachable_nodes'] == _get_name_to_replica_reachable(node)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use hard-coded values here (expected string in expected format)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

assert info['Pool_info']['Unreachable_nodes_count'] == 0
assert info['Pool_info']['Unreachable_nodes'] == []
assert info['Pool_info']['Unreachable_nodes'] == _get_name_to_replica_unreachable(node)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use hard-coded values here (expected string in expected format)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

… unreachable vals in info;

Signed-off-by: dsurnin <dmitry.surnin@dsr-corporation.com>
def primaries(self) -> dict:
return {r.instId: r.name for r in self._replicas.values()}
def primary_name_by_inst_id(self) -> dict:
return {r.instId: r.primaryName.split(":", maxsplit=1)[0] for r in self._replicas.values()}
Copy link
Contributor

Choose a reason for hiding this comment

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

r.primaryName can be None

@ashcherbakov ashcherbakov merged commit 5645f30 into hyperledger:master Nov 28, 2018
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.

None yet

3 participants