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

General Ginkgo E2E test framework + Teleporter test cases #93

Merged
merged 216 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
216 commits
Select commit Hold shift + click to select a range
b3f2604
e2e network interface
cam-schultz Oct 30, 2023
701351b
add relaymessage to interface
cam-schultz Oct 31, 2023
93cca69
example fuji test runner
cam-schultz Oct 31, 2023
d68a89d
separate ws and rpc clients
cam-schultz Oct 31, 2023
f9b94d3
send on fuji working
cam-schultz Oct 31, 2023
7585b9d
ginkgo e2e passing
cam-schultz Oct 31, 2023
605ad58
add comment for user to supply sk
cam-schultz Oct 31, 2023
6584a61
general e2e steps in readme
cam-schultz Oct 31, 2023
9230267
Merge branch 'main' into general-e2e
cam-schultz Oct 31, 2023
b376bad
string vars
cam-schultz Nov 1, 2023
6a9741c
trim sk prefix
cam-schultz Nov 1, 2023
add71d8
gitignore forge docs
cam-schultz Nov 2, 2023
b7db5f7
rename receivers
cam-schultz Nov 2, 2023
451ebcd
reorganize local vs general utils
cam-schultz Nov 2, 2023
6cfdbaf
Merge branch 'main' into general-e2e
cam-schultz Nov 2, 2023
2d1f369
build fix
cam-schultz Nov 2, 2023
cd2205f
test deliver to wrong chain
cam-schultz Nov 2, 2023
b14fbb2
interface implementation check
cam-schultz Nov 2, 2023
d4d9bc5
port refactored utils
cam-schultz Nov 2, 2023
37fc9db
deploy registry contracts
cam-schultz Nov 2, 2023
4a79128
example messenger e2e test
cam-schultz Nov 2, 2023
69cbf80
remove log
cam-schultz Nov 2, 2023
f83f360
add retry execution and execution failed utils
cam-schultz Nov 2, 2023
078ed5d
test delivery to non-existent contract
cam-schultz Nov 2, 2023
307da78
check correct message id
cam-schultz Nov 3, 2023
6b92f35
test retry successful execution
cam-schultz Nov 3, 2023
b9dfb70
test unallowed relayer
cam-schultz Nov 3, 2023
023eee4
remove debug log
cam-schultz Nov 3, 2023
c6496c9
test receive message twice
cam-schultz Nov 3, 2023
6b64fc4
abigen bin
gwen917 Nov 5, 2023
60ceb3d
test add fee amount
gwen917 Nov 5, 2023
6521eb1
fix
gwen917 Nov 5, 2023
5a31e6e
test insufficient gas
gwen917 Nov 6, 2023
b92a21b
fix
gwen917 Nov 6, 2023
142e065
send specific receipts
gwen917 Nov 6, 2023
cb96f56
Merge remote-tracking branch 'origin/main' into test-case-send-specif…
gwen917 Nov 6, 2023
2f75462
Merge remote-tracking branch 'origin/main' into test-case-insufficien…
gwen917 Nov 6, 2023
9f70081
Merge remote-tracking branch 'origin/main' into test-case-add-fee-amount
gwen917 Nov 6, 2023
18230f4
interface checks
cam-schultz Nov 6, 2023
4c1ccc7
remove address from example
cam-schultz Nov 6, 2023
62d7b6b
remove dbg log
cam-schultz Nov 6, 2023
72ef0a2
add links
cam-schultz Nov 6, 2023
63eb7b8
Merge remote-tracking branch 'origin/general-e2e' into test-case-add-…
gwen917 Nov 6, 2023
63e7dd0
remove docs from gitignore
cam-schultz Nov 6, 2023
6c298ad
Merge remote-tracking branch 'origin/test-case-add-fee-amount' into t…
gwen917 Nov 6, 2023
7f7447f
Merge branch 'main' into general-e2e
cam-schultz Nov 6, 2023
4165cd8
Merge remote-tracking branch 'origin/general-e2e' into test-case-add-…
gwen917 Nov 6, 2023
bcb76c3
Merge remote-tracking branch 'origin/test-case-add-fee-amount' into t…
gwen917 Nov 6, 2023
eb3bce9
Merge remote-tracking branch 'origin/test-case-insufficient-gas' into…
gwen917 Nov 6, 2023
3229953
gen abi binding
gwen917 Nov 6, 2023
1b2ffca
Merge remote-tracking branch 'origin/test-case-add-fee-amount' into t…
gwen917 Nov 6, 2023
3f373db
Merge remote-tracking branch 'origin/test-case-insufficient-gas' into…
gwen917 Nov 6, 2023
0ca6937
Merge branch 'general-e2e' into teleporter-test-cases
cam-schultz Nov 6, 2023
65e1bfe
Merge branch 'teleporter-test-cases' into teleporter-test-cases-2
cam-schultz Nov 6, 2023
6f6ba58
fix test
gwen917 Nov 6, 2023
e4ebf0d
fix
gwen917 Nov 6, 2023
54fdc4c
Merge remote-tracking branch 'origin/test-case-add-fee-amount' into t…
gwen917 Nov 6, 2023
0e8ef2d
Merge pull request #109 from ava-labs/test-case-add-fee-amount
cam-schultz Nov 6, 2023
d251bf3
Merge branch 'general-e2e' into teleporter-test-cases
cam-schultz Nov 6, 2023
7d0b186
contract call refactor
cam-schultz Nov 6, 2023
27c86f0
refactor tests
cam-schultz Nov 7, 2023
6142b1f
Merge branch 'teleporter-test-cases' into teleporter-test-cases-2
cam-schultz Nov 7, 2023
1986f4f
fix
gwen917 Nov 7, 2023
7441638
send receipt multiple times
gwen917 Nov 7, 2023
9829541
Merge remote-tracking branch 'origin/general-e2e' into test-case-insu…
gwen917 Nov 7, 2023
3e57df9
Merge remote-tracking branch 'origin/general-e2e' into test-case-send…
gwen917 Nov 7, 2023
76a47a2
fix
gwen917 Nov 7, 2023
867ee80
Merge remote-tracking branch 'origin/teleporter-test-cases' into test…
gwen917 Nov 7, 2023
c308122
fix
gwen917 Nov 7, 2023
5320503
test insufficient gas
gwen917 Nov 7, 2023
e0a076f
fix comments
gwen917 Nov 7, 2023
e8a3751
Merge pull request #113 from ava-labs/test-case-send-specific-receipts
gwen917 Nov 7, 2023
73b4c0e
retry execution
gwen917 Nov 7, 2023
00ab975
fix
gwen917 Nov 7, 2023
be37a4f
fix
gwen917 Nov 7, 2023
eaded34
fix
gwen917 Nov 7, 2023
2d87554
fix comments
gwen917 Nov 7, 2023
5251025
call retry directly
cam-schultz Nov 7, 2023
e928ce3
Merge branch 'general-e2e' into teleporter-test-cases
cam-schultz Nov 7, 2023
ee795c7
fix merge conflict
cam-schultz Nov 7, 2023
fd28c05
add deploy example messenger util
cam-schultz Nov 7, 2023
3ae5057
Merge branch 'teleporter-test-cases' into teleporter-test-cases-2
cam-schultz Nov 7, 2023
8c12e89
better use of utils
cam-schultz Nov 7, 2023
891133e
Merge pull request #104 from ava-labs/teleporter-test-cases
cam-schultz Nov 7, 2023
026223d
Merge pull request #105 from ava-labs/teleporter-test-cases-2
cam-schultz Nov 7, 2023
44336f9
Merge remote-tracking branch 'origin/general-e2e' into test-case-insu…
gwen917 Nov 7, 2023
0bbaa3d
fix
gwen917 Nov 7, 2023
60ee6c6
Merge pull request #110 from ava-labs/test-case-insufficient-gas
gwen917 Nov 8, 2023
2e0499c
altered message
gwen917 Nov 9, 2023
6ffffdc
wip
cam-schultz Nov 9, 2023
7939be6
wip
cam-schultz Nov 9, 2023
714ac6a
fix
gwen917 Nov 9, 2023
90a9696
fix
gwen917 Nov 9, 2023
a8b883f
latest anr
cam-schultz Nov 9, 2023
2461ca1
Merge branch 'main' into general-e2e
cam-schultz Nov 9, 2023
1461dec
Merge branch 'general-e2e' of github.com:ava-labs/teleporter into gen…
cam-schultz Nov 9, 2023
e157c8c
Merge branch 'general-e2e' into test-retry-send-message
cam-schultz Nov 9, 2023
b2a5142
Merge branch 'subnet-evm-v0.5.9' into test-retry-send-message
cam-schultz Nov 9, 2023
ce874e8
fix typo
gwen917 Nov 14, 2023
ae7d407
Merge remote-tracking branch 'origin/general-e2e' into test-cases
gwen917 Nov 14, 2023
047cacf
test passing
cam-schultz Nov 14, 2023
7b84332
cleanup
cam-schultz Nov 14, 2023
6b69b81
fix
gwen917 Nov 14, 2023
145d2dd
cleanup
cam-schultz Nov 14, 2023
9aa03f9
fix
gwen917 Nov 14, 2023
b9c3a32
Merge branch 'main' into general-e2e
cam-schultz Nov 14, 2023
b840569
update versions.sh
cam-schultz Nov 14, 2023
b0d201f
Merge branch 'general-e2e' into test-retry-send-message
cam-schultz Nov 14, 2023
1b71f2b
Merge remote-tracking branch 'origin/general-e2e' into test-cases
gwen917 Nov 15, 2023
bbdf20b
fix
gwen917 Nov 15, 2023
2b85738
rename var
cam-schultz Nov 15, 2023
7764595
add package localnetworkutils
cam-schultz Nov 15, 2023
c9ff4b4
add package localnetworkutils 2
cam-schultz Nov 15, 2023
fe8d062
Merge branch 'general-e2e' into test-retry-send-message
cam-schultz Nov 15, 2023
df938d2
Merge pull request #133 from ava-labs/test-retry-send-message
cam-schultz Nov 15, 2023
e5881cf
fix
gwen917 Nov 15, 2023
f2ba9e2
fix
gwen917 Nov 15, 2023
14b1968
Merge remote-tracking branch 'origin/general-e2e' into test-cases
gwen917 Nov 15, 2023
c093521
Merge pull request #121 from ava-labs/test-cases
gwen917 Nov 15, 2023
1d068f3
clean up setsubnetvalues
cam-schultz Nov 15, 2023
ccad78f
cleanup ethclient function params
cam-schultz Nov 15, 2023
4012818
Merge branch 'general-e2e' of github.com:ava-labs/teleporter into gen…
cam-schultz Nov 15, 2023
c0babca
cleanup fuji network
cam-schultz Nov 15, 2023
ab8d916
fuji relayer timeout
cam-schultz Nov 15, 2023
5b13d06
Merge branch 'main' into general-e2e
cam-schultz Nov 15, 2023
bcae30a
link to files
cam-schultz Nov 16, 2023
5a0d779
rename DeployExampleERC20
cam-schultz Nov 16, 2023
98492c6
pass in fundedaddr as arg
cam-schultz Nov 16, 2023
13d8262
add go linter
cam-schultz Nov 16, 2023
edae269
fix linter.yml
cam-schultz Nov 16, 2023
2813001
fix linter.yml
cam-schultz Nov 16, 2023
fd00f64
run linter on pr
cam-schultz Nov 16, 2023
905441a
checkout submodules in linter job
cam-schultz Nov 16, 2023
666d0d6
bump golangci version
cam-schultz Nov 16, 2023
996cd5d
appease linter
cam-schultz Nov 16, 2023
51a1a5e
ERC20 bridge multihop
gwen917 Nov 16, 2023
9dd9266
Merge remote-tracking branch 'origin/general-e2e' into erc20-bridge-m…
gwen917 Nov 16, 2023
81c40de
fix
gwen917 Nov 16, 2023
4632158
fix lint
gwen917 Nov 16, 2023
dfde758
fix lint
gwen917 Nov 16, 2023
e0cae29
fix
gwen917 Nov 17, 2023
4c76abc
fix
gwen917 Nov 17, 2023
8d12650
fix
gwen917 Nov 17, 2023
460f295
fix
gwen917 Nov 17, 2023
d297452
do not reset fuji network vals
cam-schultz Nov 20, 2023
a41f598
rename var
cam-schultz Nov 20, 2023
fda4f59
golang lint in script
cam-schultz Nov 20, 2023
78a8e6b
add comment
cam-schultz Nov 20, 2023
1b87b99
check error
cam-schultz Nov 20, 2023
9c50b68
declare messageid inline
cam-schultz Nov 20, 2023
8fd37a1
use retry execution util
cam-schultz Nov 20, 2023
dd62226
use dummy destination address
cam-schultz Nov 20, 2023
abd698d
use deplpoy example messenger util
cam-schultz Nov 20, 2023
7e2f7e7
use util
cam-schultz Nov 20, 2023
d6c6b71
zero address as fee addr
cam-schultz Nov 20, 2023
52ada51
add example messenger sendmsg gas const
cam-schultz Nov 20, 2023
91c1ddb
comment typo
cam-schultz Nov 20, 2023
18250bf
check received message
cam-schultz Nov 20, 2023
dccfcf6
use gas const
cam-schultz Nov 20, 2023
dcca538
use util
cam-schultz Nov 20, 2023
b4589c8
build fix
cam-schultz Nov 20, 2023
6120051
remove teleporter message validation from util
cam-schultz Nov 20, 2023
7637635
use destination addr
cam-schultz Nov 20, 2023
ea52a60
use relaymessage to receive again
cam-schultz Nov 20, 2023
1cdadb0
check received receipts match messageIDs
cam-schultz Nov 20, 2023
e2bd923
dynamically set node names
cam-schultz Nov 20, 2023
83b6365
setup teleportermessenger objects on suite init
cam-schultz Nov 20, 2023
98d31b9
derive address from key
cam-schultz Nov 20, 2023
06c42ed
fix validator for subnetC
gwen917 Nov 20, 2023
9342e1f
run ValidatorChurn in the end
gwen917 Nov 20, 2023
60e7f80
derive address from key
cam-schultz Nov 20, 2023
5652eb0
Merge branch 'main' into general-e2e
cam-schultz Nov 20, 2023
80f23e7
add PackRetryMessageExecution
cam-schultz Nov 20, 2023
9f4c142
remove alterMessage param from RelayMessage
cam-schultz Nov 20, 2023
ebf29d7
remove golangci lint from script
cam-schultz Nov 20, 2023
4f94e63
add comment
cam-schultz Nov 20, 2023
9317d94
linter
cam-schultz Nov 20, 2023
2971fb1
Merge branch 'main' into general-e2e
cam-schultz Nov 20, 2023
3a8c4d4
increment node name idx
cam-schultz Nov 20, 2023
7298c4a
Merge remote-tracking branch 'origin/general-e2e' into erc20-bridge-m…
gwen917 Nov 21, 2023
3ea5c66
fix
gwen917 Nov 21, 2023
ae1fa90
Merge remote-tracking branch 'origin/main' into general-e2e
gwen917 Nov 21, 2023
917b4cb
fix
gwen917 Nov 21, 2023
a52290e
Merge remote-tracking branch 'origin/main' into general-e2e
gwen917 Nov 21, 2023
6cd4997
fix
gwen917 Nov 21, 2023
fcc7068
fix
gwen917 Nov 21, 2023
0e17d79
fix
gwen917 Nov 21, 2023
2e33eed
fix
gwen917 Nov 21, 2023
9fc7a92
Merge remote-tracking branch 'origin/main' into general-e2e
gwen917 Nov 21, 2023
f23157e
fix
gwen917 Nov 21, 2023
e0823f1
fix
gwen917 Nov 21, 2023
00d2323
Merge pull request #140 from ava-labs/erc20-bridge-multihop
gwen917 Nov 21, 2023
a4c0ce6
break long line (whitespace only)
feuGeneA Nov 16, 2023
4b9ef90
convert basic_one_way to basic_send_receive
feuGeneA Nov 16, 2023
cb00351
restore integration-tests/basic_send_receive.sh
feuGeneA Nov 17, 2023
dccff64
Merge remote-tracking branch 'origin/main' into general-e2e
gwen917 Nov 22, 2023
8688b4f
fix
gwen917 Nov 22, 2023
7a88ff8
have Ginkgo always emit the full stack trace
feuGeneA Nov 22, 2023
b9caca7
Merge pull request #154 from ava-labs/e2e-always-emit-full-stack-trace
feuGeneA Nov 22, 2023
2ea34c0
fix review comments
gwen917 Nov 22, 2023
e78983f
Merge branch 'general-e2e' of github.com:ava-labs/teleporter into gen…
gwen917 Nov 22, 2023
e66a8d4
test relayer reward redemption
feuGeneA Nov 20, 2023
67650ae
Merge branch 'general-e2e' into e2e-basic-send-receive-ginkgo
feuGeneA Nov 22, 2023
f2f5694
Merge pull request #139 from ava-labs/e2e-basic-send-receive-ginkgo
feuGeneA Nov 22, 2023
1a16fc3
check the number of subnets
gwen917 Nov 22, 2023
f8d08f3
fix review comments
gwen917 Nov 23, 2023
07f248e
fix review comments
gwen917 Nov 27, 2023
7f7cfdb
remove empty lines
gwen917 Nov 27, 2023
319fd8b
fix lint
gwen917 Nov 27, 2023
ee93246
fix linter
gwen917 Nov 27, 2023
9e9ccd0
fix lint.yml
gwen917 Nov 27, 2023
54df067
fix lint.yml
gwen917 Nov 27, 2023
60af7bb
fix lint.yml
gwen917 Nov 27, 2023
10b09b4
fix lint.yml
gwen917 Nov 27, 2023
ff2af16
Merge branch 'main' into general-e2e
michaelkaplan13 Nov 28, 2023
19b25d3
Merge remote-tracking branch 'origin/main' into general-e2e
gwen917 Nov 28, 2023
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
64 changes: 42 additions & 22 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,47 @@
name: Linter

