Repository navigation
Eth balance snapshot - #4605
Open
Tomasvrba wants to merge 4 commits into
Open
Eth balance snapshot#4605Tomasvrba wants to merge 4 commits into
Tomasvrba wants to merge 4 commits into
Conversation
Contributor
|
Please target master instead of the release branch - It will not make it in time. It is not a regression introduced in 4.53 right? |
Collaborator
Author
No, it's not, it's a pre-existing bug, but @strmci discovered it during release testing I believe. |
The displayed balance is the on-chain balance minus pending outgoing amounts. The updater fetched the block number, then the balances, and checked outgoing transactions at that block number. Etherscan answers eth_call and balancemulti at the latest block regardless of the requested block, and its backends can be a block or more apart. A transaction mined in between was already missing from the balance but still counted as pending, so it was subtracted twice. After sending the whole balance, the account showed a negative balance until the next poll. Read the block number together with all native and ERC20 balances in a single Multicall3 eth_call and check outgoing transactions at the block it returns, so both describe the same chain state. Multicall3 is deployed at the same address on mainnet and Sepolia.
Use the same Multicall3 read as the full update.
Etherscan can report a new balance before it has indexed the transaction. The transaction then only appeared with the next poll, up to five minutes later. The active account probe already refreshed again after 30 seconds. Do that for every update that changes the on-chain balance of a synced account, so it also covers the update after sending and the periodic poll. It stops by itself once the balance no longer changes.
When the block number and balances cannot be read, no account of that chain is updated. Retry after 30 seconds instead of waiting for the next poll, doubling the delay up to the poll interval while it keeps failing.
Tomasvrba
force-pushed
the
eth-balance-snapshot
branch
from
November 17, 2026 21:56
d8b378a to
26167a9
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix negative balances after Send all. Separate balance and block-number requests could observe different blocks, causing a confirmed outgoing transaction to be deducted from a balance that already included the debit.