Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transition fraud proof prototype from block fraud proofs to fraud proof with ISRs #265

Closed
Tracked by #514
Manav-Aggarwal opened this issue Aug 20, 2022 · 1 comment
Assignees
Labels
block-fraud-proofs Block Fraud Proofs (Generation and verification) C: Cevmos Changes related to the cevmos branches

Comments

@Manav-Aggarwal
Copy link
Member

Manav-Aggarwal commented Aug 20, 2022

#245 covers the block fraud-proof prototype, we'd like to make it compatible with ISRs. It'd modify the cycle of a fraudproof to look like this:

Optimint Full Node (Producer of ISR fraudproof)

  1. An optimint full node while trying to execute blocks, finds a fraudulent tx in some block. It passes a message to cosmos-sdk telling it to go into fraudproof generation mode.
  2. In the fraudproof generation mode, a cosmos-sdk app reverts its state to a previous state before the fraudulent block is applied and enables tracing.
  3. Now, optimint can tell cosmos-sdk to fast forward to right before the fraudulent transaction was executed. Now, simply execute the fraudulent transaction while logging all the states touched by the transaction. Then, it will revert to a previous state again, fast forward it to right before the fraudulent transaction was executed, and then snapshot the state while using the contents of the log to filter down to the minimal set of states needed. This minimal snapshot will be packaged as a fraudproof and passed back to optimint.
  4. The verifying optimint full node will alert the P2P network by gossiping that fraudproof around.

Optimint Full/Light Node (Verifier of fraudproof)

  1. An optimint full/node receives the fraudproof from the P2P Network. It retrieves the fraudulent block header from the DA layer using the block height and hash indicated in the fraudproof.
  2. It verifies the fraudproof by doing a cross-reference of a header app hash from the blockchain against the contents of a fraudproof
  3. Now, it spins up a fresh cosmos-sdk and tells it to initialize with the fraudproof which is essentially a minimal snapshot sufficient to execute the fraudulent block.
  4. Optimint tells cosmos-sdk to execute the fraudulent transaction and finally checks if the local app's state (app hash) matches the app hash of the next block published on-chain.
  5. If it doesn't match, then fraud has been verified, so the whole network halts. Otherwise, no fraud was detected, so the system continues as it is.

Specifically, we cover this part of the cycle by modifying the existing TestGenerateAndLoadFraudProof:

  1. Now, optimint can tell cosmos-sdk to fast forward to right before the fraudulent transaction was executed. Now, simply execute the fraudulent transaction while logging all the states touched by the transaction. Then, it will revert to a previous state again, fast forward it to right before the fraudulent transaction was executed, and then snapshot the state while using the contents of the log to filter down to the minimal set of states needed. This minimal snapshot will be packaged as a fraudproof and passed back to Optimint.

The fast forwards parts by Optimint should be just simulated in the test.

@Manav-Aggarwal Manav-Aggarwal added C: Cevmos Changes related to the cevmos branches block-fraud-proofs Block Fraud Proofs (Generation and verification) labels Aug 20, 2022
@Manav-Aggarwal Manav-Aggarwal self-assigned this Aug 20, 2022
@Manav-Aggarwal
Copy link
Member Author

Closed by: rollkit#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
block-fraud-proofs Block Fraud Proofs (Generation and verification) C: Cevmos Changes related to the cevmos branches
Projects
None yet
1 participant