on:
push:
branches:
- main
pull_request:
branches:
- "*"
push:
branches:
- main
pull_request:
branches:
- "*"

jobs:
solhint:
runs-on: ubuntu-20.04
steps:
- name: Checkout teleporter
uses: actions/checkout@v4

- name: Install solhint
run: |
npm install solhint -g
solhint --version

# "solhint **/*.sol" runs differently than "solhint '**/*.sol'", where the latter checks sol files
# in subdirectories. The former only checks sol files in the current directory and directories one level down.
- name: Run Lint
run: |
./scripts/lint.sh
solhint:
runs-on: ubuntu-20.04
steps:
- name: Checkout teleporter
uses: actions/checkout@v4

- name: Install solhint
run: |
npm install solhint -g
solhint --version

- name: Run Lint
run: |
./scripts/lint.sh -l sol

golangci:
runs-on: ubuntu-20.04
steps:
- name: Checkout repositories and submodules
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set Go version
run: |
source ./scripts/versions.sh
GO_VERSION=$GO_VERSION >> $GITHUB_ENV

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Run Lint
run: |
./scripts/lint.sh -l go
31 changes: 31 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This file configures github.com/golangci/golangci-lint.

run:
timeout: 3m
tests: true
# skip auto-generated files.
skip-dirs:
- "abi-bindings/go"
skip-files:
gwen917 marked this conversation as resolved.
Show resolved Hide resolved
- ".*mock.*"

