Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
e534031c
Unverified
Commit
e534031c
authored
Jun 16, 2023
by
protolambda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cannon: update readme, no need for makefile anymore
parent
aa6d64ea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
26 deletions
+62
-26
Makefile
cannon/Makefile
+0
-12
README.md
cannon/README.md
+62
-14
No files found.
cannon/Makefile
deleted
100644 → 0
View file @
aa6d64ea
SHELL
:=
/bin/bash
build
:
contracts
.PHONY
:
build
contracts
:
cd
contracts
&&
forge build
.PHONY
:
contracts
test
:
cd
mipsevm
&&
go
test
-v
./...
.PHONY
:
test
cannon/README.md
View file @
e534031c
<!---->
<!---->
<!---->
<!---->
<!---->
<!---->

<!---->
---
---
...
@@ -17,25 +17,73 @@ one instruction at a time, as part of an interactive dispute game.
...
@@ -17,25 +17,73 @@ one instruction at a time, as part of an interactive dispute game.
For more information, see
[
Docs
](
./docs/README.md
)
.
For more information, see
[
Docs
](
./docs/README.md
)
.
##
Directory Layout
##
Usage
```
```
shell
contracts -- A MIPS emulator implementation, using merkleized state and a pre-image oracle.
# Build op-program server-mode and MIPS-client binaries.
example -- Example programs that can be run and proven with Cannon.
cd
../op-program
extra -- Extra scripts and legacy contracts, deprecated.
make op-program
# build
mipsevm -- Go tooling to test the onchain MIPS implementation, and generate proof data.
diffmips -- MIPS diff testing, to ensure correctness of the main Cannon implementation, with isolated dependencies.
```
## Building
# Switch back to cannon, and build the CLI
cd
../cannon
go build
-o
cannon
.
### `contracts`
# Transform MIPS op-program client binary into first VM state.
# This outputs state.json (VM state) and meta.json (for debug symbols).
./cannon load-elf
--path
=
../optimism/op-program/bin/op-program-client.elf
The contracts are compiled with
[
`forge`
](
https://github.com/foundry-rs/foundry
)
.
# Run cannon emulator (with example inputs)
```
# Note that the server-mode op-program command is passed into cannon (after the --),
make contracts
# it runs as sub-process to provide the pre-image data.
#
# Note:
# - The L2 RPC is an archive L2 node on OP goerli.
# - The L1 RPC is a non-archive RPC, also change `--l1.rpckind` to reflect the correct L1 RPC type.
./cannon run
--pprof
.cpu
--info-at
'%10000000'
--proof-at
never
--input
./state.json
--
../optimism/op-program/bin/op-program
--l2
ws://127.0.0.1:8746
--l1
ws://127.0.0.1:8646
--l1
.trustrpc
--l1
.rpckind debug_geth
--log
.format terminal
--l2
.head 0xedc79de4d616a9100fdd42192224580daee81ea3d6303de8089d48a6c1bf4816
--network
goerli
--l1
.head 0x204f815790ca3bb43526ad60ebcc64784ec809bdc3550e82b54a0172f981efab
--l2
.claim 0x530658ab1b1b3ff4829731fc8d5955f0e6b8410db2cd65b572067ba58df1f2b9
--l2
.blocknumber 8813570
--datadir
/tmp/fpp-database
--server
# Add --proof-at '=12345' (or pick other pattern, see --help)
# to pick a step to build a proof for (e.g. exact step, every N steps, etc.)
# Also see `./cannon run --help` for more options
```
```
## Contracts
The Cannon contracts:
-
`MIPS.sol`
: A MIPS emulator implementation, to run a single instruction onchain, with merkleized VM memory.
-
`Oracle.sol`
: implements the pre-image oracle ABI, to support the instruction execution pre-image requests.
The smart-contracts are integrated into the Optimism monorepo contracts:
[
`../packages/contracts-bedrock/contracts/cannon`
](
../packages/contracts-bedrock/contracts/cannon
)
## `mipsevm`
`mipsevm`
is Go tooling to test the onchain MIPS implementation, and generate proof data.
## `example`
Example programs that can be run and proven with Cannon.
Optional dependency, but required for
`mipsevm`
Go tests.
See
[
`example/Makefile`
](
./example/Makefile
)
for building the example MIPS binaries.
## License
## License
MIT, see
[
`LICENSE`
](
./LICENSE
)
file.
MIT, see
[
`LICENSE`
](
./LICENSE
)
file.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment