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

fix: update naming from era_test_node to anvil-zksync #1567

Merged
merged 10 commits into from
Dec 10, 2024
36 changes: 18 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ jobs:

- uses: actions/checkout@v3

- name: Run Era Test Node
uses: dutterbutter/era-test-node-action@latest
- name: Run anvil-zksync
uses: dutterbutter/anvil-zksync-action@v1.1.0

- name: Run fixture-projects script
run: |
cd e2e
chmod +x run-fixture-projects.sh
./run-fixture-projects.sh
cd e2e
chmod +x run-fixture-projects.sh
./run-fixture-projects.sh
shell: bash

examples:
Expand All @@ -108,8 +108,8 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Run Era Test Node
uses: dutterbutter/era-test-node-action@latest
- name: Run anvil-zksync
uses: dutterbutter/anvil-zksync-action@v1.1.0

- uses: pnpm/action-setup@v3

Expand Down Expand Up @@ -145,9 +145,9 @@ jobs:

- name: Test node example
run: |
cd examples/node-example
pnpm hardhat compile
pnpm hardhat test
cd examples/node-example
pnpm hardhat compile
pnpm hardhat test

- name: Test noninline libraries example
run: |
Expand Down Expand Up @@ -178,7 +178,7 @@ jobs:
pnpm hardhat run scripts/deploy-box-uups-factory.ts
pnpm hardhat run scripts/upgrade-box-uups-factory.ts
pnpm hardhat run scripts/upgrade-box-beacon-factory.ts
pnpm hardhat run scripts/upgrade-box-factory.ts
pnpm hardhat run scripts/upgrade-box-factory.ts

- name: Test upgradable example
run: |
Expand All @@ -189,7 +189,7 @@ jobs:
pnpm hardhat run scripts/deploy-box-uups.ts
pnpm hardhat run scripts/upgrade-box-beacon.ts
pnpm hardhat run scripts/upgrade-box-uups.ts
pnpm hardhat run scripts/upgrade-box.ts
pnpm hardhat run scripts/upgrade-box.ts

- name: Test zksync-ethers example
run: |
Expand All @@ -208,8 +208,8 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Run Era Test Node
uses: dutterbutter/era-test-node-action@latest
- name: Run anvil-zksync
uses: dutterbutter/anvil-zksync-action@v1.1.0

- uses: pnpm/action-setup@v3

Expand Down Expand Up @@ -295,8 +295,8 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Run Era Test Node
uses: dutterbutter/era-test-node-action@latest
- name: Run anvil-zksync
uses: dutterbutter/anvil-zksync-action@v1.1.0

- uses: pnpm/action-setup@v3

Expand Down Expand Up @@ -328,8 +328,8 @@ jobs:

- uses: actions/checkout@v3

- name: Run Era Test Node
uses: dutterbutter/era-test-node-action@latest
- name: Run anvil-zksync
uses: dutterbutter/anvil-zksync-action@v1.1.0

- uses: pnpm/action-setup@v3

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Here is an overview of the plugins currently available:
| hardhat-zksync-vyper | Streamlines the compilation of Vyper contracts for deployment on the ZKsync network. |
| hardhat-zksync | Offers a suite of ZKsync-related Hardhat plugins in one package, enhancing accessibility and efficiency. |
| hardhat-zksync-upgradeable | Enables easier deployment and upgrading of smart contracts on the ZKsync network, improving contract lifecycle management. |
| hardhat-zksync-node | Convenient plugin to run the ZKsync era-test-node locally. |
| hardhat-zksync-node | Convenient plugin to run the anvil-zksync locally. |
| hardhat-zksync-ethers | A zksync-ethers SDK wrapper providing additional methods for accelerated development on ZKsync. |

