Skip to content

Commit 4f3c411

Browse files
authored
Merge branch 'main' into upgrade-sdfl
2 parents 22f6580 + c9017f1 commit 4f3c411

File tree

16 files changed

+168
-70
lines changed

16 files changed

+168
-70
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,44 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: "[BUG]"
4+
title: "[BUG] <brief summary>"
55
labels: bug
66
assignees: ''
7-
87
---
98

10-
**Describe the bug**
11-
A clear and concise description of what the bug is.
9+
<!--
10+
Thank you for reporting a bug! Please fill out the sections below to help us resolve the issue.
11+
-->
12+
13+
## Describe the bug
14+
_A clear and concise description of what the bug is._
1215

13-
**To Reproduce**
14-
Steps to reproduce the behavior:
16+
## To Reproduce
17+
_Steps to reproduce the behavior:_
1518
1. Go to '...'
16-
2. Click on '....'
17-
3. Deploy the following scenario '....'
19+
2. Click on '...'
20+
3. Deploy the following scenario '...'
1821
4. See error
1922

20-
**Expected behavior**
21-
A clear and concise description of what you expected to happen.
23+
## Expected behavior
24+
_A clear and concise description of what you expected to happen._
25+
26+
## Screenshots
27+
_If applicable, add screenshots to help explain your problem._
28+
29+
## Logs, Error Messages, or Stack Traces
30+
_If applicable, please paste relevant logs, error messages, or stack traces here. Use code blocks (```) for readability._
2231

23-
**Screenshots**
24-
If applicable, add screenshots to help explain your problem.
32+
## Environment (please complete the following information):
33+
- OS: [e.g. MacOS, Windows 11]
34+
- Python version: [e.g. 3.10, 3.11]
35+
- Affected component(s): [e.g. Frontend, Controller, Core, etc.]
2536

26-
**Desktop (please complete the following information):**
27-
- OS: [e.g. MacOS, Windows 11]
28-
- Python version [e.g. 3.10, 3.11]
37+
## Additional context
38+
_Add any other context about the problem here._
2939

30-
**Additional context**
31-
Add any other context about the problem here.
40+
<!--
41+
Before submitting, please:
42+
- Search existing issues to avoid duplicates.
43+
- Remove any sensitive information.
44+
-->
Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
---
22
name: Feature request
33
about: Suggest an idea for this project
4-
title: "[FEATURE]"
4+
title: "[FEATURE] <brief summary>"
55
labels: enhancement
66
assignees: ''
7-
87
---
98

10-
**Is your feature request related to a problem? Please describe.**
11-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9+
<!--
10+
Thank you for suggesting a feature! Please fill out the sections below to help us understand your request.
11+
-->
12+
13+
## Is your feature request related to a problem? Please describe.
14+
_A clear and concise description of what the problem is. Example: "I'm always frustrated when..."_
15+
16+
## Describe the solution you'd like
17+
_A clear and concise description of what you want to happen._
18+
19+
## Describe alternatives you've considered
20+
_A clear and concise description of any alternative solutions or features you've considered._
1221

13-
**Describe the solution you'd like**
14-
A clear and concise description of what you want to happen.
22+
## Motivation and Benefits
23+
_Why is this feature important? What value does it add? Who will benefit from it?_
1524

16-
**Describe alternatives you've considered**
17-
A clear and concise description of any alternative solutions or features you've considered.
25+
## Additional context
26+
_Add any other context, screenshots, or links to related issues/PRs here._
1827

19-
**Additional context**
20-
Add any other context or screenshots about the feature request here.
28+
<!--
29+
Before submitting, please:
30+
- Search existing issues to avoid duplicates.
31+
- Remove any sensitive information.
32+
-->

.github/ISSUE_TEMPLATE/question.md

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
11
---
22
name: Question
33
about: Ask a question about a specific topic
4-
title: "[QUESTION]"
4+
title: "[QUESTION] <brief summary>"
55
labels: question
66
assignees: ''
7-
87
---
98

10-
** What is your question related to? **
11-
A specific topic or area of the project.
12-
- [ ] Core
9+
<!--
10+
Thank you for your question! Please fill out the sections below to help us assist you.
11+
-->
12+
13+
## What is your question related to?
14+
_Select the most relevant area(s) of the project:_
1315
- [ ] Frontend
14-
- [ ] Other (please specify)
16+
- [ ] Controller
17+
- [ ] Core
18+
- [ ] Other (please specify):
19+
20+
## Question
21+
_Describe your question in detail. Be as specific as possible._
22+
23+
## Context or Background
24+
_Provide any relevant context, background information, or links to documentation that might help us understand your question._
25+
26+
## Code Snippets or Screenshots (if applicable)
27+
_If your question relates to a specific piece of code or error, please include code snippets or screenshots here._
1528

16-
** What is the question you would like to ask? **
17-
Please provide a detailed description of your question.
29+
<!--
30+
Before submitting, please:
31+
- Search existing issues to avoid duplicates.
32+
- Remove any sensitive information.
33+
-->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
<!--
2+
Thank you for contributing to the project!
3+
Please fill out the following template to help us review your pull request.
4+
-->
5+
6+
# Pull Request
7+
8+
## Summary
9+
<!-- Please provide a short summary of your changes and the motivation behind them. -->
10+
11+
## Checklist
112
- [ ] I have read and agree to the **[Contributor License Agreement](../CLA.md)**.
2-
- [ ] Every commit is signed off with `Signed-off-by`.
3-
- [ ] I have read and agree to the **[Contributing Guidelines](../CONTRIBUTING.md)**.
13+
- [ ] I have read and agree to the **[Contributing Guidelines](../CONTRIBUTING.md)**.
14+
- [ ] I have completed the Signed-off-by and Date fields below.
15+
16+
## Related Issues
17+
<!-- List any related issues, e.g. "Closes #123" -->
18+
19+
## Signed-off-by
20+
Signed-off-by: *Your Name (email)*
21+
Date: *YYYY-MM-DD*

.github/workflows/main.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,23 @@ on:
88
types: [opened, synchronize, reopened, ready_for_review]
99

1010
jobs:
11-
quality:
12-
runs-on: ubuntu-latest
13-
steps:
14-
- name: Check out
15-
uses: actions/checkout@v4
16-
17-
- uses: actions/cache@v4
18-
with:
19-
path: ~/.cache/pre-commit
20-
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
21-
22-
- name: Set up the environment
23-
uses: ./.github/actions/setup-env
24-
25-
- name: Run checks
26-
run: make check
11+
# The checking system is disabled for now
12+
# quality:
13+
# runs-on: ubuntu-latest
14+
# steps:
15+
# - name: Check out
16+
# uses: actions/checkout@v4
17+
18+
# - uses: actions/cache@v4
19+
# with:
20+
# path: ~/.cache/pre-commit
21+
# key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
22+
23+
# - name: Set up the environment
24+
# uses: ./.github/actions/setup-env
25+
26+
# - name: Run checks
27+
# run: make check
2728

2829
check-docs:
2930
runs-on: ubuntu-latest

.pre-commit-config.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ repos:
99
- id: end-of-file-fixer
1010
- id: trailing-whitespace
1111

12-
- repo: https://github.com/astral-sh/ruff-pre-commit
13-
rev: v0.7.2
14-
hooks:
15-
- id: ruff
16-
args: [--exit-non-zero-on-fix]
17-
- id: ruff-format
12+
# The checking system is disabled for now
13+
# - repo: https://github.com/astral-sh/ruff-pre-commit
14+
# rev: v0.7.2
15+
# hooks:
16+
# - id: ruff
17+
# args: [--exit-non-zero-on-fix]
18+
# - id: ruff-format

CLA.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ By submitting a pull request, patch or code snippet, you agree that:
1818
your contribution and that Authors may use, sell or license the
1919
software containing your contribution at its sole discretion.
2020

21-
Signed-off-by: *\<Your Name\> (\<email\>)*
22-
Date: *\<YYYY-MM-DD\>*
21+
Signed-off-by: *Enrique Tomás Martínez Beltrán (enriquetomas@um.es)*
22+
Date: *2025-06-25*

nebula/controller/scenarios.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ def __init__(self, scenario, user=None):
700700
participant_config["adversarial_args"]["attack_params"] = node_config["attack_params"]
701701
else:
702702
participant_config["adversarial_args"]["attack_params"] = {"attacks": "No Attack"}
703-
participant_config["defense_args"]["reputation"] = self.scenario.reputation
703+
participant_config["defense_args"]["reputation"] = self.scenario.reputation
704704

705705
participant_config["mobility_args"]["random_geo"] = self.scenario.random_geo
706706
participant_config["mobility_args"]["latitude"] = self.scenario.latitude

nebula/core/engine.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,22 @@ async def _federation_federation_models_included_callback(self, source, message)
398398
finally:
399399
await self.cm.get_connections_lock().release_async()
400400

401+
async def _reputation_share_callback(self, source, message):
402+
try:
403+
logging.info(f"handle_reputation_message | Trigger | Received reputation message from {source} | Node: {message.node_id} | Score: {message.score} | Round: {message.round}")
404+
405+
current_node = self.addr
406+
nei = message.node_id
407+
408+
if hasattr(self, '_reputation') and self._reputation is not None:
409+
if current_node != nei:
410+
key = (current_node, nei, message.round)
411+
if key not in self._reputation.reputation_with_all_feedback:
412+
self._reputation.reputation_with_all_feedback[key] = []
413+
self._reputation.reputation_with_all_feedback[key].append(message.score)
414+
except Exception as e:
415+
logging.exception(f"Error handling reputation message: {e}")
416+
401417
""" ##############################
402418
# REGISTERING CALLBACKS #
403419
##############################

nebula/core/nebulaevents.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,26 @@ async def get_event_data(self) -> tuple[str, tuple[float, float]]:
362362

363363
async def is_concurrent(self) -> bool:
364364
return True
365+
366+
class DuplicatedMessageEvent(NodeEvent):
367+
"""
368+
Event triggered when a message is received that has already been processed.
369+
370+
Attributes:
371+
source (str): The address of the node that sent the duplicated message.
372+
"""
373+
374+
def __init__(self, source: str, message_type: str):
375+
self.source = source
376+
377+
def __str__(self):
378+
return f"DuplicatedMessageEvent from {self.source}"
365379

380+
async def get_event_data(self) -> tuple[str]:
381+
return (self.source)
382+
383+
async def is_concurrent(self) -> bool:
384+
return True
366385

367386
""" ##############################
368387
# ADDON EVENTS #

0 commit comments

Comments
 (0)