Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
1064fae
Add flag to enable l2geth for alt l1s
boyuan-chen Feb 6, 2023
8acff21
Rename variable
boyuan-chen Feb 6, 2023
993046a
Set l2geth for Ethereum L2
boyuan-chen Feb 6, 2023
8a5d911
DTL and SDK support alt l1s
boyuan-chen Feb 7, 2023
ef3281d
Support core contracts for Alt L1s
boyuan-chen Feb 8, 2023
b17ef6f
Fix deployment and eslint
boyuan-chen Feb 8, 2023
f619604
Add tests and fix state dump
boyuan-chen Feb 8, 2023
c4a7958
Restructure folders
boyuan-chen Feb 8, 2023
7d189ff
Add boba deployer contracts
boyuan-chen Feb 8, 2023
1fe6748
Support Alt L1 in boba deployer
boyuan-chen Feb 9, 2023
f5197b7
Merge branch 'develop' into merge-alt-l1-to-develop
boyuan-chen Feb 9, 2023
76ff796
Add integration test files for alt l1s
boyuan-chen Feb 9, 2023
cf0be6d
Fix Ethereum L2 test
boyuan-chen Feb 9, 2023
08392cf
Revert script changes
boyuan-chen Feb 9, 2023
bc4050e
Add moonbeam integration test
boyuan-chen Feb 9, 2023
398551f
Add scripts to start docker
boyuan-chen Feb 9, 2023
fed56da
Add KMS seeds
boyuan-chen Feb 9, 2023
ec16501
Rewrite boba deployer
boyuan-chen Feb 10, 2023
f5b9ea7
Fix genesis block for Ethereum L2
boyuan-chen Feb 10, 2023
31a1196
Remove unused packages
boyuan-chen Feb 10, 2023
79344e1
Fix boba deployer
boyuan-chen Feb 11, 2023
ce68f70
Fix some tests
boyuan-chen Feb 13, 2023
55dbd69
Fix more tests
boyuan-chen Feb 13, 2023
d3393f4
Add script for filtering tests
boyuan-chen Feb 13, 2023
3a91cd7
Fix integration script
boyuan-chen Feb 13, 2023
0b32d85
Restructure folder for integration tests
boyuan-chen Feb 13, 2023
5c89d6f
Fix roots
boyuan-chen Feb 13, 2023
bfd7b01
Enable all tests
boyuan-chen Feb 13, 2023
49e8c7c
Fix more tests
boyuan-chen Feb 13, 2023
8b71caf
Fix LP tests
boyuan-chen Feb 14, 2023
82f5e53
Fix tests
boyuan-chen Feb 14, 2023
1f2e2f1
Fix integration tests
boyuan-chen Feb 14, 2023
1734649
Fix bobalink tests
boyuan-chen Feb 14, 2023
3cdbd85
Fix the building issue on M1
boyuan-chen Feb 15, 2023
b44090f
Fix order of variables
boyuan-chen Feb 15, 2023
e2a0b4c
Fix geth
boyuan-chen Feb 15, 2023
15d23d4
Merge branch 'develop' into merge-alt-l1-to-develop
boyuan-chen Feb 15, 2023
c61af81
Add other alt l1s
boyuan-chen Feb 15, 2023
97d7fa9
Fix the deployment for boba_deployer
boyuan-chen Feb 15, 2023
fd3f7fc
Fix bobalink contract addresses
boyuan-chen Feb 15, 2023
d8525a1
Fix NFT bridge tests
boyuan-chen Feb 15, 2023
12e05d4
Clean code
boyuan-chen Feb 15, 2023
5bf610b
Add gas price oracle for Alt L1s
boyuan-chen Feb 15, 2023
0d77e0e
Merge branch 'develop' into merge-alt-l1-to-develop
boyuan-chen Feb 16, 2023
61ba9b4
Fix issue of building images on M1 chip
boyuan-chen Feb 16, 2023
c273cb9
Support Alt L2 in monitor
boyuan-chen Feb 18, 2023
b2f1f8b
Fix typo
boyuan-chen Feb 21, 2023
022cb8d
Add MaxGasLimit in batch submitter for moonbeam
boyuan-chen Feb 21, 2023
55b82f3
Merge branch 'develop' into merge-alt-l1-to-develop
boyuan-chen Feb 21, 2023
97d096d
Add API templates
boyuan-chen Feb 21, 2023
19eb17e
Update go version
boyuan-chen Feb 21, 2023
c43465e
Merge branch 'develop' into merge-alt-l1-to-develop
boyuan-chen Feb 22, 2023
66a8de7
Simplify circleci config
boyuan-chen Feb 22, 2023
a207368
Fix template
boyuan-chen Feb 22, 2023
a7a31ae
Fix tab and env
boyuan-chen Feb 22, 2023
e47f63d
Update command name
boyuan-chen Feb 22, 2023
821bb4e
Use one bash to start networks
boyuan-chen Feb 22, 2023
c610d12
Fix docker file for integration tests
boyuan-chen Feb 22, 2023
c130e2b
Fix circleci config
boyuan-chen Feb 22, 2023
eb38345
Fix file names
boyuan-chen Feb 24, 2023
7193f70
Simplify configuration of replica
boyuan-chen Feb 27, 2023
de58ceb
Fix filter logic
boyuan-chen Mar 1, 2023
b005328
Merge branch 'develop' into merge-alt-l1-to-develop
boyuan-chen Mar 1, 2023
5261d39
Upgrade golang lint
boyuan-chen Mar 1, 2023
9c04dde
Upgrade lint version
boyuan-chen Mar 1, 2023
4b10a47
Merge branch 'develop' into merge-alt-l1-to-develop
boyuan-chen Mar 4, 2023
fc5de7b
Merge branch 'develop' into merge-alt-l1-to-develop
boyuan-chen Mar 9, 2023
7772342
Merge branch 'develop' into merge-alt-l1-to-develop
boyuan-chen Mar 12, 2023
8e0a5a6
Merge branch 'develop' into merge-alt-l1-to-develop
boyuan-chen Mar 14, 2023
a35f9e1
Remove local-network-config from root
boyuan-chen Mar 14, 2023
5afcc23
Merge branch 'develop' into merge-alt-l1-to-develop
wsdt Mar 15, 2023
af9cbf8
Merge branch 'develop' into merge-alt-l1-to-develop
boyuan-chen Mar 19, 2023
e55a456
await for transaction
boyuan-chen Mar 19, 2023
930d90e
build the stack through parameters
InoMurko Mar 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
248 changes: 158 additions & 90 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,103 +1,26 @@
#adapted from https://raw.githubusercontent.com/ethereum-optimism/optimism/develop/.circleci/config.yml
version: 2.1

jobs:
go-lint-test-build:
parameters:
binary_name:
description: Binary name to build
type: string
working_directory:
description: Working directory
type: string
build:
description: Whether or not to build the binary
type: boolean
default: true
dependencies:
description: Regex matching dependent packages
type: string
default: this-package-does-not-exist
docker:
- image: ethereumoptimism/ci-builder:latest
- image: cimg/postgres:14.1
steps:
- checkout
- run:
name: Check if we should run
command: |
shopt -s inherit_errexit
CHANGED=$(check-changed "(<<parameters.working_directory>>|<<parameters.dependencies>>)" || echo "TRUE")
echo $CHANGED
if [[ "$CHANGED" = "FALSE" ]]; then
circleci step halt
fi
- run:
name: Lint
command: golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint -e "errors.As" -e "errors.Is" ./...
working_directory: <<parameters.working_directory>>
- store_test_results:
path: /test-results
- run:
name: Test
command: |
mkdir -p /test-results
DB_USER=postgres gotestsum --junitfile /test-results/tests.xml
working_directory: <<parameters.working_directory>>
- when:
condition:
equal: [ true, <<parameters.build>> ]
steps:
- run:
name: Build
command: make <<parameters.binary_name>>
working_directory: <<parameters.working_directory>>

test_flow_bundler_and_depcheck:
docker: # run the steps with Docker
- image: cimg/node:16.6.2
steps: # a collection of executable commands
- checkout
- attach_workspace:
at: .
- run: # run hardhat-node as standalone process fork
command: yarn && yarn build
working_directory: ./
- run: # run hardhat-node as standalone process fork
name: hardhat-node-process
command: yarn hardhat-node
background: true
working_directory: ./packages/boba/bundler
- run: # run tests
name: test
command: yarn test-flows | tee /tmp/test-flows-results.log
working_directory: ./packages/boba/bundler
- run:
name: depcheck
command: yarn depcheck
working_directory: ./packages/boba/bundler
- store_test_results: # special step to upload test results for display in Test Summary
path: /tmp/test-flow-results.log
integration-tests:
executors:
intergration-tests-executor:
resource_class: xlarge
machine:
image: ubuntu-2004:202111-02
docker_layer_caching: true
environment:
DOCKER_BUILDKIT: 1
parallelism: 4

