[go: up one dir, main page]

/chains/main/blocks/(level|hash|head)/context/contracts returns incomplete list of contracts

Implicit contracts with balance of 0 do not appear in the list.

Steps to reproduce:

Fetch a contract's info, with a balance at 0:

$ curl localhost:8732/chains/main/blocks/1680000/context/contracts/tz1UzKDcDyvK9fq7nfXvXr85v5CqXnhU8r37 
{"balance":"0","counter":"25757460"}

Verify that it's absent from the parent RPC: (beware, it takes quite some time to fetch that long list, that's why it can be useful to save it in a file)

$ curl localhost:8732/chains/main/blocks/1680000/context/contracts | tee list_of_contracts_1680000.txt | grep tz1UzKDcDyvK9fq7nfXvXr85v5CqXnhU8r37
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 58.3M    0 58.3M    0     0   165k      0 --:--:--  0:06:01 --:--:-- 12.7M

grep returns an empty result, which means the contract is absent from the list.

AFAIK, all contracts with a balance at 0 will be missing from that list. (If not all, then 234,328, which is quite a lot.)

That does not match the documentation of the RPC: https://tezos.gitlab.io/011/rpc.html#get-block-id-context-contracts https://tezos.gitlab.io/ithaca/rpc.html#get-block-id-context-contracts which says:

All existing contracts (including non-empty default contracts).

I haven't managed to find the code that does the filtering. (I may or may not try again.)

Edited by Philippe Wang