You can find more detailed explanations on how to use hardhat ZKsync plugins on our [documentation page](https://docs.zksync.io/build/tooling/hardhat/getting-started) where each plugin has its own section:
Expand Down
2 changes: 1 addition & 1 deletion e2e/fixture-projects/node/preprocess.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cat <<EOF > "$SCRIPT_DIR/package.json"
{
"name": "@matterlabs/hardhat-zksync-node",
"version": "1.0.3",
"description": "Hardhat plugin to run ZKsync era-test-node locally",
"description": "Hardhat plugin to run anvil-zksync locally",
"repository": "github:matter-labs/hardhat-zksync",
"homepage": "https://github.com/matter-labs/hardhat-zksync/tree/main/packages/hardhat-zksync-node",
"author": "Matter Labs",
Expand Down
7 changes: 3 additions & 4 deletions examples/deploy-example/deploy-ZKsync/002_deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@ const deployScript = async function (hre: HardhatRuntimeEnvironment) {
// This contract has no constructor arguments.
const factoryContract = await hre.deployer.deploy(artifact, [], 'create2', {
customData: {
salt: '0x7935910912126667836566922594852029127629416664760357073852948630'
}
salt: '0x7935910912126667836566922594852029127629416664760357073852948630',
},
});

// Show the contract info.
const contractAddress = await factoryContract.getAddress();
console.info(chalk.green(`${artifact.contractName} was deployed to ${contractAddress}!`));
}
};

export default deployScript;

deployScript.tags = ['first'];

4 changes: 2 additions & 2 deletions examples/node-example/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ZKsync Era node environment example

