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

Implement a Single Round Fraudproof as a minimal integration test #245

Closed
5 tasks done
Tracked by #514
Manav-Aggarwal opened this issue Aug 1, 2022 · 1 comment
Closed
5 tasks done
Tracked by #514
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 1, 2022

We'd like to implement a simple single-round fraudproof similar to the one here but in the context of cosmos-sdk.
Focus shouldn't be on performance and optimizations just yet.

The cycle of a fraudproof:

Optimint Full Node (Producer of fraudproof)

  1. An optimint full node while trying to execute blocks, finds a fraudulent 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 generate a fraudproof by supplying it with a fraudulent block. The cosmos-sdk will simply execute the fraudulent block while logging all the states touched by the transaction. Then, it will revert to a previous state again, and then snapshot the state while using the contents of the log to filter down to the minimal set of state needed. This minimial 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 block, 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.

Child issues:

Note: This is only possible after SMT is supported in cosmos-sdk as described in ADR-040 and the PR here.

@Manav-Aggarwal Manav-Aggarwal added the C: Cevmos Changes related to the cevmos branches label Aug 1, 2022
@Manav-Aggarwal Manav-Aggarwal self-assigned this Aug 1, 2022
@Manav-Aggarwal Manav-Aggarwal linked a pull request Aug 12, 2022 that will close this issue
19 tasks
@Manav-Aggarwal Manav-Aggarwal added the block-fraud-proofs Block Fraud Proofs (Generation and verification) label Aug 12, 2022
@Manav-Aggarwal
Copy link
Member Author

Closed by: rollkit#2

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
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant