Skip to content

Commit

Permalink
Start fixing issues after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
popzxc committed Jan 19, 2021
1 parent c02852f commit 3df9b77
Show file tree
Hide file tree
Showing 26 changed files with 2,306 additions and 2,047 deletions.
Empty file modified .githooks/pre-commit
100644 → 100755
Empty file.
Empty file modified .githooks/pre-push
100644 → 100755
Empty file.
1,304 changes: 787 additions & 517 deletions Cargo.lock

Large diffs are not rendered by default.

Empty file modified bin/ci_run
100644 → 100755
Empty file.
Empty file modified bin/zcli
100644 → 100755
Empty file.
Empty file modified bin/zk
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion contracts/contract-templates/TokenInitTemplate.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.7.0;

contract TokenDeployInit {
function getTokens() internal pure returns (address[] memory) {
Expand Down
8 changes: 5 additions & 3 deletions contracts/contracts/TokenInit.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// SPDX-License-Identifier: MIT OR Apache-2.0

pragma solidity ^0.7.0;

contract TokenDeployInit {
function getTokens() internal pure returns (address[] memory) {
address[] memory tokens = new address[](0);
address[] memory tokens = new address[](4);
tokens[0] = 0x472d533243475f40221F3fD22C5bA5F98c71D10B;
tokens[1] = 0x1412295a435aB93CC9082FeaB48532170189E0D2;
tokens[2] = 0x623CFDc6F8D2011A2607254D2Fa4582691b66A45;
tokens[3] = 0xAd4E5DE9646A905a57e26ba99d58538BcA48bf28;
return tokens;
}
}
32 changes: 16 additions & 16 deletions contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ const prodConfig = {
MAX_AMOUNT_OF_REGISTERED_TOKENS: 127,
// PRIORITY_EXPIRATION: 101,
DUMMY_VERIFIER: false,
UPGRADE_FROM_V3: true
UPGRADE_FROM_V3: true,
};
const testnetConfig = {
UPGRADE_NOTICE_PERIOD: 0,
MAX_AMOUNT_OF_REGISTERED_TOKENS: 127,
// PRIORITY_EXPIRATION: 101,
DUMMY_VERIFIER: false,
UPGRADE_FROM_V3: true
UPGRADE_FROM_V3: true,
};
const testConfig = {
UPGRADE_NOTICE_PERIOD: 0,
MAX_AMOUNT_OF_REGISTERED_TOKENS: 5,
PRIORITY_EXPIRATION: 101,
DUMMY_VERIFIER: true
DUMMY_VERIFIER: true,
};

const localConfig = Object.assign({}, prodConfig);
Expand All @@ -33,7 +33,7 @@ const contractDefs = {
ropsten: testnetConfig,
mainnet: prodConfig,
test: testConfig,
localhost: localConfig
localhost: localConfig,
};

export default {
Expand All @@ -42,33 +42,33 @@ export default {
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
runs: 200,
},
},
},
contractSizer: {
runOnCompile: false
runOnCompile: false,
},
paths: {
sources: './contracts'
sources: './contracts',
},
solpp: {
defs: (() => {
if (process.env.CONTRACT_TESTS) {
return contractDefs.test;
}
return contractDefs[process.env.ETH_NETWORK];
})()
return contractDefs[process.env.CHAIN_ETH_NETWORK];
})(),
},
networks: {
env: {
url: process.env.WEB3_URL
url: process.env.ETH_CLIENT_WEB3_URL,
},
hardhat: {
allowUnlimitedContractSize: true
}
allowUnlimitedContractSize: true,
},
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY
}
apiKey: process.env.MISC_ETHERSCAN_API_KEY,
},
};
6 changes: 3 additions & 3 deletions contracts/scripts/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ethers } from 'ethers';
const hre = require('hardhat');

