Skip to content

Commit

Permalink
Fail ft test on executor error
Browse files Browse the repository at this point in the history
  • Loading branch information
ignasirv committed Nov 20, 2023
1 parent 4c90cd5 commit a9b5bbd
Show file tree
Hide file tree
Showing 4 changed files with 766 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ pil-config.json
parallel-tests
verbose-config.json
*.stats
full-tracer-tests/ft-traces
1 change: 1 addition & 0 deletions tools/full-tracer-tests/full-tracer-tests-prover.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const { newCommitPolsArray, compile } = require('pilcom');
const buildPoseidon = require('@0xpolygonhermez/zkevm-commonjs').getPoseidon;
const _ = require('lodash');
const chalk = require('chalk');
const zkasm = require('@0xpolygonhermez/zkasmcom');
const grpc = require('@grpc/grpc-js');
const protoLoader = require('@grpc/proto-loader');
const { Scalar } = require('ffjavascript');
Expand Down
14 changes: 12 additions & 2 deletions tools/full-tracer-tests/full-tracer-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const opCreate = ['CREATE', 'CREATE2'];
const ethereumTestsPath = '../../../zkevm-testvectors/tools/ethereum-tests/tests/BlockchainTests/GeneralStateTests/';
const stTestsPath = '../../../zkevm-testvectors/state-transition';
const stopOnFailure = true;
const invalidTests = ['custom-tx.json', 'access-list.json', 'effective-gas-price.json', 'op-basefee.json', 'CREATE2_HighNonceDelegatecall.json', 'op-selfdestruct.json', 'txs-calldata.json'];
const invalidTests = ['custom-tx.json', 'access-list.json', 'effective-gas-price.json', 'op-basefee.json', 'CREATE2_HighNonceDelegatecall.json', 'op-selfdestruct.json', 'txs-calldata.json', 'over-calldata.json'];
const invalidOpcodes = ['BASEFEE', 'SELFDESTRUCT', 'TIMESTAMP', 'COINBASE', 'BLOCKHASH', 'NUMBER', 'DIFFICULTY', 'GASLIMIT', 'EXTCODEHASH', 'SENDALL', 'PUSH0'];
const invalidErrors = ['return data out of bounds', 'gas uint64 overflow', 'contract creation code storage out of gas', 'write protection'];
const noExec = require('../../../zkevm-testvectors/tools/ethereum-tests/no-exec.json');
Expand Down Expand Up @@ -127,6 +127,7 @@ async function main() {
console.log('Finished');
} catch (e) {
console.log(e);
process.exit(1);
}
}

Expand Down Expand Up @@ -696,7 +697,7 @@ async function runTxs(test) {
to: txTest.to,
nonce: Number(txTest.nonce),
value: ethers.utils.parseUnits(String(txTest.value), 'wei'),
data: txTest.data,
data: formatNotOddData(txTest.data),
gasLimit: Number(txTest.gasLimit),
gasPrice: Number(txTest.gasPrice),
chainId: Number(txTest.chainId),
Expand Down Expand Up @@ -839,4 +840,13 @@ function sleep(ms) {
setTimeout(resolve, ms);
});
}

function formatNotOddData(data) {
if (data && data.length % 2 !== 0) {
return `0x0${data.slice(2)}`;
}

return data;
}

main();
Loading

0 comments on commit a9b5bbd

Please sign in to comment.