Skip to content

Add ability to fork

David Vorick requested to merge fork into master

This PR adds the logic to switch blockchain forks if a fork that we aren't on gets enough weight. It's pretty resource intense, but should be alright until we're dealing with large blocks and large forks.

At this point, except for the encoding stuff that isn't done yet, the blockchain should pretty much be able to handle any block that contains transactions with inputs and outputs. It doesn't verify signatures, but it does check for validity of inputs and outputs, it checks for a valid block header, it can switch forks, it tracks difficulty.

So most of what's left on the backend side is mining, managing contracts, and managing storage proofs. And that's pretty much it. Then we've got network stuff, and an actual client on which you can make transactions and offer yourself as a host and such. And testing. Much more testing.

I did:

  • fix some bugs and add organization to genesis.go
  • move Block.ID() to types.go ---> decided it's okay for types.go to be pretty massive as a file
  • rename difficulty to target
  • add organization and error checking to wallet.go
  • begin organization of verify.go, but it could use a fair amount of additional organization.

Tomorrow's agenda for me is organizing things some more, and then writing tests to make sure that I've introduced less than a thousand bugs. If I finish that before the day ends, I'll try to write contract handling code.

Would be nice to have:

  • Signing transactions, including all of the potential pieces of the coverage struct
  • The merkle tree for the spend conditions

Merge request reports