Skip to content

Commit

Permalink
Merge branch 'develop' into fix/criadoperez
Browse files Browse the repository at this point in the history
  • Loading branch information
criadoperez committed Mar 20, 2024
2 parents e36d72c + 6de80b8 commit 084a2f2
Show file tree
Hide file tree
Showing 54 changed files with 7,540 additions and 980 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ module.exports = {
'no-console': [2, { allow: ['warn', 'error'] }],
'import/prefer-default-export': [0],
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
'multiline-comment-style': 'error',
'no-await-in-loop': 'off',
'newline-before-return': 'error',
},
Expand Down
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# global owner
* @krlosMata

# src owners
/src/ @krlosMata @laisolizq @invocamanman @ignasirv
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Bug Report
description: File a bug report
title: "[Bug]: "
labels: ["bug"]
assignees:
- krlosMata
body:
- type: markdown
attributes:
value: |
Fill in all necessary information to report a bug
- type: input
id: version
attributes:
label: Version
description: What version are you using ?
placeholder: 'ex: v1.0.0'
validations:
required: true
- type: textarea
id: description
attributes:
label: Description
description: Explain the bug found and the expected result
validations:
required: true
- type: textarea
id: steps
attributes:
label: Steps to reproduce
description: Please share detailed information about ho to reproduce the bug
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log
description: Please copy and paste any relevant log output
render: shell
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Feature Request
description: File a bug report
title: "[Feature]: "
labels: ["feature"]
assignees:
- krlosMata
body:
- type: markdown
attributes:
value: |
Fill in all necessary information to request a feature
- type: input
id: version
attributes:
label: Version
description: What version the features should be added ?
placeholder: 'ex: v1.0.0'
validations:
required: true
- type: textarea
id: description
attributes:
label: Description
description: Explain the feature
validations:
required: true
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Question
description: Submit a question
title: "[Question]: "
labels: ["question"]
assignees:
- krlosMata
body:
- type: markdown
attributes:
value: |
Fill in all necessary information to submit a question
- type: input
id: version
attributes:
label: Version
description: What version the question is refering to ?
placeholder: 'ex: v1.0.0'
validations:
required: true
- type: textarea
id: question
attributes:
label: Description
description: Explain the question
validations:
required: true
81 changes: 2 additions & 79 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ on:
branches:
- main
- develop
repository_dispatch:
types: [ok-to-test-command]
- feature/fork-etrog

jobs:
trusted-build:
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
build:
runs-on: ubuntu-latest

strategy:
Expand All @@ -29,89 +27,14 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Set int-bot SSH key
run: |
touch /tmp/ssh-key
echo "${{ secrets.INT_BOT_SSH_KEY }}" > /tmp/ssh-key
chmod 400 /tmp/ssh-key
eval "$(ssh-agent -s)"
ssh-add /tmp/ssh-key
- name: Checkout code
uses: actions/checkout@v2
- name: setup
run: |
eval "$(ssh-agent -s)"
ssh-add /tmp/ssh-key
npm install -g npm@7.13.0
npm run setup
- name: eslint
run: npm run eslint
- name: test
run: npm run test

from-fork-build:
if:
github.event_name == 'repository_dispatch' &&
github.event.client_payload.slash_command.sha != '' &&
contains(github.event.client_payload.pull_request.head.sha, github.event.client_payload.slash_command.sha)
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Set int-bot SSH key
run: |
touch /tmp/ssh-key
echo "${{ secrets.INT_BOT_SSH_KEY }}" > /tmp/ssh-key
chmod 400 /tmp/ssh-key
eval "$(ssh-agent -s)"
ssh-add /tmp/ssh-key
- name: Fork based /ok-to-test checkout
uses: actions/checkout@v2
with:
ref: 'refs/pull/${{ github.event.client_payload.pull_request.number }}/merge'
- name: setup
run: |
eval "$(ssh-agent -s)"
ssh-add /tmp/ssh-key
npm install -g npm@7.13.0
npm run setup
- name: eslint
run: npm run eslint
- name: test
run: npm run test
# Update check run
- uses: actions/github-script@v5
id: update-check-run
if: ${{ always() }}
env:
number: ${{ github.event.client_payload.pull_request.number }}
job: ${{ github.job }}
# Conveniently, job.status maps to https://developer.github.com/v3/checks/runs/#update-a-check-run
conclusion: ${{ job.status }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: pull } = await github.rest.pulls.get({
...context.repo,
pull_number: process.env.number
});
const ref = pull.head.sha;
const { data: checks } = await github.rest.checks.listForRef({
...context.repo,
ref
});
const check = checks.check_runs.filter(c => c.name === process.env.job);
const { data: result } = await github.rest.checks.update({
...context.repo,
check_run_id: check[0].id,
status: 'completed',
conclusion: process.env.conclusion
});
return result;
22 changes: 0 additions & 22 deletions .github/workflows/ok-to-test.yml