This project demonstrates how to run [era-test-node](https://docs.zksync.io/build/test-and-debug/in-memory-node) locally using the zksync's `hardhat-zksync-node` Hardhat plugin for testing purposes.
This project demonstrates how to run [anvil-zksync](https://docs.zksync.io/build/test-and-debug/in-memory-node) locally using the zksync's `hardhat-zksync-node` Hardhat plugin for testing purposes.

## Prerequisites

Expand Down Expand Up @@ -50,4 +50,4 @@ yarn hardhat test

- `yarn hardhat compile`: compiles all the contracts in the `contracts` folder.
- `yarn hardhat deploy-zksync`: runs all the deploy scripts in the `deploy` folder.
- `yarn hardhat test`: runs all the tests against the era-test-node instance instantiated in a separate process.
- `yarn hardhat test`: runs all the tests against the anvil-zksync instance instantiated in a separate process.
2 changes: 1 addition & 1 deletion packages/hardhat-zksync-node/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# hardhat-zksync-node πŸš€

ZKsync Era [Hardhat](https://hardhat.org/) plugin to run the ZKsync era-test-node locally.
ZKsync Era [Hardhat](https://hardhat.org/) plugin to run anvil-zksync locally.

![Era Logo](https://github.com/matter-labs/era-contracts/raw/main/eraLogo.svg)

Expand Down
2 changes: 1 addition & 1 deletion packages/hardhat-zksync-node/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@matterlabs/hardhat-zksync-node",
"version": "1.2.0",
"description": "Hardhat plugin to run ZKsync era-test-node locally",
"description": "Hardhat plugin to run anvil-zksync locally",
"repository": "github:matter-labs/hardhat-zksync",
"homepage": "https://github.com/matter-labs/hardhat-zksync/tree/main/packages/hardhat-zksync-node",
"author": "Matter Labs",
Expand Down
8 changes: 4 additions & 4 deletions packages/hardhat-zksync-node/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export const PLUGIN_NAME = '@matterlabs/hardhat-zksync-node';

export const ZKNODE_BIN_OWNER = 'matter-labs';
export const ZKNODE_BIN_REPOSITORY_NAME = 'era-test-node';
export const ZKNODE_BIN_REPOSITORY = 'https://github.com/matter-labs/era-test-node';
export const ZKNODE_BIN_REPOSITORY_NAME = 'anvil-zksync';
export const ZKNODE_BIN_REPOSITORY = 'https://github.com/matter-labs/anvil-zksync';
// User agent of MacOSX Chrome 120.0.0.0
export const USER_AGENT =
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36';
Expand All @@ -16,7 +16,7 @@ export const PROCESS_TERMINATION_SIGNALS = ['SIGINT', 'SIGTERM', 'SIGKILL'];

export const ALLOWED_LOG_VALUES = ['error', 'warn', 'info', 'debug'];
export const ALLOWED_CACHE_VALUES = ['none', 'disk', 'memory'];
export const ALLOWED_FORK_VALUES = ['testnet', 'mainnet'];
export const ALLOWED_FORK_VALUES = ['sepolia-testnet', 'mainnet'];
export const ALLOWED_SHOW_CALLS_VALUES = ['none', 'user', 'system', 'all'];
export const ALLOWED_SHOW_STORAGE_LOGS_VALUES = ['none', 'read', 'write', 'all'];
export const ALLOWED_SHOW_VM_DETAILS_VALUES = ['none', 'all'];
Expand All @@ -38,7 +38,7 @@ export const MAX_PORT_ATTEMPTS = 10;
export const PORT_CHECK_DELAY = 500;
export const RPC_ENDPOINT_PATH = 'eth_chainId';

export const ZKSYNC_ERA_TEST_NODE_NETWORK_NAME = 'zkSyncEraTestNode';
export const ZKSYNC_ERA_TEST_NODE_NETWORK_NAME = 'AnvilZKsync';
export const BASE_URL = `http://127.0.0.1`;
export const NETWORK_ACCOUNTS = {
REMOTE: 'remote',
Expand Down
4 changes: 2 additions & 2 deletions packages/hardhat-zksync-node/src/downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ export class RPCServerDownloader {
private async _download(tag: any): Promise<void> {
const url: any = await getNodeUrl(ZKNODE_BIN_REPOSITORY, tag);
try {
console.info(chalk.yellow(`Downloading era-test-node binary, release: ${tag}`));
console.info(chalk.yellow(`Downloading anvil-zksync binary, release: ${tag}`));
await download(url, await this._createBinaryPath(tag), PLUGIN_NAME, tag, 30000);
await this._postProcessDownload(tag);
console.info(chalk.green('era-test-node binary downloaded successfully'));
console.info(chalk.green('anvil-zksync binary downloaded successfully'));
} catch (error: any) {
throw new ZkSyncNodePluginError(`Error downloading binary from URL ${url}: ${error.message}`);
}
Expand Down
8 changes: 4 additions & 4 deletions packages/hardhat-zksync-node/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { CommandArguments } from './types';
import { RPCServerDownloader } from './downloader';
import { JsonRpcServer } from './server';

// Generates command arguments for running the era-test-node binary
// Generates command arguments for running the anvil-zksync binary
export function constructCommandArgs(args: CommandArguments): string[] {
const commandArgs: string[] = [];

Expand Down Expand Up @@ -145,7 +145,7 @@ function getArch() {
return process.arch === 'arm64' ? 'aarch64' : arch;
}

// Returns the path to the directory where the era-test-node binary is/will be located
// Returns the path to the directory where the anvil-zksync binary is/will be located
export async function getRPCServerBinariesDir(): Promise<string> {
const compilersCachePath = await getCompilersDir();
const basePath = path.dirname(compilersCachePath);
Expand All @@ -154,7 +154,7 @@ export async function getRPCServerBinariesDir(): Promise<string> {
return rpcServerBinariesPath;
}

// Get latest release from GitHub of the era-test-node binary
// Get latest release from GitHub of the anvil-zksync binary
export async function getLatestRelease(owner: string, repo: string, userAgent: string, timeout: number): Promise<any> {
const url = `https://github.com/${owner}/${repo}/releases/latest`;
const redirectUrlPattern = `https://github.com/${owner}/${repo}/releases/tag/v`;
Expand Down Expand Up @@ -191,7 +191,7 @@ export async function getLatestRelease(owner: string, repo: string, userAgent: s
}
}

// Get the asset to download from the latest release of the era-test-node binary
// Get the asset to download from the latest release of the anvil-zksync binary
export async function getNodeUrl(repo: string, release: string): Promise<string> {
const platform = getPlatform();

Expand Down
2 changes: 1 addition & 1 deletion packages/hardhat-zksync-upgradable/src/core/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ export const networkNames: { [chainId in number]?: string } = Object.freeze({
280: 'ZKsync-testnet-goerli',
270: 'ZKsync-local-setup',
300: 'ZKsync-testnet-sepolia',
260: 'ZKsync-era-test-node',
260: 'ZKsync-anvil',
});
2 changes: 1 addition & 1 deletion packages/hardhat-zksync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Here is an overview of the plugins currently available in this package when inst
| hardhat-zksync-deploy | Facilitates the deployment of contracts on ZKsync, utilizing artifacts from hardhat-zksync-solc. |
| hardhat-zksync-verify | Automates the process of verifying smart contracts on the ZKsync network, enhancing transparency and trust. |
| hardhat-zksync-upgradeable | Enables easier deployment and upgrading of smart contracts on the ZKsync network, improving contract lifecycle management. |
| hardhat-zksync-node | Convenient plugin to run the ZKsync era-test-node locally. |
| hardhat-zksync-node | Convenient plugin to run anvil-zksync locally. |
| hardhat-zksync-ethers | A zksync-ethers SDK wrapper providing additional methods for accelerated development on ZKsync. |


Expand Down
Loading