Mantle | Mass adoption of decentralized & token-governed technologies. With Mantle Network, Mantle Treasury, and token holder-governed products initiatives.
The above huge calldata includes a context array. And there is an array iteration in appendSequencerBatch.
for (uint32 i = 0; i < numContexts; i++) {
BatchContext memory nextContext = _getBatchContext(i);
// Now we can update our current context.
curContext = nextContext;
// Process sequencer transactions first.
numSequencerTransactions += uint32(curContext.numSequencedTransactions);
// Now process any subsequent queue transactions.
nextQueueIndex += uint40(curContext.numSubsequentQueueTransactions);
}
If it can be optimized into an array with only one element, the later rollup transactions will be much smaller than current rollup transactions and expensive array iteration in smart contract will be avoided, which might significantly reduce rollup gas consumption.
According to our analysis, after optimization, each batch rollup transaction will reduce 1/18 to 1/6 gas consumption
Simplify groupedBlocks array to include only one element to reduce gas consumption.
Current calldata of CTC appendSequencerBatch:
The above huge calldata includes a context array. And there is an array iteration in appendSequencerBatch.
If it can be optimized into an array with only one element, the later rollup transactions will be much smaller than current rollup transactions and expensive array iteration in smart contract will be avoided, which might significantly reduce rollup gas consumption.
According to our analysis, after optimization, each batch rollup transaction will reduce 1/18 to 1/6 gas consumption