ape icon indicating copy to clipboard operation
ape copied to clipboard

Ape Cache plugin is failing to query from the caching database

Open johnson2427 opened this issue 3 years ago • 4 comments

Environment information

  • OS: linux
  • Python Version: 3.10.4
  • ape and plugin versions: tokens 0.5.0 infura 0.5.0 vyper 0.5.0
$ ape --version
# ...copy and paste result of above command here...
0.5.2.dev22+g6b758dcc

What went wrong?

Please include information like:

  • what command you ran
  • the code that caused the failure (see this link for help with formatting code)
  • full output of the error you received Using infura plugin:
ape cache init --network ethereum:mainnet:infura
ape console --network ethereum:mainnet:infura
[1]: chain.blocks.query("*", start_block=-8, stop_block=-2)  # This will come from the provider
[2]: chain.blocks.query("*", start_block=-8, stop_block=-2)  # This most likely will come from cache and fail...

The reason this fails is because we use "*" to call all columns, but the pydantic Model is not handling this request. It is supposed to create a list of all available fields from Blocks

How can it be fixed?

Fill this in if you have ideas on how the bug could be fixed.

But, I do believe if we fix our BaseModel, we should be able to handle this query properly

johnson2427 avatar Sep 23 '22 22:09 johnson2427

I believe I am hitting this issue.

antazoey avatar Nov 09 '22 17:11 antazoey

Is it not storing in your SQLite database?

johnson2427 avatar Nov 09 '22 20:11 johnson2427

Is it not storing in your SQLite database?

I think the data it gets back fails validation somehow, like it may be not storing everything

antazoey avatar Nov 10 '22 19:11 antazoey

Could be related to #1129 ?

fubuloubu avatar Nov 11 '22 18:11 fubuloubu