Skip to content

catch up#1

Open
Corey-Code wants to merge 794 commits into
vidulum:masterfrom
trezor:master
Open

catch up#1
Corey-Code wants to merge 794 commits into
vidulum:masterfrom
trezor:master

Conversation

@Corey-Code
Copy link
Copy Markdown
Member

No description provided.

pragmaxim and others added 30 commits May 6, 2026 11:15
* chore: remove legacy socket.io interface

* chore: remove dead code using OnNewTxAddr used only in obsolete socket.io interface

* remove empty socketio.go
… calls costs (#1502)

* fix(erc20): stop ERC20 batch fallback from amplifying RPC calls

When a batched balanceOf returned per-element errors or unparseable
results, the worker fell back to a single eth_call per affected
contract — a wallet with N tokens could turn into N+1 RPCs on a single
bad batch, and parse failures triggered retries that were never going
to succeed (malformed returns indicate non-conforming contracts, not
transient faults).

* chore(erc4626): accountInfo only returns erc4626 support in tokens

accountInfo for an address holding any number of ERC4626 vaults now costs 0 RPC for vault flagging, regardless of vault count. The flag is populated for free during block indexing.

* feat(eth): add Multicall3 aggregate3 primitive

Add ABI encoding/decoding and an EthereumRPC aggregate3 method for batched eth_calls. This prepares ERC4626 contractInfo enrichment to use one RPC round-trip.

* chore(erc4626): store asset contract on ContractInfo

Add Erc4626AssetContract to ContractInfo serialization so ERC4626 enrichment can cache the vault asset address without a DB version bump.

* feat(erc4626): use multicalls for contractInfo enrichment

Replace sequential vault eth_calls with Multicall3 batches, cache the asset address, and keep cold/warm paths covered by focused tests.

* feat(erc4626): cache per-block enrichment calls

Add a contract/block-keyed LRU with singleflight so repeated or concurrent contractInfo requests share ERC4626 enrichment work.

* fix(erc4626): require totalAssets before persisting vaults

Persist ERC4626 metadata only after asset() returns a non-zero address and totalAssets() decodes successfully; cover failed totalAssets paths.

* feat(erc4626): backfill vault flags from accountInfo

Probe ERC4626 support lazily from accountInfo and persist negative results so already-synced vaults can be recognized without repeated RPC work.

* fix(erc4626): persist only confirmed vault probes

Stop treating negative ERC-4626 probes as authoritative.
Re-probe non-confirmed fungible contracts on demand and
persist only positive vault detections.

* fix(erc4626): pin vault data to response height

Use the best block selected by getContractInfo for both the
reported blockHeight and the ERC-4626 multicall/cache key,
so protocol data is built from the same chain state.

* chore(4626): negative vault caching

* chore(4626): multicall chunking

* chore(4626): cleanup

* chore(4626): simplification and code deduplication

* chore(4626): remove problematic optimization that saves one multicall per new vault discovery globally

* fixing Base test data

* chore(erc4626): new cfContract protocol format

contractInfo :=
  baseContractInfo
  [protocolExtensions]

baseContractInfo :=
  name: string
  symbol: string
  standard: string
  decimals: vuint
  createdInBlock: vuint
  destructedInBlock: vuint

protocolExtensions :=
  extensionHeader: vuint
  extensionCount: vuint
  repeated extensionCount times:
    protocolId: vuint
    payloadLength: vuint
    payload: bytes

* chore(erc4626): more unit tests for the protocol

* chore(erc4626): rocksdb contracts column family documentation

* chore(erc4626): bound a concurrent unit test of singlefliht optimization

* chore(erc4626): tighten singleFlight cache

* chore(erc4626): multicall3 probe

* chore(erc4626): singleflight cache fix

* chore(erc4626): bestBlock warning

* chore(erc4626): cleanup

* chore(erc4626): avg block time config

* chore(erc4626): reorg safety

* chore(erc4626): simplification and cleanup

* fix(erc4626): populate-after-write race

* chore(erc4626): polishing API

* chore(erc4626): cleanup

* chore(erc4626): use averageBlockTimeMs for the negative-cache TTL

* chore(erc4626): rename towards new convention
…n rates when "platformVsCurrency" was changed
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/trezor/blockbook/sessions/114623cb-c06f-422f-a952-bc35ad93c8a2

Co-authored-by: pragmaxim <8983344+pragmaxim@users.noreply.github.com>
GetAddress always loaded every mempool tx of an address to compute
unconfirmedBalance/Sending/Receiving, even when the caller only
needed basic info (balance, tx counts). For hot addresses with many
mempool entries this dominated the response cost. Reflected that in xpub too.
* feat(tron): add claimedvotereward to tron chain extra data

* feat(tron): improve perfomance of GetAddressChainExtraData by calling the backend concurrently

* tests(tron): add stakingpool fixture to tron fakechain and update public tron test

* feat(tron): omit stakinginfo/chainextradata for non-existent/non-activated addresses

* fix(tron): tests missing "address" field

* feat(tron): show stakinginfo on the UI /account page

* fix(tron): calculation of available/total voting power

* docs(tron): description of the address.chainextra resource fields

* feat(tron): add check for malformed vote count

* docs(tron): updated stakingInfo field description

* feat(tron): add mutex to MockTronHTTPClient to avoid data races for concurrent methods

* fix(tron): getting delegated frozen balance for staking account info

* feat(tron): add tron tx memo/note and process it safely

* refactor(tron): simplify stakedBalance computation in tronBuildStakingInfo

big.Int.Add(x, y) stores the sum in the receiver and does not mutate
its operands, so the inner new(big.Int).Set(stakedBandwidth) copy was
redundant. Drop it and pass stakedBandwidth directly to Add.

No behavior change; same result, one fewer big.Int allocation per call.

* fix(tron): clamp negative limit to zero in tronAvailableResource

Previously, a negative limit returned by the Tron API combined with a
smaller used value would yield a non-sensical positive availability
(e.g., limit=10, used=-50 -> 60). All other resource fields in
tronBuildStakingInfo already clamp negative values to zero, so make
tronAvailableResource symmetric and treat any non-positive limit as
zero availability.

Real Tron nodes shouldn't return negative limits, but this hardens the
function against malformed responses.

* docs(tron): document TRON_POWER exclusion from stakedBalance

In Stake 2.0, only BANDWIDTH and ENERGY freeze types produce frozen
TRX; TRON_POWER is a derived voting weight, not a separate stake.
The frozenV2 loop in tronBuildStakingInfo therefore intentionally
ignores TRON_POWER entries when summing stakedBalance.

Add an inline comment explaining the intent so the silent drop is
not mistaken for a missing case.

* chore(metrics): increase metric buckets for rpc latency

* fix(tron): mempool tx not retrieved using HTTP API

* fix(tron): set default GasUsed as "0x0" so it is packed to txcache without error

* tests(tron): test correct setting of "GasUsed" in transaction

* fix(tron): correctly process mempool txs using the gettransactionfrompending endpoint

* fix(tron): tron api does not always return "data" in tx logs

* fix(tron): allow the addrDesc to be empty for specific tron transactions (voting, etc.) to avoid parse errors

* refactor(tron): more readable max capping of values in tron staking info

---------

Co-authored-by: pragmaxim <pragmaxim@gmail.com>
* fix: skip ZMQ initialization when message_queue_binding is empty

* refactor(btc-zeromq): refactor the zeromq init code

---------

Co-authored-by: Jakub Jerabek <xjerab28@stud.fit.vutbr.cz>
Cap descriptor change lists, bound xpub scan width, and trim the xpub cache by entry count.
Keep change-list parsing broad enough to return explicit limit errors and report descriptor regex compilation failures clearly.
Agent-Logs-Url: https://github.com/trezor/blockbook/sessions/8fda94ae-e21d-46ff-abe7-9bbfa806c56f

Co-authored-by: pragmaxim <8983344+pragmaxim@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.