trifle-labs / anybody-problem

Anybody Problem simulates the 3-body problem in two dimensions using zk proofs written in circom.
https://anybody.gg
17 stars 4 forks source link

re-architect missile cancel system #368

Open okwme opened 1 month ago

okwme commented 1 month ago

a couple times one player has turned up an invalid position x bug when submitting their final game. Every time I've gone through their player data I am unable to reproduce the error. What's essentially happening is that in the middle of one of the later rounds, a chunk uses invalid starting data to create a proof. For instance:

Level 4, chunk 1 ends with body 0 position x at 12345. JS and Circom agree when the game is replayed. However for some reason, in the live game, the player's version of JS thinks that body 0 ends at position 54321 (made up numbers to demonstrate point). This causes an error when the next chunk is run and solidity stores the circom results instead of the js results.

This could only happen if the user's version of JS is incorrectly calculating. OR if there is something else occuring that results in the JS thinking it has a different outcome. The most likely culprit is the missile removal system which has caused problems in the past.

Actually, now that generating the proofs as soon as possible is not so important thanks to Sindri, we postpone posting a level's missiles until the entire thing is complete. Then chunk them in the front end for the prover 🤔