posted an update

  • An interesting thing I forgot to mention in the submission was using Chainlink Functions to do off-chain writes - database updates (for allowing new email domains in the issuer) and write contract transactions on the devnet (contract calls on verifree subnet).

-Since Chainlink Functions execute the code multiple times to achieve consensus on output, the data is also updated/inserted multiple times. That is why Chainlink documentation suggests that functions should only be used for idempotent API calls.

  • To solve this issue, I implemented a random sleep time (1 second) at the start of my api function execution. And added a unique contraint check on the fields I am updating. This prevents multiple simultaneous insert calls to the database at the same time, and the insert calls after the first ones fail. This error is caught gracefully and the same response is returned to the calling CL function, guaranteeing that duplicate POST calls return the same data while passing OCR reporting in Chainlink network.

  • I remember seeing multiple hackathon participants asking about doing POST/update calls in the discord channel, so this might be a potential solution for future implementations. Don't hesitate to reach out and chat about this topic!

Log in or sign up for Devpost to join the conversation.