Skip to content

Commit cea8238

Browse files
santiago-MVmpaulucci
authored andcommitted
chore(l1,l2): reorder fixtures (lambdaclass#3155)
**Motivation** <!-- Why does this pull request exist? What are its goals? --> The `tests_data` folder was unorganized **Description** <!-- A clear and concise general description of the changes this PR introduces --> Created a `fixtures` folder inside of test data with a folder for each type of file. The current structure looks like this: ``` fixtures/ ├── genesis/ # All genesis files │ └── *.json │ ├── network/ # Network configuration │ ├── params.yaml │ └── hive_clients | └── *.yml | ├── contracts/ # Smart contracts for testing │ ├── ERC20/ │ │ ├── ERC20.sol │ │ ├── ERC20.bin │ │ | └── TestToken.bin │ │ └── deps.sol │ ├── load-test/ │ | └── IOHeavyContract.sol | └──levm_print | └── Print.sol | ├── blockchain/ # Blockchain data files │ └── *.rlp | ├── blobs/ # BLOB files │ └── *.blob | ├── keys/ # Private keys for testing │ ├── private_keys.txt │ └── private_keys_l1.txt | ├── cache/ # Cached data │ └── rpc_prover/ │ └── cache_3990967.json | └── rsp/ └── input/ └── 1/ └── 21272632.bin ``` All references were updated to avoid breaking the code <!-- Link to issues: Resolves lambdaclass#111, Resolves lambdaclass#222 --> Closes lambdaclass#3006 --------- Co-authored-by: Martin Paulucci <[email protected]>
1 parent d2c3141 commit cea8238

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+672
-102
lines changed

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
test_data/2000-blocks.rlp filter=lfs diff=lfs merge=lfs -text
2-
test_data/l2-1k-erc20.rlp filter=lfs diff=lfs merge=lfs -text
1+
fixtures/blockchain/2000-blocks.rlp filter=lfs diff=lfs merge=lfs -text
2+
fixtures/blockchain/l2-1k-erc20.rlp filter=lfs diff=lfs merge=lfs -text

.github/scripts/flamegraph_watcher.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ cargo build --release --manifest-path ./tooling/load_test/Cargo.toml
1616

1717
echo "Starting load test"
1818
start_time=$(date +%s)
19-
RUST_BACKTRACE=1 ./target/release/load_test -k ./test_data/private_keys.txt -t eth-transfers -N 1000 -n http://localhost:1729 -w 1
19+
RUST_BACKTRACE=1 ./target/release/load_test -k ./fixtures/keys/private_keys.txt -t eth-transfers -N 1000 -n http://localhost:1729 -w 1
2020
end_time=$(date +%s)
2121

2222
elapsed=$((end_time - start_time))

.github/workflows/common_hive_reports.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
fi
7878
7979
- name: Run Hive Simulation
80-
run: cd hive && ./hive --client-file ../test_data/network/hive_clients/ethrex.yml --client ethrex --sim ${{ matrix.test.simulation }} --sim.parallelism 16 ${{ env.HIVE_FLAGS }}
80+
run: cd hive && ./hive --client-file ../fixtures/network/hive_clients/ethrex.yml --client ethrex --sim ${{ matrix.test.simulation }} --sim.parallelism 16 ${{ env.HIVE_FLAGS }}
8181
continue-on-error: true
8282

8383
- name: Upload results

.github/workflows/main_flamegraph_report.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ jobs:
241241
cargo build --release --bin ethrex --features dev
242242
CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph -c "record -o perf.data -F997 --call-graph dwarf,16384 -g" \
243243
--bin ethrex --release --features dev -- \
244-
--dev --network /home/runner/work/ethrex/ethrex/test_data/genesis-load-test.json --http.port 1729 &
244+
--dev --network /home/runner/work/ethrex/ethrex/fixtures/genesis/load-test.json --http.port 1729 &
245245
sleep 10
246246
echo "Executing load test..."
247247
bash /home/runner/work/ethrex/ethrex/.github/scripts/flamegraph_watcher.sh &&
@@ -356,7 +356,7 @@ jobs:
356356
rm -rf target/profiling/reth
357357
cargo build --bin reth --profile profiling
358358
CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph -c "record -o perf.data -F997 --call-graph dwarf,16384 -g" --bin reth --profile profiling -- \
359-
node --chain /home/runner/work/ethrex/ethrex/test_data/genesis-load-test.json --dev \
359+
node --chain /home/runner/work/ethrex/ethrex/fixtures/genesis/load-test.json --dev \
360360
--dev.block-time 1000ms --http.port 1729 --txpool.max-pending-txns 100000000 --txpool.max-new-txns 1000000000 \
361361
--txpool.pending-max-count 100000000 --txpool.pending-max-size 10000000000 --txpool.basefee-max-count 100000000000 \
362362
--txpool.basefee-max-size 1000000000000 --txpool.queued-max-count 1000000000 &

.github/workflows/main_prover_l1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
# RPC_URL: $${{ secrets.ETHREX_L2_RPC_URL }}
5353
RPC_URL: "dummy"
5454
run: |
55-
cp test_data/rpc_prover/cache_690403.json cmd/ethrex_replay
55+
cp fixtures/cache/rpc_prover/cache_690403.json cmd/ethrex_replay
5656
cd cmd/ethrex_replay
5757
make prove-sp1-gpu-ci BLOCK_NUMBER=690403 NETWORK=hoodi
5858

.github/workflows/pr-main_l1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ jobs:
203203
docker load --input /tmp/ethrex_image.tar
204204
205205
- name: Run Hive Simulation
206-
run: chmod +x hive && ./hive --client-file test_data/network/hive_clients/ethrex.yml --client ethrex --sim ${{ matrix.simulation }} --sim.limit "${{ matrix.test_pattern }}" --sim.parallelism 16
206+
run: chmod +x hive && ./hive --client-file fixtures/network/hive_clients/ethrex.yml --client ethrex --sim ${{ matrix.simulation }} --sim.limit "${{ matrix.test_pattern }}" --sim.parallelism 16
207207
# We use 8 here instead of 16 due to performance issues in some tests
208208
# Notably the tests "Invalid Missing Ancestor Syncing ReOrG" in engine cancun
209209

.github/workflows/pr-main_l2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
branches: ["**"]
77
paths:
88
- "crates/l2/**"
9-
- "test_data/**"
9+
- "fixtures/**"
1010
- "crates/blockchain/dev/**"
1111
- "crates/vm/levm/**"
1212
- ".github/workflows/pr-main_l2.yaml"

.github/workflows/pr-main_l2_tdx.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
paths:
88
- "crates/l2/tee/**"
99
- "crates/l2/contracts/**"
10-
- "test_data/**"
10+
- "fixtures/**"
1111
- ".github/workflows/pr-main_l2_tdx.yaml"
1212

1313
concurrency:

.github/workflows/pr_perf_blocks_exec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
BINS="base,head"
8686
hyperfine --setup "./bin/ethrex-base removedb" -w 5 -N -r 10 --show-output --export-markdown "bench_pr_comparison.md" \
8787
-L bin "$BINS" -n "{bin}" \
88-
"./bin/ethrex-{bin} --network test_data/genesis-perf-ci.json --force import ./test_data/l2-1k-erc20.rlp --removedb"
88+
"./bin/ethrex-{bin} --network fixtures/genesis/perf-ci.json --force import ./fixtures/blockchain/l2-1k-erc20.rlp --removedb"
8989
echo -e "## Benchmark Block Execution Results Comparison Against Main\n\n$(cat bench_pr_comparison.md)" > bench_pr_comparison.md
9090
- name: Upload PR results
9191
uses: actions/upload-artifact@v4

Makefile

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ run-image: build-image ## 🏃 Run the Docker image
3232

3333
dev: ## 🏃 Run the ethrex client in DEV_MODE with the InMemory Engine
3434
cargo run --bin ethrex --features dev -- \
35-
--network ./test_data/genesis-l1.json \
35+
--network ./fixtures/genesis/l1.json \
3636
--http.port 8545 \
3737
--http.addr 0.0.0.0 \
3838
--authrpc.port 8551 \
@@ -56,12 +56,12 @@ checkout-ethereum-package: ethereum-package ## 📦 Checkout specific Ethereum p
5656
ENCLAVE ?= lambdanet
5757

5858
localnet: stop-localnet-silent build-image checkout-ethereum-package ## 🌐 Start local network
59-
kurtosis run --enclave $(ENCLAVE) ethereum-package --args-file test_data/network_params.yaml
59+
kurtosis run --enclave $(ENCLAVE) ethereum-package --args-file fixtures/network/network_params.yaml
6060
docker logs -f $$(docker ps -q --filter ancestor=ethrex)
6161

6262
localnet-client-comparision: stop-localnet-silent build-image checkout-ethereum-package ## 🌐 Start local network
6363
cp crates/blockchain/metrics/provisioning/grafana_provisioning/dashboards/common_dashboards/ethrex_l1_perf.json ethereum-package/src/grafana/ethrex_l1_perf.json
64-
kurtosis run --enclave $(ENCLAVE) ethereum-package --args-file test_data/network_params_client_comparision.yaml
64+
kurtosis run --enclave $(ENCLAVE) ethereum-package --args-file fixtures/network/network_params_client_comparision.yaml
6565
docker logs -f $$(docker ps -q -n 1 --filter ancestor=ethrex)
6666

6767
localnet-assertoor-blob: stop-localnet-silent build-image checkout-ethereum-package ## 🌐 Start local network with assertoor test
@@ -112,9 +112,9 @@ SIM_PARALLELISM ?= 16
112112
# The evm can be selected by using seting HIVE_ETHREX_FLAGS='--evm revm' (the default is levm)
113113
# The log level can be selected by switching SIM_LOG_LEVEL from 1 up to 4
114114

115-
HIVE_CLIENT_FILE := ../test_data/network/hive_clients/ethrex.yml
116-
HIVE_CLIENT_FILE_GIT := ../test_data/network/hive_clients/ethrex_git.yml
117-
HIVE_CLIENT_FILE_LOCAL := ../test_data/network/hive_clients/ethrex_local.yml
115+
HIVE_CLIENT_FILE := ../fixtures/network/hive_clients/ethrex.yml
116+
HIVE_CLIENT_FILE_GIT := ../fixtures/network/hive_clients/ethrex_git.yml
117+
HIVE_CLIENT_FILE_LOCAL := ../fixtures/network/hive_clients/ethrex_local.yml
118118

119119
run-hive: build-image setup-hive ## 🧪 Run Hive testing suite
120120
- cd hive && ./hive --client-file $(HIVE_CLIENT_FILE) --client ethrex --sim $(SIMULATION) --sim.limit "$(TEST_PATTERN)" --sim.parallelism $(SIM_PARALLELISM) --sim.loglevel $(SIM_LOG_LEVEL)
@@ -147,28 +147,28 @@ start-node-with-flamegraph: rm-test-db ## 🚀🔥 Starts an ethrex client used
147147
--features "dev" \
148148
-- \
149149
--evm $$LEVM \
150-
--network test_data/genesis-l2.json \
150+
--network fixtures/genesis/l2.json \
151151
--http.port 1729 \
152152
--dev \
153153
--datadir test_ethrex
154154

155155
load-test: ## 🚧 Runs a load-test. Run make start-node-with-flamegraph and in a new terminal make load-node
156-
cargo run --release --manifest-path ./tooling/load_test/Cargo.toml -- -k ./test_data/private_keys.txt -t eth-transfers
156+
cargo run --release --manifest-path ./tooling/load_test/Cargo.toml -- -k ./fixtures/keys/private_keys.txt -t eth-transfers
157157

158158
load-test-erc20:
159-
cargo run --release --manifest-path ./tooling/load_test/Cargo.toml -- -k ./test_data/private_keys.txt -t erc20
159+
cargo run --release --manifest-path ./tooling/load_test/Cargo.toml -- -k ./fixtures/keys/private_keys.txt -t erc20
160160

161161
load-test-fibonacci:
162-
cargo run --release --manifest-path ./tooling/load_test/Cargo.toml -- -k ./test_data/private_keys.txt -t fibonacci
162+
cargo run --release --manifest-path ./tooling/load_test/Cargo.toml -- -k ./fixtures/keys/private_keys.txt -t fibonacci
163163

164164
load-test-io:
165-
cargo run --release --manifest-path ./tooling/load_test/Cargo.toml -- -k ./test_data/private_keys.txt -t io-heavy
165+
cargo run --release --manifest-path ./tooling/load_test/Cargo.toml -- -k ./fixtures/keys/private_keys.txt -t io-heavy
166166

167167
rm-test-db: ## 🛑 Removes the DB used by the ethrex client used for testing
168168
sudo cargo run --release --bin ethrex -- removedb --force --datadir test_ethrex
169169

170-
test_data/ERC20/ERC20.bin: ## 🔨 Build the ERC20 contract for the load test
171-
solc ./test_data/ERC20.sol -o $@
170+
fixtures/ERC20/ERC20.bin: ## 🔨 Build the ERC20 contract for the load test
171+
solc ./fixtures/contracts/ERC20/ERC20.sol -o $@
172172

173173
sort-genesis-files:
174174
cd ./tooling/genesis && cargo run

0 commit comments

Comments
 (0)