Skip to content
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.

Siafunds #590

Merged
merged 12 commits into from
Jun 15, 2015
Merged

Siafunds #590

merged 12 commits into from
Jun 15, 2015

Conversation

DavidVorick
Copy link
Member

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.


// SpendSiagSiafunds sends siafunds to another address. The siacoins stored in
// the siafunds are sent to an address in the wallet.
func (w *Wallet) SpendSiagSiafunds(amount types.Currency, dest types.UnlockHash, keyfiles []string) (txn types.Transaction, err error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these named return values are never used

@lukechampine
Copy link
Member

you're right, this is super janky. I don't like any of it. But I don't really understand it either, so maybe it's not as bad as it looks.
Could the .siakey files be moved inside the test files? It doesn't look like you're using all of them anyway.

@DavidVorick
Copy link
Member Author

As far as 'it works without being buggy' goes, it should be pretty solid. It's just not a very strong design, nor is it much in the way of maintainability.

@DavidVorick
Copy link
Member Author

ok, hopefully addressed all of your concerns

lukechampine added a commit that referenced this pull request Jun 15, 2015
@lukechampine lukechampine merged commit 45305da into master Jun 15, 2015
@DavidVorick DavidVorick deleted the siafunds branch June 16, 2015 12:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants