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
2d1dd18e
Commit
2d1dd18e
authored
Oct 15, 2023
by
clabby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address review
parent
3c889e67
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
10 deletions
+17
-10
witness.go
cannon/mipsevm/witness.go
+8
-2
mips_more.go
op-bindings/bindings/mips_more.go
+1
-1
preimageoracle_more.go
op-bindings/bindings/preimageoracle_more.go
+1
-1
.gas-snapshot
packages/contracts-bedrock/.gas-snapshot
+1
-1
semver-lock.json
packages/contracts-bedrock/semver-lock.json
+1
-1
PreimageKeyLib.sol
packages/contracts-bedrock/src/cannon/PreimageKeyLib.sol
+2
-1
FaultDisputeGame.sol
packages/contracts-bedrock/src/dispute/FaultDisputeGame.sol
+3
-3
No files found.
cannon/mipsevm/witness.go
View file @
2d1dd18e
...
...
@@ -27,6 +27,12 @@ func uint32ToBytes32(v uint32) []byte {
return
out
[
:
]
}
func
uint64ToBytes32
(
v
uint64
)
[]
byte
{
var
out
[
32
]
byte
binary
.
BigEndian
.
PutUint64
(
out
[
32
-
8
:
],
v
)
return
out
[
:
]
}
func
(
wit
*
StepWitness
)
EncodeStepInput
(
localContext
LocalContext
)
[]
byte
{
abiStateLen
:=
len
(
wit
.
State
)
if
abiStateLen
%
32
!=
0
{
...
...
@@ -40,7 +46,7 @@ func (wit *StepWitness) EncodeStepInput(localContext LocalContext) []byte {
input
=
append
(
input
,
StepBytes4
...
)
input
=
append
(
input
,
uint32ToBytes32
(
32
*
3
)
...
)
// state data offset in bytes
input
=
append
(
input
,
uint32ToBytes32
(
32
*
3
+
32
+
uint32
(
len
(
abiState
)))
...
)
// proof data offset in bytes
input
=
append
(
input
,
uint
32ToBytes32
(
uint32
(
localContext
))
...
)
// local context in bytes
input
=
append
(
input
,
uint
64ToBytes32
(
uint64
(
localContext
))
...
)
// local context in bytes
input
=
append
(
input
,
uint32ToBytes32
(
uint32
(
len
(
wit
.
State
)))
...
)
// state data length in bytes
input
=
append
(
input
,
abiState
[
:
]
...
)
...
...
@@ -66,7 +72,7 @@ func (wit *StepWitness) EncodePreimageOracleInput(localContext LocalContext) ([]
var
input
[]
byte
input
=
append
(
input
,
LoadLocalDataBytes4
...
)
input
=
append
(
input
,
wit
.
PreimageKey
[
:
]
...
)
input
=
append
(
input
,
uint
32ToBytes32
(
uint32
(
localContext
))
...
)
// local context in bytes
input
=
append
(
input
,
uint
64ToBytes32
(
uint64
(
localContext
))
...
)
// local context in bytes
preimagePart
:=
wit
.
PreimageValue
[
8
:
]
var
tmp
[
32
]
byte
...
...
op-bindings/bindings/mips_more.go
View file @
2d1dd18e
This diff is collapsed.
Click to expand it.
op-bindings/bindings/preimageoracle_more.go
View file @
2d1dd18e
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/.gas-snapshot
View file @
2d1dd18e
...
...
@@ -659,7 +659,7 @@ SequencerFeeVault_Test:test_withdraw_toL1_succeeds() (gas: 171675)
SetPrevBaseFee_Test:test_setPrevBaseFee_succeeds() (gas: 11549)
StandardBridge_Stateless_Test:test_isCorrectTokenPair_succeeds() (gas: 49936)
StandardBridge_Stateless_Test:test_isOptimismMintableERC20_succeeds() (gas: 33072)
Storage_Roundtrip_Test:test_setGetAddress_succeeds(bytes32,address) (runs: 64, μ: 31
199
, ~: 31821)
Storage_Roundtrip_Test:test_setGetAddress_succeeds(bytes32,address) (runs: 64, μ: 31
510
, ~: 31821)
Storage_Roundtrip_Test:test_setGetBytes32_succeeds(bytes32,bytes32) (runs: 64, μ: 31598, ~: 31598)
Storage_Roundtrip_Test:test_setGetUint_succeeds(bytes32,uint256) (runs: 64, μ: 31042, ~: 31664)
SystemConfig_Initialize_Test:test_initialize_events_succeeds() (gas: 71972)
...
...
packages/contracts-bedrock/semver-lock.json
View file @
2d1dd18e
...
...
@@ -20,7 +20,7 @@
"src/L2/SequencerFeeVault.sol"
:
"0xc2f733c1128d06ad60bf1e1d98c8f684a4825b11875ccdf2376ede33f5aad4e6"
,
"src/dispute/BlockOracle.sol"
:
"0x7e724b1ee0116dfd744f556e6237af449c2f40c6426d6f1462ae2a47589283bb"
,
"src/dispute/DisputeGameFactory.sol"
:
"0xfdfa141408d7f8de7e230ff4bef088e30d0e4d569ca743d60d292abdd21ff270"
,
"src/dispute/FaultDisputeGame.sol"
:
"0x
1f7d912e17f8bef2934cd3e5eee4f6a0e520e514c4ad6fdd7d1a8234494071d1
"
,
"src/dispute/FaultDisputeGame.sol"
:
"0x
0766707ab32338a6586c2340ddfbfd4e9023eeb9dfa3ef87e4b404fb0260479f
"
,
"src/legacy/DeployerWhitelist.sol"
:
"0x0a6840074734c9d167321d3299be18ef911a415e4c471fa92af7d6cfaa8336d4"
,
"src/legacy/L1BlockNumber.sol"
:
"0x20d83a636c5e2067fca8c0ed505b295174e6eddb25960d8705e6b6fea8e77fa6"
,
"src/legacy/LegacyMessagePasser.sol"
:
"0x80f355c9710af586f58cf6a86d1925e0073d1e504d0b3d814284af1bafe4dece"
,
...
...
packages/contracts-bedrock/src/cannon/PreimageKeyLib.sol
View file @
2d1dd18e
...
...
@@ -15,12 +15,13 @@ library PreimageKeyLib {
// the [1, 32) bytes in this value.
key_ := or(shl(248, 1), and(_ident, not(shl(248, 0xFF))))
}
// Localize the key with the given local context.
key_ = localize(key_, _localContext);
}
/// @notice Localizes a given local data key for the caller's context.
/// @dev The localization operation is defined as:
/// localize(k) = H(k .. sender) & ~(0xFF << 248) | (0x01 << 248)
/// localize(k) = H(k .. sender
.. local_context
) & ~(0xFF << 248) | (0x01 << 248)
/// where H is the Keccak-256 hash function.
/// @param _key The local data key to localize.
/// @param _localContext The local context for the key.
...
...
packages/contracts-bedrock/src/dispute/FaultDisputeGame.sol
View file @
2d1dd18e
...
...
@@ -174,9 +174,9 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, ISemver {
// SAFETY: While the `attack` path does not need an extra check for the post
// state's depth in relation to the parent, we don't need another
// branch because (n - n) % 2 == 0.
// TODO(cl
abby
): Once output bisection is implemented, the local context will no longer
// be constant. We will need to pass it in here based off of the ancestor
// disputed output root's L2 block number.
// TODO(cl
ient-pod#94
): Once output bisection is implemented, the local context will no longer
//
be constant. We will need to pass it in here based off of the ancestor
//
disputed output root's L2 block number.
bool validStep = VM.step(_stateData, _proof, 0) == Claim.unwrap(postState.claim);
bool parentPostAgree = (parentPos.depth() - postState.position.depth()) % 2 == 0;
if (parentPostAgree == validStep) revert ValidStep();
...
...
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