Add fraud prover#544
Add fraud prover#544jliphard wants to merge 31 commits intoethereum-optimism:masterfrom jliphard:add_fraud_prover
Conversation
|
|
Hey @jliphard thanks for your contribution! It looks like some files could use some linting. I think the first step is to get the code into the repo and then we can follow up with additional PRs that add in the CI. Let us know when its ready for review and we can remove the |
|
Ok, lint looks good and cleaned up some other things. No idea why the unit tests are failing for smockit (Error: src/smockit/binding.ts(2,43): error TS2307: Cannot find module 'hardhat/internal/hardhat-network/provider/errors' or its corresponding type declarations.) since that's in an entirely different part of the codebase. |
Update: i see that the fraud prover doesn't have a dependency on |
|
Created an issue to track fixing this bug: #554 |
Complete function testing and document spinup of a Verifier/Fraud Prover pair in the setting of a generic local deployment
|
Ok, things seems to work as expected. I documented (in the readme) the needed |
|
GitHub actions seem to be stuck? Will reset them by closing the PR, and then re-opening it. |
|
Hey @jliphard, we'll hold off on merging this PR until we can get some integration tests in for this functionality, as well as bringing it up in the docker-compose stack. If you end up writing any of these, go ahead and push them in this PR. Thank you for the contribution! |
|
Hello @gakonst - makes perfect sense not to merge for the time being. I'm happy to help, but would require some input on what you think would be most useful. Which fraud scenarios should be evaluated? There are 'simple' fraud scenarios but also presumably others (e.g. involving the safety checker or gas limits or timing). What kind(s) of fraud to consider -> Simple Fraudulent State Roots only? A basic thing could be to inject/generate fraudulent state roots in the Mockchain vs. live local system It would be easiest (in terms of lines of code written) to just spin up a local system and define/use a suitable Where could/should the integration test live? Setup could be (partially) handled in /integration-tests/test/shared/util.ts, although not entirely, since the Let me know what would be useful (and please correct the above) - there are dozens of ways of doing this - in the above tried to minimize the number of lines of code that would be affected. |
|
If you wanted to use the Mockchain, I think it'd end up being a fraud prover unit test - see how the batch submitter unit tests are written. For the integration tests, the setup code would be:
In order to get a fraudulent batch in, you'd make a manual tx/state root submission to the smart contracts such that the post-tx state root is not the one which corresponds to the one from the transaction. Then you'd wait for the fraud prover to do its job. |
This could be done by calling the contracts directly from the tests, ie skipping the batch submitter. The key to use in the tests can be found here: optimism/ops/docker-compose.yml Line 113 in 01a2e7d |
|
All good - take your time. Thank you again. |
|
Closing for now until there is more activity. |
### Description In order to construct a signature to add to an `OpNetworkPayloadEnvelope`, the op payload has to be serialized as ssz. The serialized ssz bytes are then signed over using a local signer. Along with constructing the payload hash, the signature is used to construct the `OpNetworkPayloadEnvelope`. Once the `OpNetworkPayloadEnvelope` is constructed with the signature over the ssz encoded payload bytes, the `OpNetworkPayloadEnvelope` is encoded and sent over the wire through op p2p gossip.
Basic Function Testing Completed - See Readme for Documentation Thereof
HOWTO
For basic instructions on adding a Verifier and Fraud_Prover pair to your local test system, please see the Readme.
Description
Refactor the now archived fraud-prover service for the new monorepo.
Context
The
fraud-proverservice is relevant to the sequencer operating in its verifier mode. Adding the fraud-prover service into the monorepo raises several questions that relate to other repos, the dockers, the ci, etc. For example, some of the utility functions needed by the fraud-prover might be best located incore-utils? More generally, it could be useful to write a few simple scripts/commands related to running a verifier, rather than running the system in its normal operating mode.Please let me know what would be most useful for you all!