Skip to content

siad tests

Luke Champine requested to merge testsiad into master

See #362 (closed) for a list of completed tests.

Preliminary testing revealed that a lot of siad internals were completely broken. Host, Renter, and Wallet did not satisfy their respective interfaces. Miner doesn't have an interface at all. The Gateway was calling "AcceptBlock" even though that RPC is registered to "RelayBlock". "SharePeers" wasn't registered at all (it used to be registered by the TCPServer). I guess the moral is that RPCs are tricky business, although I don't know of a way to make them safer. There isn't really a way to check their correctness at compile time.

The mining tests are pretty hacky; they just start the miner and wait for a second. We need a much more reliable mechanism for mining, similar to the ConsensusTester.MineCurrentBlock method. I added a naive function for accomplishing this. Maybe when you take it over you can make better use of the ConsensusTester.

There is one serious problem that I left unaddressed, which is that transactions cannot be relayed between synchronized peers. It seems that this causes an infinite loop: peer1 accepts a transaction and relays it via the Gateway to peer2. Then peer2 accepts the transaction and relays it back to peer1. The chain should stop there, but instead it seems peer1 will relay back to peer2 again, and the transaction will bounce between them forever. Perhaps the Transaction Pool is not rejecting duplicate transactions? This was actually caused by synchronous broadcasts, which are fixed now. However, the fix was kind of hacky. It requires you to keep track of all the RPCs going on behind the scenes. Hopefully we can work out a better method soon.

Merge request reports