Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hardhat deployment and test #40

Merged
merged 12 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,86 @@ jobs:
when: on_fail
working_directory: packages/contracts-bedrock

devnet-hardhat:
machine:
image: ubuntu-2204:2022.10.2
environment:
DOCKER_BUILDKIT: 1
steps:
- checkout-with-submodules
- check-changed:
patterns: op-(.+),packages,ops-bedrock
- run:
name: Install latest golang
command: |
wget https://go.dev/dl/go1.20.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go1.20.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
go version
- run:
name: foundryup
command: |
curl -L https://foundry.paradigm.xyz | bash
source $HOME/.bashrc
foundryup
echo 'export PATH=$HOME/.foundry/bin:$PATH' >> $BASH_ENV
source $HOME/.bashrc
forge --version
- run:
name: Install NVM
command: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
source ~/.bashrc
nvm --version
- run:
name: Install Node
command: |
nvm install
nvm use && node --version && npm --version
- run:
name: Install pnpm
command: |
npm i pnpm --global
- run:
name: git submodules
command: git submodule update --init --recursive
- run:
name: Install and build
command: |
pnpm install --frozen-lockfile --prefer-offline && pnpm build
- run:
name: Bring up the stack
command: make devnet-hardhat-up
- run:
name: Test the stack
command: make devnet-hardhat-test
- run:
name: Dump op-node logs
command: |
docker logs ops-bedrock-op-node-1 || echo "No logs."
when: on_fail
- run:
name: Dump op-geth logs
command: |
docker logs ops-bedrock-l2-1 || echo "No logs."
when: on_fail
- run:
name: Dump l1 logs
command: |
docker logs ops-bedrock-l1-1 || echo "No logs."
when: on_fail
- run:
name: Dump op-batcher logs
command: |
docker logs ops-bedrock-op-batcher-1 || echo "No logs."
when: on_fail
- run:
name: Dump op-proposer logs
command: |
docker logs ops-bedrock-op-proposer-1 || echo "No logs."
when: on_fail

semgrep-scan:
parameters:
diff_branch:
Expand Down Expand Up @@ -1164,6 +1244,7 @@ workflows:
requires:
- pnpm-monorepo
- devnet
- devnet-hardhat
- go-lint-test-build:
name: proxyd-tests
binary_name: proxyd
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ cache

packages/contracts-bedrock/deployments/devnetL1
packages/contracts-bedrock/deployments/anvil
packages/contracts-bedrock/deployments/hardhat-local

# vim
*.sw*
Expand Down
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,17 @@ devnet-up:
# alias for devnet-up
devnet-up-deploy: devnet-up

devnet-hardhat-up:
@if [ ! -e op-program/bin ]; then \
make cannon-prestate; \
fi
PYTHONPATH=./bedrock-devnet ${PYTHON} ./bedrock-devnet/hardhat.py --monorepo-dir=.
.PHONY: devnet-hardhat-up

devnet-hardhat-test:
PYTHONPATH=./bedrock-devnet ${PYTHON} ./bedrock-devnet/hardhat.py --monorepo-dir=. --test
.PHONY: devnet-hardhat-test

devnet-test:
PYTHONPATH=./bedrock-devnet ${PYTHON} ./bedrock-devnet/main.py --monorepo-dir=. --test
.PHONY: devnet-test
Expand Down
7 changes: 7 additions & 0 deletions bedrock-devnet/hardhat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import hardhat

def main():
hardhat.main()

if __name__ == '__main__':
main()
Loading