Skip to content

Commit

Permalink
Fix repo setup (#210)
Browse files Browse the repository at this point in the history
* remove era-test-node submodule

* Update README.md

* Update Makefile

Added node commands and update repo installation

* Fix era-test-node path

* Add .gitignore

* Remove useless commands

* Fix CI

* Add EOL

* Fix CI

* Fix CI

* Fix CI

* Fix CI

* Fix CI

* Fix CI

* Fix CI

* Fix CI

* Debug CI

* Debug CI

* Debug CI

* Fix CI

* Fix CI

* Fix CI

* Fix CI

* Fix CI

* Rename ModExp precompile file

---------

Co-authored-by: Ivan Litteri <[email protected]>
  • Loading branch information
ilitteri and Ivan Litteri authored Jan 24, 2024
1 parent 0d6c0f2 commit fe92e93
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 25 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ jobs:
name: "Build precompiles"
runs-on: ubuntu-latest
steps:
- name: "Build precompiles"
- name: Checkout sources
uses: actions/checkout@v3

- name: Clone node
run: cd submodules && git clone https://github.com/lambdaclass/era-test-node.git --branch lambdaclasss_precompiles

- name: "Setup requirements"
run: make setup

- name: copy-precompiles
run: make copy-precompiles
- name: Download solc
uses: pontem-network/get-solc@master

- name: "Build precompiles"
run: make build-precompiles
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
era_test_node.log
submodules/era_test_node
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[submodule "submodules/eth-tests"]
path = submodules/eth-tests
url = https://www.github.com/ethereum/tests.git
[submodule "submodules/era-test-node"]
path = submodules/era-test-node
url = https://www.github.com/lambdaclass/era-test-node.git
branch = yul-console-log-vm-fixes
38 changes: 28 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,42 @@
.PHONY: setup update run test docs
.PHONY: install run copy-precompiles build-precompiles download-node build-node setup-node update-node run-node run-node-light test docs clean

setup:
git submodule update --init && \
# Main commands

install: setup-node
cp -r precompiles/ submodules/era-test-node/etc/system-contracts/contracts/precompiles && \
cd submodules/era-test-node && \
make build-contracts

update:
git submodule update
# Precompiles commands

.PHONY: copy-precompiles
copy-precompiles:
cp precompiles/*.yul submodules/era-test-node/etc/system-contracts/contracts/precompiles/

.PHONY: build-precompiles
build-precompiles: copy-precompiles
cd submodules/era-test-node && make build-precompiles
cd submodules/era-test-node && \
make build-contracts

# Node Commands

download-node:
cd submodules && \
[ -d "./era-test-node" ] || git clone [email protected]:LambdaClass/era-test-node.git --branch lambdaclasss_precompiles

build-node:
cd submodules/era-test-node && make rust-build && make build-contracts

setup-node: download-node build-node

update-node:
cd submodules/era-test-node && git pull && make rust-build

run-node:
./submodules/era-test-node/target/release/era_test_node --show-calls=all --resolve-hashes --show-gas-details=all run

run-node-light:
./submodules/era-test-node/target/release/era_test_node run

run: build-precompiles
cd submodules/era-test-node && cargo +nightly run -- --show-calls=all --resolve-hashes --show-gas-details=all run
# Other commands

test:
cd tests && \
Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,24 @@ Follow the instructions below to setup the repo and run a development L2 node.
### Setup the repo

```
make setup
make install
```

### Update the submodules (if needed)
### Running an era-test-node

Once built, run one of the following commands to have a working test node.

```
make update
make run-node
make run-node-light # no call trace, no hash resolving, and no gas details
```

### Run a development L2 node
### Must run after every change in a precompile

Our precompiles are located in `precompiles/` but as they are there, they're no being tracked by our `era-test-node` clone. We need to always copy our precompiles into the `era-test-node` repo for it to be able to track and compile them for later testing.

```
make run
make build-node
```

### Run the tests
Expand Down
File renamed without changes.

0 comments on commit fe92e93

Please sign in to comment.