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

Review of #335: simplify fulfillAndPay by extracting callback #364

Merged
merged 2 commits into from
Mar 5, 2025

Conversation

nategraf
Copy link
Member

@nategraf nategraf commented Mar 5, 2025

  • simplify fulfillAndPay function by extracting callbacks
  • update gas snapshots

@nategraf
Copy link
Member Author

nategraf commented Mar 5, 2025

On my way home I realized two things:

  1. Using reentrance, it is possible to violate the "exactly once" property of the callback under this implementation. The target would either need to be crafted to do so, or itself call out to a contract crafted to do so.
  2. The "exactly once" calling is not a meaningful guarantee, because I can issue an arbitrary number (N) of identical callbacks by creating N requests with the same image ID and requirements and fulfilling each with the same journal and seal. The called contract would find this indistinguishable from the "exactly once" property being broken.

My inclination is to not attempt to provide this property, and instead simplify the code by removing this check (implemented here by checking the fulfillment status of the request).

Copy link
Contributor

@willpote willpote left a comment

Choose a reason for hiding this comment

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

Nice!

@willpote willpote merged commit 2f27f94 into willpote/callbacks-2 Mar 5, 2025
@willpote willpote deleted the victor/review-335 branch March 5, 2025 14:55
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