issues:
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0

linters:
disable-all: true
enable:
- goimports
- gosimple
- govet
- ineffassign
- misspell
- unconvert
- unused
- whitespace
- lll

linters-settings:
gofmt:
simplify: true
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,24 @@ Next, provide the path to the `subnet-evm` repository and the path to a writeabl
./scripts/local/e2e_test.sh --local --subnet-evm ./subnet-evm --data-dir ~/tmp/e2e-test
```

## ABI Bindings
#### Run the E2E tests on another network

The E2E tests can be run on another network by implementing the `Network` interface in [`package network`](./tests/network/network.go). For example, the type `FujiNetwork` in [`example_fuji_network.go`](./tests/network/example_fuji_network.go) implements this interface, pointing to the [Amplify](https://subnets-test.avax.network/amplify), [Bulletin](https://subnets-test.avax.network/bulletin), and [Conduit](https://subnets-test.avax.network/conduit) Fuji subnets. After implementing this interface, you can run the E2E tests on this network by running a program such as:
```go
func main() {
// Register a failure handler that panics
gomega.RegisterFailHandler(func(message string, callerSkip ...int) {
panic(message)
})

// Run the test, composing it with the Network implementation
network := network.NewFujiNetwork()
defer network.CloseNetworkConnections()
cam-schultz marked this conversation as resolved.
Show resolved Hide resolved
tests.BasicOneWaySend(network)
}
```

### ABI Bindings

To generate Golang ABI bindings for the Solidity smart contracts, run:
```bash
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package examplecrosschainmessenger

import "math/big"

var SendMessageRequiredGas = big.NewInt(300000)

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading