-
Notifications
You must be signed in to change notification settings - Fork 106
New dependencies #169
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
base: testnet
Are you sure you want to change the base?
New dependencies #169
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
HudsonGraeme
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
...oyment_layer/model_b4a373270b59e2b9d5aac05e41df8cdff76a252f5543e00fcd87f2626b37360c/input.py
Fixed
Show fixed
Hide fixed
...oyment_layer/model_b4a373270b59e2b9d5aac05e41df8cdff76a252f5543e00fcd87f2626b37360c/input.py
Fixed
Show fixed
Hide fixed
| # def deserialize(self) -> str | None: | ||
| # """ | ||
| # unpack proof | ||
| # """ | ||
| # return self.proof |
Check notice
Code scanning / CodeQL
Commented-out code Note
Show autofix suggestion
Hide autofix suggestion
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.
-
Copy modified line R124
| @@ -121,8 +121,4 @@ | ||
| slice_num: Optional[str] = None | ||
| run_uid: Optional[str] = None | ||
|
|
||
| # def deserialize(self) -> str | None: | ||
| # """ | ||
| # unpack proof | ||
| # """ | ||
| # return self.proof | ||
|
|
...oyment_layer/model_b4a373270b59e2b9d5aac05e41df8cdff76a252f5543e00fcd87f2626b37360c/input.py
Fixed
Show fixed
Hide fixed
...oyment_layer/model_b4a373270b59e2b9d5aac05e41df8cdff76a252f5543e00fcd87f2626b37360c/input.py
Fixed
Show fixed
Hide fixed
| 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
Show autofix suggestion
Hide autofix suggestion
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.
| @@ -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 | ||
|
|
| from dsperse.src.prover import Prover | ||
|
|
||
| import cli_parser | ||
| from _validator.api import ValidatorAPI |
Check notice
Code scanning / CodeQL
Unused import Note
Show autofix suggestion
Hide autofix suggestion
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.
-
Copy modified line R13
| @@ -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 |
| ] | ||
| 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
Show autofix suggestion
Hide autofix suggestion
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.
-
Copy modified line R36
| @@ -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") |
🚧🚧🚧 UNDER CONSTRUCTION 🚧🚧🚧