Snapshot
- Focus: Continue development and maintenance for ZKsync's local Ethereum-compatible test node (EraVM).
- Context: Matter Labs developed anvil-zksync, the local dev node for ZKsync's EraVM. As the project matured, Moonsong Labs assisted with targeted improvements and ongoing maintenance.
- Who it's for: Matter Labs and ecosystem developers building on ZKsync.
- Moonsong Labs' role: Supporting Matter Labs with RPC method implementation and upkeep, Hardhat workflow support, developer infrastructure improvements, documentation, and community issue triage.
Working with Moonsong Labs was a really smooth experience. The team was quite autonomous and didn't require micromanagement, which made it easy to trust that things would get done. Communication was strong, they brought up blockers early and followed up when needed instead of letting things slip. Overall, they were organized, responsible, and easy to work with. I was very happy with this collaboration.
Context
ZKsync Era introduced EraVM: a register-based virtual machine designed for efficient zero-knowledge proof generation, with an architecture different from the standard EVM. Matter Labs developed anvil-zksync (formerly era-test-node) as the local testing node for this environment, providing a familiar Ethereum/Hardhat-compatible workflow adapted to EraVM semantics.
As the node gained adoption across the ecosystem, Matter Labs brought in Moonsong Labs to assist with implementing missing RPC methods, maintenance, and targeted improvements.
The Challenge
Maintaining and extending a local node for EraVM involved:
- EraVM differences: Native account abstraction, different gas and opcode behavior required ongoing attention to keep the node accurate as EraVM evolved.
- RPC method upkeep: Ethereum RPC methods assume EVM semantics. As the network changed, methods needed revalidation and EraVM-aware adjustments.
- Hardhat compatibility: Hardhat-exclusive methods (impersonation, time travel, snapshots) needed continued support under EraVM to keep existing workflows familiar.
- Ecosystem expectations: Ecosystem users relied on clear documentation, working examples, and responsive issue triage.
- Evolving architecture: EraVM updates required careful adaptation at the RPC layer without breaking the user-facing contract.
Our Approach
Guided by the Matter Labs team, Moonsong Labs focused on adding new features, improving usability, and maintaining solution quality.
- RPC method implementation and maintenance: Assisted with implementing core Ethereum RPC methods and ZKsync-specific endpoints, and keeping them up to date as EraVM evolved.
- Infrastructure and tooling: Contributed logging, caching, and build improvements that strengthened the project's foundation.
- Documentation and examples: Helped maintain and expand documentation for supported RPC methods and EraVM-specific behaviors, including example projects for common workflows.
- Community support: Worked on GitHub issue triage, feeding ecosystem feedback into Matter Labs' roadmap.
Execution
Moonsong Labs' work progressed iteratively, coordinated with Matter Labs' priorities:
RPC method implementation
- Implemented core Ethereum RPC methods, including eth_getBlockByHash, eth_getBlockByNumber, eth_getLogs, eth_getFilterLogs, eth_getStorageAt, eth_protocolVersion, eth_getTransactionByBlockHashAndIndex, eth_getTransactionByBlockNumberAndIndex, and block transaction count queries.
- Implemented ZKsync-specific endpoints: zks_L1ChainId, zks_getBytecodeByHash, zks_getBridgeContracts.
- Added event filter support and helped validate RPC behavior against updated ZKsync dependencies.
Hardhat workflow assistance
- Implemented hardhat_setCode, time controls (evm_increaseTime, evm_setNextBlockTimestamp, evm_setTime), and snapshot/revert (evm_snapshot, evm_revert).
- Validated compatibility against real Hardhat projects.
Infrastructure and tooling
- Refactored logging to use the tracing crate for structured, dynamic log output.
- Added caching to HttpForkSource for improved fork-mode performance.
- Added aarch64-unknown-linux-gnu build target and console log selector support.
- Refactored storage view and namespace organization for cleaner internal architecture.
Documentation
- Set up the rustbook documentation framework for the project.
- Fixed documentation deployment and accessibility issues.
Results
anvil-zksync is currently the go-to local node for the ZKsync ecosystem. Moonsong Labs' contributions helped strengthen it across several areas:
- Expanded RPC coverage across core Ethereum methods and ZKsync-specific endpoints, improving fidelity for EraVM-based development.
- Strengthened developer workflows by keeping Hardhat-style testing features reliable in local and forked environments.
- Improved day-to-day usability through documentation, performance-focused infrastructure upgrades, and timely community issue triage.
Together, these contributions helped ensure anvil-zksync remained a reliable foundation for building and testing on ZKsync EraVM-based chains.
