Skip to content

Commit

Permalink
test: revert PoV tests to their original expected proofSize value ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandar Brayanov committed Oct 11, 2024
1 parent d962111 commit 58db5bd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describeSuite({
let contracts: HeavyContract[];
let callData: `0x${string}`;
const MAX_CONTRACTS = 20;
const EXPECTED_POV_ROUGH = 38_000; // bytes
const EXPECTED_POV_ROUGH = 16_000; // bytes

beforeAll(async () => {
const { contractAddress, abi } = await deployCreateCompiledContract(context, "CallForwarder");
Expand Down Expand Up @@ -98,7 +98,7 @@ describeSuite({
// in the block.
// 1M Gas allows ~38k of PoV, so we verify we are within range.
expect(block.proofSize).to.be.at.least(15_000);
expect(block.proofSize).to.be.at.most(38_000 * 1.2);
expect(block.proofSize).to.be.at.most(25_000);
expect(result?.successful).to.equal(true);
expectEVMResult(result!.events, "Error", "OutOfGas");
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ describeSuite({
const { result, block } = await context.createBlock(rawSigned);

log(`block.proofSize: ${block.proofSize} (successful: ${result?.successful})`);
expect(block.proofSize).toBeGreaterThanOrEqual(30_000);
expect(block.proofSize).toBeLessThanOrEqual(50_000n + emptyBlockProofSize);
expect(block.proofSize).toBeGreaterThanOrEqual(15_000);
expect(block.proofSize).toBeLessThanOrEqual(25_000n + emptyBlockProofSize);
expect(result?.successful).to.equal(true);
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describeSuite({
testCases: ({ context, it }) => {
let contracts: HeavyContract[];
const MAX_CONTRACTS = 50;
const EXPECTED_POV_ROUGH = 8_000; // bytes
const EXPECTED_POV_ROUGH = 20_000; // bytes
let batchAbi: Abi;
let proxyAbi: Abi;
let proxyAddress: `0x${string}`;
Expand Down Expand Up @@ -63,8 +63,8 @@ describeSuite({
// With 1M gas we are allowed to use ~62kb of POV, so verify the range.
// The tx is still included in the block because it contains the failed tx,
// so POV is included in the block as well.
expect(block.proofSize).to.be.at.least(6_000);
expect(block.proofSize).to.be.at.most(10_000);
expect(block.proofSize).to.be.at.least(15_000);
expect(block.proofSize).to.be.at.most(30_000);
expect(result?.successful).to.equal(true);
expectEVMResult(result!.events, "Error", "OutOfGas");
},
Expand All @@ -91,7 +91,7 @@ describeSuite({
expect(block.proofSize).to.be.at.least(EXPECTED_POV_ROUGH / 1.3);
expect(block.proofSize).to.be.at.most(EXPECTED_POV_ROUGH * 1.3);
expect(result?.successful).to.equal(true);
expectEVMResult(result!.events, "Succeed");
expectEVMResult(result!.events, "Succeed", "Reserved");
},
});

Expand All @@ -110,7 +110,7 @@ describeSuite({
expect(block.proofSize).to.be.at.least(EXPECTED_POV_ROUGH / 1.3);
expect(block.proofSize).to.be.at.most(EXPECTED_POV_ROUGH * 1.3);
expect(result?.successful).to.equal(true);
expectEVMResult(result!.events, "Succeed");
expectEVMResult(result!.events, "Succeed", "Returned");
},
});
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ describeSuite({
});

const { result, block } = await context.createBlock(rawSigned);
expect(block.proofSize).to.be.at.least(Number(6_000));
expect(block.proofSize).to.be.at.most(Number(10_000n + emptyBlockProofSize));
expect(block.proofSize).to.be.at.least(Number(15_000));
expect(block.proofSize).to.be.at.most(Number(30_000n + emptyBlockProofSize));
expect(result?.successful).to.equal(true);
},
});
Expand Down

0 comments on commit 58db5bd

Please sign in to comment.