Skip to content

Commit 163099b

Browse files
authored
Initial commit
0 parents  commit 163099b

24 files changed

+1285
-0
lines changed

.github/pull_request_template.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## 📝 Summary
2+
3+
<!--- A general summary of your changes -->
4+
5+
## ⛱ Motivation and Context
6+
7+
<!--- Why is this change required? What problem does it solve? -->
8+
9+
## 📚 References
10+
11+
<!-- Any interesting external links to documentation, articles, tweets which add value to the PR -->
12+
13+
---
14+
15+
## ✅ I have run these commands
16+
17+
* [ ] `make lint`
18+
* [ ] `make test`
19+
* [ ] `go mod tidy`

.github/workflows/checks.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
name: Test
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Set up Go
15+
uses: actions/setup-go@v3
16+
with:
17+
go-version: ^1.21
18+
id: go
19+
20+
- name: Check out code into the Go module directory
21+
uses: actions/checkout@v2
22+
23+
- name: Run unit tests and generate the coverage report
24+
run: make test-race
25+
26+
lint:
27+
name: Lint
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Set up Go
31+
uses: actions/setup-go@v3
32+
with:
33+
go-version: ^1.21
34+
id: go
35+
36+
- name: Check out code into the Go module directory
37+
uses: actions/checkout@v2
38+
39+
- name: Install gofumpt
40+
run: go install mvdan.cc/[email protected]
41+
42+
- name: Install staticcheck
43+
run: go install honnef.co/go/tools/cmd/[email protected]
44+
45+
- name: Install golangci-lint
46+
run: go install github.com/golangci/golangci-lint/cmd/[email protected]
47+
48+
- name: Install NilAway
49+
run: go install go.uber.org/nilaway/cmd/nilaway@latest
50+
51+
- name: Lint
52+
run: make lint
53+
54+
- name: Ensure go mod tidy runs without changes
55+
run: |
56+
go mod tidy
57+
git update-index -q --really-refresh
58+
git diff-index HEAD

.github/workflows/release.yaml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
10+
dummy:
11+
name: Dummy
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Dummy
16+
run: exit 0
17+
18+
19+
# docker-image:
20+
# name: Publish Docker Image
21+
# runs-on: ubuntu-latest
22+
23+
# steps:
24+
# - name: Checkout sources
25+
# uses: actions/checkout@v2
26+
27+
# - name: Get tag version
28+
# run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
29+
30+
# - name: Print version
31+
# run: |
32+
# echo $RELEASE_VERSION
33+
# echo ${{ env.RELEASE_VERSION }}
34+
35+
# - name: Set up QEMU
36+
# uses: docker/setup-qemu-action@v3
37+
38+
# - name: Set up Docker Buildx
39+
# uses: docker/setup-buildx-action@v3
40+
41+
# - name: Extract metadata (tags, labels) for Docker
42+
# id: meta
43+
# uses: docker/metadata-action@v5
44+
# with:
45+
# images: flashbots/go-template
46+
# tags: |
47+
# type=sha
48+
# type=pep440,pattern={{version}}
49+
# type=pep440,pattern={{major}}.{{minor}}
50+
# type=raw,value=latest,enable=${{ !contains(env.RELEASE_VERSION, '-') }}
51+
52+
# - name: Login to DockerHub
53+
# uses: docker/login-action@v3
54+
# with:
55+
# username: ${{ secrets.DOCKERHUB_USERNAME }}
56+
# password: ${{ secrets.DOCKERHUB_TOKEN }}
57+
58+
# - name: Go Build Cache for Docker
59+
# uses: actions/cache@v3
60+
# with:
61+
# path: go-build-cache
62+
# key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }}
63+
64+
# - name: inject go-build-cache into docker
65+
# uses: reproducible-containers/[email protected]
66+
# with:
67+
# cache-source: go-build-cache
68+
69+
# - name: Build and push
70+
# uses: docker/build-push-action@v5
71+
# with:
72+
# context: .
73+
# build-args: |
74+
# VERSION=${{ env.RELEASE_VERSION }}
75+
# push: true
76+
# tags: ${{ steps.meta.outputs.tags }}
77+
# labels: ${{ steps.meta.outputs.labels }}
78+
# platforms: linux/amd64,linux/arm64
79+
# cache-from: type=gha
80+
# cache-to: type=gha,mode=max
81+
82+
# github-release:
83+
# runs-on: ubuntu-latest
84+
# steps:
85+
# - name: Checkout sources
86+
# uses: actions/checkout@v2
87+
88+
# - name: Create release
89+
# id: create_release
90+
# uses: actions/create-release@v1
91+
# env:
92+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
93+
# with:
94+
# tag_name: ${{ github.ref }}
95+
# release_name: ${{ github.ref }}
96+
# draft: false
97+
# prerelease: false

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, built with `go test -c`
9+
*.test
10+
11+
# Output of the go coverage tool, specifically when used with LiteIDE
12+
*.out
13+
14+
# Dependency directories (remove the comment below to include it)
15+
# vendor/
16+
17+
# IDE
18+
.vscode
19+
20+
# Builds
21+
/build

.golangci.yaml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
linters:
2+
enable-all: true
3+
disable:
4+
- cyclop
5+
- forbidigo
6+
- funlen
7+
- gci
8+
- gochecknoglobals
9+
- gochecknoinits
10+
- gocritic
11+
- godot
12+
- godox
13+
- gomnd
14+
- lll
15+
- nestif
16+
- nilnil
17+
- nlreturn
18+
- noctx
19+
- nonamedreturns
20+
- nosnakecase
21+
- paralleltest
22+
- revive
23+
- testpackage
24+
- unparam
25+
- varnamelen
26+
- wrapcheck
27+
- wsl
28+
- deadcode
29+
- varcheck
30+
- exhaustruct
31+
- depguard
32+
33+
#
34+
# Disabled because of generics:
35+
#
36+
- contextcheck
37+
- rowserrcheck
38+
- sqlclosecheck
39+
- structcheck
40+
- wastedassign
41+
42+
#
43+
# Disabled because deprecated:
44+
#
45+
- exhaustivestruct
46+
- golint
47+
- ifshort
48+
- interfacer
49+
- maligned
50+
- scopelint
51+
52+
linters-settings:
53+
#
54+
# The G108 rule throws a false positive. We're not actually vulnerable. If
55+
# you're not careful the profiling endpoint is automatically exposed on
56+
# /debug/pprof if you import net/http/pprof. See this link:
57+
#
58+
# https://mmcloughlin.com/posts/your-pprof-is-showing
59+
#
60+
gosec:
61+
excludes:
62+
- G108
63+
64+
tagliatelle:
65+
case:
66+
rules:
67+
json: snake
68+
69+
gofumpt:
70+
extra-rules: true
71+
72+
exhaustruct:
73+
exclude:
74+
#
75+
# Because it's easier to read without the other fields.
76+
#
77+
- 'GetPayloadsFilters'
78+
79+
#
80+
# Structures outside our control that have a ton of settings. It doesn't
81+
# make sense to specify all of the fields.
82+
#
83+
- 'cobra.Command'
84+
- 'database.*Entry'
85+
- 'http.Server'
86+
- 'logrus.*Formatter'
87+
- 'Options' # redis
88+
89+
#
90+
# Excluded because there are private fields (not capitalized) that are
91+
# not initialized. If possible, I think these should be altered.
92+
#
93+
- 'Datastore'
94+
- 'Housekeeper'
95+
- 'MockBeaconClient'
96+
- 'RelayAPI'
97+
- 'Webserver'

LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2021-2024 Flashbots
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)