Skip to content

Commit

Permalink
lint fix + move gas bound caller to separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
StanislavBreadless committed May 7, 2024
1 parent 2c1c688 commit 6afb3ab
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 49 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/gas-bound-caller-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: GasBoundCaller CI

on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.18.0
cache: yarn

- name: Install dependencies
run: yarn

- name: Build L1 artifacts
run: yarn gas-bound-caller build

- name: Check the correcntess of the canonical bytecode
run: yarn gas-bound-caller calculate-canonical-bytecode:check

- name: Create cache
uses: actions/cache/save@v3
with:
key: artifacts-gas-bound-caller-${{ github.sha }}
path: |
gas-bound-caller/artifacts-zk
gas-bound-caller/cache-zk
gas-bound-caller/typechain
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.18.0
cache: yarn

- name: Install dependencies
run: yarn

- name: Lint
run: yarn lint:check

test:
needs: [build, lint]
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.18.0
cache: yarn

- name: Install dependencies
run: yarn

- name: Restore artifacts cache
uses: actions/cache/restore@v3
with:
fail-on-cache-miss: true
key: artifacts-gas-bound-caller-${{ github.sha }}
path: |
gas-bound-caller/artifacts-zk
gas-bound-caller/cache-zk
gas-bound-caller/typechain
- name: Use era-test-node for testing
uses: dutterbutter/[email protected]
with:
releaseTag: v0.0.1-vm1.5.0

- name: Run tests
run: yarn gas-bound-caller test
33 changes: 0 additions & 33 deletions .github/workflows/l2-contracts-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,36 +94,3 @@ jobs:

- name: Run tests
run: yarn l2 test

gas-bound-caller:
needs: [build, lint]
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.18.0
cache: yarn

- name: Install dependencies
run: yarn

- name: Build GasBoundCaller
run: yarn gas-bound-caller build

- name: CHeck the correcntess of the canonical bytecode
run: yarn gas-bound-caller calculate-canonical-bytecode:check

- name: Use era-test-node for testing
uses: dutterbutter/[email protected]
with:
releaseTag: v0.0.1-vm1.5.0

- name: Run tests
run: yarn gas-bound-caller test
9 changes: 4 additions & 5 deletions gas-bound-caller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ yarn deploy-on-hyperchain --private-key <private-key> --l2-rpc <rpc>

### Deployed addresses

| Network | Address |
| -------- | ------- |
| Era Testnet | [0xDaAD9137Deec2FCbB8C4aB3820553E0da60328b6](https://sepolia.explorer.zksync.io/address/0xDaAD9137Deec2FCbB8C4aB3820553E0da60328b6#contract) |
| Era Mainnet | TODO |

| Network | Address |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| Era Testnet | [0xDaAD9137Deec2FCbB8C4aB3820553E0da60328b6](https://sepolia.explorer.zksync.io/address/0xDaAD9137Deec2FCbB8C4aB3820553E0da60328b6#contract) |
| Era Mainnet | TODO |
4 changes: 2 additions & 2 deletions gas-bound-caller/scripts/deploy-on-hyperchain.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// hardhat import should be the first import in the file
import { ethers } from "ethers";
import { Command } from "commander";
import { PREDEPLOYED_CREATE2_ADDRESS, getCreate2DeploymentInfo, readCanonicalArtifact } from "./utils";
import { Wallet, Provider, Contract, utils } from "zksync-ethers";
import { PREDEPLOYED_CREATE2_ADDRESS, getCreate2DeploymentInfo } from "./utils";
import { Wallet, Provider, Contract } from "zksync-ethers";

const singletonFactoryAbi = [
{
Expand Down
6 changes: 3 additions & 3 deletions gas-bound-caller/scripts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export function readCanonicalArtifact() {
}

export interface Create2DeploymentInfo {
bytecode: string,
bytecodeHash: string,
expectedAddress: string,
bytecode: string;
bytecodeHash: string;
expectedAddress: string;
}

export function getCreate2DeploymentInfo(): Create2DeploymentInfo {
Expand Down
2 changes: 1 addition & 1 deletion gas-bound-caller/scripts/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async function main() {

const verificationMessage = await verifyPromise(expectedAddress);

if(verificationMessage.status == "fulfilled") {
if (verificationMessage.status == "fulfilled") {
console.log(verificationMessage.value);
} else {
console.log(verificationMessage.reason);
Expand Down
6 changes: 1 addition & 5 deletions l1-contracts/test/unit_tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,7 @@ export const REQUIRED_L2_GAS_PRICE_PER_PUBDATA =

/// Set of parameters that are needed to test the processing of priority operations
export class DummyOp {
constructor(
public id: number,
public expirationBatch: BigNumber,
public layer2Tip: number
) {}
constructor(public id: number, public expirationBatch: BigNumber, public layer2Tip: number) {}

Check failure on line 62 in l1-contracts/test/unit_tests/utils.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `public·id:·number,·public·expirationBatch:·BigNumber,·public·layer2Tip:·number` with `⏎····public·id:·number,⏎····public·expirationBatch:·BigNumber,⏎····public·layer2Tip:·number⏎··`

Check failure on line 62 in l1-contracts/test/unit_tests/utils.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `public·id:·number,·public·expirationBatch:·BigNumber,·public·layer2Tip:·number` with `⏎····public·id:·number,⏎····public·expirationBatch:·BigNumber,⏎····public·layer2Tip:·number⏎··`

Check failure on line 62 in l1-contracts/test/unit_tests/utils.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `public·id:·number,·public·expirationBatch:·BigNumber,·public·layer2Tip:·number` with `⏎····public·id:·number,⏎····public·expirationBatch:·BigNumber,⏎····public·layer2Tip:·number⏎··`

Check failure on line 62 in l1-contracts/test/unit_tests/utils.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `public·id:·number,·public·expirationBatch:·BigNumber,·public·layer2Tip:·number` with `⏎····public·id:·number,⏎····public·expirationBatch:·BigNumber,⏎····public·layer2Tip:·number⏎··`
}

export async function getCallRevertReason(promise) {
Expand Down
1 change: 1 addition & 0 deletions system-contracts/contracts/DefaultAccount.sol
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ contract DefaultAccount is IAccount {
assert(msg.sender != BOOTLOADER_FORMAL_ADDRESS);

// If the contract is called directly, behave like an EOA

}

receive() external payable {
Expand Down

0 comments on commit 6afb3ab

Please sign in to comment.