tig-foundation / tig-monorepo

TIG is the first coordination protocol designed specifically for algorithmic innovation
https://tig.foundation
15 stars 28 forks source link

feat: Handle benchmark and proof submission errors #6

Closed DamianPala closed 4 weeks ago

DamianPala commented 1 month ago

When submitting a benchmark or proof, if a high transaction volume error occurs, the algorithm waits until a new block is mined before retrying. If a proof already submitted error occurs, the submission will not be repeated. Added more descriptive logs to enhance the clarity of the submission process.

FiveMovesAhead commented 1 month ago

Thanks for this @DamianPala ! Can you point it to the blank_slate branch

FiveMovesAhead commented 1 month ago

A few comments:

  1. Apart from high transaction volume, also retry on the 400 error code cases (all other 400 error code cases should not need retrying):
    • You can only submit a benchmark once per X seconds
    • You can only submit a proof once per X seconds
  2. Should also retry on any >500 error code cases
  3. Change submit_benchmark and submit_proof to use future_utils::spawn to create a separate task to do submissions so it doesn't block the main loop
    • You will have to put a Arc<Mutex<...>> or a Arc<RwLock<...>> around query_data so you can safely access from multiple tasks/threads
  4. Move the script into a separate PR