-
Notifications
You must be signed in to change notification settings - Fork 2
Add endpoints for event based decryption triggers #79
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
Conversation
Note: it changed from 'use 3rd party tooling' but does not mention, that the provided compiler implementation is opinionated, and 3rd party tooling could provide more flexible event triggers. Namely triggers that allow for some parameters to be omitted, e.g. topic0
… get_data_for_encryption endpoint
Whitelisting only certain contracts for event based decryption triggers does not help with reducing or limiting load on keypers. Instead, if there is need for it, we would need to limit the total number of active event based triggers.
The parameter is not necessary for event based identities, because it can be derived from signing key.
The specialized func was used in only one place and could produce semantically incorrect results. I inlined the switch statement and added an explicit error case on default.
In order to avoid overflow for large integers, the 'number' argument is parsed from a decimal string.
ylembachar
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.
Looks good to me. Thank you for the updates. Added a comment about a potential contract update.
|
Added this issue to track a few discussions and todos post-deployment on Chiado: #84 |
| lp.ValuePredicate.Op = shs.BytesEq | ||
| lp.ValuePredicate.ByteArgs = [][]byte{Align(val)} | ||
| length = uint64(len([]byte(arg.Bytes)) / 32) | ||
| length = uint64(len(val) / shs.Word) |
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.
We should align val here as well, as otherwise, the value is not padded to 32 bytes, and calculation will not work for less than 32 byte words. A unit test would be helpful here to catch these cases. I'll add this to the improvements needed, for now, we can just deploy and pad manually as a workaround.
This implements API endpoints for event based decryption triggers.
WIP/TODO:
TODOcommentsRegisterEventIdentityis untested so far/compile_event_trigger_definition,/register_event_trigger) to rate limitingFixes #74
See also https://github.com/shutter-network/shutter-api?tab=readme-ov-file#1b-register-an-identity-with-event-based-decryption-triggers-wip