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

L2 public testnet deployment and related fixes #751

Merged
merged 43 commits into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
5e36583
fix: use path.join to manage path concat
abarmat Sep 21, 2022
0ca43ff
feat: add publish and mint to the CLI
abarmat Sep 21, 2022
45ce81e
chore: add reports for recent audits (#710)
pcarranzav Sep 28, 2022
b6219d3
chore: run GitHub actions when it makes sense (#707)
tmigone Sep 29, 2022
04cfd3a
chore: provide sane defaults for graph config (#721)
tmigone Oct 3, 2022
fdc0bae
chore: remove rinkeby and kovan references (#729)
tmigone Oct 4, 2022
f1c5fe7
feat: add optional expression logging to GRE (#728)
tmigone Oct 4, 2022
0b7055a
test: print gas report, and ensure evm is killed
pcarranzav Oct 13, 2022
3f16e5a
Merge pull request #732 from graphprotocol/pcv/test-gas-cat-report
pcarranzav Oct 14, 2022
7e5ac05
feat(gre): add hardhat-secure-accounts to GRE (#696)
tmigone Oct 28, 2022
598ecc3
chore: update arbitrum sdk to 3.0-rc1
tmigone Sep 26, 2022
a7ba535
fix(task): accept ownership only if pending owner matches
tmigone Sep 26, 2022
0aed5eb
feat(task): split unpause task into protocol and bridge tasks
tmigone Sep 26, 2022
a3fa719
feat(e2e): run L1 and L2 together in e2e tests
tmigone Sep 26, 2022
ad11bdf
feat(e2e): fetch deployment data from testnodes
tmigone Sep 27, 2022
e9cab36
chore: update README.md
tmigone Sep 27, 2022
7eb7ba2
fix(e2e): allow skipping bridge tests
tmigone Sep 27, 2022
1436a0c
fix(e2e): update github action to multi layer e2e tests
tmigone Sep 27, 2022
d9977b5
fix(e2e): bump gas limit for l2 scenario txs
tmigone Sep 28, 2022
6a9a999
chore(e2e): run nitro addressbook setup only on localnitro networks
tmigone Sep 28, 2022
9729f43
fix: allow e2e to run only on L2
tmigone Oct 3, 2022
85c2964
fix(e2e): use fixed gasLimit for CI send to L2
tmigone Oct 3, 2022
ee8c7f3
fix(e2e): use fixed gasLimit for redeem in CI
tmigone Oct 6, 2022
967e085
e2e: add bridge e2e tests (#720)
tmigone Oct 31, 2022
ae1d70b
fix: gateways now unpaused on e2e
tmigone Nov 2, 2022
60afb9e
Merge branch 'dev' into l2-public-testnet
abarmat Nov 2, 2022
b1be78b
chore: fix automerge wrong import
tmigone Oct 31, 2022
ccaf653
fix: remove unused task folder
abarmat Nov 2, 2022
dff1845
fix: wrong imports and params
abarmat Nov 2, 2022
5f1a3c4
fix: additional post merge fixes
tmigone Nov 3, 2022
32fc123
fix: update nitro task for nitro v2.0.8
tmigone Nov 3, 2022
5daa3c1
chore: add deployed addresses for L2 public testnet
abarmat Nov 4, 2022
fb40819
fix: minor tweaks to e2e
tmigone Nov 7, 2022
3605081
v1.17.0
abarmat Nov 7, 2022
1dd6f06
chore: bump npm package version to v2.0.0-testnet
tmigone Nov 7, 2022
93f6939
Merge branch 'pcv/l2-bridge' into l2-public-testnet
pcarranzav Nov 23, 2022
dcc2cec
fix(e2e): no need to explicitly disable secure accounts
pcarranzav Nov 23, 2022
f45173c
Merge remote-tracking branch 'origin/dev' into l2-public-testnet
pcarranzav Nov 23, 2022
12e54e5
chore: bump @arbitrum/sdk to 3.0.0
pcarranzav Nov 23, 2022
43e719b
chore: bump package version to 2.0.0
pcarranzav Nov 23, 2022
4e2872b
fix: set flat bonding curve in all L2 configs
pcarranzav Nov 23, 2022
51c0441
test(e2e): reenable finalizeInboundTransfer revert check
pcarranzav Nov 23, 2022
aa85104
fix: use correct governance addresses on Arbitrum One
pcarranzav Nov 23, 2022
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
12 changes: 9 additions & 3 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ name: Run E2E tests
on:
push:
branches: [dev]
paths:
- contracts/**
- config/**
- e2e/**
- cli/**
- tasks/**
- scripts/**
- hardhat.config.ts
pull_request: {}

jobs:
Expand All @@ -25,9 +33,7 @@ jobs:
run: |
git clone https://github.com/edgeandnode/nitro
pushd nitro
git checkout ci
git submodule update --init --recursive
./test-node.bash --init --no-blockscout --detach
popd
NETWORK=localnitrol1 ADDRESS_BOOK=addresses.json GRAPH_CONFIG=config/graph.localhost.yml yarn test:e2e
NETWORK=localnitrol2 ADDRESS_BOOK=addresses.json GRAPH_CONFIG=config/graph.arbitrum-localhost.yml yarn test:e2e
L1_NETWORK=localnitrol1 L2_NETWORK=localnitrol2 yarn test:e2e
2 changes: 2 additions & 0 deletions .github/workflows/gre.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Run GRE tests
on:
push:
branches: [dev]
paths:
- gre/**
pull_request: {}

jobs:
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,12 @@ bin/
# Coverage and other reports
/reports
coverage.json

# Local test files
addresses-local.json
localNetwork.json
arbitrum-addresses-local.json
tx-*.log

# Keys
.keystore
4 changes: 2 additions & 2 deletions DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ To deploy to a different network execute:
yarn deploy -- --network {networkName}

# Example
yarn deploy -- --network kovan
yarn deploy -- --network goerli
```

The network must be configured in the `hardhat.config.ts` as explained in https://hardhat.org/config.
Expand Down Expand Up @@ -100,7 +100,7 @@ Some contracts require the address from previously deployed contracts. For that
### Deploying a new testnet

1. Make sure contracts are up to date as you please.
2. `yarn deploy-rinkeby` to deploy to Rinkeby. This will create new contracts with new addresses in `addresses.json`.
2. `yarn deploy-goerli` to deploy to Goerli. This will create new contracts with new addresses in `addresses.json`.
3. Update the `package.json` and `package-lock.json` files with the new package version and publish a new npm package with `npm publish`. You can dry-run the files to be uploaded by running `npm publish --dry-run`.
4. Merge this update into master, branch off and save for whatever version of the testnet is going on, and then tag this on the github repo, pointing to your branch (ex. at `testnet-phase-1` branch). This way we can always get the contract code for testnet, while continuing to do work on mainnet.
5. Pull the updated package into the subgraph, and other apps that depend on the package.json.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ yarn add @graphprotocol/contracts

# Contract Addresses

The testnet runs on Rinkeby, while mainnet is on Ethereum Mainnet. The addresses for both of these can be found in `./addresses.json`.
The testnet runs on Goerli, while mainnet is on Ethereum Mainnet. The addresses for both of these can be found in `./addresses.json`.

# Local Setup

Expand Down Expand Up @@ -92,7 +92,7 @@ The most straightforward way to interact with the contracts is through the hardh

```
# A console to interact with testnet contracts
npx hardhat console --network rinkeby
npx hardhat console --network goerli
```

### Hardhat Tasks
Expand Down
67 changes: 30 additions & 37 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,37 +33,52 @@ There are several types of e2e tests which can be run separately:
- Read and write interactions with the blockchain. _Requires an account with sufficient balance!_
- Example: a test validating that a user can add signal to a subgraph.

### Hardhat local node
### Hardhat local node (L1)

To run all e2e tests against a hardhat local node run:
It can be useful to run E2E tests against a fresh protocol deployment on L1, this can be done with the following:

```bash
yarn test:e2e
L1_NETWORK=localhost yarn test:e2e
```

The command will perform the following actions:
The command will:
- start a hardhat local node
- deploy the L1 protocol
- configure the new L1 deployment
- Run all L1 e2e tests

- Start a hardhat node (localhost)
- Run `migrate:accounts` hardhat task to create keys for all protocol roles (deployer, governor, arbiter, etc). This currently doesn't support multisig accounts.
- Run `migrate` hardhat task to deploy the protocol
- Run `migrate:ownership` hardhat task to transfer ownership of governed contracts to the governor
- Run `migrate:unpause` to unpause the protocol
- Run `e2e` hardhat task to run all deployment tests (config and init)
- Run `e2e:scenario` hardhat task to run a scenario
### Arbitrum Nitro testnodes (L1/L2)

If you want to test the protocol on an L1/L2 setup, you can run:

```bash
L1_NETWORK=localnitrol1 L2_NETWORK=localnitrol2 yarn test:e2e
```

In this case the command will:
- deploy the L1 protocol
- configure the new L1 deployment
- deploy the L2 protocol
- configure the new L2 deployment
- configure the L1/L2 bridge
- Run all L1 e2e tests
- Run all L2 e2e tests

Note that you'll need to setup the testnodes before running the tests. See [Quick Setup](https://github.com/edgeandnode/nitro#quick-setup) for details on how to do this.

### Other networks

To run tests against a live testnet or even mainnet run:

```bash
# All e2e tests
npx hardhat e2e --network <network> --graph-config config/graph.<network>.yml
ARBITRUM_ADDRESS_BOOK=<arbitrum-address-book> npx hardhat e2e --network <network> --l1-graph-config config/graph.<l1-network>.yml --l2-graph-config config/graph.<l2-network>.yml

# Only deployment config tests
npx hardhat e2e:config --network <network> --graph-config config/graph.<network>.yml
ARBITRUM_ADDRESS_BOOK=<arbitrum-address-book> npx hardhat e2e:config --network <network> --l1-graph-config config/graph.<l1-network>.yml --l2-graph-config config/graph.<l2-network>.yml

# Only deployment init tests
npx hardhat e2e:init --network <network> --graph-config config/graph.<network>.yml
ARBITRUM_ADDRESS_BOOK=<arbitrum-address-book> npx hardhat e2e:init --network <network> --l1-graph-config config/graph.<l1-network>.yml --l2-graph-config config/graph.<l2-network>.yml

# Only a specific scenario
npx hardhat e2e:scenario <scenario> --network <network> --graph-config config/graph.<network>.yml
Expand All @@ -82,26 +97,4 @@ Scenarios are defined by an optional script and a test file:
- They run before the test file.
- Test file
- Should be named e2e/scenarios/{scenario-name}.test.ts.
- Standard chai/mocha/hardhat/ethers test file.

## Setting up Arbitrum's testnodes

Arbitrum provides a quick way of setting up L1 and L2 testnodes for local development and testing. The following steps will guide you through the process of setting them up. Note that a local installation of Docker and Docker Compose is required.

```bash
git clone https://github.com/offchainlabs/nitro
cd nitro
git submodule update --init --recursive

# Apply any changes you might want, see below for more info, and then start the testnodes
./test-node.bash --init
```

**Useful information**
- L1 RPC: [http://localhost:8545](http://localhost:8545/)
- L2 RPC: [http://localhost:8547](http://localhost:8547/)
- Blockscout explorer (L2 only): [http://localhost:4000/](http://localhost:4000/)
- Prefunded genesis key (L1 and L2): `e887f7d17d07cc7b8004053fb8826f6657084e88904bb61590e498ca04704cf2`

**Enable automine on L1**
In `docker-compose.yml` file edit the `geth` service command by removing the `--dev.period 1` flag.
- Standard chai/mocha/hardhat/ethers test file.
Loading