keep-starknet-strange / raito

Bitcoin ZK client written in Cairo.
https://raito.wtf
MIT License
40 stars 34 forks source link

[bug] Unexpected state after applying blocks 2016*k (header-only validation) #152

Closed m-kus closed 1 month ago

m-kus commented 1 month ago

Applying blocks that are multiplies of 2016 leads to incorrect chain state (probably related to the epoch start time).
Note that it might also be a problem with the data generation script which estimates epoch start time.

How to troubleshoot:

  1. Add integration test for block height 2015 (so that we apply block 2016 on top) - see readme for instructions
  2. Obtain the diff between the chain states
  3. Fix the issue

Suggested deadline: 10 Sep

Jeanmichel7 commented 1 month ago

Can I do it ?

onlydustapp[bot] commented 1 month ago

Hey @Jeanmichel7! Thanks for showing interest. We've created an application for you to contribute to Raito - Bitcoin ZK Client. Go check it out on OnlyDust!

Jeanmichel7 commented 1 month ago

@m-kus I don't see the problem with block 2016*k, I added the light_2015.json, checked the data, and ran the integration test, I don't see any problem. The Epoch start time seems correct [0, 2015] [2016, 4031]... The same goes for block 32255 (first target change), but it's #137 issue

m-kus commented 1 month ago

@Jeanmichel7 that's actually a bug in the integration tests runner 😅 Please change the order here https://github.com/keep-starknet-strange/raito/pull/153/commits/10236dd453f40b98515a3982bae54399f32cc3cb#diff-bff0220c1f1b1ed70f408a135df468ce59f92d7e0d3ff38d842fb83a129ecbfaR40

(or you can rebase on top of my branch if you'd like)

Jeanmichel7 commented 1 month ago

Ah yes ok! I got it