revaultd
revaultd copied to clipboard
Either properly test or deny deployments with an high CSV
At the moment we aren't testing spends with an higher CSV because calling generatetoaddress
with a too high number of blocks causes:
> rn.spend_vaults_anyhow([vaultA, vaultB])
test_misc.py:403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_framework/revault_network.py:567: in spend_vaults_anyhow
return self.spend_vaults(vaults, destinations, feerate)
test_framework/revault_network.py:538: in spend_vaults
vaults, destinations, feerate
test_framework/revault_network.py:520: in spend_vaults_unconfirmed
self.bitcoind.generate_block(self.csv)
test_framework/bitcoind.py:131: in generate_block
self.rpc.generatetoaddress(500, addr)
test_framework/bitcoind.py:47: in f
return proxy._call(name, *args)
venv/lib/python3.7/site-packages/bitcoin/rpc.py:233: in _call
response = self._get_response()
venv/lib/python3.7/site-packages/bitcoin/rpc.py:263: in _get_response
http_response = self.__conn.getresponse()
/nix/store/dgjm8090l365id2m7zhi6l7864kkb3n7-python3-3.7.10/lib/python3.7/http/client.py:1369: in getresponse
response.begin()
/nix/store/dgjm8090l365id2m7zhi6l7864kkb3n7-python3-3.7.10/lib/python3.7/http/client.py:310: in begin
version, status, reason = self._read_status()
/nix/store/dgjm8090l365id2m7zhi6l7864kkb3n7-python3-3.7.10/lib/python3.7/http/client.py:271: in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <socket.SocketIO object at 0x7f9e8064f690>, b = <memory at 0x7f9e8110c050>
def readinto(self, b):
"""Read up to len(b) bytes into the writable buffer *b* and return
the number of bytes read. If the socket is non-blocking and no bytes
are available, None is returned.
If *b* is non-empty, a 0 return value indicates that the connection
was shutdown at the other end.
"""
self._checkClosed()
self._checkReadable()
if self._timeout_occurred:
raise OSError("cannot read from timed out object")
while True:
try:
> return self._sock.recv_into(b)
E socket.timeout: timed out
/nix/store/dgjm8090l365id2m7zhi6l7864kkb3n7-python3-3.7.10/lib/python3.7/socket.py:589: timeout
We do sometimes test them, as discussed on mattermost (eg test_large_spend). But i'm not opposed to forbidding large CSVs, as that's better than officially supporting but undertesting them.