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

bug: processID duplication when importing processes from archive #1223

Open
jordipainan opened this issue Dec 15, 2023 · 1 comment
Open
Labels
bug Something isn't working

Comments

@jordipainan
Copy link
Member

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.

@jordipainan jordipainan added the bug Something isn't working label Dec 15, 2023
@jordipainan
Copy link
Member Author

Not related but in the same topic of #1224

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants