# EPF5 Week-2: Testing
## Week overview
- [X] Learned testing tools
- [X] Focused on CL testing
- [X] Ran Hive, failed
- [X] Ran Kurtosis
This week was dedicated to Ethereum testing. Upon discovering the various aspects and tools available for testing Ethereum, I quickly reviewed these tools and concentrated on the Consensus Layer. My objective is to run PeerDAS Devnet using Kurtosis.
[EPF Study Group: Testing & Security Overview](https://www.youtube.com/watch?v=PQVW5dJ8J0c&list=PLvu3JfoGPg5nt45MNYEuExw17pbH9MB3p&index=4)
### CL testing
The way to start CL testing is [CL tests from specs](https://github.com/ethereum/consensus-specs/tree/dev/tests).
### Interop testing
Cross-Layer testing: Execution Layer + Consensus Layer.
End-to-end testing can include building chains from genesis to some point verifying all interactions are running correctly.
### Hive
[Hive](https://github.com/ethereum/hive) is a system for running integration tests against Ethereum clients. In hive, integration tests are called **simulations**. A simulation is controlled by a program (the **simulator**) written in any language. The simulator launches clients and contains test logic. It reports test results back to hive, where they are aggregated for display in a web browser.
**Available Hive simulators:**
- **devp2p** runs 'eth', 'snap' and 'discv4' peer-to-peer protocol tests.
- **ethereum/sync** attempts to synchronize the blockchain among all clients.
- **ethereum/consensus** runs the Ethereum 1 consensus tests against all clients.
- **ethereum/rpc** configures a client for clique PoA mining and runs various tests against the web3 JSON-RPC interface.
- **ethereum/graphql** initializes a client with a known test chain and enables the GraphQL API endpoint.
- **ethereum/engine** verifies specification compliance of the Engine API implementation of execution clients.
Installing Hive:
```
git clone https://github.com/ethereum/hive.git
cd ./hive
go build .
```
To run simulations, I need a Docker running.
The example of running a simulation:
```
./hive --sim ethereum/sync --client go-ethereum,besu,nethermind
```
Hive builds simulator and client images using docker. Once all images are built, the simulator program is launched in a docker container. It launches clients and reports test results through the API.
Hive simulator eth2 runs an Execution Client and a Consensus Client at the same time.
For now I failed to run Hive having issues with Docker.

### Assertoor
[Assertoor](https://github.com/ethpandaops/assertoor) is an Ethereum Testnet Testing Tool. It runs tests from a YAML file. Each test is a sequence of tasks executed in a defined order to assess various aspects of the Ethereum network. Based on assertions with given inputs and expected outputs.
**Key features:**
- **connects to multiple Consensus and Execution Clients** via their HTTP RPC API, ensuring compatibility with all clients and providing a resilient view of the network status.
- **YAML-Based Tests & Tasks**, can include tasks specified in the test configuration or sideloaded from external URLs, offering flexible and organized test management.
- **Task Orchestrator** enables execution of tasks in a predefined order, supporting both parallelization and sequential steps with dependencies.
- **Versatile Task Capabilities**, includes tasks ranging from simple shell scripts to complex built-in logic.
- **Web interface** displays real-time test and task status, logs, and results for easy monitoring and analysis.
- **Web API** provides real-time test and task status, logs, and results for easy programmatic access.
The example of running Assertoor:
```
./bin/assertoor --config=./example/config/check_proposals.yaml
```
Using the web interface you can track progress, view logs, and analyze results in real-time.
### Kurtosis
[Kurtosis](https://github.com/ethpandaops/ethereum-package) package deploys a private, portable, and modular Ethereum devnet over Docker or Kubernetes with multi-client support, Flashbot's mev-boost infrastructure for PBS-related testing/validation, and other useful network tools (transaction spammer, monitoring tools, etc).
I installed Kurtosis and ran a basic version:
```
brew install kurtosis-tech/tap/kurtosis-cli
kurtosis run --enclave my-testnet github.com/ethpandaops/ethereum-package
```

## Weekly EPF Activity
- [EPF5 Standup]()
- [EPF5 Office Hours]()
- [ACDE #190](https://youtube.com/live/8VGf-EE6zNE)
[Github issue #1066](https://github.com/ethereum/pm/issues/1066)
[Pectra-devnet-1 specs](https://notes.ethereum.org/@ethpandaops/pectra-devnet-1)
Updates from the EL teams. Discussing Pectra Devnet 1. EIP 7702 updates.
## TODO
- [ ] Dive deep into PeerDAS and blobs
- [ ] Configure Kurtosis
- [ ] Explore tests for PeerDAS
- [ ] Investigate devnets (devnet1, peerdas-devnet-0)
## Glossary
| Term | Description |
| -------- | -------- |
| Interop | Cross-Layer |
## Links
[Testing on epf.wiki](https://epf.wiki/#/wiki/testing/overview)
[CL tests from specs](https://github.com/ethereum/consensus-specs/tree/dev/tests)
[Hive Docs](https://github.com/ethereum/hive/blob/master/docs/overview.md)
[EF ESP - Ecosystem support program](https://esp.ethereum.foundation/)
[Pectra Devnets from EthPandaOps](https://github.com/ethpandaops/pectra-devnets)
[Kurtosis package on EthPandaOps](https://github.com/ethpandaops/ethereum-package)