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
0eb8edea
Commit
0eb8edea
authored
Jul 24, 2023
by
inphi
Committed by
clabby
Jul 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update preimage oracle input
parent
3f4ba769
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
evm.go
cannon/mipsevm/evm.go
+1
-1
witness.go
cannon/mipsevm/witness.go
+5
-2
No files found.
cannon/mipsevm/evm.go
View file @
0eb8edea
...
@@ -27,7 +27,7 @@ var (
...
@@ -27,7 +27,7 @@ var (
StepBytes4
=
crypto
.
Keccak256
([]
byte
(
"step(bytes,bytes)"
))[
:
4
]
StepBytes4
=
crypto
.
Keccak256
([]
byte
(
"step(bytes,bytes)"
))[
:
4
]
CheatBytes4
=
crypto
.
Keccak256
([]
byte
(
"cheat(uint256,bytes32,bytes32,uint256)"
))[
:
4
]
CheatBytes4
=
crypto
.
Keccak256
([]
byte
(
"cheat(uint256,bytes32,bytes32,uint256)"
))[
:
4
]
LoadKeccak256PreimagePartBytes4
=
crypto
.
Keccak256
([]
byte
(
"loadKeccak256PreimagePart(uint256,bytes)"
))[
:
4
]
LoadKeccak256PreimagePartBytes4
=
crypto
.
Keccak256
([]
byte
(
"loadKeccak256PreimagePart(uint256,bytes)"
))[
:
4
]
LoadLocalDataBytes4
=
crypto
.
Keccak256
([]
byte
(
"loadLocalData(uint256,bytes32,uint
8
)"
))[
:
4
]
LoadLocalDataBytes4
=
crypto
.
Keccak256
([]
byte
(
"loadLocalData(uint256,bytes32,uint
256,uint256
)"
))[
:
4
]
)
)
// LoadContracts loads the Cannon contracts, from op-bindings package
// LoadContracts loads the Cannon contracts, from op-bindings package
...
...
cannon/mipsevm/witness.go
View file @
0eb8edea
...
@@ -55,10 +55,13 @@ func (wit *StepWitness) EncodePreimageOracleInput() ([]byte, error) {
...
@@ -55,10 +55,13 @@ func (wit *StepWitness) EncodePreimageOracleInput() ([]byte, error) {
var
input
[]
byte
var
input
[]
byte
input
=
append
(
input
,
LoadLocalDataBytes4
...
)
input
=
append
(
input
,
LoadLocalDataBytes4
...
)
input
=
append
(
input
,
wit
.
PreimageKey
[
:
]
...
)
input
=
append
(
input
,
wit
.
PreimageKey
[
:
]
...
)
preimagePart
:=
wit
.
PreimageValue
[
wit
.
PreimageOffset
:
]
var
tmp
[
32
]
byte
var
tmp
[
32
]
byte
copy
(
tmp
[
:
],
wit
.
PreimageValue
[
8
:
]
)
copy
(
tmp
[
:
],
preimagePart
)
input
=
append
(
input
,
tmp
[
:
]
...
)
input
=
append
(
input
,
tmp
[
:
]
...
)
input
=
append
(
input
,
uint32ToBytes32
(
uint32
(
len
(
wit
.
PreimageValue
))
-
8
)
...
)
input
=
append
(
input
,
uint32ToBytes32
(
32
)
...
)
input
=
append
(
input
,
uint32ToBytes32
(
wit
.
PreimageOffset
)
...
)
// Note: we can pad calldata to 32 byte multiple, but don't strictly have to
// Note: we can pad calldata to 32 byte multiple, but don't strictly have to
return
input
,
nil
return
input
,
nil
case
preimage
.
Keccak256KeyType
:
case
preimage
.
Keccak256KeyType
:
...
...
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