Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/fix ft stop #360

Merged
merged 3 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches:
- main
- develop
- develop-eldelberry
- develop-banana
push:
branches:
- main
Expand Down
94 changes: 47 additions & 47 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@
"license": "AGPL3",
"dependencies": {
"@0xpolygonhermez/zkasmcom": "github:0xPolygonHermez/zkasmcom#v5.0.0-fork.8",
"@0xpolygonhermez/zkevm-commonjs": "github:0xpolygonhermez/zkevm-commonjs#v6.0.1-fork.9",
"@0xpolygonhermez/zkevm-rom": "github:0xPolygonHermez/zkevm-rom#v8.0.0-rc.1-fork.12",
"@0xpolygonhermez/zkevm-commonjs": "github:0xpolygonhermez/zkevm-commonjs#v8.0.0-fork.12",
"@0xpolygonhermez/zkevm-rom": "github:0xPolygonHermez/zkevm-rom#v8.0.0-rc.3-fork.12",
"@0xpolygonhermez/zkevm-storage-rom": "https://github.com/0xPolygonHermez/zkevm-storage-rom.git#v4.0.0-fork.7",
"@0xpolygonhermez/zkevm-testvectors": "github:0xPolygonHermez/zkevm-testvectors#v6.0.1-fork.9",
"@0xpolygonhermez/zkevm-testvectors": "github:0xPolygonHermez/zkevm-testvectors#v8.0.0-rc.3-fork.12",
"@grpc/grpc-js": "^1.8.14",
"chalk": "^3.0.0",
"circomlib": "^2.0.3",
Expand Down
2 changes: 1 addition & 1 deletion src/sm/sm_main/debug/full-tracer.js
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ class FullTracer {
}
// If is an ether transfer, don't add stop opcode to trace
if (singleInfo.opcode === 'STOP'
&& (typeof prevStep === 'undefined' || (opCreate.includes(prevStep.opcode) && Number(prevStep.gas_cost) <= 32000))
&& (typeof prevStep === 'undefined' || (opCreate.includes(prevStep.opcode) && Number(prevStep.gas_cost) <= 32000 && prevStep.error === ''))
&& Number(getVarFromCtx(ctx, false, 'bytecodeLength')) === 0) {
this.full_trace.pop();
}
Expand Down
2 changes: 1 addition & 1 deletion tools/full-tracer-tests/full-tracer-tests-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const { initBlockHeader, fillReceiptTree, setBlockGasUsed } = blockUtils;
const { computeL2TxHash } = processorUtils;

async function checkBlockInfoRootsFromTrace(testName) {
const ftTrace = JSON.parse(fs.readFileSync(path.join(__dirname, `../../src/sm/sm_main/logs-full-trace/${testName}__full_trace.json`), 'utf8'));
const ftTrace = JSON.parse(fs.readFileSync(path.join(__dirname, `../../src/sm/sm_main/logs-full-trace/${testName}__full_trace_FULL_BATCH.json`), 'utf8'));
const poseidon = await buildPoseidon();
const { F } = poseidon;
// Generate block info tree from trace for each block
Expand Down
6 changes: 5 additions & 1 deletion tools/full-tracer-tests/full-tracer-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,10 @@ async function compareCallTracer(geth, fullTracer, i) {
// }
// Detect failed create2
} else if (opCreate.includes(previousStep.opcode) && previousStep.depth === step.depth) {
if (previousStep.error === 'invalidAddressCollision') {
currentStep++;
continue;
}
callData[ctx + 1] = {
from: previousStep.contract.address,
gas: `0x${Number(step.gas).toString(16)}`,
Expand Down Expand Up @@ -709,7 +713,7 @@ async function getFtTrace(test, txsCount, rom, isEthereumTest) {
const ftTraces = [];
for (let i = 0; i < txsCount; i++) {
const blockNum = isEthereumTest ? [1, i] : getBlockNumFromTxCount(test, i);
const ftTrace = JSON.parse(fs.readFileSync(path.join(__dirname, `../../src/sm/sm_main/logs-full-trace/${test.testName}__full_trace_${blockNum[0]}_${blockNum[1]}.json`), 'utf8'));
const ftTrace = JSON.parse(fs.readFileSync(path.join(__dirname, `../../src/sm/sm_main/logs-full-trace/${test.testName}__full_trace_TX_${blockNum[0]}_${blockNum[1]}.json`), 'utf8'));
ftTraces.push(ftTrace);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"from": "0x4d5cf5032b2a844602278b01199ed191a86c93ff",
"gas": "0x989680",
"gasUsed": "0x96255e",
"to": "0x1275fbb540c8efc58b812ba83b0d0b8b9917ae98",
"input": "0xe1925e75",
"output": "0x0000000000000000000000000000000000000000000000000000000000000000",
"calls": [
{
"from": "0x1275fbb540c8efc58b812ba83b0d0b8b9917ae98",
"gas": "0x241e2",
"gasUsed": "0x0",
"to": "0x69ea213eb18d02b6a6748167762aecbf2a826972",
"input": "0x00000000",
"value": "0x0",
"type": "CALL"
}
],
"value": "0x0",
"type": "CALL"
}
Loading
Loading