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
2024b56b
Unverified
Commit
2024b56b
authored
Sep 16, 2021
by
Maurelian
Committed by
Kelvin Fichter
Nov 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(contracts): remove additional batch checks
parent
538a7895
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
70 deletions
+0
-70
OVM_CanonicalTransactionChain.sol
...cts/contracts/L1/rollup/OVM_CanonicalTransactionChain.sol
+0
-20
OVM_CanonicalTransactionChain.spec.ts
...contracts/L1/rollup/OVM_CanonicalTransactionChain.spec.ts
+0
-50
No files found.
packages/contracts/contracts/L1/rollup/OVM_CanonicalTransactionChain.sol
View file @
2024b56b
...
@@ -418,16 +418,6 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad
...
@@ -418,16 +418,6 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad
"Function can only be called by the Sequencer."
"Function can only be called by the Sequencer."
);
);
require(
numContexts > 0,
"Must provide at least one batch context."
);
require(
totalElementsToAppend > 0,
"Must append at least one element."
);
uint40 nextTransactionPtr = uint40(
uint40 nextTransactionPtr = uint40(
BATCH_CONTEXT_START_POS + BATCH_CONTEXT_SIZE * numContexts
BATCH_CONTEXT_START_POS + BATCH_CONTEXT_SIZE * numContexts
);
);
...
@@ -504,16 +494,6 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad
...
@@ -504,16 +494,6 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad
}
}
}
}
require(
msg.data.length == nextTransactionPtr,
"Not all sequencer transactions were processed."
);
require(
leafIndex == totalElementsToAppend,
"Actual transaction index does not match expected total elements to append."
);
// Generate the required metadata that we need to append this batch
// Generate the required metadata that we need to append this batch
uint40 numQueuedTransactions = totalElementsToAppend - numSequencerTransactions;
uint40 numQueuedTransactions = totalElementsToAppend - numSequencerTransactions;
uint40 blockTimestamp;
uint40 blockTimestamp;
...
...
packages/contracts/test/contracts/L1/rollup/OVM_CanonicalTransactionChain.spec.ts
View file @
2024b56b
...
@@ -715,27 +715,6 @@ describe('OVM_CanonicalTransactionChain', () => {
...
@@ -715,27 +715,6 @@ describe('OVM_CanonicalTransactionChain', () => {
)
)
})
})
it
(
'
should revert if not all sequencer transactions are processed
'
,
async
()
=>
{
const
timestamp
=
await
getEthTime
(
ethers
.
provider
)
const
blockNumber
=
(
await
getNextBlockNumber
(
ethers
.
provider
))
-
1
await
expect
(
appendSequencerBatch
(
OVM_CanonicalTransactionChain
,
{
transactions
:
[
'
0x1234
'
,
'
0x1234
'
],
contexts
:
[
{
numSequencedTransactions
:
0
,
numSubsequentQueueTransactions
:
0
,
timestamp
,
blockNumber
,
},
],
shouldStartAtElement
:
0
,
totalElementsToAppend
:
1
,
})
).
to
.
be
.
revertedWith
(
'
Not all sequencer transactions were processed.
'
)
})
it
(
'
should revert if not called by the sequencer
'
,
async
()
=>
{
it
(
'
should revert if not called by the sequencer
'
,
async
()
=>
{
await
expect
(
await
expect
(
appendSequencerBatch
(
OVM_CanonicalTransactionChain
.
connect
(
signer
),
{
appendSequencerBatch
(
OVM_CanonicalTransactionChain
.
connect
(
signer
),
{
...
@@ -754,35 +733,6 @@ describe('OVM_CanonicalTransactionChain', () => {
...
@@ -754,35 +733,6 @@ describe('OVM_CanonicalTransactionChain', () => {
).
to
.
be
.
revertedWith
(
'
Function can only be called by the Sequencer.
'
)
).
to
.
be
.
revertedWith
(
'
Function can only be called by the Sequencer.
'
)
})
})
it
(
'
should revert if no contexts are provided
'
,
async
()
=>
{
await
expect
(
appendSequencerBatch
(
OVM_CanonicalTransactionChain
,
{
transactions
:
[
'
0x1234
'
],
contexts
:
[],
shouldStartAtElement
:
0
,
totalElementsToAppend
:
1
,
})
).
to
.
be
.
revertedWith
(
'
Must provide at least one batch context.
'
)
})
it
(
'
should revert if total elements to append is zero
'
,
async
()
=>
{
await
expect
(
appendSequencerBatch
(
OVM_CanonicalTransactionChain
,
{
transactions
:
[
'
0x1234
'
],
contexts
:
[
{
numSequencedTransactions
:
0
,
numSubsequentQueueTransactions
:
0
,
timestamp
:
0
,
blockNumber
:
0
,
},
],
shouldStartAtElement
:
0
,
totalElementsToAppend
:
0
,
})
).
to
.
be
.
revertedWith
(
'
Must append at least one element.
'
)
})
it
(
'
should revert when trying to input more data than the max data size
'
,
async
()
=>
{
it
(
'
should revert when trying to input more data than the max data size
'
,
async
()
=>
{
const
MAX_ROLLUP_TX_SIZE
=
const
MAX_ROLLUP_TX_SIZE
=
await
OVM_CanonicalTransactionChain
.
MAX_ROLLUP_TX_SIZE
()
await
OVM_CanonicalTransactionChain
.
MAX_ROLLUP_TX_SIZE
()
...
...
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