Fix Avalanche transaction history sync - #1085
Open
j0ntz wants to merge 1 commit into
Open
Conversation
Contributor
Author
📸🪓 Test evidence
avax wallet search 🪓 HACK-FORCED: avax tx history after resync Captured by the agent's in-app test run (build-and-test). |
All three evmscan servers configured for Avalanche had stopped answering, so txlist, txlistinternal and tokentx never returned. The RPC adapter still served balances, nonce, block height and broadcast, so wallets looked healthy while history stayed blank. Point the evmscan adapter at Routescan, already used for Botanix and HyperEVM. Leave gastracker off, since Routescan reports gas in wei while fetchFeesFromEvmScan assumes Etherscan's gwei and multiplies by 1e9.
j0ntz
marked this pull request as ready for review
August 10, 2026 20:54
j0ntz
force-pushed
the
jon/avax-tx-history-routescan
branch
from
August 10, 2026 20:54
2e73419 to
b15ed5a
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.


CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
none
Description
Asana task
Asana: https://app.asana.com/1/9976422036640/project/1200382638405084/task/1216409263474102
AVAX wallets show balances and send fine, but transaction history never syncs. The RPC adapter covers balance, nonce, block height and broadcast, so a wallet looks healthy while its history stays blank; only the evmscan adapter fetches transactions, and all three servers configured for Avalanche have stopped answering.
Verified live against a real C-Chain address, using the AVAX key from
env.jsonAVALANCHE_INIT:https://api.etherscan.io(V2,chainid=43114)status 0 NOTOK— "Free API access is not supported for this chain. Please upgrade your api plan for full chain coverage."https://api.avascan.info/v2/network/mainnet/evm/43114/etherscand3rhlnpz39fui8.cloudfront.nethas no records.https://api.snowscan.xyzstatus 0 NOTOK— "You are using a deprecated V1 endpoint, switch to Etherscan API V2".Replaced with Routescan's etherscan-compatible endpoint, which this repo already uses for Botanix (chain 3637) and HyperEVM (999). It needs no API key and answers every action
EvmScanAdapterissues:txlist,txlistinternal,tokentx,proxy/eth_blockNumber,proxy/eth_getTransactionCount,account/balance. Its path containsetherscan, so theserver.includes('etherscan')guards infetchBlockheightandfetchNoncepass.gastrackerSupportis dropped in the same change. Routescan'sgastracker/gasoraclereports gas in wei (SafeGasPrice 57,699,304 against an RPCeth_gasPriceof 53,313,756 wei), whilefetchFeesFromEvmScanassumes Etherscan's gwei and multiplies byWEI_MULTIPLIER. Today the flag is inert because every server throws, soEthereumEngine.updateNetworkFeesfalls through tofetchFeesFromRpc. A working evmscan server would let the evmScan provider win that loop'sbreakand write a 1e9x-inflated gasPrice, which becomesmaxFeePerGason this EIP-1559 chain. Leaving the flag off preserves today's effective fee behavior.Production note (needs a separate operator action)
This change fixes the plugin default, but it does not by itself fix existing installs.
EthereumTools.updateInfoPayloadrunsmergeDeeply(networkInfo, infoPayload), andmergeDeeplyreplaces arrays rather than merging them, so the info server'snetworkAdapterConfigswins outright. The live payload the app fetches (/v2/coreRollup?appId=edge&...) currently serves Avalanche exactly the two dead servers:[ { "type": "rpc", "servers": ["https://api.avax.network/ext/bc/C/rpc", "..."], "ethBalCheckerContract": "0xd023d153a0dfa485130ecfde2faa7e612ef94818" }, { "type": "evmscan", "gastrackerSupport": true, "servers": ["https://api.etherscan.io"] }, { "type": "evmscan", "gastrackerSupport": true, "servers": ["https://api.avascan.info/v2/network/mainnet/evm/43114/etherscan"] } ]That value lives in the
corePluginsInternal2CouchDB document in the info server'sinfo_datadatabase, whichsyncedDocumentreads from Couch. The repo'sdefaultJson/dbInfo/corePluginsInternal2.jsonis empty and only seeds a fresh database, so no edge-info-server PR reaches production. Someone with info-server access needs to replace that Avalanche entry's two evmscan configs with:{ "type": "evmscan", "servers": ["https://api.routescan.io/v2/network/mainnet/evm/43114/etherscan"] }Until then every existing Edge install keeps querying the dead servers regardless of which plugin version it ships.
Testing
verify-repo.shpasses (CHANGELOG check, install, prepare, eslint on changed files,npm test).EvmScanAdapteragainst the live network with the shipped AvalanchenetworkInfo:fetchBlockheight→ 92496927,fetchNonce→ 173624, andfetchTxspaged roughly 200 pages of realtxlistdata throughprocessEvmScanTransaction.transactionList/txIdList/txIdMap) on a build carrying this change, and its transaction history repopulated from the network. Reaching that state required a local, uncommitted hack to drop the info server'snetworkAdapterConfigsso the plugin default under test was what ran; the hack is reverted and the branch is clean.Known limitation, unchanged by this PR
An address with more than 10,000 transactions still fails to page: Routescan answers
Result window is too large, PageNo x Offset size must be less than or equal to 10000. Etherscan V2 returns the identical error at the same boundary, so this is a pre-existingEvmScanAdapterpagination limit affecting every EVM chain, not a Routescan regression.Note
Medium Risk
Changes only default network adapter config for history sync and fee-source selection; wrong gas-oracle handling was explicitly avoided, but production still depends on info-server payload overrides for many users.
Overview
Avalanche C-Chain transaction history was broken because every configured
evmscanindexer failed (paid Etherscan V2 for chain 43114, dead Avascan DNS, Snowscan on retired V1), while RPC still handled balance, nonce, and broadcast—so wallets looked fine with empty history.The plugin default in
avalancheInfo.tsnow pointsEvmScanAdapterat Routescan’s etherscan-compatible API (same pattern as Botanix and HyperEVM).gastrackerSupportis removed so a working evmscan source cannot feed gas-oracle values in wei through code that expects Etherscan gwei and would inflate EIP-1559 fees; fees stay on the RPC path.CHANGELOG documents the fix. Existing installs may still use dead servers until the info server’s
networkAdapterConfigsis updated separately (array merge replaces plugin defaults).Reviewed by Cursor Bugbot for commit b15ed5a. Bugbot is set up for automated code reviews on this repo. Configure here.