Commit 2024b56b authored by Maurelian's avatar Maurelian Committed by Kelvin Fichter

feat(contracts): remove additional batch checks

parent 538a7895
...@@ -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;
......
...@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment