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

fix: Skip BSP confirm file keys that have failed to update or create a payment stream #341

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

snowmead
Copy link
Contributor

Moved the payment stream create and update block in bsp_confirm_storing to skip file keys if those operations have failed.

Moving these operations at the top avoids any possibility for any storage elements from being updated when they shouldn't if we skipped the file key.

See the audit issue raised for more details.

Fixes issue #30

Copy link
Contributor

@santikaplan santikaplan left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines +1248 to +1249
// We ignore all errors from the payment stream operations (create/update) and add the file key to the skipped_file_keys set.
// This operation must be the first one to be executed before we being updating storage elements as to avoid any potential case
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// We ignore all errors from the payment stream operations (create/update) and add the file key to the skipped_file_keys set.
// This operation must be the first one to be executed before we being updating storage elements as to avoid any potential case
// All errors from the payment stream operations (create/update) are ignored, and the file key is added to the `skipped_file_keys` set.
// This operation must be executed first, before updating any storage elements, to prevent potential cases

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