This file was deleted.

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,7 @@ test/cache
package-lock.json

# ignore genesis
tools/fill-genesis/*.ignore.json
tools/fill-genesis/*.ignore.json

# input examples
tools/inputs-examples/
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ module.exports.getPoseidon = require('./src/poseidon_opt');
module.exports.MTBridge = require('./src/mt-bridge');
module.exports.mtBridgeUtils = require('./src/mt-bridge-utils');
module.exports.Database = require('./src/database');
module.exports.l1InfoTreeUtils = require('./src/l1-info-tree-utils');
module.exports.VirtualCountersManager = require('./src/virtual-counters-manager');
module.exports.blockUtils = require('./src/block-utils');
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
{
"name": "@0xpolygonhermez/zkevm-commonjs",
"description": "Javascript library implementing common utilities for zkevm",
"version": "1.0.0",
"version": "5.0.0",
"main": "index.js",
"scripts": {
"setup": "npm i",
"test": "cd test && npx hardhat compile && cd .. && npx mocha ./test/*.test.js && npm run test:e2e && npm run test:blockinfo && npm run test:selfdestruct",
"test": "cd test && npx hardhat compile && cd .. && npx mocha ./test/*.test.js && npm run test:e2e && npm run test:blockinfo && npm run test:selfdestruct && npm run test:etrog",
"test:etrog": "npx mocha ./test/processor.test.js --etrog",
"test:e2e": "npx mocha ./test/processor.test.js --e2e",
"test:blockinfo": "npx mocha ./test/processor.test.js --blockinfo",
"test:selfdestruct": "npx mocha ./test/processor.test.js --selfdestruct",
"eslint": "npx eslint src/** test/*.test.js && npx eslint tools",
"eslint:fix": "npx eslint src/** test/*.test.js --fix && npx eslint tools --fix",
"test:update": "./tools/update-tests/update-tests.sh",
"test:database": "npx mocha ./test/database.test.js"
"test:database": "npx mocha ./test/database.test.js",
"build:inputs": "npx mocha ./test/processor.test.js --update --geninputs && npx mocha ./test/processor.test.js --etrog --update --geninputs"
},
"repository": {
"type": "git",
Expand All @@ -35,7 +37,7 @@
},
"homepage": "https://github.com/0xPolygonHermez/zkevm-commonjs#readme",
"devDependencies": {
"@0xpolygonhermez/zkevm-contracts": "github:0xPolygonHermez/zkevm-contracts#v1.0.0-fork.3",
"@0xpolygonhermez/zkevm-contracts": "github:0xPolygonHermez/zkevm-contracts#feature/l1-info-tree",
"@ethersproject/abi": "^5.6.4",
"@nomiclabs/hardhat-ethers": "^2.1.0",
"@nomiclabs/hardhat-waffle": "^2.0.2",
Expand All @@ -51,7 +53,7 @@
"@ethereumjs/block": "^3.6.2",
"@ethereumjs/tx": "^3.4.0",
"@polygon-hermez/common": "2.6.4",
"@polygon-hermez/vm": "5.7.30",
"@polygon-hermez/vm": "6.0.12",
"ethereumjs-util": "^7.1.4",
"ethers": "^5.5.4",
"ffjavascript": "^0.2.55",
Expand Down
Loading

0 comments on commit 084a2f2

Please sign in to comment.