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

Code improvements PoA module #3 #8965

Closed
Tracked by #7245
ishantiw opened this issue Sep 13, 2023 · 0 comments
Closed
Tracked by #7245

Code improvements PoA module #3 #8965

ishantiw opened this issue Sep 13, 2023 · 0 comments
Assignees
Milestone

Comments

@ishantiw
Copy link
Contributor

Description

  1. The getAllValidatorsResponseSchema schema specifies that weights should have a 'uint64' format, while the implementation may assign them to be blank strings: This is not a security issue, since there is no formal definition of the 'uint64' format anyway, and since the response is never validated against the schema
  2. Unnecessary store lookup: In the PoAEndpoint.getAllValidators function, validatorStore.iterate is used to get a list of validator (address, name) pairs. However, later on, the addresses in the returned list are again looked up using validatorStore.get(context, data.key), when data.value could be used instead.
  3. Unnecessary call to getAddressFromPublicKey: The register authority command uses address.getAddressFromPublicKey(context.transaction.senderPublicK ey) in its verify function to get the transaction’s sender address, when it could instead use context.transaction.senderAddress.

Steps to reproduce

N/A

Which version(s) does this affect? (Environment, OS, etc...)

6.1.0-beta.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants