status-im / community-dapp

Community directory curator dApp for Status
https://status-community-dapp.vercel.app
2 stars 5 forks source link

[FE] Batching functionality #88

Closed jkbktl closed 11 months ago

jkbktl commented 11 months ago

✅ This PR:

⚠️ Known issue:

vercel[bot] commented 11 months ago

@jkbktl is attempting to deploy a commit to the Status Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] commented 11 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
community-dapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2023 10:11am
jkbktl commented 11 months ago

There are currently two bugs:

a. This one is mentioned in the description on the top of the PR. It's related to counting votes. For some reason, during finalization phase, only "saved" votes from contract are shown. Every batch of finalization adds up new votes (included in that specific batch). You can reproduce it during every basic vote, it's visible without any specific actions.

b. Second bug happens when verification was not processes completely, meaning not all batches were sent to contract and therefore not all votes were verified during verification phase. It makes impossible for FE to evaluate verified votes in batches, because we are not able to figure it out how many votes was verified. In case it's just one batch we can use evaluatingPos to finalize voting, but even in that case it means that not all votes are counted for that specific voting. It should be reproducible by these steps (in local environment with hard limit 2 votes per batch):

  1. create voting with initial vote
  2. vote at least by three other accounts, which means there will be at least 2 batches
  3. go through verification phase without clicking on button "verify"
  4. try to finalize voting
  5. it should throw an error limit is greater than votes length, because FE expects there's 4 votes (1 initial + 3 other) so it sends hard limit 2, but in reality, there's only 1 initial vote, which causes an error.