Skip to content

Siafunds

David Vorick requested to merge siafunds into master

This PR feels like a hack job. The last hack job for a while, thankfully, but it builds on a lot of incomplete concepts. We need to get the siafunds spender out to our crowdfund holders asap, which is why I was okay building on top of deprecated designs.

One seemingly small change had major cascades. The genesis block outputs hadn't originally been included in the subscription list, which is a problem because that's where all the siafund outputs exist. So I added the genesis block to the notification list.

Problem is, this happens immediately, on startup. So, before the test suite ever mines a block, there's already a notification, and there needs to be a check that the notification spread to all of the other modules. This resulted in some headache, and ultimately a conclusion that the notification system could be revised.

Support for siag files has been added, but in a bit of a weird way. You don't load them into your wallet, because siag files are actually multisig files. The idea of multisig files is that you don't have everything in one place, yet you need to put everything in one place to spend the siafunds. Usage is complex and counterintuitive. Could use revising at some point, but I just accepted the limitations for now.

Siag stuff eventually needs to be fully integrated into the wallet itself.

There's no way to rescan the diff set when you add a new siafund key to the wallet. So, after adding the siafund key you just have to restart siad. That's pretty lame, but changing it would require some fairly major architectural changes. This just points back to the limitations of our current subscription architecture. I'll be looking at it more closely later this week as I return to polishing up the consensus package.

The api calls still aren't implemented for spending siafunds, because you might need to load multiple keys, instead of just one key. I figured that api call is something you can add when you implement the other calls in siac.

Ideally, the siafund stuff (including siac) will be merged into master sometime before tomorrow ends. I don't want to keep people waiting.

Merge request reports