Skip to content

Conversation

@konradkonrad
Copy link
Contributor

@konradkonrad konradkonrad commented Dec 19, 2025

This implements API endpoints for event based decryption triggers.
WIP/TODO:

  • check TODO comments
  • codepath for RegisterEventIdentity is untested so far
  • consistency in json parameter naming: camel vs snake case
  • Add new endpoints (/compile_event_trigger_definition, /register_event_trigger) to rate limiting

Fixes #74

See also https://github.com/shutter-network/shutter-api?tab=readme-ov-file#1b-register-an-identity-with-event-based-decryption-triggers-wip

konradkonrad and others added 8 commits December 19, 2025 13:34
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
@blockchainluffy blockchainluffy marked this pull request as ready for review December 29, 2025 11:15
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.
Copy link
Collaborator

@ylembachar ylembachar left a 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.

@ylembachar
Copy link
Collaborator

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)
Copy link
Collaborator

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.

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.

Update Shutter API to include ETDs

4 participants