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
7ca852ec
Unverified
Commit
7ca852ec
authored
Jun 22, 2023
by
OptimismBot
Committed by
GitHub
Jun 22, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6111 from ethereum-optimism/inphi/cannon-docs
cannon: Remove unicorn references
parents
09a63f3d
4b281cc1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
16 deletions
+5
-16
README.md
cannon/docs/README.md
+2
-3
evm_test.go
cannon/mipsevm/evm_test.go
+2
-2
memory.go
cannon/mipsevm/memory.go
+1
-2
mips.go
cannon/mipsevm/mips.go
+0
-9
No files found.
cannon/docs/README.md
View file @
7ca852ec
...
...
@@ -32,9 +32,8 @@ And as it executes each step, it can optionally produce the witness data for the
The Cannon CLI is used to load a program into an initial state,
transition it N steps quickly without witness generation, and 1 step while producing a witness.
`mipsevm`
is backed by the Unicorn emulator, but instrumented for proof generation,
and handles delay-slots by isolating each individual instruction and tracking
`nextPC`
to emulate the delayed
`PC`
changes after delay-slot execution.
`mipsevm`
is instrumented for proof generation and handles delay-slots by isolating each individual instruction
and tracking
`nextPC`
to emulate the delayed
`PC`
changes after delay-slot execution.
## Witness Data
...
...
cannon/mipsevm/evm_test.go
View file @
7ca852ec
...
...
@@ -108,7 +108,7 @@ func TestEVM(t *testing.T) {
// TODO: maybe more readable to decode the evmPost state, and do attribute-wise comparison.
uniPost
:=
us
.
state
.
EncodeWitness
()
require
.
Equal
(
t
,
hexutil
.
Bytes
(
uniPost
)
.
String
(),
hexutil
.
Bytes
(
evmPost
)
.
String
(),
"
unicorn
produced different state than EVM"
)
"
mipsevm
produced different state than EVM"
)
}
require
.
Equal
(
t
,
uint32
(
endAddr
),
state
.
PC
,
"must reach end"
)
// inspect test result
...
...
@@ -175,7 +175,7 @@ func TestHelloEVM(t *testing.T) {
// TODO: maybe more readable to decode the evmPost state, and do attribute-wise comparison.
uniPost
:=
us
.
state
.
EncodeWitness
()
require
.
Equal
(
t
,
hexutil
.
Bytes
(
uniPost
)
.
String
(),
hexutil
.
Bytes
(
evmPost
)
.
String
(),
"
unicorn
produced different state than EVM"
)
"
mipsevm
produced different state than EVM"
)
}
end
:=
time
.
Now
()
delta
:=
end
.
Sub
(
start
)
...
...
cannon/mipsevm/memory.go
View file @
7ca852ec
...
...
@@ -11,8 +11,7 @@ import (
"github.com/ethereum/go-ethereum/crypto"
)
// Note: 2**12 = 4 KiB, the minimum page-size in Unicorn for mmap
// as well as the Go runtime min phys page size.
// Note: 2**12 = 4 KiB, the min phys page size in the Go runtime.
const
(
PageAddrSize
=
12
PageKeySize
=
32
-
PageAddrSize
...
...
cannon/mipsevm/mips.go
View file @
7ca852ec
...
...
@@ -56,15 +56,6 @@ func (m *InstrumentedState) handleSyscall() error {
v0
=
a0
//fmt.Printf("mmap hint 0x%x size 0x%x\n", v0, sz)
}
// Go does this thing where it first gets memory with PROT_NONE,
// and then mmaps with a hint with prot=3 (PROT_READ|WRITE).
// We can ignore the NONE case, to avoid duplicate/overlapping mmap calls to unicorn.
//prot := a2
//if prot != 0 {
// if err := mu.MemMap(uint64(v0), uint64(sz)); err != nil {
// log.Fatalf("mmap fail: %v", err)
// }
//}
case
4045
:
// brk
v0
=
0x40000000
case
4120
:
// clone (not supported)
...
...
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