Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ipaddress.ip_address for storing IPv4/IPv6 #9

Open
bswck opened this issue Nov 28, 2024 · 1 comment
Open

Use ipaddress.ip_address for storing IPv4/IPv6 #9

bswck opened this issue Nov 28, 2024 · 1 comment

Comments

@bswck
Copy link

bswck commented Nov 28, 2024

For the Address class,

class Address(ABC):
"""
Class describing address, which redirects to original miner's server.
"""
def __init__(self, address_id, address_type: AddressType, address: str, port: int):
"""
Args:
address_id: Identifier (used by AddressManager) of the address. Type depends on the implementation.
address_type: Type of the address.
address: Address.
port: Port of the address.
"""
self.address_id = address_id
self.address_type = address_type
self.address = address
self.port = port

let's use what ip_address provides us in order to validate and reliably store IP address information.

@bswck bswck changed the title Use ip.ip_address for storing IPv4/IPv6 Use ipaddress.ip_address for storing IPv4/IPv6 Nov 28, 2024
@bswck bswck mentioned this issue Nov 28, 2024
@ggleszczynski
Copy link
Contributor

ggleszczynski commented Dec 5, 2024

This IP and IPv6 AddressType is used only in miner_address param passed when creating AddressManager instance and is used just for finding EC2 server with given IP - it is agreed with @ppolewicz that we are shielding only EC2 server as for now. See AddressManager::_initialize_miner_instance where it is done. There is no need to use ipaddress library for anything there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants