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
914157f9
Unverified
Commit
914157f9
authored
Nov 17, 2024
by
Inphi
Committed by
GitHub
Nov 17, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
devnet: Replace mt-cannon with 64-bit Cannon (#12924)
parent
78fed1ee
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
14 deletions
+37
-14
Makefile
Makefile
+2
-2
precompile_test.go
op-e2e/faultproofs/precompile_test.go
+28
-6
README.md
op-program/README.md
+1
-0
Deploy.s.sol
packages/contracts-bedrock/scripts/deploy/Deploy.s.sol
+3
-3
DeployDisputeGame.s.sol
.../contracts-bedrock/scripts/deploy/DeployDisputeGame.s.sol
+1
-1
DeployImplementations.s.sol
...tracts-bedrock/scripts/deploy/DeployImplementations.s.sol
+1
-1
DeployMIPS.s.sol
packages/contracts-bedrock/scripts/deploy/DeployMIPS.s.sol
+1
-1
No files found.
Makefile
View file @
914157f9
...
...
@@ -147,8 +147,8 @@ cannon-prestate: op-program cannon ## Generates prestate using cannon and op-pro
mv
op-program/bin/0.json op-program/bin/prestate-proof.json
.PHONY
:
cannon-prestate
cannon-prestate-mt
:
op-program cannon
##
Generates prestate using cannon and op-program in the multithreaded cannon format
./cannon/bin/cannon load-elf
--type
multithreaded
--path
op-program/bin/op-program-client
.elf
--out
op-program/bin/prestate-mt.bin.gz
--meta
op-program/bin/meta-mt.json
cannon-prestate-mt
:
op-program cannon
##
Generates prestate using cannon and op-program in the multithreaded
64
cannon format
./cannon/bin/cannon load-elf
--type
multithreaded
64
--path
op-program/bin/op-program-client64
.elf
--out
op-program/bin/prestate-mt.bin.gz
--meta
op-program/bin/meta-mt.json
./cannon/bin/cannon run
--proof-at
'=0'
--stop-at
'=1'
--input
op-program/bin/prestate-mt.bin.gz
--meta
op-program/bin/meta-mt.json
--proof-fmt
'op-program/bin/%d-mt.json'
--output
""
mv
op-program/bin/0-mt.json op-program/bin/prestate-proof-mt.json
.PHONY
:
cannon-prestate-mt
...
...
op-e2e/faultproofs/precompile_test.go
View file @
914157f9
package
faultproofs
import
(
"bytes"
"context"
"encoding/json"
"math"
"math/big"
"os/exec"
"path/filepath"
"testing"
...
...
@@ -12,7 +15,6 @@ import (
"github.com/ethereum-optimism/optimism/op-e2e/system/e2esys"
"github.com/ethereum-optimism/optimism/op-e2e/system/helpers"
"github.com/ethereum-optimism/optimism/cannon/mipsevm/versions"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
...
...
@@ -276,9 +278,29 @@ func runCannon(t *testing.T, ctx context.Context, sys *e2esys.System, inputs uti
err
:=
executor
.
DoGenerateProof
(
ctx
,
proofsDir
,
math
.
MaxUint
,
math
.
MaxUint
,
extraVmArgs
...
)
require
.
NoError
(
t
,
err
,
"failed to generate proof"
)
state
,
err
:=
versions
.
LoadStateFromFile
(
vm
.
FinalStatePath
(
proofsDir
,
cfg
.
Cannon
.
BinarySnapshots
))
require
.
NoError
(
t
,
err
,
"failed to parse state"
)
require
.
True
(
t
,
state
.
GetExited
(),
"cannon did not exit"
)
require
.
Zero
(
t
,
state
.
GetExitCode
(),
"cannon failed with exit code %d"
,
state
.
GetExitCode
())
t
.
Logf
(
"Completed in %d steps"
,
state
.
GetStep
())
stdOut
,
_
,
err
:=
runCmd
(
ctx
,
cfg
.
Cannon
.
VmBin
,
"witness"
,
"--input"
,
vm
.
FinalStatePath
(
proofsDir
,
cfg
.
Cannon
.
BinarySnapshots
))
require
.
NoError
(
t
,
err
,
"failed to run witness cmd"
)
type
stateData
struct
{
Step
uint64
`json:"step"`
ExitCode
uint8
`json:"exitCode"`
Exited
bool
`json:"exited"`
}
var
data
stateData
err
=
json
.
Unmarshal
([]
byte
(
stdOut
),
&
data
)
require
.
NoError
(
t
,
err
,
"failed to parse state data"
)
require
.
True
(
t
,
data
.
Exited
,
"cannon did not exit"
)
require
.
Zero
(
t
,
data
.
ExitCode
,
"cannon failed with exit code %d"
,
data
.
ExitCode
)
t
.
Logf
(
"Completed in %d steps"
,
data
.
Step
)
}
func
runCmd
(
ctx
context
.
Context
,
binary
string
,
args
...
string
)
(
stdOut
string
,
stdErr
string
,
err
error
)
{
var
outBuf
bytes
.
Buffer
var
errBuf
bytes
.
Buffer
cmd
:=
exec
.
CommandContext
(
ctx
,
binary
,
args
...
)
cmd
.
Stdout
=
&
outBuf
cmd
.
Stderr
=
&
errBuf
err
=
cmd
.
Run
()
stdOut
=
outBuf
.
String
()
stdErr
=
errBuf
.
String
()
return
}
op-program/README.md
View file @
914157f9
...
...
@@ -45,6 +45,7 @@ After running `make reproducible-prestate`, the following files can be found in
[
./bin/
](
./bin/
)
:
-
[
`op-program`
](
./bin/op-program
)
-
[
`op-program-client.elf`
](
./bin/op-program-client.elf
)
-
[
`op-program-client64.elf`
](
./bin/op-program-client64.elf
)
-
[
`prestate.bin.gz`
](
./bin/prestate.bin.gz
)
-
[
`prestate-proof.json`
](
./bin/prestate-proof.json
)
...
...
packages/contracts-bedrock/scripts/deploy/Deploy.s.sol
View file @
914157f9
...
...
@@ -695,12 +695,12 @@ contract Deploy is Deployer {
addr_ = address(oracle);
}
/// @notice Deploy Mips VM. Deploys either MIPS or MIPS
2
depending on the environment
/// @notice Deploy Mips VM. Deploys either MIPS or MIPS
64
depending on the environment
function deployMips() public broadcast returns (address addr_) {
addr_ = DeployUtils.create2AndSave({
_save: this,
_salt: _implSalt(),
_name: Config.useMultithreadedCannon() ? "MIPS
2
" : "MIPS",
_name: Config.useMultithreadedCannon() ? "MIPS
64
" : "MIPS",
_args: DeployUtils.encodeConstructor(
abi.encodeCall(IMIPS2.__constructor__, (IPreimageOracle(mustGetAddress("PreimageOracle"))))
)
...
...
@@ -1019,7 +1019,7 @@ contract Deploy is Deployer {
mipsAbsolutePrestate_ =
Claim.wrap(abi.decode(bytes(Process.bash(string.concat("cat ", filePath, " | jq -r .pre"))), (bytes32)));
console.log(
"[MT-Cannon Dispute Game] Using devnet MIPS
2
Absolute prestate: %s",
"[MT-Cannon Dispute Game] Using devnet MIPS
64
Absolute prestate: %s",
vm.toString(Claim.unwrap(mipsAbsolutePrestate_))
);
}
...
...
packages/contracts-bedrock/scripts/deploy/DeployDisputeGame.s.sol
View file @
914157f9
...
...
@@ -376,7 +376,7 @@ contract DeployDisputeGame is Script {
vm.broadcast(msg.sender);
singleton = IMIPS(
DeployUtils.create1({
_name: mipsVersion == 1 ? "MIPS" : "MIPS
2
",
_name: mipsVersion == 1 ? "MIPS" : "MIPS
64
",
_args: DeployUtils.encodeConstructor(abi.encodeCall(IMIPS.__constructor__, (preimageOracle)))
})
);
...
...
packages/contracts-bedrock/scripts/deploy/DeployImplementations.s.sol
View file @
914157f9
...
...
@@ -802,7 +802,7 @@ contract DeployImplementations is Script {
vm.broadcast(msg.sender);
singleton = IMIPS(
DeployUtils.create1({
_name: mipsVersion == 1 ? "MIPS" : "MIPS
2
",
_name: mipsVersion == 1 ? "MIPS" : "MIPS
64
",
_args: DeployUtils.encodeConstructor(abi.encodeCall(IMIPS.__constructor__, (preimageOracle)))
})
);
...
...
packages/contracts-bedrock/scripts/deploy/DeployMIPS.s.sol
View file @
914157f9
...
...
@@ -98,7 +98,7 @@ contract DeployMIPS is Script {
vm.broadcast(msg.sender);
singleton = IMIPS(
DeployUtils.create1({
_name: mipsVersion == 1 ? "MIPS" : "MIPS
2
",
_name: mipsVersion == 1 ? "MIPS" : "MIPS
64
",
_args: DeployUtils.encodeConstructor(abi.encodeCall(IMIPS.__constructor__, (preimageOracle)))
})
);
...
...
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