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

Fix use of Porter for sampling #313

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions deployment/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from ape.contracts import ContractContainer, ContractInstance
from ape_etherscan.utils import API_KEY_ENV_KEY_MAP

from deployment.constants import ARTIFACTS_DIR, LYNX, MAINNET, PORTER_SAMPLING_ENDPOINTS, TAPIR
from deployment.constants import ARTIFACTS_DIR, MAINNET, PORTER_SAMPLING_ENDPOINTS
from deployment.networks import is_local_network


Expand Down Expand Up @@ -192,7 +192,14 @@ def sample_nodes(
params["min_version"] = min_version

response = requests.get(porter_endpoint, params=params)
response.raise_for_status()

data = response.json()
result = sorted(data["result"]["ursulas"], key=lambda x: x.lower())
ursulas = data["result"]["ursulas"]
if domain != MAINNET:
# /get_ursulas is used for sampling (instead of /bucket_sampling)
# so the json returned is slightly different
ursulas = [u["checksum_address"] for u in ursulas]

result = sorted(ursulas, key=lambda x: x.lower())
return result
Loading