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

feat(ci): Add github workflow actions #6

Merged
merged 5 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
55 changes: 55 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Go test workflow
name: actions

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21

- name: Build App
run: make da-server

go-test:
outputs:
COVERAGE: ${{ steps.unit.outputs.coverage }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21

- name: Install project dependencies
run: |
go mod download

- name: Run Unit Tests
id: unit
run: |
make test

gosec:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- name: Checkout Source
uses: actions/checkout@v3
- name: Run Gosec Security Scanner
uses: securego/gosec@master
with:
args: ./...
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ lint:

@golangci-lint run

gosec:
@echo "$(GREEN) Running security scan with gosec...$(COLOR_END)"
gosec ./...

.PHONY: \
op-batcher \
clean \
Expand Down
11 changes: 4 additions & 7 deletions daserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ type PlasmaStore interface {
PutWithoutComm(ctx context.Context, value []byte) (key []byte, err error)
}

/*
TODO - enable application server throughput constraints to prevent abuse

a) read/write timeouts
b) concurrency limits for request processing
*/
type DAServer struct {
log log.Logger
endpoint string
Expand All @@ -47,7 +41,10 @@ func NewDAServer(host string, port int, store PlasmaStore, log log.Logger) *DASe
endpoint: endpoint,
store: store,
httpServer: &http.Server{
Addr: endpoint,
Addr: endpoint,
ReadHeaderTimeout: 10 * time.Second,
// aligned with existing blob finalization times
WriteTimeout: 40 * time.Minute,
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion eigenda/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewEigenDAClient(log log.Logger, config Config) *EigenDAClient {

func (m *EigenDAClient) getConnection() (*grpc.ClientConn, error) {
if m.UseTLS {
config := &tls.Config{}
config := &tls.Config{} // #nosec G402
credential := credentials.NewTLS(config)
dialOptions := []grpc.DialOption{grpc.WithTransportCredentials(credential)}
return grpc.Dial(m.RPC, dialOptions...)
Expand Down
Loading