{"action":"created","issue":{"url":"https://api.github.com/repos/Racecraft/digibytewallet-core/issues/7","repository_url":"https://api.github.com/repos/Racecraft/digibytewallet-core","labels_url":"https://api.github.com/repos/Racecraft/digibytewallet-core/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/Racecraft/digibytewallet-core/issues/7/comments","events_url":"https://api.github.com/repos/Racecraft/digibytewallet-core/issues/7/events","html_url":"https://github.com/Racecraft/digibytewallet-core/issues/7","id":304038348,"number":7,"title":"DigiByte Bug Bounty #1: Synchronizing with the DigiByte blockchain stalls periodically.","user":{"login":"gto90","id":33842337,"avatar_url":"https://avatars3.githubusercontent.com/u/33842337?v=4","gravatar_id":"","url":"https://api.github.com/users/gto90","html_url":"https://github.com/gto90","followers_url":"https://api.github.com/users/gto90/followers","following_url":"https://api.github.com/users/gto90/following{/other_user}","gists_url":"https://api.github.com/users/gto90/gists{/gist_id}","starred_url":"https://api.github.com/users/gto90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gto90/subscriptions","organizations_url":"https://api.github.com/users/gto90/orgs","repos_url":"https://api.github.com/users/gto90/repos","events_url":"https://api.github.com/users/gto90/events{/privacy}","received_events_url":"https://api.github.com/users/gto90/received_events","type":"User","site_admin":false},"labels":[{"id":756266770,"url":"https://api.github.com/repos/Racecraft/digibytewallet-core/labels/bug","name":"bug","color":"ee0701","default":true},{"id":756266773,"url":"https://api.github.com/repos/Racecraft/digibytewallet-core/labels/help%20wanted","name":"help wanted","color":"33aa3f","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-03-10T03:43:14Z","updated_at":"2018-03-11T15:51:58Z","closed_at":null,"author_association":"NONE","body":"# Impact\r\nStalled blockchain synchronization prevents the sync progress indicator from progressing and new blocks and transactions from being added to the local wallet.\r\n\r\n# Components\r\nThe primary affected component is the digiwallet-core SPV library.  Secondary affected components are the digibytewallet-android and digibytewallet-ios mobile clients.\r\n\r\n# Details\r\nGenerally, the blockchain synchronization behavior of the iOS or Android wallets is unremarkable.  However, periodically the sync progress view will cease to make further progress causing the application to fail to retrieve new blocks and transactions.  This incorrect, periodic behavior usually manifests itself after the initial wallet sync has completed, but not in all cases.  It usually stalls after several days of not having opened the wallet or rescanning the blockchain from the application menu.\r\n\r\n# Reproduction Environments\r\nThere are two environments in which you can reproduce this issue:\r\n## iOS\r\nIn order to be able to reproduce this issue via the digibytewallet-ios client, you will need a suitable Apple computer capable of running the latest version of the Xcode IDE.  Once you have your Xcode environment set up, you need to clone the following these steps:\r\n\r\n1. Clone the following GitHub repository: https://github.com/Racecraft/digibytewallet-ios\r\n1. Use [cocoapods](https://cocoapods.org) and run the `pod install` command.\r\n1. Open the xcworkspace file named `breadwallet.xcworkspace`\r\n1. Build and run the DigiWallet for iOS application on any iOS simulator you have configured.\r\n\r\n## Android\r\nIn order to be able to reproduce this issue via the digibytewallet-android client, you will need a computer with the latest version of Google’s Android Studio installed and configured.  Once you have your Android Studio environment set up, you need to clone the following these steps:\r\n\r\n1. Clone the following GitHub repository: https://github.com/Racecraft/digibytewallet-android\r\n1. Open the project in Android Studio and allow Gradle to sync\r\n1. You can now build and run the DigiByte for Android application on any AVD you have configured using the Debug build variant.\r\n\r\n# Steps to Reproduce\r\nTo reproduce the issue please attempt all of the following:\r\n\r\n1. Create a new wallet\r\n1. Restore a wallet from a seed phrase\r\n1. Rescan the blockchain from the menu\r\n\r\n## Expected Behavior\r\nWhenever a synchronization with the blockchain is happening, the user will be presented with a sync progress indicator view.  This view should show steady and consistent progress with the date on the view increasing and the progress bar filling up.\r\n\r\n## Observed Behavior\r\nPeriodically, the sync progress indicator will stop updating and remain stalled on a given date.  When this happens, the user's only recourse is to force quit the application and restart where the sync progress view will usually continue without issue.  In some rare cases, sync will get into a state that requires the user to delete the application and reinstall forcing a fresh sync from either the checkpoint closest to the wallet creation date or the earliestKeyTime.\r\n\r\nWhen the sync process stalls, one of two patterns can be observed in the respective environment's console logs.  These patterns will loop indefinitely until the user force quits the application.  No other method is known to recover once this application state is entered:\r\n\r\n### iOS\r\n```\r\n76.184.81.189:12024 connect error: Operation timed out\r\n76.184.81.189:12024 disconnected\r\n96.58.224.14:12024 connecting\r\n84.26.82.96:12024 Connection reset by peer\r\n84.26.82.96:12024 disconnected\r\n84.26.82.96:12024 mempool request failed\r\n94.130.69.23:12022 connecting\r\n```\r\nor\r\n```\r\n52.173.197.109:12024 got inv with 1 item(s)\r\n104.209.37.175:12024 got inv with 1 item(s)\r\n52.173.197.109:12024 got inv with 1 item(s)\r\n104.209.37.175:12024 got inv with 1 item(s)\r\n52.173.197.109:12024 got inv with 1 item(s)\r\n104.209.37.175:12024 got inv with 1 item(s)\r\n52.173.197.109:12024 got inv with 1 item(s)\r\n104.209.37.175:12024 got inv with 1 item(s)\r\n```\r\n\r\n# Bounty Award\r\nThe solution accepted by the DigiByte Core development team will be rewarded with 100,000 DGB.\r\n\r\n# Bounty Payout Process\r\n\r\n- Code will need to be published on Github\r\n- Code merged with main branch\r\n- Will be reviewed by a lead wallet developer and also by another senior DigiByte developer\r\n- Code commits will then be built into a test build and initial Q/A testing around it done\r\n- If Q/A comes back good, funds will be sent from the wallet to a DigiByte address of your choosing\r\n- Alternatively additional debugging may be required to ensure the code is of a good standard free of regressions."},"comment":{"url":"https://api.github.com/repos/Racecraft/digibytewallet-core/issues/comments/372125503","html_url":"https://github.com/Racecraft/digibytewallet-core/issues/7#issuecomment-372125503","issue_url":"https://api.github.com/repos/Racecraft/digibytewallet-core/issues/7","id":372125503,"user":{"login":"gto90","id":33842337,"avatar_url":"https://avatars3.githubusercontent.com/u/33842337?v=4","gravatar_id":"","url":"https://api.github.com/users/gto90","html_url":"https://github.com/gto90","followers_url":"https://api.github.com/users/gto90/followers","following_url":"https://api.github.com/users/gto90/following{/other_user}","gists_url":"https://api.github.com/users/gto90/gists{/gist_id}","starred_url":"https://api.github.com/users/gto90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gto90/subscriptions","organizations_url":"https://api.github.com/users/gto90/orgs","repos_url":"https://api.github.com/users/gto90/repos","events_url":"https://api.github.com/users/gto90/events{/privacy}","received_events_url":"https://api.github.com/users/gto90/received_events","type":"User","site_admin":false},"created_at":"2018-03-11T15:51:58Z","updated_at":"2018-03-11T15:51:58Z","author_association":"NONE","body":"@SmartArray and @ploenne ,  Between the two of you it seems like sync is so far not stalling at all for me on iOS.  We will need to push out a TestFlight build to put it through the paces so if both of you could PM me in telegram an email I can use for TestFlight I'd like to get a test build in your hands.\r\n\r\nAlso, we'll still need to work to see what Android needs to also resolve it's sync issue but iOS is looking strong right now.\r\n\r\n@ChillingSilence could you please also work to get @SmartArray added to the bounty #1 telegram channel.  I'd like to chat in there about how we can perhaps share the bounty between both engineers as both contained fixes that helped get iOS going.  Of course Android was a part of this bounty, so we'll need to discuss that as well."}}
{"actor":{"display_login":"gto90"}}