4

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 my 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?

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

1
  • 1
    Calldata is the transaction's input field.
    – Ismael
    Oct 20, 2020 at 0:10

1 Answer 1

1

Here's an ethresear.ch thread covering the same topic, for anyone who may stumble upon this question (as I did): https://ethresear.ch/t/clarification-on-how-calldata-persists-on-the-blockchain-and-how-optimistic-rollups-use-it/8136

Some answers from that thread:

(barrywhitehat) 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.

(me) The calldata isn’t just sent in a noop transaction-- it’s merklized by the EVM and the resulting root is stored in the contract’s storage. So any disputes that want to reference that calldata can do so via merkle proof with the root that the contract holds.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.