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

Rewards wallet is not regenerated when wallet data is unreadable #18717

Closed
zenparsing opened this issue Oct 12, 2021 · 2 comments · Fixed by brave/brave-core#10409
Closed

Rewards wallet is not regenerated when wallet data is unreadable #18717

zenparsing opened this issue Oct 12, 2021 · 2 comments · Fixed by brave/brave-core#10409

Comments

@zenparsing
Copy link

Currently, if the Rewards wallet info stored in Preferences becomes unreadable (most commonly due to a pre-1.31 version of the browser losing access to OSCrypt keys) a new wallet is not created for the user.

When the user is performing an action that requires a payment ID and the existing data cannot be read, we should:

  • Write to the event log, recording that wallet corruption was detected.
  • Generate a new wallet for the user.
  • Display previous wallet IDs for the user on the rewards-internals page.
@stephendonner
Copy link

stephendonner commented Oct 25, 2021

Verified PASSEDusing

Brave 1.32.81 Chromium: 95.0.4638.54 (Official Build) beta (x86_64)
Revision d31a821ec901f68d0d34ccdbaea45b4c86ce543e-refs/branch-heads/4638@{#871}
OS macOS Version 11.6.1 (Build 20G224)
New Profile

Steps:

  1. new profile
  2. launched Brave
  3. opened a new-tab page
  4. clicked on Start using Rewards
  5. triggered an ad; confirmed I got credited for viewing it
  6. shut down Brave
  7. edited Preferences and removed the payment_id snippet
  8. relaunched Brave
  9. triggered and viewed push-notification ads, an inline-content ad, and a promoted-content ad
  10. confirmed I was given BAT for the above
  11. opened brave://rewards-internals

Confirmed:

  • previous (corrupted) wallet ID is displayed
  • newly created wallet ID is displayed
  • there's an event in the log recording that wallet corruption was detected
example example example example example example example example example
Screen Shot 2021-10-25 at 2 56 06 PM Screen Shot 2021-10-25 at 2 58 35 PM Screen Shot 2021-10-25 at 2 58 52 PM Screen Shot 2021-10-25 at 3 01 32 PM Screen Shot 2021-10-25 at 3 01 34 PM Screen Shot 2021-10-25 at 3 02 31 PM Screen Shot 2021-10-25 at 3 02 39 PM Screen Shot 2021-10-25 at 3 04 21 PM Screen Shot 2021-10-25 at 3 04 48 PM
Upgrade from 1.31.x to 1.32.x

Steps:

  1. installed 1.31.87
  2. launched Brave
  3. enabled Rewards
  4. viewed a few ads
  5. shut down Brave
  6. opened Preferences and deleted the payment_id section; saved changes
  7. renamed the folder to Brave-Browser-Beta
  8. relaunched Brave using 1.32.81
  9. viewed an ad and claimed UGP grants

Confirmed:

  • newly created wallet ID is displayed after upgrade
  • previous (corrupted) wallet ID is displayed
  • there's an event in the log recording that wallet corruption was detected
  • confirmed ad rewards are reconciled and unblinded tokens are redeemed successfully after regenerating a new wallet ID

1.31.x

example example example example
Screen Shot 2021-10-26 at 8 28 50 AM Screen Shot 2021-10-26 at 8 29 06 AM Screen Shot 2021-10-26 at 8 31 46 AM Screen Shot 2021-10-26 at 8 33 01 AM
[4183:259:1026/083732.889549:INFO:ad_rewards.cc(67)] Failed to reconcile ad rewards due to invalid wallet
[4183:259:1026/083732.891089:VERBOSE1:confirmations.cc(115)] Retry failed confirmations in 0 hours, 0 minutes, 1 second at 8:37 AM
[4183:259:1026/083732.891756:INFO:redeem_unblinded_payment_tokens.cc(55)] Failed to redeem unblinded payment tokens due to invalid wallet
[4183:259:1026/083732.891814:VERBOSE1:account.cc(202)] Failed to redeem unblinded payment tokens

1.32.x

example example example example example example
Screen Shot 2021-10-26 at 8 37 37 AM Screen Shot 2021-10-26 at 8 37 58 AM Screen Shot 2021-10-26 at 8 40 00 AM Screen Shot 2021-10-26 at 8 40 10 AM Screen Shot 2021-10-26 at 8 40 29 AM Screen Shot 2021-10-26 at 8 40 51 AM
[6065:259:1026/090912.855540:VERBOSE1:redeem_unblinded_payment_tokens.cc(110)] OnRedeemUnblindedPaymentTokens
[6065:259:1026/090912.855655:VERBOSE6:redeem_unblinded_payment_tokens.cc(112)] URL Response:
  URL: https://ads-serve.bravesoftware.com/v1/confirmation/payment/80f0ed4f-0099-472d-8f83-8bc5d8412de4
  Response Status Code: 200
  Response: {"status":"ok"}
[6065:259:1026/090912.856614:VERBOSE1:account.cc(193)] Successfully redeemed unblinded payment tokens
[6065:259:1026/090912.856936:VERBOSE1:ad_rewards.cc(218)] Reconcile ad rewards
[6065:259:1026/090912.857004:VERBOSE1:ad_rewards.cc(226)] GetPayments
[6065:259:1026/090912.857048:VERBOSE2:ad_rewards.cc(227)] GET /v1/confirmation/payment/{payment_id}
[6065:259:1026/090912.858655:VERBOSE6:ad_rewards.cc(231)] URL Request:
  URL: https://ads-serve.bravesoftware.com/v1/confirmation/payment/80f0ed4f-0099-472d-8f83-8bc5d8412de4
  Method: kGet
[6065:259:1026/090912.859410:VERBOSE1:redeem_unblinded_payment_tokens.cc(72)] Redeem unblinded payment tokens in 0 hours, 19 minutes, 42 seconds at 9:28 AM
[6065:259:1026/090912.915515:VERBOSE1:ad_rewards.cc(240)] OnGetPayments
[6065:259:1026/090912.915622:VERBOSE6:ad_rewards.cc(242)] URL Response:
  URL: https://ads-serve.bravesoftware.com/v1/confirmation/payment/80f0ed4f-0099-472d-8f83-8bc5d8412de4
  Response Status Code: 200
  Response: [{"month":"2021-10","transactionCount":"6","balance":"0.075"}]
[6065:259:1026/090912.916487:VERBOSE1:ad_rewards.cc(263)] Successfully reconciled ad rewards

Verification passed on


Brave | 1.32.81 Chromium: 95.0.4638.54 (Official Build) beta (64-bit)
-- | --
Revision | d31a821ec901f68d0d34ccdbaea45b4c86ce543e-refs/branch-heads/4638@{#871}
OS | Windows 10 Version 21H1 (Build 19043.1288)

Clean profile
  1. Clean profile, enable rewards and view some Ads
  2. Close the brave
  3. Open Preference file from profile folder and delete the Payment id from it and save the changes
  4. Relaunch Brave
  5. View some more ads and claim UGP grants

Confirmed:

  • previous (corrupted) wallet ID is displayed
  • newly created wallet ID is displayed
  • there's an event in the log recording that wallet corruption was detected
  • confirmed ad rewards are reconciled and unblinded tokens are redeemed successfully after generating a new wallet id
Example Example Example Example Example Example Example
image image image image image image image
  • Ads rewards are not reconciled and unblinded payment tokens are not redeemed when the wallet is corrupted
[Oct 26, 2021, 8:24:15.7 PM:ERROR:ad_rewards.cc(67)] Failed to reconcile ad rewards due to invalid wallet
[Oct 26, 2021, 8:24:15.7 PM:ERROR:redeem_unblinded_payment_tokens.cc(55)] Failed to redeem unblinded payment tokens due to invalid wallet
[Oct 26, 2021, 8:24:22.3 PM:ERROR:ledger_impl.cc(579)] Wallet is null

  • Confirmed ad rewards are reconciled and unblinded tokens are redeemed successfully after generating a new wallet id
[14368:14876:1026/203051.092:VERBOSE1:redeem_unblinded_payment_tokens.cc(110)] OnRedeemUnblindedPaymentTokens
[14368:14876:1026/203051.093:VERBOSE6:redeem_unblinded_payment_tokens.cc(112)] URL Response:
  URL: https://ads-serve.bravesoftware.com/v1/confirmation/payment/06c2b978-75b3-4978-b6e4-cf62fe90f0fd
  Response Status Code: 200
  Response: {"status":"ok"}
[14368:14876:1026/203051.098:VERBOSE1:account.cc(193)] Successfully redeemed unblinded payment tokens
[14368:14876:1026/203051.102:VERBOSE1:ad_rewards.cc(218)] Reconcile ad rewards
[14368:14876:1026/203051.108:VERBOSE1:ad_rewards.cc(226)] GetPayments
[14368:14876:1026/203051.109:VERBOSE2:ad_rewards.cc(227)] GET /v1/confirmation/payment/{payment_id}
[14368:14876:1026/203051.111:VERBOSE6:ad_rewards.cc(231)] URL Request:
  URL: https://ads-serve.bravesoftware.com/v1/confirmation/payment/06c2b978-75b3-4978-b6e4-cf62fe90f0fd
  Method: kGet
[14368:14876:1026/203051.112:VERBOSE1:redeem_unblinded_payment_tokens.cc(72)] Redeem unblinded payment tokens in 0 hours, 11 minutes, 44 seconds at 8:42 PM
[14368:14876:1026/203051.491:VERBOSE1:ad_rewards.cc(240)] OnGetPayments
[14368:14876:1026/203051.491:VERBOSE6:ad_rewards.cc(242)] URL Response:
  URL: https://ads-serve.bravesoftware.com/v1/confirmation/payment/06c2b978-75b3-4978-b6e4-cf62fe90f0fd
  Response Status Code: 200
  Response: [{"month":"2021-10","transactionCount":"1","balance":"0.01"}]
[14368:14876:1026/203051.494:VERBOSE1:ad_rewards.cc(263)] Successfully reconciled ad rewards
Upgrade profile
  1. Install 1.31.x RC version and enable rewards
  2. View some ads
  3. Close the browser
  4. Open Preference file from profile folder and delete the Payment_id from it and save the changes done
  5. Rename the profile folder to beta (1.32.x)
  6. Relaunch browser 1.32.x
  7. View an ad and claim UGP grants

Confirmed:

  • newly created wallet ID is displayed after upgrade
  • previous (corrupted) wallet ID is displayed
  • there's an event in the log recording that wallet corruption was detected
  • confirmed ad rewards are reconciled and unblinded tokens are redeemed successfully after generating a new wallet id

1.31.x

Example Example Example Example Example
image image image image image
  • Ads rewards are not reconciled and unblinded payment tokens are not redeemed due to a corrupted wallet
[Oct 26, 2021, 7:09:14.4 PM:ERROR:ad_rewards.cc(73)] Failed to reconcile ad rewards due to invalid wallet
[Oct 26, 2021, 7:09:14.4 PM:ERROR:redeem_unblinded_payment_tokens.cc(62)] Failed to redeem unblinded payment tokens due to invalid wallet

Upgrade to 1.32.x

Example Example Example Example
image image image image
  • Confirmed ad rewards are reconciled and unblinded tokens are redeemed successfully after generating a new wallet id
[21116:19116:1026/194850.348:VERBOSE1:redeem_unblinded_payment_tokens.cc(110)] OnRedeemUnblindedPaymentTokens
[21116:19116:1026/194850.348:VERBOSE6:redeem_unblinded_payment_tokens.cc(112)] URL Response:
  URL: https://ads-serve.bravesoftware.com/v1/confirmation/payment/a3f261be-2c1e-43e6-b9a9-acd1a7642dc0
  Response Status Code: 200
  Response: {"status":"ok"}
[21116:19116:1026/194850.351:VERBOSE1:account.cc(193)] Successfully redeemed unblinded payment tokens
[21116:19116:1026/194850.353:VERBOSE1:ad_rewards.cc(218)] Reconcile ad rewards
[21116:19116:1026/194850.358:VERBOSE1:ad_rewards.cc(226)] GetPayments
[21116:19116:1026/194850.359:VERBOSE2:ad_rewards.cc(227)] GET /v1/confirmation/payment/{payment_id}
[21116:19116:1026/194850.368:VERBOSE6:ad_rewards.cc(231)] URL Request:
  URL: https://ads-serve.bravesoftware.com/v1/confirmation/payment/a3f261be-2c1e-43e6-b9a9-acd1a7642dc0
  Method: kGet
[21116:19116:1026/194850.370:VERBOSE1:redeem_unblinded_payment_tokens.cc(72)] Redeem unblinded payment tokens in 0 hours, 18 minutes, 21 seconds at 8:07 PM
[21116:19116:1026/194850.728:VERBOSE1:ad_rewards.cc(240)] OnGetPayments
[21116:19116:1026/194850.728:VERBOSE6:ad_rewards.cc(242)] URL Response:
  URL: https://ads-serve.bravesoftware.com/v1/confirmation/payment/a3f261be-2c1e-43e6-b9a9-acd1a7642dc0
  Response Status Code: 200
  Response: [{"month":"2021-10","transactionCount":"3","balance":"0.045"}]
[21116:19116:1026/194850.730:VERBOSE1:ad_rewards.cc(263)] Successfully reconciled ad rewards

Brave | 1.32.88 Chromium: 95.0.4638.69 (Official Build) beta (64-bit)
-- | --
Revision | 6a1600ed572fedecd573b6c2b90a22fe6392a410-refs/branch-heads/4638@{#984}
OS | Windows 10 Version 21H1 (Build 19043.1288)

Case 1: corrupted recovery_seed
  1. Clean profile, enable rewards and view some Ads
  2. Close the brave
  3. Open Preference file from profile folder and add junk chars to recovery_seed section and save the changes
  4. Relaunch Brave
  5. View some more ads and claim UGP grants

Confirmed:

  • previous (corrupted) wallet ID is displayed
  • newly created wallet ID is displayed
  • there's an event in the log recording that wallet corruption was detected
  • confirmed ad rewards are reconciled and unblinded tokens are redeemed successfully after generating a new wallet id
Example Example Example Example Example Example
image image image image image image
[16524:13520:1103/130024.256:VERBOSE1:redeem_unblinded_payment_tokens.cc(80)] RedeemUnblindedPaymentTokens
[16524:13520:1103/130024.257:VERBOSE2:redeem_unblinded_payment_tokens.cc(89)] PUT /v1/confirmation/payment/{payment_id}
[16524:13520:1103/130024.263:VERBOSE6:redeem_unblinded_payment_tokens.cc(99)] URL Request:
  URL: https://ads-serve.bravesoftware.com/v1/confirmation/payment/48a71aa8-37f6-4bc8-b366-77e152b624b0
  Content: {"payload":"{\"paymentId\":\"48a71aa8-37f6-4bc8-b366-77e152b624b0\"}","paymentCredentials":[{"credential":{"signature":"XdNoIVqBKDMIczer8qfoyRYO7wGiK7v1eoAbOjd29qGD0d1mXuZzagnu1Y5IodxMgBOGyOsWI5L54cUrpNxt5g==","t":"+J39/aUYzjLPozVT/CEhdgZ/eWUs5cqb0HtDcbVz/2FF+4O49mLIIzT7wbjPDgnHMQBiFisFLUcEM3V/dHSXjQ=="},"publicKey":"Hrgq+Vvq6nFYxkEJpGAyU6D26mdvDXcXcz/fM2ZLfHg="},{"credential":{"signature":"AmViky5YDRbTYz2jIxEy5dnxVayDABp6kuWTt+ndQFORRCLV43S1bb7UBp1sy+6RhEk8BAGm2AY9VpiVWZNmoA==","t":"4wlHAboqyNujlrlnabx+YLhtfGcwdSrccw6ox+DKgMR52A2L64G6wGBgInPe6oq6hjYkpOAURRkBxW86UN9+3A=="},"publicKey":"6JgWYjDtDWAzMSfXFLNEbP5h2q+hZabhX9/DmKkl5Rg="}]}
  Content Type: application/json
  Method: kPut
[16524:13520:1103/130025.559:VERBOSE1:redeem_unblinded_payment_tokens.cc(110)] OnRedeemUnblindedPaymentTokens
[16524:13520:1103/130025.559:VERBOSE6:redeem_unblinded_payment_tokens.cc(112)] URL Response:
  URL: https://ads-serve.bravesoftware.com/v1/confirmation/payment/48a71aa8-37f6-4bc8-b366-77e152b624b0
  Response Status Code: 200
  Response: {"status":"ok"}
[16524:13520:1103/130025.563:VERBOSE1:account.cc(193)] Successfully redeemed unblinded payment tokens
[16524:13520:1103/130203.207:VERBOSE1:ad_rewards.cc(218)] Reconcile ad rewards
[16524:13520:1103/130203.214:VERBOSE1:ad_rewards.cc(226)] GetPayments
[16524:13520:1103/130203.216:VERBOSE2:ad_rewards.cc(227)] GET /v1/confirmation/payment/{payment_id}
[16524:13520:1103/130203.223:VERBOSE6:ad_rewards.cc(231)] URL Request:
  URL: https://ads-serve.bravesoftware.com/v1/confirmation/payment/48a71aa8-37f6-4bc8-b366-77e152b624b0
  Method: kGet
[16524:13520:1103/130204.390:VERBOSE1:ad_rewards.cc(240)] OnGetPayments
[16524:13520:1103/130204.390:VERBOSE6:ad_rewards.cc(242)] URL Response:
  URL: https://ads-serve.bravesoftware.com/v1/confirmation/payment/48a71aa8-37f6-4bc8-b366-77e152b624b0
  Response Status Code: 200
  Response: [{"month":"2021-11","transactionCount":"1","balance":"0.025"}]
[16524:13520:1103/130204.394:VERBOSE1:ad_rewards.cc(263)] Successfully reconciled ad rewards
Case 2: corrupted wallets_brave
  1. Clean profile, enable rewards and view some Ads
  2. Close the brave
  3. Open Preference file from profile folder and add junk chars to wallets.brave section and save the changes
  4. Relaunch Brave
  5. View some more ads and claim UGP grants

Confirmed:

  • previous (corrupted) wallet ID is displayed
  • newly created wallet ID is displayed
  • there's an event in the log recording that wallet corruption was detected
  • confirmed ad rewards are reconciled and unblinded tokens are redeemed successfully after generating a new wallet id
Example Example Example Example
image image image image
------

Verified PASSED on

Brave 1.32.83 Chromium: 95.0.4638.54 (Official Build) beta (64-bit)
Revision d31a821ec901f68d0d34ccdbaea45b4c86ce543e-refs/branch-heads/4638@{#871}
OS Linux
Clean profile
  1. Clean profile, enable rewards and view some Ads
  2. Close the browser
  3. Open Preference file from profile folder and delete the Payment id from it and save the changes
  4. Relaunch Brave
  5. View some more ads and claim UGP grants

Confirmed:

  • previous (corrupted) wallet ID is displayed
  • newly created wallet ID is displayed
  • there's an event in the log recording that wallet corruption was detected
  • confirmed ad rewards are reconciled and unblinded tokens are redeemed successfully after generating a new wallet id
Example Example Example Example Example Example Example Example
Screen Shot 2021-10-27 at 2 49 05 PM Screen Shot 2021-10-27 at 2 57 30 PM Screen Shot 2021-10-27 at 2 53 21 PM Screen Shot 2021-10-27 at 2 53 43 PM Screen Shot 2021-10-27 at 3 02 14 PM Screen Shot 2021-10-27 at 3 16 20 PM Screen Shot 2021-10-27 at 3 16 38 PM Screen Shot 2021-10-27 at 3 17 07 PM
  • Ads rewards are not reconciled and unblinded payment tokens are not redeemed when the wallet is corrupted
[52088:52088:1027/145851.418405:INFO:ad_rewards.cc(67)] Failed to reconcile ad rewards due to invalid wallet
[52088:52088:1027/145851.419748:VERBOSE1:confirmations.cc(115)] Retry failed confirmations in 0 hours, 10 minutes, 26 seconds at 3:09 PM
[52088:52088:1027/145851.420241:INFO:redeem_unblinded_payment_tokens.cc(55)] Failed to redeem unblinded payment tokens due to invalid wallet
  • Confirmed ad rewards are reconciled and unblinded tokens are redeemed successfully after generating a new wallet id
[51656:51656:1027/145543.730176:VERBOSE1:ad_rewards.cc(240)] OnGetPayments
[51656:51656:1027/145543.730274:VERBOSE6:ad_rewards.cc(242)] URL Response:
  URL: https://ads-serve.bravesoftware.com/v1/confirmation/payment/3eaa736f-a656-43d6-9f5a-74980f82dbd5
  Response Status Code: 200
  Response: [{"balance":"0","month":"2021-10","transactionCount":"0"}]
[51656:51656:1027/145543.730570:VERBOSE1:ad_rewards.cc(263)] Successfully reconciled ad rewards
Upgrade profile
  1. Install 1.31.x RC version and enable rewards
  2. View some ads
  3. Close the browser
  4. Open Preference file from profile folder and delete the Payment_id from it and save the changes done
  5. Rename the profile folder to beta (1.32.x)
  6. Relaunch browser 1.32.x
  7. View an ad and claim UGP grants

Confirmed:

  • newly created wallet ID is displayed after upgrade
  • previous (corrupted) wallet ID is displayed
  • there's an event in the log recording that wallet corruption was detected
  • confirmed ad rewards are reconciled and unblinded tokens are redeemed successfully after generating a new wallet id

1.31.x

Example Example Example Example Example
Screen Shot 2021-10-27 at 3 44 17 PM Screen Shot 2021-10-27 at 3 44 29 PM Screen Shot 2021-10-27 at 3 45 41 PM Screen Shot 2021-10-27 at 3 45 55 PM Screen Shot 2021-10-27 at 3 46 30 PM
  • Ads rewards are not reconciled and unblinded payment tokens are not redeemed due to a corrupted wallet
[55728:55728:1027/155108.405735:INFO:ad_rewards.cc(67)] Failed to reconcile ad rewards due to invalid wallet
[54767:54767:1027/154604.407534:INFO:redeem_unblinded_payment_tokens.cc(62)] Failed to redeem unblinded payment tokens due to invalid wallet

Upgrade to 1.32.x

Example Example Example Example
Screen Shot 2021-10-27 at 4 08 12 PM Screen Shot 2021-10-27 at 3 54 27 PM Screen Shot 2021-10-27 at 3 54 32 PM Screen Shot 2021-10-27 at 3 54 38 PM
  • Confirmed ad rewards are reconciled and unblinded tokens are redeemed successfully after generating a new wallet id
[54270:54270:1027/153812.297617:VERBOSE1:ad_rewards.cc(249)] OnGetPayments
[54270:54270:1027/153812.297743:VERBOSE6:ad_rewards.cc(251)] URL Response:
  URL: https://ads-serve.bravesoftware.com/v1/confirmation/payment/ddf18b98-9ce0-435c-b6b4-d3ad7386094b
  Response Status Code: 200
  Response: [{"balance":"0","month":"2021-10","transactionCount":"0"}]
[54270:54270:1027/153812.297792:VERBOSE1:ad_rewards.cc(272)] Successfully reconciled ad rewards

@stephendonner stephendonner added QA/In-Progress Indicates that QA is currently in progress for that particular issue QA Pass-Linux and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels Oct 27, 2021
@stephendonner
Copy link

stephendonner commented Nov 2, 2021

Addendum

Case One: mangled recovery_seed

Steps:

  1. installed 1.31.87
  2. launched Brave
  3. enabled Rewards
  4. viewed a few ads
  5. shut down Brave
  6. opened Preferences and added junk characters to the recovery_seed section; saved changes
  7. renamed the folder to Brave-Browser-Beta
  8. relaunched Brave using 1.32.81
  9. viewed an ad and claimed UGP grants

Confirmed:

  • newly created wallet ID is displayed after upgrade
  • previous (corrupted) wallet ID is displayed
  • there's an event in the log recording that wallet corruption was detected
  • confirmed ad rewards are reconciled and unblinded tokens are redeemed successfully after regenerating a new wallet ID
example example example example example example example example
Screen Shot 2021-11-02 at 10 11 43 AM Screen Shot 2021-11-02 at 10 11 56 AM Screen Shot 2021-11-02 at 10 14 01 AM Screen Shot 2021-11-02 at 10 14 17 AM Screen Shot 2021-11-02 at 10 20 52 AM Screen Shot 2021-11-02 at 10 21 52 AM Screen Shot 2021-11-02 at 10 22 41 AM Sorry, screenshot missing (but work done)
[Nov 02, 2021, 10:15:02.5 AM:ERROR:ad_rewards.cc(67)] Failed to reconcile ad rewards due to invalid wallet
[Nov 02, 2021, 10:15:02.5 AM:ERROR:redeem_unblinded_payment_tokens.cc(55)] Failed to redeem unblinded payment tokens due to invalid wallet
[12879:259:1102/141013.936545:VERBOSE1:ad_rewards.cc(240)] OnGetPayments
[12879:259:1102/141013.936634:VERBOSE6:ad_rewards.cc(242)] URL Response:
 URL: https://ads-serve.bravesoftware.com/v1/confirmation/payment/a26f29ca-d773-4ce3-a45d-d63aa6646a6a
 Response Status Code: 200
 Response: [{"balance":"0","month":"2021-11","transactionCount":"0"}]
[12879:259:1102/141013.937861:VERBOSE1:ad_rewards.cc(263)] Successfully reconciled ad rewards

Case Two: mangled wallets.brave JSON

Steps:

  1. installed 1.31.87
  2. launched Brave
  3. enabled Rewards
  4. viewed a few ads
  5. shut down Brave
  6. opened Preferences and added junk characters to the wallets.brave section; saved changes
  7. renamed the folder to Brave-Browser-Beta
  8. relaunched Brave using 1.32.81
  9. viewed an ad and claimed UGP grants

Confirmed:

  • newly created wallet ID is displayed after upgrade
  • previous (corrupted) wallet ID is displayed
  • there's an event in the log recording that wallet corruption was detected
  • confirmed ad rewards are reconciled and unblinded tokens are redeemed successfully after regenerating a new wallet ID
example example example example example example example example example
Screen Shot 2021-11-03 at 10 47 47 AM Screen Shot 2021-11-03 at 10 47 55 AM Screen Shot 2021-11-03 at 10 51 38 AM Screen Shot 2021-11-03 at 10 51 55 AM Screen Shot 2021-11-03 at 10 54 39 AM Screen Shot 2021-11-03 at 10 54 45 AM Screen Shot 2021-11-03 at 11 03 44 AM Screen Shot 2021-11-03 at 11 03 52 AM Screen Shot 2021-11-03 at 11 03 58 AM
[23404:259:1103/105242.433227:INFO:ad_rewards.cc(67)] Failed to reconcile ad rewards due to invalid wallet
[23404:259:1103/105242.436248:VERBOSE1:confirmations.cc(115)] Retry failed confirmations in 0 hours, 0 minutes, 33 seconds at 10:53 AM
[23404:259:1103/105242.436910:INFO:redeem_unblinded_payment_tokens.cc(55)] Failed to redeem unblinded payment tokens due to invalid wallet
[23404:259:1103/105242.436960:VERBOSE1:account.cc(202)] Failed to redeem unblinded payment tokens
[23545:259:1103/110826.861392:VERBOSE1:ad_rewards.cc(218)] Reconcile ad rewards
[23545:259:1103/110826.861470:VERBOSE1:ad_rewards.cc(226)] GetPayments
[23545:259:1103/110826.861503:VERBOSE2:ad_rewards.cc(227)] GET /v1/confirmation/payment/{payment_id}
[23545:259:1103/110826.862681:VERBOSE6:ad_rewards.cc(231)] URL Request:
  URL: https://ads-serve.bravesoftware.com/v1/confirmation/payment/0c8c5e06-926f-4e4a-b9ec-24cf3b819848
  Method: kGet
[23545:259:1103/110826.864823:VERBOSE1:confirmations.cc(115)] Retry failed confirmations in 0 hours, 1 minute, 15 seconds at 11:09 AM
[23545:259:1103/110826.864928:VERBOSE1:redeem_unblinded_payment_tokens.cc(72)] Redeem unblinded payment tokens in 0 hours, 5 minutes, 32 seconds at 11:13 AM
[23545:259:1103/110827.440728:VERBOSE1:ad_rewards.cc(240)] OnGetPayments
[23545:259:1103/110827.440832:VERBOSE6:ad_rewards.cc(242)] URL Response:
  URL: https://ads-serve.bravesoftware.com/v1/confirmation/payment/0c8c5e06-926f-4e4a-b9ec-24cf3b819848
  Response Status Code: 200
  Response: [{"balance":"0","month":"2021-11","transactionCount":"0"}]
[23545:259:1103/110827.442180:VERBOSE1:ad_rewards.cc(263)] Successfully reconciled ad rewards

Case Three: token clearing in confirmations.json

Steps:

  1. installed 1.31.87
  2. launched Brave
  3. enabled Rewards
  4. viewed a few ads
  5. shut down Brave
  6. opened Preferences and added junk characters to the wallets.brave section; saved changes
  7. renamed the folder to Brave-Browser-Beta
  8. relaunched Brave using 1.32.81
  9. viewed an ad and claimed UGP grants
  10. examined confirmations.json for the following:
  • absence of failed payment tokens
  • absence of unblinded payment tokens

Confirmed:

example example example example example example example example example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment