Skip to content

Commit

Permalink
Merge Seth to CTF (#1087)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel authored Aug 26, 2024
1 parent 4a0c9a0 commit f30d0d0
Show file tree
Hide file tree
Showing 90 changed files with 22,477 additions and 2 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/seth-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: SETH Lint
on:
push:
permissions:
contents: read
jobs:
golangci:
defaults:
run:
working-directory: seth
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Check for changes in Seth project
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
filters: |
src:
- 'seth/**'
- uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26
if: steps.changes.outputs.src == 'true'
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Run tests
run: |
nix develop -c make lint
36 changes: 36 additions & 0 deletions .github/workflows/seth-test-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: SETH API tests
on:
push:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
defaults:
run:
working-directory: seth
runs-on: ubuntu-latest
strategy:
matrix:
network: [Anvil, Geth]
env:
SETH_ROOT_PRIVATE_KEY: ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
steps:
- name: Checkout repo
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Check for changes in Seth project
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
filters: |
src:
- 'seth/**'
- uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26
if: steps.changes.outputs.src == 'true'
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Run tests
env:
SETH_NETWORK: ${{ matrix.network }}
run: |
nix develop -c make "$SETH_NETWORK" && make SETH_LOG_LEVEL=debug root_private_key="$SETH_ROOT_PRIVATE_KEY" network="$SETH_NETWORK" test_api
36 changes: 36 additions & 0 deletions .github/workflows/seth-test-bumping.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: SETH Gas bumping tests
on:
push:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
defaults:
run:
working-directory: seth
runs-on: ubuntu-latest
strategy:
matrix:
network: [Geth]
env:
SETH_ROOT_PRIVATE_KEY: ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
steps:
- name: Checkout repo
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Check for changes in Seth project
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
filters: |
src:
- 'seth/**'
- uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26
if: steps.changes.outputs.src == 'true'
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Run tests
env:
SETH_NETWORK: ${{ matrix.network }}
run: |
nix develop -c make "$SETH_NETWORK" && make SETH_LOG_LEVEL=debug root_private_key="$SETH_ROOT_PRIVATE_KEY" network="$SETH_NETWORK" test_gas_bumping
36 changes: 36 additions & 0 deletions .github/workflows/seth-test-cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: SETH CLI tests
on:
push:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
defaults:
run:
working-directory: seth
runs-on: ubuntu-latest
strategy:
matrix:
network: [Anvil, Geth]
env:
SETH_ROOT_PRIVATE_KEY: ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
steps:
- name: Checkout repo
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Check for changes in Seth project
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
filters: |
src:
- 'seth/**'
- uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26
if: steps.changes.outputs.src == 'true'
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Run tests
env:
SETH_NETWORK: ${{ matrix.network }}
run: |
nix develop -c make "$SETH_NETWORK" && make SETH_LOG_LEVEL=debug root_private_key="$SETH_ROOT_PRIVATE_KEY" network="$SETH_NETWORK" test_cli
39 changes: 39 additions & 0 deletions .github/workflows/seth-test-decode-testnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: SETH Decoding tests (testnets)
on:
push:
tags:
- v.**
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
defaults:
run:
working-directory: seth
runs-on: ubuntu-latest
strategy:
matrix:
# TODO: Sepolia is usually down but it worked, turn it on when possible
# TODO: Mumbai is not working right now
network: [Fuji]
steps:
- name: Checkout repo
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Check for changes in Seth project
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
filters: |
src:
- 'seth/**'
- uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26
if: steps.changes.outputs.src == 'true'
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Run tests
env:
SETH_NETWORK: ${{ matrix.network }}
SETH_ROOT_PRIVATE_KEY: ${{ secrets.TESTNET_COMMON_KEYS }}
run: |
nix develop -c make SETH_LOG_LEVEL=debug root_private_key="$SETH_ROOT_PRIVATE_KEY" network="$SETH_NETWORK" test
36 changes: 36 additions & 0 deletions .github/workflows/seth-test-decode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: SETH Decoding tests
on:
push:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
defaults:
run:
working-directory: seth
runs-on: ubuntu-latest
strategy:
matrix:
network: [Anvil, Geth]
env:
SETH_ROOT_PRIVATE_KEY: ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
steps:
- name: Checkout repo
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Check for changes in Seth project
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
filters: |
src:
- 'seth/**'
- uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26
if: steps.changes.outputs.src == 'true'
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Run tests
env:
SETH_NETWORK: ${{ matrix.network }}
run: |
nix develop -c make "$SETH_NETWORK" && make SETH_LOG_LEVEL=debug root_private_key="$SETH_ROOT_PRIVATE_KEY" network="$SETH_NETWORK" test
36 changes: 36 additions & 0 deletions .github/workflows/seth-test-others.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: SETH Other tests
on:
push:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
defaults:
run:
working-directory: seth
runs-on: ubuntu-latest
strategy:
matrix:
network: [Geth]
env:
SETH_ROOT_PRIVATE_KEY: ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
steps:
- name: Checkout repo
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Check for changes in Seth project
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
filters: |
src:
- 'seth/**'
- uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26
if: steps.changes.outputs.src == 'true'
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Run tests
env:
SETH_NETWORK: ${{ matrix.network }}
run: |
nix develop -c make "$SETH_NETWORK" && make SETH_LOG_LEVEL=debug root_private_key="$SETH_ROOT_PRIVATE_KEY" network="$SETH_NETWORK" test_others
36 changes: 36 additions & 0 deletions .github/workflows/seth-test-trace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: SETH Tracing tests
on:
push:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
defaults:
run:
working-directory: seth
runs-on: ubuntu-latest
strategy:
matrix:
network: [Anvil, Geth]
env:
SETH_ROOT_PRIVATE_KEY: ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
steps:
- name: Checkout repo
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Check for changes in Seth project
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
filters: |
src:
- 'seth/**'
- uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26
if: steps.changes.outputs.src == 'true'
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Run tests
env:
SETH_NETWORK: ${{ matrix.network }}
run: |
nix develop -c make "$SETH_NETWORK" && make SETH_LOG_LEVEL=debug root_private_key="$SETH_ROOT_PRIVATE_KEY" network="$SETH_NETWORK" test_trace
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
exclude: '(\.bin|\.abi)'

repos:
- repo: local
hooks:
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ node_modules/
index.yaml
wasp/**
havoc/**
seth/**
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ CTF contains a set of useful libraries:

- [WASP](wasp/README.md) - Scalable protocol-agnostic load testing library for `Go`
- [Havoc](havoc/README.md) - Chaos testing library
- [Seth](seth/README.md) - Ethereum client library with transaction tracing and gas bumping

## k8s package

Expand Down
4 changes: 3 additions & 1 deletion _typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ extend-exclude = [
"**/*.tgz",
"**/*.png",
"wasp/HOW_IT_WORKS.md",
"wasp/dashboard/**"
"wasp/dashboard/**",
"seth/*_test.go",
"seth/dot_graph.go"
]
60 changes: 60 additions & 0 deletions seth/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# IDE and environment
.idea/
.vscode/
.DS_STORE

# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories
dist/
vendor/
node_modules/
.yarn/

# Mercuy server configuration file
config.toml
config.*.toml

# Personal/secret env vars
.envrc-personal

# Other
tmp/
*.log
*.swp
.air.toml
.DS_Store
output.txt

# Default binary name with go build
main
test.sh

# Ignore DevSpace cache and log folder
.devspace/

# env files
.env
.envrc

# Geth data
geth_data/geth/**

/traces
reverted_transactions*.json
/dot_graphs
artifacts/

#map of address -> ABI name of deployed contracts
deployed_contracts*.toml
Loading

0 comments on commit f30d0d0

Please sign in to comment.