Blockscout: Add Validators Metadata information to Blockscout

Created on 24 Oct 2018  路  4Comments  路  Source: blockscout/blockscout

As a user, I want to see the Validators metadata on its address page to increase reliability over the validators identify on POA chains. This info should be seen along with his primary name, validated blocks and transactions in the overview section.

Example (To see the info you have to connect your wallet on the POA chain before):
https://validators.poa.network

This information is stored in the blockchain, to fetch it is necessary to use the POA_ADDRESS and METADATA_ADDRESS contracts, with the abi specified below.

The validators info does not change frequently.

ABI
https://raw.githubusercontent.com/poanetwork/poa-chain-spec/core/abis/PoaNetworkConsensus.abi.json

https://raw.githubusercontent.com/poanetwork/poa-chain-spec/core/abis/ValidatorMetadata.abi.json

Contracts
https://raw.githubusercontent.com/poanetwork/poa-chain-spec/core/contracts.json

Motivation

POA is a Proof of Authority Network with identity at stake. Validators stake their identities and reputation for validating blocks and keeping networks secure and reliable. Validators have to go through several verification stages, making sure this information is verified and available. Metadata should be publicly available from explorers.

Questions?

  • ~Should this be a task to run only one time or a periodic task?~
  • ~Will those contracts and abi change in the future?~

Acceptance Criteria

  • It must display all metadata we know about the validator (Home Address, License ID, License Expiration Date, and Miner Creation Date);

    • It may be displayed when clicking on the primary name of the Validator and then provide the list of info;

  • It may be handled through a JSON object of field iterating with the address_names table;
  • If the field does not exist or is empty it must not be displayed
  • It must be only seen in the POA chains (Core and Sokol);

Tasks

  • Make something to trigger the fetching and updating of the metadata(time, deploy, script, task, etc.)
  • Create Validator.MetadataRetriever
  • Create configuration for Validator.MetadataRetriever

    • Use the METADATA_ADDRESS: string with metadata contract address;

    • Use the POA_ADDRESScontract to fetch all the validators info.

  • Use the PoaNetworkConsensus.abi.json to read the info from the POA_ADDRESS contract;
  • Use the ValidatorMetadata.abi.json to read the info from the METADATA_ADDRESS contract;
  • Create JSON column metadata on address_names

    • This saves all retrieved metadata

  • Store the info in the address_names related to the validator address hash;
  • Display this information in the front-end in the Overview section;

    • Create "Validator card" template;

    • Add link on validators' address page;

    • Show modal on click.

Recurrency

  • Create Validator.MetadataUpdater;

    • Calls Validator.MetadataRetriever a single time;

  • Create configuration for Validator.MetadataUpdater;

    • Enabled: true/false;

    • interval: time between updates;

  • Run on application startup;
  • Sends a message to itself after interval amount of time to redo operation.
chain enhancement high contributor

Most helpful comment

@amandasposito

  1. Ideally, this task should run only when the information from validators.poa.network updates. Since this will most likely be on a cronjob, let's check once daily.
  1. There is always a chance that the contract could change. I believe this should a configurable option. One for each contract that we need to interact with.

All 4 comments

Thank you @maratP. We'll include this feature sometime soon. Please keep the feedback coming :smile:

  1. Add more columns to the address_names table.

    • address
    • license id
    • license creation date
    • license expiration date
  2. Another option is that we can create a column for custom JSON data.

  3. In the UI when on the page with address_names -> primary = true, the user should be able to click on the name and a modal pops up showing all this extra data.

I'm not sure if we need an image.
This information is not a part of our governance process.

@amandasposito

  1. Ideally, this task should run only when the information from validators.poa.network updates. Since this will most likely be on a cronjob, let's check once daily.
  1. There is always a chance that the contract could change. I believe this should a configurable option. One for each contract that we need to interact with.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

weilbith picture weilbith  路  7Comments

banteg picture banteg  路  6Comments

acravenho picture acravenho  路  4Comments

vbaranov picture vbaranov  路  7Comments

igorffs picture igorffs  路  7Comments