Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
icemelon committed Sep 1, 2023
1 parent 76072bd commit c0cd3c5
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions contracts/integration-test/ScrollChain.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable node/no-unpublished-import */
/* eslint-disable node/no-missing-import */
import { concat } from "ethers/lib/utils";
import { constants } from "ethers";
import { concat } from "ethers/lib/utils";
import { ethers } from "hardhat";
Expand Down Expand Up @@ -32,7 +33,7 @@ describe("ScrollChain", async () => {
await chainProxy.deployed();
chain = await ethers.getContractAt("ScrollChain", chainProxy.address, deployer);

await chain.initialize(queue.address, constants.AddressZero, 44);
await chain.initialize(queue.address, constants.AddressZero, 100);
await chain.addSequencer(deployer.address);
await queue.initialize(
constants.AddressZero,
Expand All @@ -50,11 +51,11 @@ describe("ScrollChain", async () => {
await chain.importGenesisBatch(batchHeader0, "0x0000000000000000000000000000000000000000000000000000000000000001");
const parentBatchHash = await chain.committedBatches(0);
console.log("genesis batch hash:", parentBatchHash);

for (let numChunks = 1; numChunks <= 3; ++numChunks) {
for (let numBlocks = 1; numBlocks <= 3; ++numBlocks) {
for (let numTx = 1; numTx <= 10; ++numTx) {
for (let txLength = 100; txLength <= 1000; txLength += 100) {
console.log(`ChunkPerBatch`, `BlockPerChunk`, `TxPerBlock`, `BytesPerTx`, `TotalBytes`, `EstimateGas`);
for (let numChunks = 3; numChunks <= 6; ++numChunks) {
for (let numBlocks = 1; numBlocks <= 5; ++numBlocks) {
for (let numTx = 20; numTx <= Math.min(30, 100 / numBlocks); ++numTx) {
for (let txLength = 800; txLength <= 1000; txLength += 100) {
const txs: Array<Uint8Array> = [];
for (let i = 0; i < numTx; i++) {
const tx = new Uint8Array(4 + txLength);
Expand Down Expand Up @@ -82,12 +83,12 @@ describe("ScrollChain", async () => {

const estimateGas = await chain.estimateGas.commitBatch(0, batchHeader0, chunks, "0x");
console.log(
`ChunkPerBatch[${numChunks}]`,
`BlockPerChunk[${numBlocks}]`,
`TxPerBlock[${numTx}]`,
`BytesPerTx[${txLength}]`,
`TotalBytes[${numChunks * numBlocks * numTx * (txLength + 1)}]`,
`EstimateGas[${estimateGas.toString()}]`
`${numChunks}`,
`${numBlocks}`,
`${numTx}`,
`${txLength}`,
`${numChunks * numBlocks * numTx * (txLength + 1)}`,
`${estimateGas.toString()}`
);
}
}
Expand Down

0 comments on commit c0cd3c5

Please sign in to comment.