Skip to content

Commit

Permalink
Merge pull request #345 from 0xPolygonHermez/feature/fix-computez
Browse files Browse the repository at this point in the history
Feature/fix computez
  • Loading branch information
krlosMata authored Apr 23, 2024
2 parents 9b5840f + cdff16a commit f3c1504
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
"license": "UNLICENSED",
"dependencies": {
"@0xpolygonhermez/zkasmcom": "github:0xPolygonHermez/zkasmcom#develop-feijoa",
"@0xpolygonhermez/zkevm-commonjs": "github:0xpolygonhermez/zkevm-commonjs#develop-feijoa",
"@0xpolygonhermez/zkevm-commonjs": "github:0xpolygonhermez/zkevm-commonjs#feature/fix-computez",
"@grpc/grpc-js": "^1.8.14",
"chalk": "^3.0.0",
"circomlib": "^2.0.3",
Expand Down
6 changes: 3 additions & 3 deletions src/sm/sm_main/sm_main_exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ module.exports = async function execute(pols, input, rom, config = {}, metadata
throw new Error('input.z != poseidon(pointZData)');
}
await db.setProgram(stringToH4(z), hexString2byteArray(pointZData));

const kzgCommitmentHash = createHash('sha256').update(Uint8Array.from(input.kzgCommitment)).digest('hex');
input.kzgCommitmentHash = `0x${kzgCommitmentHash}`;
const kzgCommitmentArray = new Uint8Array(hexString2byteArray(input.kzgCommitment));
const sha256Str = createHash('sha256').update(kzgCommitmentArray).digest('hex');
input.kzgCommitmentHash = `0x${sha256Str}`;
await db.setProgram(stringToH4(input.kzgCommitmentHash), hexString2byteArray(input.kzgCommitment));

} else if (blob && (input.blobType === ConstantsBlob.BLOB_TYPE.CALLDATA || input.blobType === ConstantsBlob.BLOB_TYPE.FORCED)) {
Expand Down

0 comments on commit f3c1504

Please sign in to comment.