opentensor / subtensor

Bittensor Blockchain Layer
The Unlicense
145 stars 149 forks source link

feat: bad blocks chain extension #479

Closed orriin closed 4 months ago

orriin commented 4 months ago

Closes https://github.com/opentensor/subtensor/issues/467

Tested:

Screenshot 2024-05-27 at 08 32 05

Node will log attempts to import bad blocks a few times before banning the peer trying to propagate the bad block.

distributedstatemachine commented 4 months ago

Nice ! @orriin can you please add instructions to test this ? It be also be helpful to try using this to sync an archive node on finney

Node will log attempts to import bad blocks a few times before banning the peer trying to propagate the bad block.

What happens if all the peers have the badblocks? Does this mean it wont be able to sync as it is banning a peers?

orriin commented 4 months ago

Nice ! @orriin can you please add instructions to test this ? It be also be helpful to try using this to sync an archive node on finney

  1. Sync Alice and Bob some blocks
  2. Stop Bob
  3. Add latest block hash to bad blocks
  4. Regen chain spec
  5. Start Alice again

What happens if all the peers have the badblocks? Does this mean it wont be able to sync as it is banning a peers?

Yeah, it can't sync from them anyway because they have bad blocks. Dw though, the ban list is cleared when the node restarts.

distributedstatemachine commented 4 months ago

@orriin please resolve conflicts