Skip to content

Module Cleanup

David Vorick requested to merge renter into master

Gateway now gets updated by the transaction pool, instead of getting updated by things submitting transactions. Gateway also now gets blocks from the consensus set, instead of getting blocks from rpcs. Rpcs directly submit to the transaction pool and the state. Fixes #354 (closed)

The website has been added to the readme. Fixes #324 (closed)

Timeouts have been added to make test.

Some thread safety was added to the consensus tester functions. I'm pretty sure they're still not fully thread safe, because I didn't do a good job of following threading conventions. More thorough lookover of these functions to come later.

I added notifications to the state. Now, the gateway and the host get notified every time the state updates. Sometimes, the gateway seems to get too many notifications. Idk what this is about, but it might cause sporadic testing failures until I fix it. It's up there in priority.

The gateway now checks for nil input. This does cause some port problems when testing in bulk. There are multiple ways to handle this but I chose to introduce some global state, which is kind of gross. I do think it's much more acceptable than just passing in a nil tcp server, and I don't think that would end up being a good solution anyway because a lot of the tests do use tcp functions at some point, so the tests would fail anyway and we'd still need some sort of way to prevent port conflicts. I'm sure there's a better way to do this, but I think we should mostly devote our energy towards the next iteration being finished.

Host/renter negotiation has been cleaned up a bit to match the new file contracts. Unfortunately, download is broken (just remembered now) and the renter requires the host to be non-malicious. Both of these can be fixed with finesse, but it adds 2.5 more steps to the negotiation. (current steps: 1. send terms, 2. send file, 3. send signed contract. New steps: 1. send terms, 2. send file, 3. send unsigned contract 4. receive unsigned contract but with host inputs added, 5. send signed whole transaction. The host then needs to check again that the signed contract matches the unsigned contract before signing it).

This whole PR comes without tests. Those to be added soon.

Merge request reports