Clarification on how Calldata persists on the blockchain and how Optimistic Rollups use it

Hey all I have tried asking this on various other forums but haven’t gotten a clear answer.

So I see that a lot of optimistic rollup solutions say that they store the chain’s transaction data on Ethereum via “calldata” which is way cheaper in gas costs than contract storage (I understand this is due to the ever expanding State trie). Looking up how calldata works, it seems it is read-only memory slot for function arguments. But if it is memory that means it is non-persistent after the the function has completed thus the data wouldn’t be available for users to rebuild the chain if necessary.

Where is the Calldata stored in the blockchain after the transaction is complete? Is it in the transaction trie? Also for optimistic rollups a guess is that once a submit block function is initiated via a transaction, the transaction and calldata are not removed from memory until the function ends (after the the usual two 2 week finality period). Thus the calldata would available for anyone wanting to create the rollup state, and after the two weeks it can be removed from calldata as the fraud proof period is over. Is this correct?

Tldr; Basically where do I find the transaction data for optimistic rollups if I want to re-create the state of the child chain? Thanks!

Call data is stored as part of the eth chain history. If you want to validate the whole chain you need to have the call data so it needs to be available for a chian to be considered valid.

Miners could try and make this call data unavailable but that attack would be similar in difficulty to a 51% attack.

You can get the call data by running a full node.

1 Like

Would the calldata be stored within the transaction trie then? If I was running a fullnode is that where I would search to find the calldata? I assume it avoids posting into the storage trie because avoiding state bloat is basically the purpose of rollups.

Would the calldata be stored within the transaction trie then?

Yes.