From b6eab4ff55e0ef6f63c3f0afb4d2272a3e9564b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Zdyba=C5=82?= Date: Wed, 25 Sep 2024 11:21:24 +0200 Subject: [PATCH 1/9] chore: add Makefile and linters configuration --- .golangci.yml | 49 ++++++++++++++++++++++++++++++++++++ .markdownlint.yaml | 6 +++++ .yamllint.yml | 9 +++++++ Makefile | 63 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 127 insertions(+) create mode 100644 .golangci.yml create mode 100644 .markdownlint.yaml create mode 100644 .yamllint.yml create mode 100644 Makefile diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..d85cb58 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,49 @@ +run: + timeout: 5m + modules-download-mode: readonly + +linters: + enable: + - errorlint + - errcheck + - gofmt + - goimports + - gosec + - gosimple + - govet + - ineffassign + - misspell + - revive + - staticcheck + - typecheck + - unconvert + - unused + +issues: + exclude-use-default: false + # mempool and indexer code is borrowed from Tendermint + exclude-dirs: + - mempool + - state/indexer + - state/txindex + - third_party + include: + - EXC0012 # EXC0012 revive: Annoying issue about not having a comment. The rare codebase has such comments + - EXC0014 # EXC0014 revive: Annoying issue about not having a comment. The rare codebase has such comments + +linters-settings: + gosec: + excludes: + - G115 + revive: + rules: + - name: package-comments + disabled: true + - name: duplicated-imports + severity: warning + - name: exported + arguments: + - disableStutteringCheck + + goimports: + local-prefixes: github.com/rollkit diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000..6369b8d --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,6 @@ +default: true +MD010: + code_blocks: false +MD013: false +MD024: + allow_different_nesting: true diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000..cd2a9e8 --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,9 @@ +--- +# Built from docs https://yamllint.readthedocs.io/en/stable/configuration.html +extends: default + +rules: + # 120 chars should be enough, but don't fail if a line is longer + line-length: + max: 120 + level: warning diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..226e09a --- /dev/null +++ b/Makefile @@ -0,0 +1,63 @@ +# Define pkgs, run, and cover vairables for test so that we can override them in +# the terminal more easily. +pkgs := $(shell go list ./...) +run := . +count := 1 + +## help: Show this help message +help: Makefile + @echo " Choose a command run in "$(PROJECTNAME)":" + @sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /' +.PHONY: help + +## clean: clean testcache +clean: + @echo "--> Clearing testcache" + @go clean --testcache +.PHONY: clean + +## cover: generate to code coverage report. +cover: + @echo "--> Generating Code Coverage" + @go install github.com/ory/go-acc@latest + @go-acc -o coverage.txt $(pkgs) +.PHONY: cover + +## deps: Install dependencies +deps: + @echo "--> Installing dependencies" + @go mod download +# @make proto-gen + @go mod tidy +.PHONY: deps + +## lint: Run linters golangci-lint and markdownlint. +lint: vet + @echo "--> Running golangci-lint" + @golangci-lint run + @echo "--> Running markdownlint" + @markdownlint --config .markdownlint.yaml '**/*.md' + @echo "--> Running yamllint" + @yamllint --no-warnings . -c .yamllint.yml + +.PHONY: lint + +## fmt: Run fixes for linters. Currently only markdownlint. +fmt: + @echo "--> Formatting markdownlint" + @markdownlint --config .markdownlint.yaml '**/*.md' -f + @echo "--> Formatting go" + @golangci-lint run --fix +.PHONY: fmt + +## vet: Run go vet +vet: + @echo "--> Running go vet" + @go vet $(pkgs) +.PHONY: vet + +## test: Running unit tests +test: vet + @echo "--> Running unit tests" + @go test -v -race -covermode=atomic -coverprofile=coverage.txt $(pkgs) -run $(run) -count=$(count) +.PHONY: test From e048b768f47263a99d83539eb67e80685b43bec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Zdyba=C5=82?= Date: Wed, 25 Sep 2024 11:24:49 +0200 Subject: [PATCH 2/9] feat: initial stub of BasedSequencer go.mod with dependencies, empty stub for BaseSequencer struct --- go.mod | 19 +++++++++++++++++++ go.sum | 30 ++++++++++++++++++++++++++++++ sequencer.go | 30 ++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 go.mod create mode 100644 go.sum create mode 100644 sequencer.go diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..c68b54d --- /dev/null +++ b/go.mod @@ -0,0 +1,19 @@ +module github.com/rollkit/based-sequencer + +go 1.23.1 + +require ( + github.com/rollkit/go-da v0.7.0 + github.com/rollkit/go-sequencing v0.0.0-20240924073851-5e3b8522a072 +) + +require ( + github.com/cosmos/gogoproto v1.7.0 // indirect + github.com/google/go-cmp v0.6.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/text v0.17.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed // indirect + google.golang.org/grpc v1.67.0 // indirect + google.golang.org/protobuf v1.34.2 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..533d742 --- /dev/null +++ b/go.sum @@ -0,0 +1,30 @@ +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rollkit/go-da v0.7.0 h1:b4o5dWCCqwH0fbbhfNOoLraAsCHjN5PV1Z2rNkUB+pU= +github.com/rollkit/go-da v0.7.0/go.mod h1:9YCbEhUkF/QHbbKPBe5uvu93Co/mgPRtYjlwj6GPuhI= +github.com/rollkit/go-sequencing v0.0.0-20240924073851-5e3b8522a072 h1:ryzQ53hpEZ/tzsweDkEFUP3ovFcmi0IBye4JhCNIs+8= +github.com/rollkit/go-sequencing v0.0.0-20240924073851-5e3b8522a072/go.mod h1:s/3XzHYeY+bximgM8PDdQmoe9aWBSOa4NDQmBxpMJ4A= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed h1:J6izYgfBXAI3xTKLgxzTmUltdYaLsuBxFCgDHWJ/eXg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw= +google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sequencer.go b/sequencer.go new file mode 100644 index 0000000..e2ed5be --- /dev/null +++ b/sequencer.go @@ -0,0 +1,30 @@ +package based_sequencer + +import ( + "context" + "time" + + "github.com/rollkit/go-da" + "github.com/rollkit/go-sequencing" +) + +type BasedSequencer struct { + da da.DA +} + +var _ sequencing.Sequencer = (*BasedSequencer)(nil) + +func (b *BasedSequencer) SubmitRollupTransaction(ctx context.Context, rollupId sequencing.RollupId, tx sequencing.Tx) error { + //TODO implement me + panic("implement me") +} + +func (b *BasedSequencer) GetNextBatch(ctx context.Context, lastBatchHash sequencing.Hash) (*sequencing.Batch, time.Time, error) { + //TODO implement me + panic("implement me") +} + +func (b *BasedSequencer) VerifyBatch(ctx context.Context, batchHash sequencing.Hash) (bool, error) { + //TODO implement me + panic("implement me") +} From 5b9693c20018fc2c2b1fa03303dff881038d9341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Zdyba=C5=82?= Date: Wed, 25 Sep 2024 11:55:59 +0200 Subject: [PATCH 3/9] ci: add workflows for testing, linting, housekeeping, and updates Created workflows for testing, code coverage, linting, and other housekeeping tasks including issue management, semantic pull request enforcement, and dependency updates automation. These enhancements improve code quality, automate routine tasks, and ensure adherence to project standards. --- .github/auto_request_review.yml | 15 ++++ .github/dependabot.yml | 41 ++++++++++ .github/workflows/ci_release.yml | 45 +++++++++++ .github/workflows/housekeeping.yml | 85 +++++++++++++++++++++ .github/workflows/lint.yml | 50 ++++++++++++ .github/workflows/semantic-pull-request.yml | 20 +++++ .github/workflows/test.yml | 47 ++++++++++++ 7 files changed, 303 insertions(+) create mode 100644 .github/auto_request_review.yml create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci_release.yml create mode 100644 .github/workflows/housekeeping.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/semantic-pull-request.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/auto_request_review.yml b/.github/auto_request_review.yml new file mode 100644 index 0000000..bc48a57 --- /dev/null +++ b/.github/auto_request_review.yml @@ -0,0 +1,15 @@ +reviewers: + defaults: + - rollkit + groups: + rollkit: + - team:core +files: + ".github/**": + - MSevey + - rollkit +options: + ignore_draft: true + ignored_keywords: + - WIP + number_of_reviewers: 3 diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..f472f89 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,41 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 + labels: + - T:dependencies + # Group all patch updates into a single PR + groups: + patch-updates: + applies-to: version-updates + update-types: + - "patch" + - package-ecosystem: gomod + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 + labels: + - T:dependencies + # Group all patch updates into a single PR + groups: + patch-updates: + applies-to: version-updates + update-types: + - "patch" + - package-ecosystem: docker + directory: "/docker" + schedule: + interval: daily + open-pull-requests-limit: 10 + labels: + - T:dependencies + # Group all patch updates into a single PR + groups: + patch-updates: + applies-to: version-updates + update-types: + - "patch" diff --git a/.github/workflows/ci_release.yml b/.github/workflows/ci_release.yml new file mode 100644 index 0000000..a918873 --- /dev/null +++ b/.github/workflows/ci_release.yml @@ -0,0 +1,45 @@ +name: CI and Release +on: + push: + branches: + - main + # Trigger on version tags + tags: + - 'v[0-9]+\.[0-9]+\.[0-9]+' + - 'v[0-9]+\.[0-9]+\.[0-9]+-rc(?:[0-9]+|\.[0-9]+)' + pull_request: + merge_group: + workflow_dispatch: + # Inputs the workflow accepts. + inputs: + version: + # Friendly description to be shown in the UI instead of 'name' + description: "Semver type of new version (major / minor / patch)" + # Input has to be provided for the workflow to run + required: true + type: choice + options: + - patch + - minor + - major + +jobs: + lint: + uses: ./.github/workflows/lint.yml + + test: + uses: ./.github/workflows/test.yml + + # Make a release if this is a manually trigger job, i.e. workflow_dispatch + release: + needs: [lint, test] + runs-on: ubuntu-latest + if: ${{ github.event_name == 'workflow_dispatch' }} + permissions: "write-all" + steps: + - uses: actions/checkout@v4 + - name: Version Release + uses: rollkit/.github/.github/actions/version-release@v0.4.1 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + version-bump: ${{inputs.version}} diff --git a/.github/workflows/housekeeping.yml b/.github/workflows/housekeeping.yml new file mode 100644 index 0000000..76eb843 --- /dev/null +++ b/.github/workflows/housekeeping.yml @@ -0,0 +1,85 @@ +name: Housekeeping + +on: + issues: + types: [opened] + pull_request_target: + types: [opened, ready_for_review] + +jobs: + issue-management: + if: ${{ github.event.issue }} + name: Add issues to project and add triage label + uses: rollkit/.github/.github/workflows/reusable_housekeeping.yml@v0.4.1 + secrets: inherit + permissions: + issues: write + pull-requests: write + with: + run-labels: true + labels-to-add: "needs-triage" + run-projects: true + project-url: https://github.com/orgs/rollkit/projects/7 + + add-pr-to-project: + # ignore dependabot PRs + if: ${{ github.event.pull_request && github.actor != 'dependabot[bot]' }} + name: Add PRs to project + uses: rollkit/.github/.github/workflows/reusable_housekeeping.yml@v0.4.1 + secrets: inherit + permissions: + issues: write + pull-requests: write + with: + run-projects: true + project-url: https://github.com/orgs/rollkit/projects/7 + + auto-add-reviewer: + name: Auto add reviewer to PR + if: github.event.pull_request + uses: rollkit/.github/.github/workflows/reusable_housekeeping.yml@v0.4.1 + secrets: inherit + permissions: + issues: write + pull-requests: write + with: + run-auto-request-review: true + + auto-add-assignee-pr: + # ignore dependabot PRs + if: ${{ github.event.pull_request && github.actor != 'dependabot[bot]' }} + name: Assign PR to creator + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - name: Set pull_request url and creator login + # yamllint disable rule:line-length + run: | + echo "PR=${{ github.event.pull_request.html_url }}" >> $GITHUB_ENV + echo "CREATOR=${{ github.event.pull_request.user.login }}" >> $GITHUB_ENV + # yamllint enable rule:line-length + - name: Assign PR to creator + run: gh pr edit ${{ env.PR }} --add-assignee ${{ env.CREATOR }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + auto-add-assignee-label: + if: ${{ github.event.issue }} + name: Assign issue to creator + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - name: Checkout the repository + uses: actions/checkout@v4 + - name: Set issue number and creator login + run: | + echo "ISSUE=${{ github.event.issue.number }}" >> $GITHUB_ENV + echo "CREATOR=${{ github.event.issue.user.login }}" >> $GITHUB_ENV + - name: Assign issue to creator + run: gh issue edit ${{ env.ISSUE }} --add-assignee ${{ env.CREATOR }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..a674b3c --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,50 @@ +# lint runs all linters in this repository +# This workflow is triggered by ci_release.yml workflow +name: lint +on: + workflow_call: + +jobs: + golangci-lint: + name: golangci-lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: ./go.mod + # This steps sets the GIT_DIFF environment variable to true + # if files defined in PATTERS changed + - uses: technote-space/get-diff-action@v6.1.2 + with: + # This job will pass without running if go.mod, go.sum, and *.go + # wasn't modified. + PATTERNS: | + **/**.go + go.mod + go.sum + - uses: golangci/golangci-lint-action@v6.1.0 + with: + version: latest + args: --timeout 10m + github-token: ${{ secrets.github_token }} + if: env.GIT_DIFF + + # hadolint lints the Dockerfile + hadolint: + uses: rollkit/.github/.github/workflows/reusable_dockerfile_lint.yml@v0.4.1 # yamllint disable-line rule:line-length + with: + dockerfile: Dockerfile + failure-threshold: error + + yamllint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: rollkit/.github/.github/actions/yamllint@v0.4.1 + + markdown-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: rollkit/.github/.github/actions/markdown-lint@v0.4.1 diff --git a/.github/workflows/semantic-pull-request.yml b/.github/workflows/semantic-pull-request.yml new file mode 100644 index 0000000..e11fe30 --- /dev/null +++ b/.github/workflows/semantic-pull-request.yml @@ -0,0 +1,20 @@ +name: Semantic Pull Request + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +permissions: + pull-requests: read + +jobs: + main: + name: conventional-commit-pr-title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..655450c --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,47 @@ +# Tests / Code Coverage workflow +# This workflow is triggered by ci_release.yml workflow +name: Tests / Code Coverage +on: + workflow_call: + +jobs: + go_mod_tidy_check: + name: Go Mod Tidy Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: ./go.mod + - run: go mod tidy + - name: check for diff + run: git diff --exit-code + + unit_test: + name: Run Unit Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: set up go + uses: actions/setup-go@v5 + with: + go-version-file: ./go.mod + - name: Run unit test + run: make test + - name: upload coverage report + uses: codecov/codecov-action@v4.5.0 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.txt + + integration_test: + name: Run Integration Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: set up go + uses: actions/setup-go@v5 + with: + go-version-file: ./go.mod + - name: Integration Tests + run: echo "No integration tests yet" From 0ddd32d8a834969a670153dda6cc967115f19291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Zdyba=C5=82?= Date: Wed, 25 Sep 2024 13:48:15 +0200 Subject: [PATCH 4/9] docs: fix makrdownlint issues --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7358c7c..464cba8 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # based-sequencer + Based sequencer that implements go-sequencing interface From e8bbd5d03360e8c92e140c1833e50a130f01dd7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Zdyba=C5=82?= Date: Wed, 25 Sep 2024 14:05:05 +0200 Subject: [PATCH 5/9] docs: add comments --- sequencer.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sequencer.go b/sequencer.go index e2ed5be..89db3ab 100644 --- a/sequencer.go +++ b/sequencer.go @@ -8,22 +8,34 @@ import ( "github.com/rollkit/go-sequencing" ) +// BasedSequencer implements go-sequencing API with based sequencing logic. +// +// All transactions are passed directly to DA to be saved in a namespace. Each transaction is submitted as separate blob. +// When batch is requested DA blocks are scanned to read all blobs from given namespace at given height. type BasedSequencer struct { da da.DA } +// NewSequencer initializes a BasedSequencer with the provided DA implementation. +func NewSequencer(da da.DA) *BasedSequencer { + return &BasedSequencer{da: da} +} + var _ sequencing.Sequencer = (*BasedSequencer)(nil) +// SubmitRollupTransaction submits a transaction directly to DA, as a single blob. func (b *BasedSequencer) SubmitRollupTransaction(ctx context.Context, rollupId sequencing.RollupId, tx sequencing.Tx) error { //TODO implement me panic("implement me") } +// GetNextBatch reads data from namespace in DA and builds transactions batches. func (b *BasedSequencer) GetNextBatch(ctx context.Context, lastBatchHash sequencing.Hash) (*sequencing.Batch, time.Time, error) { //TODO implement me panic("implement me") } +// VerifyBatch ensures data-availability of a batch in DA. func (b *BasedSequencer) VerifyBatch(ctx context.Context, batchHash sequencing.Hash) (bool, error) { //TODO implement me panic("implement me") From 5b2c12e6f022e6a9644b01b62ea19c72102c2d2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Zdyba=C5=82?= Date: Wed, 25 Sep 2024 14:08:34 +0200 Subject: [PATCH 6/9] ci: disable hadolint, as there is no Dockerfile --- .github/workflows/lint.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a674b3c..19a98ca 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -31,11 +31,11 @@ jobs: if: env.GIT_DIFF # hadolint lints the Dockerfile - hadolint: - uses: rollkit/.github/.github/workflows/reusable_dockerfile_lint.yml@v0.4.1 # yamllint disable-line rule:line-length - with: - dockerfile: Dockerfile - failure-threshold: error +# hadolint: +# uses: rollkit/.github/.github/workflows/reusable_dockerfile_lint.yml@v0.4.1 # yamllint disable-line rule:line-length +# with: +# dockerfile: Dockerfile +# failure-threshold: error yamllint: runs-on: ubuntu-latest From f53c6dd5d802507c1102c9b8ab89880667dc8755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Zdyba=C5=82?= Date: Wed, 25 Sep 2024 16:01:52 +0200 Subject: [PATCH 7/9] ci: add semantic release action --- .github/workflows/semantic_release.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/semantic_release.yml diff --git a/.github/workflows/semantic_release.yml b/.github/workflows/semantic_release.yml new file mode 100644 index 0000000..c5f1d5d --- /dev/null +++ b/.github/workflows/semantic_release.yml @@ -0,0 +1,24 @@ +name: Semantic Release + +on: + push: + branches: + - main + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Configure Semantic Release + # Work around for non npm project + # REF: https://github.com/cycjimmy/semantic-release-action/issues/115#issuecomment-1817264419 + run: echo '{"branches":[],"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator","@semantic-release/github"]}' > .releaserc.json + - name: Create Release + uses: cycjimmy/semantic-release-action@v4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + branches: | + ["main"] From a30e4b91ed4563cfae424f2ebb7a447665aa02f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Zdyba=C5=82?= Date: Wed, 25 Sep 2024 16:02:47 +0200 Subject: [PATCH 8/9] ci: fix docker path for dependabot --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f472f89..17cbb6c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -27,7 +27,7 @@ updates: update-types: - "patch" - package-ecosystem: docker - directory: "/docker" + directory: "/" schedule: interval: daily open-pull-requests-limit: 10 From 6a422c49cbcbae7f848cc6486cc0f1b8c1203f57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Zdyba=C5=82?= Date: Wed, 25 Sep 2024 17:00:14 +0200 Subject: [PATCH 9/9] ci: simplify tag regexp in GH actions --- .github/workflows/ci_release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci_release.yml b/.github/workflows/ci_release.yml index a918873..3dda0de 100644 --- a/.github/workflows/ci_release.yml +++ b/.github/workflows/ci_release.yml @@ -5,8 +5,7 @@ on: - main # Trigger on version tags tags: - - 'v[0-9]+\.[0-9]+\.[0-9]+' - - 'v[0-9]+\.[0-9]+\.[0-9]+-rc(?:[0-9]+|\.[0-9]+)' + - 'v*' pull_request: merge_group: workflow_dispatch: