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

Include a note on reliability of statusOf function #339

Open
smol-ninja opened this issue Nov 25, 2024 · 0 comments
Open

Include a note on reliability of statusOf function #339

smol-ninja opened this issue Nov 25, 2024 · 0 comments
Labels
effort: low Easy or tiny task that takes less than a day. priority: 1 This is important. It should be dealt with shortly. type: docs Changes to documentation. work: clear Sense-categorize-respond. The relationship between cause and effect is clear.

Comments

@smol-ninja
Copy link
Member

The return value of statusOf cannot be relied upon. It can be manipulated by a smart sender. Take the following example:

  1. A call to statusOf is made inside a transaction.
  2. The sender sees the pending tx and front runs it by pausing the stream.
  3. The function returns PAUSED.
  4. The sender sends another tx in the next block to resume the stream.

Therefore, the natspecs of statusOf should mention a note about it as the following:

/// Since Flow offers flexibility to the senders, a sender can pause and resume a stream at any time. Therefore, 
/// it is not recommended to rely solely on the return value of `statusOf`.
@smol-ninja smol-ninja added priority: 0 Do this first before everything else. This is critical and nothing works without this. effort: low Easy or tiny task that takes less than a day. type: docs Changes to documentation. work: clear Sense-categorize-respond. The relationship between cause and effect is clear. labels Nov 25, 2024
@PaulRBerg PaulRBerg added priority: 1 This is important. It should be dealt with shortly. and removed priority: 0 Do this first before everything else. This is critical and nothing works without this. labels Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: low Easy or tiny task that takes less than a day. priority: 1 This is important. It should be dealt with shortly. type: docs Changes to documentation. work: clear Sense-categorize-respond. The relationship between cause and effect is clear.
Projects
None yet
Development

No branches or pull requests

2 participants