Closed grdddj closed 1 year ago
we can move wallets.json
but everything else is used in firmware generation so that's a no-go. instead we probably want to add the trezor-common
submodule again
ACK on the coins_details.py
changes
we can move
wallets.json
but everything else is used in firmware generation so that's a no-go. instead we probably want to add thetrezor-common
submodule again
So we would keep just the simplified versions of coin_info.py
and coins_details.py
here and would have the trezor-common
submodule for access to the defs
directory, and we would be using the local ethereum-lists
instead of defs/ethereum-lists
?
Seems alright to me, but cannot we still delete at least coins_details.py
and the coinmarket things from trezor-common
, or will we keep using it there?
So we would keep just the simplified versions of
coin_info.py
andcoins_details.py
here and would have thetrezor-common
submodule for access to thedefs
directory, and we would be using the localethereum-lists
instead ofdefs/ethereum-lists
?
Done like so in the force-push, with do_coins_details.sh
script in the root
Seems alright to me, but cannot we still delete at least
coins_details.py
and the coinmarket things fromtrezor-common
, or will we keep using it there?
coins_details yes. coinmarketcap no because it's used by some other script that calculates fee limits
So we would keep just the simplified versions of
coin_info.py
andcoins_details.py
here and would have thetrezor-common
submodule for access to thedefs
directory, and we would be using the localethereum-lists
instead ofdefs/ethereum-lists
?
exactly -- defs/ethereum-lists will not exist there soon so we need the local version
can't we use coin_info.py
from trezor-common though? seems more robust in case the format of things in defs/ changes
can't we use
coin_info.py
from trezor-common though? seems more robust in case the format of things in defs/ changes
Unfortunately, we cannot (easily), because the functions _load_ethereum_networks
and _load_erc20_tokens
are no longer there, they are replaced by _load_builtin_ethereum_networks
and *builtin*tokens
, which do not do what we want.
We could probably do some monkey-patching of these functions or define our own collect_coin_info
(and then coin_info_with_duplicates
), but it seems too much hacky for me
uhmm but we should be taking the eth/erc20 info from definitions-latest
and not from trezor-common. in fact you can completely ignore eth
and erc20
categories coming from coin_info
...for that matter, if we have trezor-common submodule, we could use coin_info
to get the list of builtins instead of downloading it, right?
...for that matter, if we have trezor-common submodule, we could use
coin_info
to get the list of builtins instead of downloading it, right?
Correct, good point. Done in cc2a6bb
Turned out I had a bug in the command updating the submodules - they would never be updated this way :)
Fixed in 6b795e8
Currently, I am unable to finish downloading the new definitions, as the connection to coingecko
is unreliable for me - tried two times with the same results (script taking a couple of minutes and then throwing this error):
requests.exceptions.RetryError: HTTPSConnectionPool(host='api.coingecko.com', port=443): Max retries exceeded with url: /api/v3/coins/markets?order=market_cap_desc&page=1&per_page=100&sparkline=false&vs_currency=usd (Caused by ResponseError('too many 502 error responses'))
Also, updating the trezor-common
submodule broke the coins_details.py
(deleted coins_details.override.json
, modified support.json
). Because of the support.json
, where most of the coins are missing now, we are getting only around 70
coins, the rest is ignored in check_missing_data
because they are neither t1_enabled
nor t2_enabled
. Trying to fix it somehow
(script taking a couple of minutes and then throwing this error):
increase delays between requests?
the rest is ignored in
check_missing_data
because they are neithert1_enabled
nort2_enabled
.
I went briefly through the code and you don't seem to be using definitions-latest
at all?
not sure if that was unclear before, but let me repeat: eth and erc20 data from trezor-common should be completely ignored, and instead filled with local data from definitions-latest. you can just hardcode t1_enabled and t2_enabled to true for this local data.
increase delays between requests?
Will try
I went briefly through the code and you don't seem to be using
definitions-latest
at all? not sure if that was unclear before, but let me repeat: eth and erc20 data from trezor-common should be completely ignored, and instead filled with local data from definitions-latest. you can just hardcode t1_enabled and t2_enabled to true for this local data.
That's right, I do not use definitions-latest.json
during coins_details.json
update, I take all the ETH
data from local ethereum-lists/{chains,tokens}
(and do not take any ETH
data from trezor-common
). We probably need to read from ethereum-lists
because of all the links
and wallet
data. It is a good idea to enforce t1_enabled = t2_enabled = True
for all the things from definitions-latest.json
, but there should be the same coins as we get from ethereum-lists
. Will try it
but there should be the same coins as we get from
ethereum-lists
no, because you're not doing the "fetch buttload of tokens from coingecko" step that way :) and yes, we want to output, at least for now, the coingecko tokens as part of coins-details.
our definitions-latest doesn't have homepage links, i'll check if we need them, hopefully not. github entry we can ignore wallets, we can hardcode mew + mycrypto (+ metamask?) as before, plus anything coming from wallets.json
one thing unclear is how to handle "same token on different networks", because our data does not have that linkage iirc. for now let's do it the easy way and consider these as separate entries.
(i don't remember whether coins-details is a list or a dict? if it is a dict, we can make it a list to simplify the matter of unique keys)
it looks like coingecko was under a DDoS yesterday and the errors you see might be countermeasures. it's possible that we'll need to wait longer for this to work again
Can it be related to this: https://satoshilabs.slack.com/archives/C03QP26JEN8/p1679769069464689 ?
our definitions-latest doesn't have homepage links, i'll check if we need them, hopefully not.
Confirmed that we don't, so you can remove the "links" section too. I don't think we need "type" either. we still need name, shortcut, t1_enabled, t2_enabled, wallet.
The suggestions above were applied in recent commits.
There are currently more than 12700
entries in coins_details.json
.
It is a dict, and it seems the issue of "same token on different networks" is being handled by the construction of the keys into this dict - erc20:{CHAIN}:{SHORTCUT}
- so the same tokens on different networks (CHAIN) are there once for each network.
Some questions:
testnet
networks? in the old code some of them were filtered out (those with Testnet
in the name), but some others were still included (like Ropsten
or Rinkeby
)wallet=WALLETS_ETH_3RDPARTY
- do we want to include Suite
into it as well?coins_details.json
has correct data now, we could share the current state with somebody who can validate itSome questions:
not sure about answers, i'll find out.
- generally not sure if
coins_details.json
has correct data now, we could share the current state with somebody who can validate it
the format is confirmed ok
- should we include all the
testnet
networks? in the old code some of them were filtered out (those withTestnet
in the name), but some others were still included (likeRopsten
orRinkeby
)- currently all the ETH have
wallet=WALLETS_ETH_3RDPARTY
- do we want to includeSuite
into it as well?
let's ignore these issue for this iteration and see what comes up. keep in mind that half the processing is now happening elsewhere so they might do their own filtering?
- generally not sure if
coins_details.json
has correct data now, we could share the current state with somebody who can validate itthe format is confirmed ok
- should we include all the
testnet
networks? in the old code some of them were filtered out (those withTestnet
in the name), but some others were still included (likeRopsten
orRinkeby
)- currently all the ETH have
wallet=WALLETS_ETH_3RDPARTY
- do we want to includeSuite
into it as well?let's ignore these issue for this iteration and see what comes up. keep in mind that half the processing is now happening elsewhere so they might do their own filtering?
Thanks for the verification. Seems coingecko
API is alright now, I was able to call the ./do_update.sh
and generate the most up-to-date versions of definitions and coins-details. We have around 12850
coins currently
should we include all the testnet networks? in the old code some of them were filtered out (those with Testnet in the name), but some others were still included (like Ropsten or Rinkeby) Do not include all testnet networks. currently all the ETH have wallet=WALLETS_ETH_3RDPARTY- do we want to include Suite into it as well? Yes, please include Suite.
Approving after discussion with Jirka and eshop team.
Fixes https://github.com/trezor/definitions/issues/7:
coins_details.json
from this repository - by runningpython coins_details/coins_details.py
ethereum-lists/{chains,tokens}
as theeth_definitions
, it should be compatible withdefinitions-latest.json
png
icons and other stuff was deleted