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

Solve issue about return already existing request_ids #36

Merged
merged 1 commit into from
Sep 27, 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
14 changes: 7 additions & 7 deletions src/aleph_vrf/coordinator/vrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,6 @@ async def _generate_vrf(
executor_selection_policy: ExecutorSelectionPolicy,
request_id: Optional[str] = None,
) -> PublishedVRFResponse:
executors = await executor_selection_policy.select_executors(nb_executors)
selected_nodes_json = json.dumps(
[executor.node for executor in executors], default=pydantic_encoder
).encode(encoding="utf-8")

nonce = generate_nonce()

if request_id:
existing_message = await get_existing_vrf_message(aleph_client, request_id)
if existing_message:
Expand All @@ -120,6 +113,13 @@ async def _generate_vrf(

return message

executors = await executor_selection_policy.select_executors(nb_executors)
selected_nodes_json = json.dumps(
[executor.node for executor in executors], default=pydantic_encoder
).encode(encoding="utf-8")

nonce = generate_nonce()

vrf_request = VRFRequest(
nb_bytes=nb_bytes,
nb_executors=nb_executors,
Expand Down
Loading