async function main() {
if (process.env.ETH_NETWORK == 'localhost') {
if (process.env.CHAIN_ETH_NETWORK == 'localhost') {
console.log('Skip contract publish on localhost');
return;
}
Expand All @@ -13,7 +13,7 @@ async function main() {
addresses.ZkSyncTarget,
addresses.VerifierTarget,
addresses.GovernanceTarget,
addresses.UpgradeGatekeeper
addresses.UpgradeGatekeeper,
]) {
try {
await hre.run('verify', { address });
Expand All @@ -26,7 +26,7 @@ async function main() {
const address = addresses.ZkSync;
const zkSyncEncodedArguments = ethers.utils.defaultAbiCoder.encode(
['address', 'address', 'bytes32'],
[addresses.Governance, addresses.Verifier, process.env.GENESIS_ROOT]
[addresses.Governance, addresses.Verifier, process.env.CONTRACTS_GENESIS_ROOT]
);

const constructorArguments = [addresses.ZkSyncTarget, zkSyncEncodedArguments];
Expand Down
69 changes: 48 additions & 21 deletions core/lib/storage/sqlx-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -1044,27 +1044,6 @@
"nullable": []
}
},
"4534e42575c3d9d93740398a6247ee09048d4abf5426389c0d07f7b6f609c372": {
"query": "\n WITH unsized_blocks AS (\n SELECT * FROM operations o\n WHERE action_type = 'COMMIT'\n AND block_number >\n (SELECT COALESCE(max(block_number),0) FROM operations WHERE action_type = 'VERIFY')\n AND NOT EXISTS\n (SELECT * FROM proofs WHERE block_number = o.block_number)\n AND NOT EXISTS\n (SELECT * FROM prover_runs\n WHERE block_number = o.block_number AND (now() - updated_at) < $1::interval)\n )\n SELECT min(block_number) FROM unsized_blocks\n INNER JOIN blocks\n ON unsized_blocks.block_number = blocks.number AND blocks.block_size = $2\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "min",
"type_info": "Int8"
}
],
"parameters": {
"Left": [
"Interval",
"Int8"
]
},
"nullable": [
null
]
}
},
"457b4a87812ac9dcad6fbfc356952f05481a5729074ce305c3dedb33f99672f6": {
"query": "\n DELETE FROM pending_block WHERE number = $1\n ",
"describe": {
Expand Down Expand Up @@ -2781,6 +2760,54 @@
"nullable": []
}
},
"ab8774812664b1c1d4207e7fcd5e04a078293d295c469f043e5bc4933c0c2944": {
"query": "SELECT * FROM aggregate_operations\n WHERE NOT EXISTS (SELECT * FROM eth_aggregated_ops_binding WHERE op_id = aggregate_operations.id)\n ORDER BY id ASC",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Int8"
},
{
"ordinal": 1,
"name": "action_type",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "arguments",
"type_info": "Jsonb"
},
{
"ordinal": 3,
"name": "from_block",
"type_info": "Int8"
},
{
"ordinal": 4,
"name": "to_block",
"type_info": "Int8"
},
{
"ordinal": 5,
"name": "created_at",
"type_info": "Timestamptz"
}
],
"parameters": {
"Left": []
},
"nullable": [
false,
false,
false,
false,
false,
false
]
}
},
"b1c528c67d3c2ecea86e3ba1b2407cb4ee72149d66be0498be1c1162917c065d": {
"query": "INSERT INTO block_witness (block, witness)\n VALUES ($1, $2)\n ON CONFLICT (block)\n DO NOTHING",
"describe": {
Expand Down
Empty file modified docker/ci-integration-test/entrypoint.sh
100644 → 100755
Empty file.
Empty file modified docker/exit-tool/exit-tool-entry.sh
100644 → 100755
Empty file.
Empty file modified docker/geth/geth-entry.sh
100644 → 100755
Empty file.
Empty file modified docker/keybase-secrets/entrypoint.sh
100644 → 100755
Empty file.
Empty file modified docker/prover/prover-entry.sh
100644 → 100755
Empty file.
Empty file modified docker/zk/entrypoint.sh
100644 → 100755
Empty file.
Empty file modified infrastructure/ci-scripts/run_services.sh
100644 → 100755
Empty file.
Empty file modified infrastructure/exit-tool/exit-tool.sh
100644 → 100755
Empty file.
Empty file modified infrastructure/grafana/generate.sh
100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions infrastructure/zk/src/test/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,6 @@ command
}
mode = mode || 'fast';
if (offline) {
delete process.env.SQLX_OFFLINE;
}
});
Empty file modified sdk/zksync-crypto/build.sh
100644 → 100755
Empty file.
Empty file modified sdk/zksync.js/abi/update-abi.sh
100644 → 100755
Empty file.
28 changes: 14 additions & 14 deletions sdk/zksync.js/src/transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import { Signer } from './signer';
const W3CWebSocket = websocket.w3cwebsocket;

export abstract class AbstractJSONRPCTransport {
abstract async request(method: string, params): Promise<any>;
abstract request(method: string, params): Promise<any>;
subscriptionsSupported(): boolean {
return false;
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async subscribe(subMethod: string, subParams, unsubMethod: string, cb: (data: any) => void): Promise<Subscription> {
throw new Error('subscription are not supported for this transport');
}
abstract async disconnect();
abstract disconnect();
}

// Has jrpcError field which is JRPC error object.
Expand Down Expand Up @@ -48,7 +48,7 @@ export class HTTPTransport extends AbstractJSONRPCTransport {
id: 1,
jsonrpc: '2.0',
method,
params
params,
};

const response = await Axios.post(this.address, request).then((resp) => {
Expand Down Expand Up @@ -81,7 +81,7 @@ export class WSTransport extends AbstractJSONRPCTransport {
packMessage: (data) => JSON.stringify(data),
unpackMessage: (data) => JSON.parse(data as string),
attachRequestId: (data, requestId) => Object.assign({ id: requestId }, data), // attach requestId to message as `id` field
extractRequestId: (data) => data && data.id
extractRequestId: (data) => data && data.id,
});

this.subscriptionCallback = new Map();
Expand Down Expand Up @@ -122,7 +122,7 @@ export class WSTransport extends AbstractJSONRPCTransport {
const unsubRep = await this.ws.sendRequest({
jsonrpc: '2.0',
method: unsubMethod,
params: [subId]
params: [subId],
});
if (unsubRep.error) {
throw new JRPCError(`Unsubscribe failed: ${subId}, ${JSON.stringify(unsubRep.error)}`, unsubRep.error);
Expand All @@ -141,7 +141,7 @@ export class WSTransport extends AbstractJSONRPCTransport {
const request = {
jsonrpc: '2.0',
method,
params
params,
};

const response = await this.ws.sendRequest(request, { requestId: 1 });
Expand Down Expand Up @@ -180,7 +180,7 @@ export class DummyTransport extends AbstractJSONRPCTransport {
// The HEX-encoded sequence of bytes [0..20) provided as the `mainContract`.
mainContract: '0x000102030405060708090a0b0c0d0e0f10111213',
// The `govContract` is not used in tests and it is simply an empty string.
govContract: ''
govContract: '',
};
}

Expand All @@ -194,7 +194,7 @@ export class DummyTransport extends AbstractJSONRPCTransport {
address: tokenItem.address,
id: id,
symbol: tokenItem.symbol,
decimals: tokenItem.decimals
decimals: tokenItem.decimals,
};

tokens[tokenItem.symbol] = token;
Expand All @@ -216,18 +216,18 @@ export class DummyTransport extends AbstractJSONRPCTransport {
depositing: {},
committed: {
balances: {
DAI: BigNumber.from(12345)
DAI: BigNumber.from(12345),
},
nonce: 0,
pubKeyHash: await this.getPubKeyHash()
pubKeyHash: await this.getPubKeyHash(),
},
verified: {
balances: {
USDC: BigNumber.from(98765)
USDC: BigNumber.from(98765),
},
nonce: 0,
pubKeyHash: ''
}
pubKeyHash: '',
},
};
}

Expand All @@ -237,7 +237,7 @@ export class DummyTransport extends AbstractJSONRPCTransport {

return {
method,
params
params,
};
}

Expand Down
Loading

0 comments on commit 3df9b77

Please sign in to comment.