From 6e19386a13d24837b01528c53dd2d563605b2c61 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Thu, 19 Dec 2024 13:56:39 -0600 Subject: [PATCH] chore: resolve conflicts --- .../10.guides/20.zksync-101/30.testing.md | 2 +- .../10.guides/20.zksync-101/40.upgrading.md | 2 +- .../10.local-setup/10.anvil-zksync-node.md | 4 +- .../20.guides/20.migrating-to-zksync.md | 2 +- .../30.plugins/120.hardhat-zksync-node.md | 8 +- .../30.plugins/130.other-plugins.md | 2 +- .../30.plugins/60.hardhat-zksync-deploy.md | 4 +- .../70.hardhat-zksync-upgradable.md | 2 +- content/20.zksync-node/00.index.md | 162 ------------------ examples/hardhat-sol-template/deploy/utils.ts | 2 +- .../hardhat-vyper-template/deploy/utils.ts | 2 +- 11 files changed, 15 insertions(+), 177 deletions(-) delete mode 100644 content/20.zksync-node/00.index.md diff --git a/content/00.zksync-era/10.guides/20.zksync-101/30.testing.md b/content/00.zksync-era/10.guides/20.zksync-101/30.testing.md index c8e80892..14d127a1 100644 --- a/content/00.zksync-era/10.guides/20.zksync-101/30.testing.md +++ b/content/00.zksync-era/10.guides/20.zksync-101/30.testing.md @@ -22,7 +22,7 @@ You will have downloaded the 101 project through ZKsync CLI `create`. Since we are using `hardhat-zksync` for testing, you do not need to have the in memory anvil-zksync node running for this section. -If your local in-memory anvil-zksync node is running, stop it with the following command: +If your local `anvil-zksync` node is running, stop it with the following command: ```bash zksync-cli dev stop diff --git a/content/00.zksync-era/10.guides/20.zksync-101/40.upgrading.md b/content/00.zksync-era/10.guides/20.zksync-101/40.upgrading.md index 1a064f23..50c655da 100644 --- a/content/00.zksync-era/10.guides/20.zksync-101/40.upgrading.md +++ b/content/00.zksync-era/10.guides/20.zksync-101/40.upgrading.md @@ -18,7 +18,7 @@ lead you through the strategies and practices for making the `CrowdfundingCampai Make sure to go through the setup provided in the initial [Getting started](/build/start-coding/zksync-101) section. You will have downloaded the 101 project through ZKsync CLI `create` and started up a local anvil-zksync node for development. -If you haven't started up your local in-memory anvil-zksync node or you're not sure, run the following: +If you haven't started up your local `anvil-zksync` node or you're not sure, run the following: ```bash zksync-cli dev restart diff --git a/content/00.zksync-era/40.tooling/10.local-setup/10.anvil-zksync-node.md b/content/00.zksync-era/40.tooling/10.local-setup/10.anvil-zksync-node.md index 76be7818..4e25c050 100644 --- a/content/00.zksync-era/40.tooling/10.local-setup/10.anvil-zksync-node.md +++ b/content/00.zksync-era/40.tooling/10.local-setup/10.anvil-zksync-node.md @@ -1,6 +1,6 @@ --- title: anvil-zksync -description: Learn how to setup a local in-memory anvil-zksync. +description: Learn how to setup a local anvil-zksync node. --- This section provides instructions on setting up and using the In-Memory Node, `anvil-zksync`, for local testing. @@ -276,7 +276,7 @@ Here's an example of what you should expect to see when `show-calls` and `resolv You can send network calls against a running `anvil-zksync`. -Launch the local in-memory anvil-zksync node: +Launch the local `anvil-zksync` node: ```bash anvil-zksync fork sepolia-testnet diff --git a/content/00.zksync-era/40.tooling/20.hardhat/20.guides/20.migrating-to-zksync.md b/content/00.zksync-era/40.tooling/20.hardhat/20.guides/20.migrating-to-zksync.md index 006bbb54..23808ac2 100644 --- a/content/00.zksync-era/40.tooling/20.hardhat/20.guides/20.migrating-to-zksync.md +++ b/content/00.zksync-era/40.tooling/20.hardhat/20.guides/20.migrating-to-zksync.md @@ -195,7 +195,7 @@ ZKSync provides different EraVM node implementations to test smart contracts loc Unless your project contains L1-L2 features, testing with the anvil-zksync is recommended, which is included in the `@matterlabs/hardhat-zksync` plugin. ::callout{icon="i-heroicons-exclamation-triangle" color="amber"} -In version `1.0.12`, `hardhat-network-helpers` introduced support for both in-memory anvil-zksync node and Dockerized setups, allowing methods +In version `1.0.12`, `hardhat-network-helpers` introduced support for both anvil-zksync node and Dockerized setups, allowing methods such as `loadFixture` to be utilized in test files. :: diff --git a/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/120.hardhat-zksync-node.md b/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/120.hardhat-zksync-node.md index 141f99b6..b51c8789 100644 --- a/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/120.hardhat-zksync-node.md +++ b/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/120.hardhat-zksync-node.md @@ -74,7 +74,7 @@ npm run hardhat node-zksync :: -This command runs a local in-memory anvil-zksync node by initiating a JSON-RPC server. +This command runs a local `anvil-zksync` node by initiating a JSON-RPC server. It uses the provided or default configurations to set up and run the ZKsync node, allowing for blockchain operations in a local environment. The command also handles tasks such as downloading the necessary JSON-RPC server binary if it's not already present. @@ -107,14 +107,14 @@ Additionally, if either `--replay-tx` or `--fork-block-number` is specified, the ::callout{icon="i-heroicons-information-circle" color="blue"} **Node task override**: -If the network `zksync` flag is set to `true`, the `hardhat node` command will launch the in-memory anvil-zksync node on port `8545`. +If the network `zksync` flag is set to `true`, the `hardhat node` command will launch the `anvil-zksync` node on port `8545`. :: ::callout{icon="i-heroicons-information-circle" color="blue"} **Overrides for Deploy and Run tasks**: If the Hardhat network is selected and the `zksync` flag is set to true, the plugin will override the `hardhat run` command and all deployment tasks from the `hardhat-zksync-deploy` plugin, -launching the in-memory anvil-zksync node before executing the scripts. +launching the `anvil-zksync` node before executing the scripts. **Note**: To achieve this for deployment scripts, @@ -137,7 +137,7 @@ To see a list of all supported APIs, visit [this link](%%zk_git_repo_era-test-no The `hardhat-zksync-node` plugin enhances Hardhat's test task, allowing all tests to run against anvil-zksync node operated in a separate process. By invoking the test task, ensure you are using the `hardhat` network and have set its `zksync` flag to `true`. -Doing so will initiate the plugin's in-memory anvil-zksync node alongside the tests. After the tests conclude, the node shuts down gracefully. +Doing so will initiate the plugin's `anvil-zksync` node alongside the tests. After the tests conclude, the node shuts down gracefully. The plugin begins port allocation from the default 8011. ```ts diff --git a/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/130.other-plugins.md b/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/130.other-plugins.md index 73e57faf..420533b0 100644 --- a/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/130.other-plugins.md +++ b/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/130.other-plugins.md @@ -78,7 +78,7 @@ To prevent this, please include the `--no-compile` flag: `yarn hardhat verify -- This plugin adds new methods that interact with the Hardhat network used for testing. -In version `1.0.12`, `hardhat-network-helpers` introduced support for both in-memory anvil-zksync node and Dockerized setups, allowing methods +In version `1.0.12`, `hardhat-network-helpers` introduced support for both anvil-zksync node and Dockerized setups, allowing methods such as `loadFixture` to be utilized in test files. ::callout{icon="i-heroicons-exclamation-triangle" color="amber"} diff --git a/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/60.hardhat-zksync-deploy.md b/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/60.hardhat-zksync-deploy.md index bee9bf4f..29d70512 100644 --- a/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/60.hardhat-zksync-deploy.md +++ b/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/60.hardhat-zksync-deploy.md @@ -240,8 +240,8 @@ const config: HardhatUserConfig = { - `accounts` represents a list of the private keys or mnemonic object for the account used in the deployment process. ::callout{icon="i-heroicons-information-circle" color="blue"} -**Accounts on In-Memory anvil-zksync Node or zksync-cli Local Node**: -`accounts` object will be automatically populated with rich accounts if used network is In-Memory anvil-zksync Node or zksync-cli Local Node +**Accounts on anvil-zksync node or zksync-cli Local Node**: +`accounts` object will be automatically populated with rich accounts if used network is anvil-zksync Node or zksync-cli Local Node :: diff --git a/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/70.hardhat-zksync-upgradable.md b/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/70.hardhat-zksync-upgradable.md index 13229e7f..0559a989 100644 --- a/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/70.hardhat-zksync-upgradable.md +++ b/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/70.hardhat-zksync-upgradable.md @@ -785,7 +785,7 @@ const config: HardhatUserConfig = { - accounts represents a list of the private keys or mnemonic object for the account used in the deployment or in the upgrade process. - accounts object will automatically be populated with rich accounts if used network is In-Memory anvil-zksync Node or zksync-cli Local Node + accounts object will automatically be populated with rich accounts if used network is anvil-zksync node or zksync-cli Local Node To establish a default index per network, which is by default `0`, you can include a `deployerAccounts` section in your `hardhat.config.ts` file. ```typescript diff --git a/content/20.zksync-node/00.index.md b/content/20.zksync-node/00.index.md deleted file mode 100644 index eeed9bc0..00000000 --- a/content/20.zksync-node/00.index.md +++ /dev/null @@ -1,162 +0,0 @@ ---- -title: Introduction -description: ---- - -::callout{icon="i-heroicons-information-circle" color="blue"} -For local testing, we recommend setting up an in-memory anvil-zksync node and forking mainnet. -:: - -This documentation explains the basics of the ZKsync Era Node. - -## Disclaimers - -- The ZKsync node software is provided "as-is" without any express or implied warranties. -- The ZKsync node is in the beta phase, and should be used with caution. -- The ZKsync node is a read-only replica of the main node. -- The ZKsync node is not going to be the consensus node. -- Running a sequencer node is currently not possible and there is no option to vote on blocks as part of the consensus mechanism - or [fork-choice](https://eth2book.info/capella/part3/forkchoice/#whats-a-fork-choice) like on Ethereum. - -## What is the ZKsync Node? - -The ZKsync node is a read-replica of the main (centralized) node that can be run by anyone. It -functions by fetching data from the ZKsync API and re-applying transactions locally, starting from the genesis block. -The ZKsync node shares most of its codebase with the main node. Consequently, when it re-applies transactions, it does -so exactly as the main node did in the past. - -In Ethereum terms, the current state of the ZKsync node represents an archive node, providing access to the entire history of the blockchain. - -## High-level Overview - -At a high level, the ZKsync node can be seen as an application that has the following modules: - -- API server that provides the publicly available Web3 interface. -- Synchronization layer that interacts with the main node and retrieves transactions and blocks to re-execute. -- Sequencer component that actually executes and persists transactions received from the synchronization layer. -- Several checker modules that ensure the consistency of the ZKsync node state. - -With the ZKsync node, you are able to: - -- Locally recreate and verify the ZKsync Era mainnet/testnet state. -- Interact with the recreated state in a trustless way (in a sense that the validity is locally verified, and you should - not rely on a third-party API ZKsync Era provides). -- Use the Web3 API without having to query the main node. -- Send L2 transactions (that will be proxied to the main node). - -With the ZKsync node, you _can not_: - -- Create L2 blocks or L1 batches on your own. -- Generate proofs. -- Submit data to L1. - -A more detailed overview of the ZKsync node's components is provided in the components section. - -## API Overview - -API exposed by the ZKsync node strives to be Web3-compliant. -If some method is exposed but behaves differently compared to -Ethereum, it should be considered a bug. -Please [report](https://zksync.io/contact) such cases. - -### `eth_` Namespace - -Data getters in this namespace operate in the L2 space: require/return L2 block numbers, check balances in L2, etc. - -Available methods: - -| Method | Notes | -|-------------------------------------------|---------------------------------------------------------------------------| -| `eth_blockNumber` | | -| `eth_chainId` | | -| `eth_call` | | -| `eth_estimateGas` | | -| `eth_gasPrice` | | -| `eth_newFilter` | Maximum amount of installed filters is configurable | -| `eth_newBlockFilter` | Same as above | -| `eth_newPendingTransactionsFilter` | Same as above | -| `eth_uninstallFilter` | | -| `eth_getLogs` | Maximum amount of returned entities can be configured | -| `eth_getFilterLogs` | Same as above | -| `eth_getFilterChanges` | Same as above | -| `eth_getBalance` | | -| `eth_getBlockByNumber` | | -| `eth_getBlockByHash` | | -| `eth_getBlockTransactionCountByNumber` | | -| `eth_getBlockTransactionCountByHash` | | -| `eth_getCode` | | -| `eth_getStorageAt` | | -| `eth_getTransactionCount` | | -| `eth_getTransactionByHash` | | -| `eth_getTransactionByBlockHashAndIndex` | | -| `eth_getTransactionByBlockNumberAndIndex` | | -| `eth_getTransactionReceipt` | | -| `eth_protocolVersion` | | -| `eth_sendRawTransaction` | | -| `eth_syncing` | EN is considered synced if it's less than 11 blocks behind the main node. | -| `eth_coinbase` | Always returns a zero address | -| `eth_accounts` | Always returns an empty list | -| `eth_getCompilers` | Always returns an empty list | -| `eth_hashrate` | Always returns zero | -| `eth_getUncleCountByBlockHash` | Always returns zero | -| `eth_getUncleCountByBlockNumber` | Always returns zero | -| `eth_mining` | Always returns false | - -### PubSub - -Only available on the WebSocket servers. - -Available methods: - -| Method | Notes | -| ------------------ | ----------------------------------------------- | -| `eth_subscribe` | Maximum amount of subscriptions is configurable | -| `eth_subscription` | | - -### `net_` Namespace - -Available methods: - -| Method | Notes | -| ---------------- | -------------------- | -| `net_version` | | -| `net_peer_count` | Always returns 0 | -| `net_listening` | Always returns false | - -### `web3_` Namespace - -Available methods: - -| Method | Notes | -| -------------------- | ----- | -| `web3_clientVersion` | | - -### `debug` namespace - -The `debug` namespace gives access to several non-standard RPC methods, which will allow developers to inspect and debug -calls and transactions. - -This namespace is disabled by default and can be configured via setting `EN_API_NAMESPACES` as described in the example config. - -Available methods: - -| Method | Notes | -| -------------------------- | ----- | -| `debug_traceBlockByNumber` | | -| `debug_traceBlockByHash` | | -| `debug_traceCall` | | -| `debug_traceTransaction` | | - -### `zks` namespace - -This namespace contains rollup-specific extensions to the Web3 API. -Note that _only methods_ specified in the documentation are considered public. -There may be other methods exposed in this namespace, but undocumented -methods come without any kind of stability guarantees and can be changed or removed without notice. - -Always refer to the documentation linked above and [API reference documentation](/build/api-reference) to see the list of stabilized methods in this namespace. - -### `en` namespace - -This namespace contains methods that ZKsync nodes call on the main node while syncing. If this namespace is enabled -other ZKsync nodes can sync from this node. diff --git a/examples/hardhat-sol-template/deploy/utils.ts b/examples/hardhat-sol-template/deploy/utils.ts index 8f64a040..b6982ba4 100644 --- a/examples/hardhat-sol-template/deploy/utils.ts +++ b/examples/hardhat-sol-template/deploy/utils.ts @@ -129,7 +129,7 @@ export const deployContract = async ( /** * Rich wallets can be used for testing purposes. - * Available on in-memory anvil-zksync node and Dockerized node. + * Available on anvil-zksync node and Dockerized node. */ export const LOCAL_RICH_WALLETS = [ { diff --git a/examples/hardhat-vyper-template/deploy/utils.ts b/examples/hardhat-vyper-template/deploy/utils.ts index c44174ec..feca2193 100644 --- a/examples/hardhat-vyper-template/deploy/utils.ts +++ b/examples/hardhat-vyper-template/deploy/utils.ts @@ -97,7 +97,7 @@ export const deployContract = async ( /** * Rich wallets can be used for testing purposes. - * Available on in-memory anvil-zksync node and Dockerized node. + * Available on anvil-zksync node and Dockerized node. */ export const LOCAL_RICH_WALLETS = [ {