-
Notifications
You must be signed in to change notification settings - Fork 9
Prioritize meta #570
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
Open
AaronVasquez
wants to merge
13
commits into
master
Choose a base branch
from
prioritize-meta
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Prioritize meta #570
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
688bef6
Adds method to get metachunk
AaronVasquez 844c742
Adds test
AaronVasquez f37d493
Fetching meta is method on brokerbrokertx instead of upload session
AaronVasquez 2008d76
Fetches meta chunk data from badger
AaronVasquez 47d6c7d
Cleanup
AaronVasquez f29e379
nit cleanup
AaronVasquez bee79c8
extract PoW function from PowJob
AaronVasquez c6141c7
Do PoW when payment event detected
AaronVasquez f877e3f
Check if meta chunk found
AaronVasquez 9ac53f9
Merge branch 'master' into prioritize-meta
AaronVasquez f5a8b62
Merge branch 'master' into prioritize-meta
AaronVasquez 148b81f
Merge branch 'master' into prioritize-meta
AaronVasquez 1f78f17
Fix code climate
AaronVasquez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this will still work while we have OYSTER_PAYS set to "true"? I don't think the for loop that this is in will ever get hit, because I think this:
...will not find any brokerTxs as long as we are in prod mode with OYSTER_PAYS set to true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do you think the best place to attach meta is if OYSTER_PAYS is true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's not really any obvious places in the existing code that come to mind. Could perhaps check in ProcessAndStoreChunkData if OYSTER_PAYS is true and if the metadata chunk is one of the chunks being passed into the method, and if so, do the PoW with that chunk immediately?
So there's basically two things we care about, whether the user has paid, and whether we have all the important data for the metadata chunk (hash and message). The best fit might be the check_if_all_data_is_ready task, but then you'd be waiting for all the chunk data to arrive and the treasure chunk to be created to, which is potentially longer than we'd want to wait.
Unfortunately I think the best thing to do is create a new task that runs every few seconds...it could check for (paid) alpha sessions with a next_idx_to_attach of 0 or (paid) beta sessions with a next_idx_to_attach of
session.NumChunks - 1. We could either add a new status to upload_sessions for when the meta is already attached, or we could useVerifyChunkMessagesMatchRecordorFindTransactionsand see if anything is on the tangle for the metachunk(s) we found, and only attach if we found nothing.There may be a simpler option that I'm missing.