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
13a5dd32
Commit
13a5dd32
authored
Jul 27, 2023
by
clabby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix `TestClaimEVM`
parent
f7368e09
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
6 deletions
+7
-6
evm_test.go
cannon/mipsevm/evm_test.go
+1
-1
witness.go
cannon/mipsevm/witness.go
+2
-2
mips_more.go
op-bindings/bindings/mips_more.go
+1
-1
MIPS.sol
packages/contracts-bedrock/src/cannon/MIPS.sol
+3
-2
No files found.
cannon/mipsevm/evm_test.go
View file @
13a5dd32
...
...
@@ -79,7 +79,7 @@ func (m *MIPSEVM) Step(t *testing.T, stepWitness *StepWitness) []byte {
t
.
Logf
(
"reading preimage key %x at offset %d"
,
stepWitness
.
PreimageKey
,
stepWitness
.
PreimageOffset
)
poInput
,
err
:=
stepWitness
.
EncodePreimageOracleInput
()
require
.
NoError
(
t
,
err
,
"encode preimage oracle input"
)
_
,
leftOverGas
,
err
:=
m
.
env
.
Call
(
vm
.
AccountRef
(
m
.
addrs
.
S
ender
),
m
.
addrs
.
Oracle
,
poInput
,
startingGas
,
big
.
NewInt
(
0
))
_
,
leftOverGas
,
err
:=
m
.
env
.
Call
(
vm
.
AccountRef
(
s
ender
),
m
.
addrs
.
Oracle
,
poInput
,
startingGas
,
big
.
NewInt
(
0
))
require
.
NoErrorf
(
t
,
err
,
"evm should not fail, took %d gas"
,
startingGas
-
leftOverGas
)
}
...
...
cannon/mipsevm/witness.go
View file @
13a5dd32
...
...
@@ -56,11 +56,11 @@ func (wit *StepWitness) EncodePreimageOracleInput() ([]byte, error) {
input
=
append
(
input
,
LoadLocalDataBytes4
...
)
input
=
append
(
input
,
wit
.
PreimageKey
[
:
]
...
)
preimagePart
:=
wit
.
PreimageValue
[
wit
.
PreimageOffset
:
]
preimagePart
:=
wit
.
PreimageValue
[
8
:
]
var
tmp
[
32
]
byte
copy
(
tmp
[
:
],
preimagePart
)
input
=
append
(
input
,
tmp
[
:
]
...
)
input
=
append
(
input
,
uint32ToBytes32
(
32
)
...
)
input
=
append
(
input
,
uint32ToBytes32
(
uint32
(
len
(
wit
.
PreimageValue
)
-
8
)
)
...
)
input
=
append
(
input
,
uint32ToBytes32
(
wit
.
PreimageOffset
)
...
)
// Note: we can pad calldata to 32 byte multiple, but don't strictly have to
return
input
,
nil
...
...
op-bindings/bindings/mips_more.go
View file @
13a5dd32
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/src/cannon/MIPS.sol
View file @
13a5dd32
...
...
@@ -20,6 +20,7 @@ import { PreimageKeyLib } from "./PreimageKeyLib.sol";
/// @dev https://github.com/golang/go/blob/master/src/syscall/zerrors_linux_mips.go
/// MIPS linux kernel errors used by Go runtime
contract MIPS {
/// @notice Stores the VM state.
/// Total state size: 32 + 32 + 6 * 4 + 1 + 1 + 8 + 32 * 4 = 226 bytes
/// If nextPC != pc + 4, then the VM is executing a branch/jump delay slot.
...
...
@@ -836,11 +837,11 @@ contract MIPS {
}
// slt: Set to 1 if less than
else if (func == 0x2a) {
return int32(rs) < int32(rt) ? 1 : 0;
return int32(rs) < int32(rt) ? 1 : 0;
}
// sltu: Set to 1 if less than unsigned
else if (func == 0x2B) {
return rs<rt ? 1 : 0;
return rs<rt ? 1 : 0;
}
}
// lui: Load Upper Immediate
...
...
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