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

feat: add bootloader hash to ProgramInfo #52

Merged
merged 3 commits into from
Feb 10, 2025
Merged

feat: add bootloader hash to ProgramInfo #52

merged 3 commits into from
Feb 10, 2025

Conversation

glihm
Copy link
Collaborator

@glihm glihm commented Feb 9, 2025

This PR solved two issues:

  1. The fact is registered using the program hash of the bootloader, that boatloads the Layout Bridge program. Piltover was using the Layout Bridge program hash. This PR addresses that by adding the bootloader program hash to the ProgramInfo.
  2. The Layout Bridge program wasn't verified (only SNOS was), which could have cause any bootloaded program to be accepted by Piltover. There is now an explicit check of the Layout Bridge program hash extracted from the program_output.

This PR makes also easier to debug Piltover execution when the fact is not found for the given parameters, which previously panicked with Index out of bounds.

Copy link
Contributor

Choose a reason for hiding this comment

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

i think at this point where we check output 3 times, we could wrap this in some function validate input to abstract that from update function

Copy link
Contributor

@chudkowsky chudkowsky left a comment

Choose a reason for hiding this comment

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

LGTM, i would think about wrapping some stuff into function to make update state function more clear

@glihm
Copy link
Collaborator Author

glihm commented Feb 10, 2025

LGTM, i would think about wrapping some stuff into function to make update state function more clear

Thank you for the review. Yes and as discussed with @xJonathanLEI, we may rework at this occasion the inputs. Since the layout bridge is for now required due to the lack of support for dynamic proof verification, having an enum instead of several inputs could make it more flexible for testing also, when only the SNOS output could be sent instead of having to mock the layout_bridge one too.

@glihm glihm merged commit fb9d988 into main Feb 10, 2025
7 checks passed
@glihm glihm deleted the dev/bootloader-hash branch February 10, 2025 17:56
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.

2 participants