Invoke contract view method at different block height

From my searches, it does not seem possible to invoke contract view methods at a different block height. Although this would probably incur significant gas, it seems like it would allow a contract to use a liquidity pool (or multiple or an average over multiple blocks) as a source of price data since it would mitigate flash loan manipulations.

Is my understanding correct? Would this be possible?

1 Like

IIUC, view functions are not actually included in blocks and are instead evaluated by the node (that’s why they cost no gas).

Yes, of course this is the case but I’m specifically asking about invoking the method from another contract. I’m well aware that I can call the function at any height if I’ve got a node.

2 Likes

Okay, that makes more sense. That’s out of my realm of expertise now. :slightly_smiling_face: