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
d40468c1
Commit
d40468c1
authored
Dec 08, 2020
by
Alina
Committed by
GitHub
Dec 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
global root index check (#106)
parent
b2ad9408
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
OVM_FraudVerifier.sol
...ptimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol
+5
-5
OVM_FraudVerifier.spec.ts
...test/contracts/OVM/verification/OVM_FraudVerifier.spec.ts
+1
-1
No files found.
packages/contracts/contracts/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol
View file @
d40468c1
...
...
@@ -125,7 +125,7 @@ contract OVM_FraudVerifier is Lib_AddressResolver, OVM_FraudContributor, iOVM_Fr
_preStateRootBatchHeader.prevTotalElements + _preStateRootProof.index == _transactionBatchHeader.prevTotalElements + _transactionProof.index,
"Pre-state root global index must equal to the transaction root global index."
);
deployTransitioner(_preStateRoot, _txHash, _preStateRootProof.index);
}
...
...
@@ -173,9 +173,9 @@ contract OVM_FraudVerifier is Lib_AddressResolver, OVM_FraudContributor, iOVM_Fr
"State transition process must be completed prior to finalization."
);
require(
_postStateRoot
Proof.index ==
_preStateRootProof.index + 1,
"
Invalid post-state root index
."
require
(
_postStateRoot
BatchHeader.prevTotalElements + _postStateRootProof.index == _preStateRootBatchHeader.prevTotalElements +
_preStateRootProof.index + 1,
"
Post-state root global index must equal to the pre state root global index plus one
."
);
require(
...
...
@@ -201,7 +201,7 @@ contract OVM_FraudVerifier is Lib_AddressResolver, OVM_FraudContributor, iOVM_Fr
_postStateRoot != transitioner.getPostStateRoot(),
"State transition has not been proven fraudulent."
);
cancelStateTransition(_postStateRootBatchHeader, _preStateRoot);
}
...
...
packages/contracts/test/contracts/OVM/verification/OVM_FraudVerifier.spec.ts
View file @
d40468c1
...
...
@@ -274,7 +274,7 @@ describe('OVM_FraudVerifier', () => {
DUMMY_BATCH_HEADERS
[
0
],
batchProof
)
).
to
.
be
.
revertedWith
(
'
Invalid post-state root index
.
'
)
).
to
.
be
.
revertedWith
(
'
Post-state root global index must equal to the pre state root global index plus one
.
'
)
})
})
...
...
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