Skip to content

Conversation

@millioner
Copy link
Collaborator

🚧🚧🚧 UNDER CONSTRUCTION 🚧🚧🚧

@coderabbitai
Copy link

coderabbitai bot commented Nov 28, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dsperse-intergration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Member

@HudsonGraeme HudsonGraeme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

"""
bt.logging.info(SYNC_LOG_PREFIX + f"Downloading {url} to {file_path}...")
try:
with requests.get(url, timeout=FIVE_MINUTES * 2, stream=True) as response:

Check warning

Code scanning / Bandit

Call to requests without timeout Warning

Call to requests without timeout
Comment on lines +123 to +127
# def deserialize(self) -> str | None:
# """
# unpack proof
# """
# return self.proof

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.

Copilot Autofix

AI 6 days ago

The best way to fix this problem is to remove the commented-out code block entirely (lines 124–128) from the DSliceProofGenerationDataModel class in neurons/protocol.py. This avoids confusion and keeps the codebase clean. Since the code is not active and there is no corresponding attribute, removing it will not affect existing functionality. This change requires deleting these lines only—no imports, definitions, or other changes are necessary.


Suggested changeset 1
neurons/protocol.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/neurons/protocol.py b/neurons/protocol.py
--- a/neurons/protocol.py
+++ b/neurons/protocol.py
@@ -121,8 +121,4 @@
     slice_num: Optional[str] = None
     run_uid: Optional[str] = None
 
-    # def deserialize(self) -> str | None:
-    #     """
-    #     unpack proof
-    #     """
-    #     return self.proof
+
EOF
@@ -121,8 +121,4 @@
slice_num: Optional[str] = None
run_uid: Optional[str] = None

# def deserialize(self) -> str | None:
# """
# unpack proof
# """
# return self.proof

Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
from execution_layer.base_input import BaseInput
from execution_layer.input_registry import InputRegistry
from _validator.models.request_type import RequestType
import random

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'random' is not used.

Copilot Autofix

AI 1 day ago

To fix the problem, simply delete the line import random from the code, since it is unused. This will clean up unnecessary dependencies, and have no effect on the operation of the current code. The change should be made only to line 6 of neurons/deployment_layer/model_b4a373270b59e2b9d5aac05e41df8cdff76a252f5543e00fcd87f2626b37360c/input.py, with no other edits necessary.

Suggested changeset 1
neurons/deployment_layer/model_b4a373270b59e2b9d5aac05e41df8cdff76a252f5543e00fcd87f2626b37360c/input.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/neurons/deployment_layer/model_b4a373270b59e2b9d5aac05e41df8cdff76a252f5543e00fcd87f2626b37360c/input.py b/neurons/deployment_layer/model_b4a373270b59e2b9d5aac05e41df8cdff76a252f5543e00fcd87f2626b37360c/input.py
--- a/neurons/deployment_layer/model_b4a373270b59e2b9d5aac05e41df8cdff76a252f5543e00fcd87f2626b37360c/input.py
+++ b/neurons/deployment_layer/model_b4a373270b59e2b9d5aac05e41df8cdff76a252f5543e00fcd87f2626b37360c/input.py
@@ -3,7 +3,6 @@
 from execution_layer.base_input import BaseInput
 from execution_layer.input_registry import InputRegistry
 from _validator.models.request_type import RequestType
-import random
 import json
 from pathlib import Path
 
EOF
@@ -3,7 +3,6 @@
from execution_layer.base_input import BaseInput
from execution_layer.input_registry import InputRegistry
from _validator.models.request_type import RequestType
import random
import json
from pathlib import Path

Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
from dsperse.src.prover import Prover

import cli_parser
from _validator.api import ValidatorAPI

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'ValidatorAPI' is not used.

Copilot Autofix

AI 1 day ago

To fix this unused import, simply delete the line containing from _validator.api import ValidatorAPI in neurons/execution_layer/dsperse_manager.py. This ensures that only necessary dependencies are included, improving code clarity and slightly reducing overhead. No additional changes to other code are required, as the symbol is not referenced elsewhere in the shown snippet.


Suggested changeset 1
neurons/execution_layer/dsperse_manager.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/neurons/execution_layer/dsperse_manager.py b/neurons/execution_layer/dsperse_manager.py
--- a/neurons/execution_layer/dsperse_manager.py
+++ b/neurons/execution_layer/dsperse_manager.py
@@ -10,7 +10,7 @@
 from dsperse.src.prover import Prover
 
 import cli_parser
-from _validator.api import ValidatorAPI
+
 from _validator.models.dslice_request import DSliceQueuedProofRequest
 from _validator.models.request_type import RequestType
 from deployment_layer.circuit_store import circuit_store
EOF
@@ -10,7 +10,7 @@
from dsperse.src.prover import Prover

import cli_parser
from _validator.api import ValidatorAPI

from _validator.models.dslice_request import DSliceQueuedProofRequest
from _validator.models.request_type import RequestType
from deployment_layer.circuit_store import circuit_store
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
]
self.runs = {} # run_uid -> run data (slices etc.), used by validator only

def generate_dslice_requests(self) -> Iterable[DSliceQueuedProofRequest]:

Check notice

Code scanning / CodeQL

Explicit returns mixed with implicit (fall through) returns Note

Mixing implicit and explicit returns may indicate an error, as implicit returns always return None.

Copilot Autofix

AI 1 day ago

The best way to fix the issue is to ensure that all exit paths for generate_dslice_requests either use yield or, if intended to return without yielding any value, use a generator return that is explicit and correct for a generator function. Specifically, instead of return [] when self.circuits is empty (line 36), we should use explicit generator syntax to yield zero items: return, which correctly exhausts the generator. This ensures consistent generator behaviour, removes the misleading return of a list, preserves existing functionality, and improves readability/intent.

Edit the code block in the file neurons/execution_layer/dsperse_manager.py, for the function generate_dslice_requests, specifically replacing return [] with just an explicit return statement.

No imports or other changes are required.

Suggested changeset 1
neurons/execution_layer/dsperse_manager.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/neurons/execution_layer/dsperse_manager.py b/neurons/execution_layer/dsperse_manager.py
--- a/neurons/execution_layer/dsperse_manager.py
+++ b/neurons/execution_layer/dsperse_manager.py
@@ -33,7 +33,7 @@
         """
         if not self.circuits:
             # there are already requests stacked, do not generate new DSlice requests
-            return []
+            return
 
         circuit = random.choice(self.circuits)
         run_uid = datetime.now().strftime("%Y%m%d%H%M%S%f")
EOF
@@ -33,7 +33,7 @@
"""
if not self.circuits:
# there are already requests stacked, do not generate new DSlice requests
return []
return

circuit = random.choice(self.circuits)
run_uid = datetime.now().strftime("%Y%m%d%H%M%S%f")
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
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

Successfully merging this pull request may close these issues.

3 participants