Skip to content

Commit 0657d45

Browse files
authored
feat: exec api (#1997)
## Overview This pr contains a rewrite of rollkit, combining all repos into one allowing systems to work seamlessly without overhead. Thank you to everyone involved --------- Co-authored-by: Tomasz Zdybał <tomek@zdybal.lap.pl> Co-authored-by: Yarik Bratashchuk <yarik.bratashchuk@gmail.com> Co-authored-by: Yarik Bratashchuk <yarikbratashchuk@protonmail.com> Co-authored-by: gupadhyaya <ganeshrvce@gmail.com> Co-authored-by: Facundo <facundomedica@gmail.com> Co-authored-by: Randy Grok <98407738+randygrok@users.noreply.github.com> Co-authored-by: Randy Grok <randygrok@gmail.com> Co-authored-by: Manav Aggarwal <manavaggarwal1234@gmail.com> Co-authored-by: tac0turtle <marko@baricevic.me> Co-authored-by: twizzl-w <196821782+twizzl-w@users.noreply.github.com> Co-authored-by: julienrbrt <julien@rbrt.fr>
1 parent 368ee48 commit 0657d45

399 files changed

Lines changed: 31329 additions & 31093 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci_release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- name: Build cli
4949
run: make install
5050
- name: Run cli
51-
run: rollkit start --ci
51+
run: testapp init
5252

5353
# branch_name trims ref/heads/ from github.ref to access a clean branch name
5454
branch_name:
@@ -69,6 +69,9 @@ jobs:
6969
permissions: "write-all"
7070
steps:
7171
- uses: actions/checkout@v4
72+
- name: Remove existing files
73+
run: |
74+
rm -rf /opt/homebrew/bin/gtar
7275
- name: Version Release
7376
uses: rollkit/.github/.github/actions/version-release@v0.5.0
7477
with:

.github/workflows/lint.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,6 @@ jobs:
5555
- uses: actions/checkout@v4
5656
- uses: rollkit/.github/.github/actions/markdown-lint@v0.5.0
5757

58-
protobuf-lint:
59-
runs-on: ubuntu-latest
60-
timeout-minutes: 5
61-
steps:
62-
- uses: actions/checkout@v4
63-
- run: make proto-gen
64-
- run: make proto-lint
65-
6658
cli-docs-lint:
6759
name: Lint CLI Docs
6860
runs-on: ubuntu-latest
@@ -75,7 +67,7 @@ jobs:
7567
- name: install rollkit cli
7668
run: make install
7769
- name: Generate Docs
78-
run: rollkit docs-gen
70+
run: testapp docs-gen
7971
- name: Verify no diff
8072
run: |
8173
DIFF=$(git diff)

.github/workflows/proto.yml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,13 @@
22
name: Protobuf
33
on:
44
workflow_call:
5+
permissions:
6+
contents: read
57

68
jobs:
7-
proto-gen:
9+
buf-check:
810
runs-on: ubuntu-latest
911
timeout-minutes: 5
1012
steps:
1113
- uses: actions/checkout@v4
12-
- name: "Check protobuf generated code matches committed code"
13-
# yamllint disable
14-
run: |
15-
set -euo pipefail
16-
17-
make proto-gen
18-
19-
if ! git diff --stat --exit-code ; then
20-
echo ">> ERROR:"
21-
echo ">>"
22-
echo ">> Protobuf generated code requires update (either tools or .proto files may have changed)."
23-
echo ">> Ensure your tools are up-to-date, re-run 'make proto-gen' and update this PR."
24-
echo ">>"
25-
exit 1
26-
fi
27-
# yamllint enable
14+
- uses: bufbuild/buf-action@v1

.github/workflows/test.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ on:
55
workflow_call:
66

77
jobs:
8+
build_all-apps:
9+
name: Build All Rollkit Binaries
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: set up go
14+
uses: actions/setup-go@v5
15+
with:
16+
go-version-file: ./go.mod
17+
- name: Build all rollkit binaries
18+
run: make build-all
19+
820
go_mod_tidy_check:
921
name: Go Mod Tidy Check
1022
runs-on: ubuntu-latest
@@ -13,7 +25,7 @@ jobs:
1325
- uses: actions/setup-go@v5
1426
with:
1527
go-version-file: ./go.mod
16-
- run: go mod tidy
28+
- run: make tidy-all
1729
- name: check for diff
1830
run: git diff --exit-code
1931

@@ -27,13 +39,37 @@ jobs:
2739
with:
2840
go-version-file: ./go.mod
2941
- name: Run unit test
30-
run: make test
42+
run: go test -race -covermode=atomic -coverprofile=coverage.txt ./...
3143
- name: upload coverage report
3244
uses: codecov/codecov-action@v5.4.0
3345
with:
3446
token: ${{ secrets.CODECOV_TOKEN }}
3547
file: ./coverage.txt
3648

49+
test_single_sequencer:
50+
name: Run Single Sequencer Tests
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v4
54+
- name: set up go
55+
uses: actions/setup-go@v5
56+
with:
57+
go-version-file: ./go.mod
58+
- name: Run unit test
59+
run: cd sequencers/single && go test ./...
60+
61+
test_da:
62+
name: Run DA Tests
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/checkout@v4
66+
- name: set up go
67+
uses: actions/setup-go@v5
68+
with:
69+
go-version-file: ./go.mod
70+
- name: Run unit test
71+
run: cd da && go test ./...
72+
3773
integration_test:
3874
name: Run Integration Tests
3975
runs-on: ubuntu-latest

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ proto/pb
33
proto/tendermint
44
types/pb/tendermint
55
.vscode/launch.json
6+
.vscode/settings.json
67
*/**.html
78
*.idea
89
*.env
910
.*env
11+
build
12+
.aider*
13+
.DS_Store

.golangci.yml

Lines changed: 43 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,52 @@
1+
version: "2"
12
run:
2-
timeout: 5m
33
modules-download-mode: readonly
4-
54
linters:
65
enable:
76
- errorlint
8-
- errcheck
9-
- gofmt
10-
- goimports
117
- gosec
12-
- gosimple
13-
- govet
14-
- ineffassign
158
- misspell
169
- revive
17-
- staticcheck
18-
- typecheck
1910
- unconvert
20-
- unused
21-
22-
issues:
23-
exclude-use-default: false
24-
# mempool and indexer code is borrowed from Tendermint
25-
exclude-dirs:
26-
- mempool
27-
- state/indexer
28-
- state/txindex
29-
- third_party
30-
include:
31-
- EXC0012 # EXC0012 revive: Annoying issue about not having a comment. The rare codebase has such comments
32-
- EXC0014 # EXC0014 revive: Annoying issue about not having a comment. The rare codebase has such comments
33-
34-
linters-settings:
35-
gosec:
36-
excludes:
37-
- G115
38-
revive:
39-
rules:
40-
- name: package-comments
41-
disabled: true
42-
- name: duplicated-imports
43-
severity: warning
44-
- name: exported
45-
arguments:
46-
- disableStutteringCheck
47-
48-
goimports:
49-
local-prefixes: github.com/rollkit
11+
settings:
12+
gosec:
13+
excludes:
14+
- G115
15+
revive:
16+
rules:
17+
- name: package-comments
18+
disabled: true
19+
- name: duplicated-imports
20+
severity: warning
21+
- name: exported
22+
arguments:
23+
- disableStutteringCheck
24+
exclusions:
25+
generated: lax
26+
presets:
27+
- comments
28+
- common-false-positives
29+
- legacy
30+
- std-error-handling
31+
paths:
32+
- third_party$
33+
- builtin$
34+
- examples$
35+
formatters:
36+
enable:
37+
- gci
38+
- gofmt
39+
settings:
40+
gci:
41+
sections:
42+
- standard
43+
- default
44+
- prefix(github.com/rollkit)
45+
- prefix(github.com/rollkit/rollkit)
46+
custom-order: true
47+
exclusions:
48+
generated: lax
49+
paths:
50+
- third_party$
51+
- builtin$
52+
- examples$

Dockerfile

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,35 @@
11
## prep the base image.
22
#
3-
FROM golang as base
3+
FROM golang:1.24 AS base
44

5-
RUN apt update && \
6-
apt-get install -y \
5+
RUN apt-get update && \
6+
apt-get install -y --no-install-recommends \
77
build-essential \
88
ca-certificates \
9-
curl
9+
curl \
10+
&& rm -rf /var/lib/apt/lists/*
1011

1112
# enable faster module downloading.
12-
ENV GOPROXY https://proxy.golang.org
13+
ENV GOPROXY=https://proxy.golang.org
1314

1415
## builder stage.
1516
#
16-
FROM base as builder
17+
FROM base AS builder
1718

1819
WORKDIR /rollkit
1920

20-
# cache dependencies.
21-
COPY ./go.mod .
22-
COPY ./go.sum .
23-
RUN go mod download
24-
21+
# Copy all source code first
2522
COPY . .
2623

27-
RUN make install
24+
# Now download dependencies and build
25+
RUN go mod download && make install
2826

2927
## prep the final image.
3028
#
3129
FROM base
3230

33-
COPY --from=builder /go/bin/rollkit /usr/bin
31+
COPY --from=builder /go/bin/testapp /usr/bin
3432

3533
WORKDIR /apps
3634

37-
ENTRYPOINT ["rollkit"]
35+
ENTRYPOINT ["testapp"]

Dockerfile.da

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM golang:1.24-alpine AS build-env
2+
3+
# Set working directory for the build
4+
WORKDIR /src
5+
6+
COPY . .
7+
8+
RUN cd da && \
9+
(test -f go.mod || go mod init da) && \
10+
go mod tidy -compat=1.19 && \
11+
CGO_ENABLED=0 go build -o local-da ./cmd/local-da/main.go
12+
13+
RUN ls -alh ./
14+
# RUN cd da && \
15+
# go mod tidy -compat=1.19
16+
# RUN pwd
17+
# RUN cd da && go build ./cmd/local-da/main.go
18+
19+
20+
# Final image
21+
FROM alpine:3.18.3
22+
23+
WORKDIR /root
24+
25+
# Copy over binaries from the build-env
26+
# COPY --from=build-env /src/build/local-da /usr/bin/local-da
27+
COPY --from=build-env /src/da/local-da /usr/bin/local-da
28+
29+
EXPOSE 7980
30+
31+
ENTRYPOINT ["local-da"]
32+
CMD ["-listen-all"]

0 commit comments

Comments
 (0)