Skip to content

bug: processID duplication when importing processes from archive #1223

@jordipainan

Description

@jordipainan

ProcessID of an election is calculated deterministically. One of the parameters for the calculation is the network chainID.

This has not been always like this, and in the past few parameters where used.
Because of it, there is the case that when importing from the archive, and for legacy reasons the chainID of the process can be empty. This is one thing.

After noticing this, we double checked and the archive, atm, always returns processes with the chainID set. So for the former "error" commented everything should be fine.

But there is another thing, when the process is read from the archive and stored into the indexer the chainID of the process is lost because of this query UpdateProcessFromState that can be found at https://github.com/vocdoni/vocdoni-node/blob/main/vochain/indexer/queries/processes.sql#L48.
This query is called when creating a non existent process at https://github.com/vocdoni/vocdoni-node/blob/main/vochain/indexer/process.go#L195.

Example:

  • curl 'https://api-stg.vocdoni.net/v2/elections/6b342d99f218e54d702f98e312aba4318e3c6bdba98ab5e11012020400000001' | jq .: Returns the process with empty chainID.
  • curl 'https://api-dev.vocdoni.net/v2/elections/6b342d99f218e54d702f98e312aba4318e3c6bdba98ab5e11012020400000001' | jq .: Returns the process with a defined chainID.

Maybe there is a confusion too between sourceNetworkID and chainID. The former identifies ethereum networks and the later vochain networks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions