ethereum-optimism / op-analytics

Onchain Data, Utilities, References, and other Analytics on Optimism
111 stars 51 forks source link

"On the fly" decoding #1065

Open MSilb7 opened 4 days ago

MSilb7 commented 4 days ago

Storing all decoded logs and traces would be heavily intensive.

We could/should instead build functions that decode "on the fly" -> intake raw data and output a decoded dataframe.

A prereq is to store as many function calls, event selectors, ABIs as possible & then have some way to intelligently decide how to decode a given trace and event.

MSilb7 commented 3 days ago

User examples:

  1. When building intermediate models, we have something like a python function that intakes raw data and outputs decoded data in something like a dataframe - We can wrap around web3.py or something similar (we use this for revenue tracking).
  2. When writing raw SQL queries in BigQuery (or elsewhere), use a similar function to (1) - there is some example using ethers.js, but we could also ask google if they have better ideas