-
Notifications
You must be signed in to change notification settings - Fork 366
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
Add bls, ip to default validator info; software info now generates on… #995
Conversation
…ce on start and later being read from file; Signed-off-by: dsurnin <dmitry.surnin@dsr-corporation.com>
Signed-off-by: dsurnin <dmitry.surnin@dsr-corporation.com>
plenum/server/replicas.py
Outdated
@@ -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: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
plenum/server/validator_info_tool.py
Outdated
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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>
plenum/server/replicas.py
Outdated
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()} |
There was a problem hiding this comment.
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
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