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

Rebase main v5 #25

Closed
wants to merge 12 commits into from
5 changes: 4 additions & 1 deletion .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ name: Build-Docker image

on:
push:
branches: [main]
# Pattern matched against refs/tags
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest
Expand Down
55 changes: 4 additions & 51 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

repository_dispatch:
types: [ok-to-test-command]

Expand All @@ -18,26 +18,17 @@ jobs:

strategy:
matrix:
node-version: [14.x]
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: Checkout code
uses: actions/checkout@v2
- name: setup
run: |
eval "$(ssh-agent -s)"
ssh-add /tmp/ssh-key
npm install -g npm@latest
npm i
- name: linter
Expand All @@ -53,60 +44,22 @@ jobs:

strategy:
matrix:
node-version: [14.x]
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@latest
npm i
- name: linter
run: npm run lint
- 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;
run: npm run test
18 changes: 18 additions & 0 deletions contracts/PolygonZkEVMBridgeWrapper.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.17;

import "./inheritedMainContracts/PolygonZkEVMBridge.sol";

contract PolygonZkEVMBridgeWrapper is PolygonZkEVMBridge{
function initialize(
uint32 _networkID,
IBasePolygonZkEVMGlobalExitRoot _globalExitRootManager,
address _polygonZkEVMaddress,
address _gasTokenAddress,
bool _isDeployedOnL2,
uint32 _lastUpdatedDepositCount,
bytes32[_DEPOSIT_CONTRACT_TREE_DEPTH] memory depositBranches
) public virtual override initializer {
PolygonZkEVMBridge.initialize(_networkID, _globalExitRootManager, _polygonZkEVMaddress, _gasTokenAddress, _isDeployedOnL2, _lastUpdatedDepositCount, depositBranches);
}
}
17 changes: 17 additions & 0 deletions contracts/PolygonZkEVMGlobalExitRootWrapper.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// SPDX-License-Identifier: AGPL-3.0

pragma solidity 0.8.17;

import "./interfaces/IPolygonZkEVMGlobalExitRoot.sol";
import "./inheritedMainContracts/PolygonZkEVMGlobalExitRoot.sol";

contract PolygonZkEVMGlobalExitRootWrapper is PolygonZkEVMGlobalExitRoot {
/**
* @param _rollupAddress Rollup contract address
* @param _bridgeAddress PolygonZkEVMBridge contract address
*/
function initialize(address _rollupAddress, address _bridgeAddress) public override initializer {
PolygonZkEVMGlobalExitRoot.initialize(_rollupAddress, _bridgeAddress);
}
}

2 changes: 1 addition & 1 deletion contracts/PolygonZkEVMTimelock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity 0.8.17;

import "@openzeppelin/contracts/governance/TimelockController.sol";
import "./PolygonZkEVM.sol";
import "./inheritedMainContracts/PolygonZkEVM.sol";

/**
* @dev Contract module which acts as a timelocked controller.
Expand Down
73 changes: 73 additions & 0 deletions contracts/PolygonZkEVMWrapper.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.17;

import "./inheritedMainContracts/PolygonZkEVM.sol";

contract PolygonZkEVMWrapper is PolygonZkEVM{
function initialize(
InitializePackedParameters calldata initializePackedParameters,
bytes32 genesisRoot,
string memory _trustedSequencerURL,
string memory _networkName,
string calldata _version,
IPolygonZkEVMGlobalExitRoot _globalExitRootManager,
IERC20Upgradeable _matic,
IVerifierRollup _rollupVerifier,
IPolygonZkEVMBridge _bridgeAddress
) public override initializer {
PolygonZkEVM.initialize(
initializePackedParameters,
genesisRoot,
_trustedSequencerURL,
_networkName,
_version,
_globalExitRootManager,
_matic,
_rollupVerifier,
_bridgeAddress
);
}
function verifyBatchesTrustedAggregator(
uint64 pendingStateNum,
uint64 initNumBatch,
uint64 finalNewBatch,
bytes32 newLocalExitRoot,
bytes32 newStateRoot,
bytes calldata proof
) public override onlyTrustedAggregator {
PolygonZkEVM.verifyBatchesTrustedAggregator(
pendingStateNum,
initNumBatch,
finalNewBatch,
newLocalExitRoot,
newStateRoot,
proof
);
}
function sequenceBatches(
BatchData[] calldata batches,
address l2Coinbase
) public override ifNotEmergencyState onlyTrustedSequencer {
PolygonZkEVM.sequenceBatches(
batches,
l2Coinbase
);
}
function verifyBatches(
uint64 pendingStateNum,
uint64 initNumBatch,
uint64 finalNewBatch,
bytes32 newLocalExitRoot,
bytes32 newStateRoot,
bytes calldata proof
) public override ifNotEmergencyState {
PolygonZkEVM.verifyBatches(
pendingStateNum,
initNumBatch,
finalNewBatch,
newLocalExitRoot,
newStateRoot,
proof
);
}
}
Loading
Loading