Severity: major (it blocks #668: with Blockscout off by default, every tracked token would read quantity unknown).
Where
refreshBalances() in src/shared/balances.js reads ETH balances through the RPC endpoint, but every ERC-20 balance comes from fetchTokenBalances(), one Blockscout request per address. Nothing reads a token's balanceOf through the RPC endpoint.
What happens
The tokens a user tracks on the active network have a balance only while Blockscout answers. When it fails, or once it is turned off under #668, Home, AddressDetail and AddressToken have no figure for them, although the RPC endpoint the user chose can answer balanceOf for each.
What should happen
Each refresh (popup and background, both through refreshBalances()) reads the balance of every token tracked on the active network, for every address, with balanceOf through the RPC endpoint, at the decimals the tracked token records. ethers sends these as one batched request. Blockscout's answer, while it is used, only adds tokens the user has not tracked, with their holder counts for the low-holder rule; for a tracked token the RPC figure stands. A balanceOf that fails leaves that token's previous figure as it is, as a failed ETH balance does, and is logged.
Package: src/shared/balances.js (its header: balance fetching via RPC and Blockscout); no new file.
Definition of done
With Blockscout failing, a tracked token shows its balance read through the RPC endpoint; a test that fails on next.
A tracked token that Blockscout also reports shows the RPC figure; an untracked one Blockscout reports is admitted exactly as on next.
README.md says where token balances come from.
Model: opus-5-5
Severity: major (it blocks https://git.eeqj.de/sneak/AutistMask/issues/668: with Blockscout off by default, every tracked token would read `quantity unknown`).
## Where
`refreshBalances()` in `src/shared/balances.js` reads ETH balances through the RPC endpoint, but every ERC-20 balance comes from `fetchTokenBalances()`, one Blockscout request per address. Nothing reads a token's `balanceOf` through the RPC endpoint.
## What happens
The tokens a user tracks on the active network have a balance only while Blockscout answers. When it fails, or once it is turned off under https://git.eeqj.de/sneak/AutistMask/issues/668, Home, AddressDetail and AddressToken have no figure for them, although the RPC endpoint the user chose can answer `balanceOf` for each.
## What should happen
Each refresh (popup and background, both through `refreshBalances()`) reads the balance of every token tracked on the active network, for every address, with `balanceOf` through the RPC endpoint, at the decimals the tracked token records. ethers sends these as one batched request. Blockscout's answer, while it is used, only adds tokens the user has not tracked, with their holder counts for the low-holder rule; for a tracked token the RPC figure stands. A `balanceOf` that fails leaves that token's previous figure as it is, as a failed ETH balance does, and is logged.
Package: `src/shared/balances.js` (its header: balance fetching via RPC and Blockscout); no new file.
## Definition of done
- [ ] With Blockscout failing, a tracked token shows its balance read through the RPC endpoint; a test that fails on `next`.
- [ ] A tracked token that Blockscout also reports shows the RPC figure; an untracked one Blockscout reports is admitted exactly as on `next`.
- [ ] `README.md` says where token balances come from.
Model: opus-5-5
Built in #670: each refresh reads every tracked token's balance at every address with balanceOf through the RPC endpoint, and Blockscout adds only the tokens the user has not tracked. The PR body lists the judgement call and the behaviour change.
Model: opus-5-5
Built in https://git.eeqj.de/sneak/AutistMask/pulls/670: each refresh reads every tracked token's balance at every address with `balanceOf` through the RPC endpoint, and Blockscout adds only the tokens the user has not tracked. The PR body lists the judgement call and the behaviour change.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Severity: major (it blocks #668: with Blockscout off by default, every tracked token would read
quantity unknown).Where
refreshBalances()insrc/shared/balances.jsreads ETH balances through the RPC endpoint, but every ERC-20 balance comes fromfetchTokenBalances(), one Blockscout request per address. Nothing reads a token'sbalanceOfthrough the RPC endpoint.What happens
The tokens a user tracks on the active network have a balance only while Blockscout answers. When it fails, or once it is turned off under #668, Home, AddressDetail and AddressToken have no figure for them, although the RPC endpoint the user chose can answer
balanceOffor each.What should happen
Each refresh (popup and background, both through
refreshBalances()) reads the balance of every token tracked on the active network, for every address, withbalanceOfthrough the RPC endpoint, at the decimals the tracked token records. ethers sends these as one batched request. Blockscout's answer, while it is used, only adds tokens the user has not tracked, with their holder counts for the low-holder rule; for a tracked token the RPC figure stands. AbalanceOfthat fails leaves that token's previous figure as it is, as a failed ETH balance does, and is logged.Package:
src/shared/balances.js(its header: balance fetching via RPC and Blockscout); no new file.Definition of done
next.next.README.mdsays where token balances come from.Model: opus-5-5
Built in #670: each refresh reads every tracked token's balance at every address with
balanceOfthrough the RPC endpoint, and Blockscout adds only the tokens the user has not tracked. The PR body lists the judgement call and the behaviour change.Model: opus-5-5