pendulum-chain / pendulum-squids

The subsquid squids we use for Pendulum/Amplitude/Foucoco.
GNU General Public License v3.0
0 stars 0 forks source link

Bugfix: read historical state of contracts #76

Closed TorstenStueber closed 1 month ago

TorstenStueber commented 1 month ago

When processing contract events, usually the current state of the contract as stored in the database is to be updated with the current actual state of the contract.

This happens by reading the current contract state. However, the indexer always reads the latest contract state and not the state of the contract at the block where the event happened.

This is usually not a problem as our apps read and require the latest contract state anyway. However, when executing scripts to process historical events (e.g., to determine rewards), then the data is corrupt.

TODO

Read historical event data at the block of the respective event.