lbryio / lbry-sdk

The LBRY SDK for building decentralized, censorship resistant, monetized, digital content apps.
https://lbry.com
MIT License
7.19k stars 482 forks source link

reproduce and test server side reorgs #3520

Open eukreign opened 2 years ago

eukreign commented 2 years ago

Before client side reorg support can be implemented we need to make sure that the wallet server is properly handling them and sending correct header information to the client.

One way to reproduce forking is:

  1. start two lbrycrd instances in regtest mode on different ports
  2. have them connect
  3. generate 200 blocks (on any of them, since they will sync)
  4. disconnect them
  5. generate 2 blocks on one and 3 blocks on the other
  6. have wallet server sync with the two block lbrycrd
  7. reconnect lbrycrds (trigger reorg)
  8. check that the 2 blocks lbrycrd accepts the longer chain from the 3 blocks lbrycrd
  9. check that wallet server reorgs correctly and sends correct header and block info to client

Further reading: