Skip to content

Conversation

@psfoley
Copy link
Member

@psfoley psfoley commented Oct 14, 2025

No description provided.

Signed-off-by: Patrick Foley <patrick@flower.ai>
# Verify the FAB hash
verified_fab_hash = hashlib.sha256(fab.content).hexdigest()
if verified_fab_hash != fab.hash_str:
raise RuntimeError(
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: a RuntimeError is thrown for consistency with SuperLink when it receives a FAB contents that can't be verified: https://github.com/adap/flower/blob/main/framework/py/flwr/superlink/servicer/control/control_servicer.py#L136-L138

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for pointing me to the ControlServicer. I think there’s a key difference between how it’s run by the SuperLink and how it works here: raising a RuntimeError won’t crash the SuperLink, but in this case, it could crash the SuperNode since the exception is raised in the main thread.

More broadly, one of our goals is to ensure the robustness of the SuperNode, i.e., it shouldn’t crash due to recoverable issues. So, we have two possible approaches here:

  1. Handle gracefully: Generate an error message as the reply to the original instruction message and suppress the exception, allowing the SuperNode to continue running.
  2. Fail fast: Crash the SuperNode (either by raising an exception or by setting an exit code and calling the flwr_exit function). Receiving an invalid FAB from the SuperLink could indicate that the SuperLink is compromised, in which case it might not be safe to maintain the connection.

Personally, I lean toward option 2, which is essentially what you’re doing here, but I’m curious to hear your thoughts.
Cc @danieljanes and @jafermarq

@github-actions github-actions bot added the Maintainer Used to determine what PRs (mainly) come from Flower maintainers. label Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintainer Used to determine what PRs (mainly) come from Flower maintainers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants