BM-601: Simplify callback logic by removing (somewhat weak) call-once property #372
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a change I am proposing, but do not have consensus on. Opening it to discuss.
With #335, we added support for callbacks on fulfillment and we aimed to have the callback trigger at most once per request. Since that PR, I realized two issues:
fulfill
methods and have the callback trigger again for the same request (ID). This is because we use thefulfilled
flag to indicate whether the callback has run, but that flag is not set until after the callback is complete.My opinion is that the call-once property does not buy us much. If there is an action which modifies state, the called application will have its own notion of what to do when the callback arrives, and ensuring it behaves reasonably if the same call is repeated is a common requirement for a wide range of applications.
As an advantage to dropping this property as a goal, benchmarks show it would save ~800 gas per fulfillment.