Skip to content

Commit

Permalink
Fix: Added aggregate_address argument on ExecuteOnAleph policy.
Browse files Browse the repository at this point in the history
  • Loading branch information
nesitor committed Jul 23, 2024
1 parent c2fa6fb commit d1afdcb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/aleph_vrf/coordinator/executor_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ class ExecuteOnAleph(ExecutorSelectionPolicy):
Select executors at random on the aleph.im network.
"""

def __init__(self, vm_function: ItemHash, crn_score_threshold: float = 0.95):
def __init__(self, vm_function: ItemHash, aggregate_address: Optional[str] = None, crn_score_threshold: float = 0.95):
self.vm_function = vm_function
self.crn_score_threshold = crn_score_threshold
self.aggregate_address = aggregate_address

async def _list_compute_nodes(self) -> AsyncIterator[ComputeResourceNode]:
"""
Expand Down Expand Up @@ -141,7 +142,8 @@ async def _get_unauthorized_nodes(self, unauthorized_nodes_list_path: Optional[P
named `unauthorized_node_list.json` in the working directory.
"""
aggregate_unauthorized_list = []
if settings.VRF_AGGREGATE_ADDRESS:
aggregate_address = self.aggregate_address or settings.VRF_AGGREGATE_ADDRESS
if aggregate_address:
aggregate_unauthorized_list = await _get_unauthorized_node_list_aggregate(settings.VRF_AGGREGATE_ADDRESS)

file_unauthorized_nodes_list = self._get_unauthorized_nodes_file(
Expand Down
2 changes: 1 addition & 1 deletion src/aleph_vrf/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Settings(BaseSettings):
description="VRF function to use.",
)
VRF_AGGREGATE_ADDRESS: Optional[str] = Field(
default="0xA07B1214bAe0D5ccAA25449C3149c0aC83658874",
default=None,
description="Address posting the `corechannel` aggregate.",
)
VRF_AGGREGATE_KEY = Field(
Expand Down

0 comments on commit d1afdcb

Please sign in to comment.