commands:
download-solidity-compilers:
steps:
- checkout

- run:
name: Generate cache key from all hardhat.config.ts files
working_directory: ops
command: ./scripts/checksum.sh /tmp/checksum.txt

- restore_cache:
keys:
- solc-compilers-{{ checksum "/tmp/checksum.txt" }}-{{ .Environment.CACHE_VERSION }}

- run:
name: Cache compliers
command: |
Expand All @@ -114,24 +37,32 @@ jobs:
find . -name solc-linux-amd64-v0.8.17+commit.8df45f5f | grep . || curl -L https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.8.17+commit.8df45f5f -o ./solc-linux-amd64-v0.8.17+commit.8df45f5f
chmod +x /home/circleci/.cache/hardhat-nodejs/compilers-v2/linux-amd64/*
working_directory: /

- save_cache:
key: solc-compilers-{{ checksum "/tmp/checksum.txt" }}-{{ .Environment.CACHE_VERSION }}
paths:
- /home/circleci/.cache/hardhat-nodejs/compilers-v2/linux-amd64/

run-integration-tests:
parameters:
docker_compose_file:
description: Docker compose file to use
type: string
test_folder:
description: Folder to run tests in
type: string
steps:
- run:
name: Build the project
command: yarn && yarn build
working_directory: ./

- run:
name: Build the core services
command: docker-compose build
working_directory: ops

- run:
name: Build the side services
command: docker-compose -f docker-compose.yml -f docker-compose-side.yml build -- $(yq '(.services | keys)[]' docker-compose-side.yml | tr '\n' ' ')
command: docker-compose -f <<parameters.docker_compose_file>> -f docker-compose-side.yml build -- $(yq '(.services | keys)[]' <<parameters.docker_compose_file>> | tr '\n' ' ') $(yq '(.services | keys)[]' docker-compose-side.yml | tr '\n' ' ')
working_directory: ops

- run:
Expand All @@ -143,30 +74,36 @@ jobs:
name: Bring up the stack
command: |
docker images
BUILD=2 DAEMON=1 ./up_local.sh
BUILD=2 DAEMON=1 DOCKER_FILE=<<parameters.docker_compose_file>> ./up_local.sh
working_directory: ops
- run:
name: Bring up services
command: |
docker-compose -f docker-compose.yml -f docker-compose-side.yml up -d bobalink aa_deployer bundler
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a part of building and spinning up the bundler got removed, can we add this back? 😄

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did I miss anything?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are now building the bundler (as a side service) and spinning it up with the stack - to enable the integration tests to work 😄, that part seems to have been removed
so just adding the bundler to docker-compose build and up
(ref - the pr that added this https://github.com/bobanetwork/boba/pull/531/files#diff-78a8a19706dbd2a4425dd72bdab0502ed7a2cef16365ab7030a5a0588927bf47)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me take a stab at this

docker-compose -f <<parameters.docker_compose_file>> -f docker-compose-side.yml up -d bobalink aa_deployer bundler
working_directory: ops
- run:
name: Start background logging
working_directory: ops
background: true
command: docker-compose -f docker-compose.yml -f docker-compose-side.yml logs --follow
command: docker-compose -f <<parameters.docker_compose_file>> -f docker-compose-side.yml logs --follow
- run:
name: Wait for sequencer
command: bash scripts/wait-for-sequencer.sh
working_directory: ops
- run:
name: Split tests
command: circleci tests glob "../integration-tests/test/*.spec.ts" | circleci tests split --split-by=timings --time-default=10s | tee splits.txt
command: circleci tests glob "../integration-tests/test/<<parameters.test_folder>>/*.spec.ts" | circleci tests split --split-by=timings --time-default=10s | tee splits.txt
working_directory: ops
- run:
name: Run integration tests
command: docker-compose run integration_tests $(cat splits.txt)
command: docker-compose -f <<parameters.docker_compose_file>> run integration_tests $(cat splits.txt)
working_directory: ops
- run:
name: Stop docker
command: docker-compose -f <<parameters.docker_compose_file>> -f docker-compose-side.yml down -v
working_directory: ops
report-integration-tests:
steps:
- run:
name: Rewrite test name for next run
command: |
Expand All @@ -178,10 +115,141 @@ jobs:
- store_artifacts:
path: /home/circleci/project/ops/result

jobs:
go-lint-test-build:
parameters:
binary_name:
description: Binary name to build
type: string
working_directory:
description: Working directory
type: string
build:
description: Whether or not to build the binary
type: boolean
default: true
dependencies:
description: Regex matching dependent packages
type: string
default: this-package-does-not-exist
docker:
- image: ethereumoptimism/ci-builder:latest
- image: cimg/postgres:14.1
steps:
- checkout
- run:
name: Check if we should run
command: |
shopt -s inherit_errexit
CHANGED=$(check-changed "(<<parameters.working_directory>>|<<parameters.dependencies>>)" || echo "TRUE")
echo $CHANGED
if [[ "$CHANGED" = "FALSE" ]]; then
circleci step halt
fi
- run:
name: Lint
command: golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint -e "errors.As" -e "errors.Is" ./...
working_directory: <<parameters.working_directory>>
- store_test_results:
path: /test-results
- run:
name: Test
command: |
mkdir -p /test-results
DB_USER=postgres gotestsum --junitfile /test-results/tests.xml
working_directory: <<parameters.working_directory>>
- when:
condition:
equal: [ true, <<parameters.build>> ]
steps:
- run:
name: Build
command: make <<parameters.binary_name>>
working_directory: <<parameters.working_directory>>

test_flow_bundler_and_depcheck:
docker: # run the steps with Docker
- image: cimg/node:16.6.2
steps: # a collection of executable commands
- checkout
- attach_workspace:
at: .
- run: # run hardhat-node as standalone process fork
command: yarn && yarn build
working_directory: ./
- run: # run hardhat-node as standalone process fork
name: hardhat-node-process
command: yarn hardhat-node
background: true
working_directory: ./packages/boba/bundler
- run: # run tests
name: test
command: yarn test-flows | tee /tmp/test-flows-results.log
working_directory: ./packages/boba/bundler
- run:
name: depcheck
command: yarn depcheck
working_directory: ./packages/boba/bundler
- store_test_results: # special step to upload test results for display in Test Summary
path: /tmp/test-flow-results.log
integration-tests:
executor: intergration-tests-executor
parallelism: 4
steps:
- download-solidity-compilers
- run-integration-tests:
docker_compose_file: "docker-compose.yml"
test_folder: "eth-l2"
- report-integration-tests

integration-tests-moonbeam:
executor: intergration-tests-executor
parallelism: 4
steps:
- download-solidity-compilers
- run-integration-tests:
docker_compose_file: "docker-compose-moonbeam.yml"
test_folder: "alt-l2"
- report-integration-tests

integration-tests-avalanche:
executor: intergration-tests-executor
parallelism: 4
steps:
- download-solidity-compilers
- run-integration-tests:
docker_compose_file: "docker-compose-avalanche.yml"
test_folder: "alt-l2"
- report-integration-tests

integration-tests-bnb:
executor: intergration-tests-executor
parallelism: 4
steps:
- download-solidity-compilers
- run-integration-tests:
docker_compose_file: "docker-compose-bnb.yml"
test_folder: "alt-l2"
- report-integration-tests

integration-tests-fantom:
executor: intergration-tests-executor
parallelism: 4
steps:
- download-solidity-compilers
- run-integration-tests:
docker_compose_file: "docker-compose-fantom.yml"
test_folder: "alt-l2"
- report-integration-tests

workflows:
main:
jobs:
- integration-tests
- integration-tests-moonbeam
- integration-tests-avalanche
- integration-tests-bnb
- integration-tests-fantom
- go-lint-test-build:
name: proxyd-tests
binary_name: proxyd
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ jobs:
- name: golangci-lint gas-oracle
uses: golangci/golangci-lint-action@v2
with:
version: v1.45.2
version: v1.51.0
working-directory: go/gas-oracle
- name: golangci-lint batch-submitter
uses: golangci/golangci-lint-action@v2
with:
version: v1.45.2
version: v1.51.0
working-directory: go/batch-submitter
- name: golangci-lint bss-core
uses: golangci/golangci-lint-action@v2
with:
version: v1.45.2
version: v1.51.0
working-directory: go/bss-core
12 changes: 4 additions & 8 deletions boba_community/boba-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ The [boba_community/boba-node](../../boba_community/boba-node) repo runs a repli

1. Running a local Boba node (replica) does not allow you to mine ETH, OMG, or BOBA. There is no mining on L2.

2. If you looking for best possible rpc read data (lowest possible latency) you are **strongly advised** not to run your own node, but to use **https://lightning-replica.boba.network**. This is an autoscaling rpc endpoint that speaks directly to the core Boba L2 geth.
2. If you looking for best possible rpc read data (lowest possible latency) you are **strongly advised** not to run your own node, but to use **https://replica.boba.network**. This is an autoscaling rpc endpoint that speaks directly to the core Boba L2 geth.

3. The Boba L2 is (at present) a single proposer/sequencer system and the only way to write transactions is via **https://mainnet.boba.network**. You cannot use a local node to write transactions.

4. If your application _does not need autoscaling and low latency_, and can tolerate sync delays, you can run your own Boba node (replica). This replica will try to follow the core L2 geth via data provided by Infura and **https://lightning-replica.boba.network**, so it will necessarily lag behind **https://lightning-replica.boba.network**.
4. If your application _does not need autoscaling and low latency_, and can tolerate sync delays, you can run your own Boba node (replica). This replica will try to follow the core L2 geth via data provided by Infura and **https://replica.boba.network**, so it will necessarily lag behind **https://replica.boba.network**.

5. Please design your rpc connectors in a resource efficient manner. Notably, calling `eth_getLogs(fromBlock: 0)` 1000 times per second serves no conceivable purpose since the Ethereum blocktime is 12 seconds and the Boba blocktime is > 1 second. All that does is to degrade your replica and trigger rate-limiting and/or IP blocking at **https://lightning-replica.boba.network**.
5. Please design your rpc connectors in a resource efficient manner. Notably, calling `eth_getLogs(fromBlock: 0)` 1000 times per second serves no conceivable purpose since the Ethereum blocktime is 12 seconds and the Boba blocktime is > 1 second. All that does is to degrade your replica and trigger rate-limiting and/or IP blocking at **https://replica.boba.network**.

## Prerequisites

Expand All @@ -30,15 +30,11 @@ $ git clone https://github.com/bobanetwork/boba.git
$ cd boba_community/boba-node
```

**Create a .env file**. Create a `.env` file in `boba_community/boba-node`. If you do not have an Infura key, you can obtain one for free from [Infura](https://infura.io) or any other node provider.
**Create a .env file**. Create a `.env` file in `boba_community/boba-node`.

```yaml
# release tag
RELEASE_VERSION=v0.X.X

L1_NODE_WEB3_URL=https://mainnet.infura.io/v3/YOUR_INFURA_KEY # for mainnet
# Or ...
L1_NODE_WEB3_URL=https://goerli.infura.io/v3/YOUR_INFURA_KEY # for goerli
```

**Pull images**
Expand Down
Loading