Skip to content

Commit

Permalink
chore: rename era_test_node to anvil-zksync
Browse files Browse the repository at this point in the history
  • Loading branch information
dutterbutter committed Nov 27, 2024
1 parent accf077 commit 1f200ec
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 55 deletions.
9 changes: 5 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@

## Welcome! 👋

Hello there, contributor! We're delighted that you're considering contributing to the `era-test-node` project. This document is here to guide you through the steps and best practices for contributing to this Rust-based repository.
Hello there, contributor! We're delighted that you're considering contributing to the `anvil-zksync` project. This document is here to guide you through the steps and best practices for contributing to this Rust-based repository.

Please take a moment to review this document to ensure a smooth and efficient contribution process for everyone involved.

## Getting Started

- **Fork the repository.** Begin by forking the main `era-test-node` repository to your personal GitHub account.
- **Fork the repository.** Begin by forking the main `anvil-zksync` repository to your personal GitHub account.

- **Clone the repository.** After forking, clone the repository to your local machine:

<!-- TODO: update when repo is updated -->
```bash
git clone https://github.com/<your-github-username>/era-test-node.git
```
Expand Down Expand Up @@ -42,7 +43,7 @@ git push origin feature/description-of-your-feature

## Submitting a Pull Request

- **Initiate a pull request (PR).** Go to the main `era-test-node` repository. Your recently pushed branch should be highlighted, showing a "Compare & pull request" button. Click on it and provide a clear, detailed description of your changes in the PR.
- **Initiate a pull request (PR).** Go to the main `anvil-zksync` repository. Your recently pushed branch should be highlighted, showing a "Compare & pull request" button. Click on it and provide a clear, detailed description of your changes in the PR.

- **Await a review.** Our maintainers will review your PR. They might request changes or clarifications, so be ready to address any feedback.

Expand All @@ -63,7 +64,7 @@ If you're unsure about something or have questions, don't hesitate to open an is

## What's Next?

Once your PR is approved and merged, your contribution will be integrated into the `era-test-node` repository. Congratulations, and thank you! We value your contribution and look forward to future collaborations.
Once your PR is approved and merged, your contribution will be integrated into the `anvil-zksync` repository. Congratulations, and thank you! We value your contribution and look forward to future collaborations.

Remember, the best contributions come from enjoying the process, being respectful, and continuously learning. Thanks for being a part of our community!

Expand Down
70 changes: 38 additions & 32 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# This workflow is borrowed from reth, which is borrowed from Lighthouse:
# This workflow is borrowed from reth, which is borrowed from Lighthouse:
# reth: https://github.com/paradigmxyz/reth/blob/500b0fac135fe07635d871d64467326599e2b27e/.github/workflows/release.yml
# lighthouse: https://github.com/sigp/lighthouse/blob/693886b94176faa4cb450f024696cb69cda2fe58/.github/workflows/release.yml

name: release

on:
push:
push:
tags:
- v*

Expand All @@ -29,16 +29,22 @@ jobs:
name: build release
strategy:
matrix:
arch: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, x86_64-apple-darwin, aarch64-apple-darwin]
arch:
[
x86_64-unknown-linux-gnu,
aarch64-unknown-linux-gnu,
x86_64-apple-darwin,
aarch64-apple-darwin,
]
include:
- arch: x86_64-unknown-linux-gnu
platform: ubuntu-20.04
- arch: aarch64-unknown-linux-gnu
platform: ubuntu-20.04
- arch: x86_64-apple-darwin
platform: macos-latest
- arch: aarch64-apple-darwin
platform: macos-latest
- arch: x86_64-unknown-linux-gnu
platform: ubuntu-20.04
- arch: aarch64-unknown-linux-gnu
platform: ubuntu-20.04
- arch: x86_64-apple-darwin
platform: macos-latest
- arch: aarch64-apple-darwin
platform: macos-latest

runs-on: ${{ matrix.platform }}
needs: [extract-version]
Expand Down Expand Up @@ -66,37 +72,37 @@ jobs:
run: |
cargo install cross --git https://github.com/cross-rs/cross --tag v0.2.4
- name: Build era-test-node for ${{ matrix.arch }}
- name: Build anvil-zksync for ${{ matrix.arch }}
run: |
make build-${{ matrix.arch }}
- name: Rename and move binary
run: |
run: |
mkdir artifacts
mv target/${{ matrix.arch }}/release/anvil-zksync ./artifacts
- name: Create artifacts
run: |
cd artifacts
tar -czf anvil-zksync-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz anvil-zksync*
mv *tar.gz* ..
# =======================================================================
# Upload artifacts
# This is required to share artifacts between different jobs
# =======================================================================
- name: Upload artifact
uses: actions/upload-artifact@v3
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: anvil-zksync-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz
path: anvil-zksync-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz

