Skip to content

Spore doesn't check if a port is passed in as int #10

@XertroV

Description

@XertroV
xertrov@X-LittleLap:~/src/cryptonet$ python3 examples/grachten.py -addnode 127.0.0.1:32555 -port 32556
set_handlers
chain: new head 0, hash: 00db713a2a561c76caaca9974d87b3b0880e748447ff078dd82e03a94b52f29c
added block 0, hash: 00db713a2a561c76caaca9974d87b3b0880e748447ff078dd82e03a94b52f29c
chain: restarting miner
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/spore/__init__.py", line 60, in _try_except
    callback(self, *args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/spore/__init__.py", line 107, in share_info
    info.port = self._address[1]
  File "/usr/local/lib/python3.4/dist-packages/encodium/__init__.py", line 89, in __setattr__
    field.check_type(value)
  File "/usr/local/lib/python3.4/dist-packages/encodium/__init__.py", line 136, in check_type
    raise ValidationError("is of type " + instance_type + ", expected " + expected_type)
encodium.ValidationError: port is of type list, expected int
on_connect_handler
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/spore/__init__.py", line 60, in _try_except
    callback(self, *args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/spore/__init__.py", line 101, in info
    peer.send('peer', Peer.make(ip=socket.inet_aton(address[0]), port=address[1]))
  File "/usr/local/lib/python3.4/dist-packages/encodium/__init__.py", line 196, in make
    return cls().make(*args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/encodium/__init__.py", line 106, in make
    ret = self.type(*args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/encodium/__init__.py", line 52, in __init__
    setattr(inner_self, key, value)
  File "/usr/local/lib/python3.4/dist-packages/encodium/__init__.py", line 89, in __setattr__
    field.check_type(value)
  File "/usr/local/lib/python3.4/dist-packages/encodium/__init__.py", line 136, in check_type
    raise ValidationError("is of type " + instance_type + ", expected " + expected_type)
encodium.ValidationError: port is of type str, expected int
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/spore/__init__.py", line 60, in _try_except
    callback(self, *args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/spore/__init__.py", line 107, in share_info
    info.port = self._address[1]
  File "/usr/local/lib/python3.4/dist-packages/encodium/__init__.py", line 89, in __setattr__
    field.check_type(value)
  File "/usr/local/lib/python3.4/dist-packages/encodium/__init__.py", line 136, in check_type
    raise ValidationError("is of type " + instance_type + ", expected " + expected_type)
encodium.ValidationError: port is of type list, expected int
on_connect_handler
intro_handler
MSG intro : 22b4d0a6159abb3ff25cee4d28640fe1c962bdef2e5bf31b63fa1f6da508b422
introhand 1629685583822781141942776544559185852632203993122318740065436872644545712
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/spore/__init__.py", line 60, in _try_except
    callback(self, *args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/spore/__init__.py", line 101, in info
    peer.send('peer', Peer.make(ip=socket.inet_aton(address[0]), port=address[1]))
  File "/usr/local/lib/python3.4/dist-packages/encodium/__init__.py", line 196, in make
    return cls().make(*args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/encodium/__init__.py", line 106, in make
    ret = self.type(*args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/encodium/__init__.py", line 52, in __init__
    setattr(inner_self, key, value)
  File "/usr/local/lib/python3.4/dist-packages/encodium/__init__.py", line 89, in __setattr__
    field.check_type(value)
  File "/usr/local/lib/python3.4/dist-packages/encodium/__init__.py", line 136, in check_type
    raise ValidationError("is of type " + instance_type + ", expected " + expected_type)
encodium.ValidationError: port is of type str, expected int
intro_handler
MSG intro : 22b4d0a6159abb3ff25cee4d28640fe1c962bdef2e5bf31b63fa1f6da508b422
introhand 1629685583822781141942776544559185852632203993122318740065436872644545712

examples/grachten.py continues as normal from thereafter (mostly)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions