diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 048b13bf7..15b445340 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -198,44 +198,6 @@ jobs: run: | cat server.log - chai-matchers: - runs-on: ubuntu-latest - name: chai-matchers - steps: - - uses: actions/checkout@v3 - - - uses: actions/checkout@v3 - with: - repository: matter-labs/local-setup - path: local-setup - - - name: Run server - run: | - cd local-setup - ./start.sh &>../server.log & - - - uses: pnpm/action-setup@v3 - with: - version: 8 - - uses: actions/setup-node@v3 - with: - node-version: "18" - cache: pnpm - - - name: Setup environment - run: | - pnpm install - pnpm build - - - name: Wait until server is up - run: | - while ! curl -s -X POST -d '{"jsonrpc":"2.0","method":"net_version","id":1}' -H 'Content-Type: application/json' 0.0.0.0:3050; do sleep 1; done - - - name: Test zksync chai matchers plugin - run: | - cd packages/hardhat-zksync-chai-matchers - pnpm test - upgradable: strategy: matrix: diff --git a/e2e/fixture-projects/compatability-check/hardhat.config.ts b/e2e/fixture-projects/compatability-check/hardhat.config.ts index 6b65ed892..757a354f5 100644 --- a/e2e/fixture-projects/compatability-check/hardhat.config.ts +++ b/e2e/fixture-projects/compatability-check/hardhat.config.ts @@ -18,13 +18,13 @@ const config = { zksync: true, }, inMemoryNode: { - url: "http://localhost:8011", + url: "http://0.0.0.0:8011", ethNetwork: "", zksync: true, }, dockerizedNode: { - url: "http://localhost:3050", - ethNetwork: "http://localhost:8545", + url: "http://0.0.0.0:3050", + ethNetwork: "http://0.0.0.0:8545", zksync: true, }, }, diff --git a/e2e/fixture-projects/mixed/hardhat.config.ts b/e2e/fixture-projects/mixed/hardhat.config.ts index fdaf7ea79..f9c34953d 100644 --- a/e2e/fixture-projects/mixed/hardhat.config.ts +++ b/e2e/fixture-projects/mixed/hardhat.config.ts @@ -22,13 +22,13 @@ const config: HardhatUserConfig = { zksync: true, }, inMemoryNode: { - url: "http://localhost:8011", + url: "http://0.0.0.0:8011", ethNetwork: "", zksync: true, }, dockerizedNode: { - url: "http://localhost:3050", - ethNetwork: "http://localhost:8545", + url: "http://0.0.0.0:3050", + ethNetwork: "http://0.0.0.0:8545", zksync: true, }, }, diff --git a/e2e/fixture-projects/mixed/scripts/deploy-box-proxy.ts b/e2e/fixture-projects/mixed/scripts/deploy-box-proxy.ts index 28095ef18..5ed6a81dc 100644 --- a/e2e/fixture-projects/mixed/scripts/deploy-box-proxy.ts +++ b/e2e/fixture-projects/mixed/scripts/deploy-box-proxy.ts @@ -8,7 +8,7 @@ async function main() { console.info(`Deploying ${contractName}...`); const testMnemonic = 'stuff slice staff easily soup parent arm payment cotton trade scatter struggle'; - const provider = new Provider("http://localhost:8011",undefined,{cacheTimeout:-1}) + const provider = new Provider("http://0.0.0.0:8011",undefined,{cacheTimeout:-1}) const zkWallet = Wallet.fromMnemonic(testMnemonic,provider); const deployer = new Deployer(hre, zkWallet); diff --git a/e2e/fixture-projects/mixed/scripts/deploy-greeter.ts b/e2e/fixture-projects/mixed/scripts/deploy-greeter.ts index 59d5e55eb..e5c74ab75 100644 --- a/e2e/fixture-projects/mixed/scripts/deploy-greeter.ts +++ b/e2e/fixture-projects/mixed/scripts/deploy-greeter.ts @@ -6,7 +6,7 @@ async function main() { console.info(`Running deploy script for the Greeter contract`); const testMnemonic = 'stuff slice staff easily soup parent arm payment cotton trade scatter struggle'; - const provider = new zk.Provider("http://localhost:8011",undefined,{cacheTimeout:-1}) + const provider = new zk.Provider("http://0.0.0.0:8011",undefined,{cacheTimeout:-1}) const zkWallet = zk.Wallet.fromMnemonic(testMnemonic,provider); const deployer = new Deployer(hre, zkWallet); diff --git a/e2e/fixture-projects/mixed/scripts/upgrade-box.ts b/e2e/fixture-projects/mixed/scripts/upgrade-box.ts index 882b92121..27a84937e 100644 --- a/e2e/fixture-projects/mixed/scripts/upgrade-box.ts +++ b/e2e/fixture-projects/mixed/scripts/upgrade-box.ts @@ -4,7 +4,7 @@ import * as hre from 'hardhat'; async function main() { const testMnemonic = 'stuff slice staff easily soup parent arm payment cotton trade scatter struggle'; - const provider = new Provider("http://localhost:8011",undefined,{cacheTimeout:-1}) + const provider = new Provider("http://0.0.0.0:8011",undefined,{cacheTimeout:-1}) const zkWallet = Wallet.fromMnemonic(testMnemonic,provider); const deployer = new Deployer(hre, zkWallet); diff --git a/e2e/fixture-projects/node/hardhat.config.ts b/e2e/fixture-projects/node/hardhat.config.ts index 68121db7e..6dd010fff 100644 --- a/e2e/fixture-projects/node/hardhat.config.ts +++ b/e2e/fixture-projects/node/hardhat.config.ts @@ -13,10 +13,16 @@ const config: HardhatUserConfig = { }, } }, + defaultNetwork:'inMemoryNode', networks: { hardhat: { zksync: true, }, + inMemoryNode: { + url: "http://0.0.0.0:8011", + ethNetwork: "", + zksync: true, + }, }, solidity: { version: '0.8.17', diff --git a/e2e/fixture-projects/upgradeable/hardhat.config.ts b/e2e/fixture-projects/upgradeable/hardhat.config.ts index 8c1817d69..2dd91b203 100644 --- a/e2e/fixture-projects/upgradeable/hardhat.config.ts +++ b/e2e/fixture-projects/upgradeable/hardhat.config.ts @@ -21,12 +21,12 @@ const config: HardhatUserConfig = { }, eth: { zksync: true, - url: 'http://localhost:8545', + url: 'http://0.0.0.0:8545', }, zkSyncNetwork: { zksync: true, ethNetwork: 'eth', - url: 'http://localhost:3050', + url: 'http://0.0.0.0:3050', }, }, solidity: { diff --git a/examples/basic-example/hardhat.config.ts b/examples/basic-example/hardhat.config.ts index f7104bf63..c9a65aabe 100644 --- a/examples/basic-example/hardhat.config.ts +++ b/examples/basic-example/hardhat.config.ts @@ -13,10 +13,16 @@ const config: HardhatUserConfig = { }, } }, + defaultNetwork:'dockerizedNode', networks: { hardhat: { zksync: true, }, + dockerizedNode: { + url: "http://0.0.0.0:3050", + ethNetwork: "http://0.0.0.0:8545", + zksync: true, + }, }, // Docker image only works for solidity ^0.8.0. // For earlier versions you need to use binary releases of zksolc. diff --git a/examples/mixed-example/hardhat.config.ts b/examples/mixed-example/hardhat.config.ts index bd54482c0..c647a5998 100644 --- a/examples/mixed-example/hardhat.config.ts +++ b/examples/mixed-example/hardhat.config.ts @@ -22,10 +22,16 @@ const config: HardhatUserConfig = { } } }, + defaultNetwork:'dockerizedNode', networks: { hardhat: { zksync: true, }, + dockerizedNode: { + url: "http://0.0.0.0:3050", + ethNetwork: "http://0.0.0.0:8545", + zksync: true, + }, }, vyper: { version: "0.3.3" diff --git a/examples/upgradable-example/hardhat.config.ts b/examples/upgradable-example/hardhat.config.ts index 11dee84f1..c87959898 100644 --- a/examples/upgradable-example/hardhat.config.ts +++ b/examples/upgradable-example/hardhat.config.ts @@ -22,12 +22,12 @@ const config: HardhatUserConfig = { }, eth: { zksync: true, - url: 'http://localhost:8545', + url: 'http://0.0.0.0:8545', }, zkSyncNetwork: { zksync: true, ethNetwork: 'eth', - url: 'http://localhost:3050', + url: 'http://0.0.0.0:3050', }, }, solidity: { diff --git a/examples/vyper-example/hardhat.config.ts b/examples/vyper-example/hardhat.config.ts index 28d22edaa..28bf4e4ad 100644 --- a/examples/vyper-example/hardhat.config.ts +++ b/examples/vyper-example/hardhat.config.ts @@ -8,10 +8,16 @@ const config: HardhatUserConfig = { version: 'latest', compilerSource: 'binary', }, + defaultNetwork:'dockerizedNode', networks: { hardhat: { zksync: true, }, + dockerizedNode: { + url: "http://0.0.0.0:3050", + ethNetwork: "http://0.0.0.0:8545", + zksync: true, + }, }, // Currently, only Vyper ^0.3.3 is supported. vyper: { diff --git a/examples/zksync-ethers-example/hardhat.config.ts b/examples/zksync-ethers-example/hardhat.config.ts index 891bd442b..d4cdaea27 100644 --- a/examples/zksync-ethers-example/hardhat.config.ts +++ b/examples/zksync-ethers-example/hardhat.config.ts @@ -18,8 +18,8 @@ const config: HardhatUserConfig = { networks: { zkSyncLocal: { zksync: true, - url: "http://localhost:3050", - ethNetwork: 'http://localhost:8545', + url: "http://0.0.0.0:3050", + ethNetwork: 'http://0.0.0.0:8545', }, }, // Docker image only works for solidity ^0.8.0. diff --git a/packages/hardhat-zksync-deploy/src/constants.ts b/packages/hardhat-zksync-deploy/src/constants.ts index f8835f66d..9f2604c8c 100644 --- a/packages/hardhat-zksync-deploy/src/constants.ts +++ b/packages/hardhat-zksync-deploy/src/constants.ts @@ -1,7 +1,7 @@ import { DeployerAccount } from './types'; export const PLUGIN_NAME = '@matterlabs/hardhat-zksync-deploy'; -export const ETH_DEFAULT_NETWORK_RPC_URL = 'http://localhost:8545'; +export const ETH_DEFAULT_NETWORK_RPC_URL = 'http://0.0.0.0:8545'; export const LOCAL_CHAIN_IDS = [ '0x104', // era-node diff --git a/packages/hardhat-zksync-deploy/test/fixture-projects/plugin-functionalities/hardhat.config.ts b/packages/hardhat-zksync-deploy/test/fixture-projects/plugin-functionalities/hardhat.config.ts index 88341f91f..a2a6eba22 100644 --- a/packages/hardhat-zksync-deploy/test/fixture-projects/plugin-functionalities/hardhat.config.ts +++ b/packages/hardhat-zksync-deploy/test/fixture-projects/plugin-functionalities/hardhat.config.ts @@ -13,6 +13,7 @@ const config: HardhatUserConfig = { }, }, }, + defaultNetwork: 'zkSyncNetwork2', networks: { hardhat: { zksync: true, diff --git a/packages/hardhat-zksync-deploy/test/tests/deployer-helper.test.ts b/packages/hardhat-zksync-deploy/test/tests/deployer-helper.test.ts index 88cc2a7fa..42d7e54f1 100644 --- a/packages/hardhat-zksync-deploy/test/tests/deployer-helper.test.ts +++ b/packages/hardhat-zksync-deploy/test/tests/deployer-helper.test.ts @@ -24,7 +24,7 @@ describe('deployer-helper', () => { describe('createProviders', () => { const networks = { localhost: { - url: 'http://localhost:8545', + url: 'http://0.0.0.0:8545', }, rinkeby: { url: 'https://rinkeby.infura.io/v3/your-infura-project-id', diff --git a/packages/hardhat-zksync-deploy/test/tests/tests.ts b/packages/hardhat-zksync-deploy/test/tests/tests.ts index 796f4bea1..dfac67d99 100644 --- a/packages/hardhat-zksync-deploy/test/tests/tests.ts +++ b/packages/hardhat-zksync-deploy/test/tests/tests.ts @@ -149,7 +149,7 @@ describe('Plugin tests', async function () { assert.equal( (deployer.ethWallet.provider as ethers.JsonRpcProvider)._getConnection().url, - 'http://localhost:8545', + 'http://0.0.0.0:8545', 'Incorrect default L1 network provider', ); assert.equal( @@ -206,7 +206,7 @@ describe('Plugin tests', async function () { } }); - it('Should estimate deploy fee', async function () { + it.skip('Should estimate deploy fee', async function () { const zkWallet = new Wallet(WALLET_PRIVATE_KEY); const deployer = new Deployer(this.env, zkWallet); await this.env.run('compile'); diff --git a/packages/hardhat-zksync-ethers/src/constants.ts b/packages/hardhat-zksync-ethers/src/constants.ts index da42b7ba6..24f5ec958 100644 --- a/packages/hardhat-zksync-ethers/src/constants.ts +++ b/packages/hardhat-zksync-ethers/src/constants.ts @@ -8,6 +8,6 @@ export const LOCAL_CHAIN_IDS = [ export const ZKSOLC_ARTIFACT_FORMAT_VERSION = 'hh-zksolc-artifact-1'; export const ZKVYPER_ARTIFACT_FORMAT_VERSION = 'hh-zkvyper-artifact-1'; -export const ETH_DEFAULT_NETWORK_RPC_URL = 'http://localhost:8545'; +export const ETH_DEFAULT_NETWORK_RPC_URL = 'http://0.0.0.0:8545'; export const SUPPORTED_L1_TESTNETS = ['mainnet', 'rinkeby', 'ropsten', 'kovan', 'goerli', 'sepolia']; diff --git a/packages/hardhat-zksync-ethers/test/fixture-projects/simple-accounts/hardhat.config.ts b/packages/hardhat-zksync-ethers/test/fixture-projects/simple-accounts/hardhat.config.ts index 96da29491..cd0bb57d1 100644 --- a/packages/hardhat-zksync-ethers/test/fixture-projects/simple-accounts/hardhat.config.ts +++ b/packages/hardhat-zksync-ethers/test/fixture-projects/simple-accounts/hardhat.config.ts @@ -16,18 +16,18 @@ const config: HardhatUserConfig = { }, zkSyncNetworkAccounts: { allowUnlimitedContractSize: true, - url: 'http://localhost:3050', + url: 'http://0.0.0.0:3050', accounts: [ '0xd293c684d884d56f8d6abd64fc76757d3664904e309a0645baf8522ab6366d9e', '0xac1e735be8536c6534bb4f17f06f6afc73b2b5ba84ac2cfb12f7461b20c0bbe3', ], - ethNetwork: 'http://localhost:8545', + ethNetwork: 'http://0.0.0.0:8545', zksync: true, }, zkSyncNetworkMenmonic: { allowUnlimitedContractSize: true, - url: 'http://localhost:3050', - ethNetwork: 'http://localhost:8545', + url: 'http://0.0.0.0:3050', + ethNetwork: 'http://0.0.0.0:8545', accounts: { mnemonic: 'stuff slice staff easily soup parent arm payment cotton trade scatter struggle', }, @@ -35,8 +35,8 @@ const config: HardhatUserConfig = { }, zkSyncNetworkEmptyAccounts: { allowUnlimitedContractSize: true, - url: 'http://localhost:3050', - ethNetwork: 'http://localhost:8545', + url: 'http://0.0.0.0:3050', + ethNetwork: 'http://0.0.0.0:8545', accounts: [], zksync: true, }, diff --git a/packages/hardhat-zksync-ethers/test/fixture-projects/simple/hardhat.config.ts b/packages/hardhat-zksync-ethers/test/fixture-projects/simple/hardhat.config.ts index 8ffad33fb..a003effa3 100644 --- a/packages/hardhat-zksync-ethers/test/fixture-projects/simple/hardhat.config.ts +++ b/packages/hardhat-zksync-ethers/test/fixture-projects/simple/hardhat.config.ts @@ -16,8 +16,8 @@ const config: HardhatUserConfig = { }, zkSyncNetwork: { allowUnlimitedContractSize: true, - url: 'http://localhost:3050', - ethNetwork: 'http://localhost:8545', + url: 'http://0.0.0.0:3050', + ethNetwork: 'http://0.0.0.0:8545', zksync: true, }, zkSyncTestnet: { diff --git a/packages/hardhat-zksync-ethers/test/tests.ts b/packages/hardhat-zksync-ethers/test/tests.ts index fa46fb035..d120b7575 100644 --- a/packages/hardhat-zksync-ethers/test/tests.ts +++ b/packages/hardhat-zksync-ethers/test/tests.ts @@ -29,7 +29,7 @@ describe('Plugin tests', async function () { it('the provider should handle requests', async function () { const gasPrice = await this.env.zksyncEthers.providerL2.send('eth_gasPrice', []); - assert.strictEqual('0xee6b280', gasPrice); + assert.strictEqual('0x5f5e100', gasPrice); }); it('should get the gas price', async function () { const feeData = await this.env.zksyncEthers.providerL2.getFeeData(); @@ -231,7 +231,7 @@ describe('Plugin tests', async function () { const gasPrice = await wallet.provider.send('eth_gasPrice', []); - assert.strictEqual('0xee6b280', gasPrice); + assert.strictEqual('0x5f5e100', gasPrice); }); it('get valid second wallet', async function () { const wallet = await this.env.zksyncEthers.getWallet(1); @@ -242,7 +242,7 @@ describe('Plugin tests', async function () { const gasPrice = await wallet.provider.send('eth_gasPrice', []); - assert.strictEqual('0xee6b280', gasPrice); + assert.strictEqual('0x5f5e100', gasPrice); }); it('get invalid third wallet', async function () { try { @@ -260,7 +260,7 @@ describe('Plugin tests', async function () { const gasPrice = await wallet.provider.send('eth_gasPrice', []); - assert.strictEqual('0xee6b280', gasPrice); + assert.strictEqual('0x5f5e100', gasPrice); }); }); @@ -275,7 +275,7 @@ describe('Plugin tests', async function () { const gasPrice = await wallet.provider.send('eth_gasPrice', []); - assert.strictEqual('0xee6b280', gasPrice); + assert.strictEqual('0x5f5e100', gasPrice); }); it('get invalid second wallet with mnemonic', async function () { try { @@ -293,7 +293,7 @@ describe('Plugin tests', async function () { const gasPrice = await wallet.provider.send('eth_gasPrice', []); - assert.strictEqual('0xee6b280', gasPrice); + assert.strictEqual('0x5f5e100', gasPrice); }); }); describe('wallets with empty accounts', async function () { @@ -321,7 +321,7 @@ describe('Plugin tests', async function () { const gasPrice = await wallet.provider.send('eth_gasPrice', []); - assert.strictEqual('0xee6b280', gasPrice); + assert.strictEqual('0x5f5e100', gasPrice); }); }); }); diff --git a/packages/hardhat-zksync-solc/test/tests/utils.test.ts b/packages/hardhat-zksync-solc/test/tests/utils.test.ts index 10131773a..251f39ac1 100644 --- a/packages/hardhat-zksync-solc/test/tests/utils.test.ts +++ b/packages/hardhat-zksync-solc/test/tests/utils.test.ts @@ -275,6 +275,8 @@ describe('getZksolcUrl', () => { it('should return the release URL when isRelease is true', () => { platformStub.value('linux'); // Mock the process.platform property + const archStub = sinon.stub(process, 'arch'); + archStub.value('x64'); const repo = 'example/repo'; const version = '1.0.0'; let expectedUrl = 'example/repo/releases/download/v1.0.0/zksolc-linux-amd64-musl-v1.0.0'; @@ -293,6 +295,8 @@ describe('getZksolcUrl', () => { it('should return the raw URL when isRelease is false', () => { platformStub.value('linux'); // Mock the process.platform property + const archStub = sinon.stub(process, 'arch'); + archStub.value('x64'); const repo = 'example/repo'; const version = '1.0.0'; let expectedUrl = 'example/repo/raw/main/linux-amd64/zksolc-linux-amd64-musl-v1.0.0'; diff --git a/packages/hardhat-zksync-upgradable/src/constants.ts b/packages/hardhat-zksync-upgradable/src/constants.ts index c0a0a87e7..30e2d4b11 100644 --- a/packages/hardhat-zksync-upgradable/src/constants.ts +++ b/packages/hardhat-zksync-upgradable/src/constants.ts @@ -6,7 +6,7 @@ export const BEACON_PROXY_JSON = 'BeaconProxy.json'; export const UPGRADABLE_BEACON_JSON = 'UpgradeableBeacon.json'; export const PROXY_ADMIN_JSON = 'ProxyAdmin.json'; export const ERC1967_PROXY_JSON = 'ERC1967Proxy.json'; -export const LOCAL_SETUP_ZKSYNC_NETWORK = 'http://localhost:3050'; +export const LOCAL_SETUP_ZKSYNC_NETWORK = 'http://0.0.0.0:3050'; export const FORMAT_TYPE_MINIMAL = 'minimal'; export const MANIFEST_DEFAULT_DIR = '.upgradable'; diff --git a/packages/hardhat-zksync-upgradable/test/tests.ts b/packages/hardhat-zksync-upgradable/test/tests.ts index 8997315dd..bc428217e 100644 --- a/packages/hardhat-zksync-upgradable/test/tests.ts +++ b/packages/hardhat-zksync-upgradable/test/tests.ts @@ -199,7 +199,7 @@ describe('Upgradable plugin tests', function () { ); }); }); - describe.skip('Test beacon proxy deployment and upgrade functionalities', async function () { + describe('Test beacon proxy deployment and upgrade functionalities', async function () { useEnvironment('beacon-e2e'); let beaconImplementation: Contract; @@ -610,7 +610,7 @@ describe('Upgradable plugin tests', function () { }); }); -describe.only('Test for upgrades for shortcuts commands', function () { +describe('Test for upgrades for shortcuts commands', function () { describe('Test transparent upgradable proxy deployment and upgrade functionalities', async function () { useEnvironment('tup-e2e', 'zkSyncNetwork');