draft-release:
name: draft release
needs: [build, extract-version]
needs: [build, extract-version]
runs-on: ubuntu-latest
env:
VERSION: ${{ needs.extract-version.outputs.VERSION }}
VERSION: ${{ needs.extract-version.outputs.VERSION }}
permissions:
# Required to post the release
contents: write
Expand All @@ -122,14 +128,14 @@ jobs:
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
echo "$(git log --pretty=format:"- %s" $(git describe --tags --abbrev=0 ${{ env.VERSION }}^)..${{ env.VERSION }})" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Generate list of contributors
id: contributors
run: |
echo "CONTRIBUTORS<<EOF" >> $GITHUB_OUTPUT
echo "$(git log --pretty=format:"- %aN (%aE)" $(git describe --tags --abbrev=0 ${{ env.VERSION }}^)..${{ env.VERSION }} | sort | uniq)" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create release draft
env:
GITHUB_USER: ${{ github.repository_owner }}
Expand All @@ -142,26 +148,26 @@ jobs:
[![YouTube Release Notes](https://img.youtube.com/vi/FZefCZW7JJk/0.jpg)](https://www.youtube.com/watch?v=FZefCZW7JJk)-->
## 📋 Summary
### 🐛 Bug Fixes:
- TBD
### ✨ New Features:
- TBD
### ⚠️ Breaking Changes:
- TBD
## 📜 All Changes
${{ steps.changelog.outputs.CHANGELOG }}
## ⭐ Contributors
${{ steps.contributors.outputs.CONTRIBUTORS }}
## 📥 Binaries
| System | Architecture | Binary |
|:---:|:---:|:---:|
| <img src="https://simpleicons.org/icons/linux.svg" style="width: 32px;"/> | x86_64 | [anvil-zksync-${{ env.VERSION }}-x86_64-unknown-linux-gnu.tar.gz](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/anvil-zksync-${{ env.VERSION }}-x86_64-unknown-linux-gnu.tar.gz) |
Expand All @@ -176,4 +182,4 @@ jobs:
assets+=("$asset/$asset")
done
tag_name="${{ env.VERSION }}"
echo "$body" | gh release create "$tag_name" "${assets[@]}" --draft -F "-" -t "Release: $tag_name"
echo "$body" | gh release create "$tag_name" "${assets[@]}" --draft -F "-" -t "Release: $tag_name"
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "anvil_zksync"
name = "anvil-zksync"
version = "0.1.0-alpha.34"
edition = "2018"
authors = ["The Matter Labs Team <[email protected]>"]
Expand Down
2 changes: 1 addition & 1 deletion SUPPORTED_APIS.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ The `status` options are:
| `HARDHAT` | `hardhat_addCompilationResult` | `NOT IMPLEMENTED` | Add information about compiled contracts |
| `HARDHAT` | `hardhat_dropTransaction` | `NOT IMPLEMENTED` | Remove a transaction from the mempool |
| [`HARDHAT`](#hardhat-namespace) | [`hardhat_impersonateAccount`](#hardhat_impersonateaccount) | `SUPPORTED` | Impersonate an account |
| [`HARDHAT`](#hardhat-namespace) | [`hardhat_getAutomine`](#hardhat_getautomine) | `PARTIAL` | Currently always returns `true` as era-test-node by default mines new blocks with each new transaction. |
| [`HARDHAT`](#hardhat-namespace) | [`hardhat_getAutomine`](#hardhat_getautomine) | `PARTIAL` | Currently always returns `true` as anvil-zksync by default mines new blocks with each new transaction. |
| `HARDHAT` | `hardhat_metadata` | `NOT IMPLEMENTED` | Returns the metadata of the current network |
| [`HARDHAT`](#hardhat-namespace) | [`hardhat_mine`](#hardhat_mine) | Mine any number of blocks at once, in constant time |
| [`HARDHAT`](#hardhat-namespace) | [`hardhat_reset`](#hardhat_reset) | `PARTIALLY` | Resets the state of the network; cannot revert to past block numbers, unless they're in a fork |
Expand Down
2 changes: 1 addition & 1 deletion docs/rustbook/src/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ You can set up In-Memory Node quickly with `npx zksync-cli dev start`.
> *Note:* at the moment this method won't allow you to use additional features like forking networks or replaying transactions.
## Release binary
Download `era-test-node`` from latest [Release](https://github.com/matter-labs/era-test-node/releases/latest)
Download `anvil-zksync` from latest [Release](https://github.com/matter-labs/era-test-node/releases/latest)

## Build from source
The project can be built from [source](https://github.com/matter-labs/era-test-node/releases/latest). Please note that you may
Expand Down
4 changes: 2 additions & 2 deletions docs/rustbook/src/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The In-memory node uses an in-memory database for storing state information and
In fork mode, it retrieves missing storage data from a remote source when not available locally.
Moreover it also uses the remote server (openchain) to resolve the ABI and topics to human readable names.

You can visit the `era-test-node` repository [here](https://github.com/matter-labs/era-test-node) to learn more.
You can visit the `anvil-zksync` repository [here](https://github.com/matter-labs/era-test-node) to learn more.

Please keep in mind that `era-test-node` is still in its **alpha** stage, so some features might not be fully supported yet and may not work as fully intended.
Please keep in mind that `anvil-zksync` is still in its **alpha** stage, so some features might not be fully supported yet and may not work as fully intended.
It is [open-sourced](https://github.com/matter-labs/era-test-node) and contributions are welcomed.
2 changes: 1 addition & 1 deletion docs/rustbook/src/usage/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ The expected output will be as follows:
12:34:56 [INFO] ========================================
```

> *Note:* When utilizing `era-test-node` with MetaMask, it's essential to note that any restart of the in-memory node will necessitate a reset of MetaMask's
> *Note:* When utilizing `anvil-zksync` with MetaMask, it's essential to note that any restart of the in-memory node will necessitate a reset of MetaMask's
cached account data (nonce, etc). To do this, navigate to `Settings`, then `Advanced`, and finally, select `Clear activity tab data`.
12 changes: 6 additions & 6 deletions docs/rustbook/src/usage/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ to target your local copy of `anvil-zksync`. For instance:

```sh
# Add path here:
export ZKSYNC_HOME=/path/to/era-test-node
export ZKSYNC_HOME=/path/to/anvil-zksync

export PATH=$ZKSYNC_HOME/bin:$PATH
```
Expand All @@ -29,7 +29,7 @@ RUST_LOG=vm=trace anvil-zksync --dev-use-local-contracts fork sepolia-testnet
```

## Writing and running tests locally
This section demonstrates how to author and execute tests locally against `era-test-node` using the `mocha` and `chai` testing frameworks.
This section demonstrates how to author and execute tests locally against `anvil-zksync` using the `mocha` and `chai` testing frameworks.

### Project configuration
Start by creating a new Hardhat project. If you need guidance, follow the [getting started guide](https://era.zksync.io/docs/tools/hardhat/getting-started.html).
Expand All @@ -50,7 +50,7 @@ This script makes it possible to run tests in a Hardhat environment with the `NO

### Configuring tests
Adjust `hardhat.config.ts` to use the local node for testing:
> *Note:* Ensure `era-test-node` is running in another process before executing `yarn test`.
> *Note:* Ensure `anvil-zksync` is running in another process before executing `yarn test`.
```ts
import "@matterlabs/hardhat-zksync-deploy";
Expand Down Expand Up @@ -115,16 +115,16 @@ To run the test file, execute:
yarn test
```

Well done! You've successfully run your first local tests with zkSync Era and `era-test-node`.
Well done! You've successfully run your first local tests with zkSync Era and `anvil-zksync`.

## CI/CD Testing with GitHub Actions
A GitHub Action is available for integrating era-test-node into your CI/CD environments.
A GitHub Action is available for integrating anvil-zksync into your CI/CD environments.
This action offers high configurability and streamlines the process of testing your applications in an automated way.

You can find this GitHub Action in the marketplace [here](https://github.com/marketplace/actions/era-test-node-action).

### Example Usage
Below is an example yaml configuration to use the era-test-node GitHub Action in your workflow:
Below is an example yaml configuration to use the anvil-zksync GitHub Action in your workflow:
```yml
name: Run Era Test Node Action

Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ async fn main() -> anyhow::Result<()> {

// Initialize the tracing subscriber
let observability =
Observability::init(vec!["anvil-zksync".into()], log_level_filter, log_file)?;
Observability::init(vec!["anvil_zksync".into()], log_level_filter, log_file)?;

// Use `Command::Run` as default.
let command = command.as_ref().unwrap_or(&Command::Run);
Expand Down
5 changes: 0 additions & 5 deletions src/observability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,8 @@ impl Observability {
.collect::<Vec<String>>()
.join(",");

println!("Logging directives: {}", directives);

let filter = Self::parse_filter(&directives)?;
println!("filter: {:?}", filter);
let (filter, reload_handle) = reload::Layer::new(filter);
println!("filter2: {:?}", filter);
println!("reload_handle: {:?}", reload_handle);
let timer_format =
time::format_description::parse("[hour]:[minute]:[second]").expect("Cataplum");
let time_offset = time::UtcOffset::current_local_offset().unwrap_or(time::UtcOffset::UTC);
Expand Down

0 comments on commit 1f200ec

Please sign in to comment.