Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
**/**.go
go.mod
go.sum
- uses: golangci/golangci-lint-action@v6.5.2
- uses: golangci/golangci-lint-action@v7.0.0
with:
version: latest
args: --timeout 10m
Expand Down
75 changes: 43 additions & 32 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,52 @@
version: "2"
run:
timeout: 5m
modules-download-mode: readonly

linters:
enable:
- errorlint
- errcheck
- gofmt
- gci
- gosec
- gosimple
- govet
- ineffassign
- misspell
- revive
- staticcheck
- typecheck
- unconvert
- unused

linters-settings:
gosec:
excludes:
- G115
revive:
rules:
- name: package-comments
disabled: true
- name: duplicated-imports
severity: warning
- name: exported
arguments:
- disableStutteringCheck
gci:
custom-order: true
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- prefix(github.com/rollkit)
- prefix(github.com/rollkit/rollkit)
settings:
gosec:
excludes:
- G115
revive:
rules:
- name: package-comments
disabled: true
- name: duplicated-imports
severity: warning
- name: exported
arguments:
- disableStutteringCheck
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gci
- gofmt
settings:
gci:
sections:
- standard
- default
- prefix(github.com/rollkit)
- prefix(github.com/rollkit/rollkit)
custom-order: true
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
13 changes: 7 additions & 6 deletions block/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"google.golang.org/protobuf/proto"

"github.com/rollkit/go-sequencing"

coreda "github.com/rollkit/rollkit/core/da"
coreexecutor "github.com/rollkit/rollkit/core/execution"
coresequencer "github.com/rollkit/rollkit/core/sequencer"
Expand Down Expand Up @@ -1173,7 +1174,7 @@
}

// sanity check timestamp for monotonically increasing
if batchData.Time.Before(lastHeaderTime) {
if batchData.Before(lastHeaderTime) {

Check warning on line 1177 in block/manager.go

View check run for this annotation

Codecov / codecov/patch

block/manager.go#L1177

Added line #L1177 was not covered by tests
return fmt.Errorf("timestamp is not monotonically increasing: %s < %s", batchData.Time, m.getLastBlockTime())
}
m.logger.Info("Creating and publishing block", "height", newHeight)
Expand Down Expand Up @@ -1220,7 +1221,7 @@
panic(err)
}
// Before taking the hash, we need updated ISRs, hence after ApplyBlock
header.Header.DataHash = data.Hash()
header.DataHash = data.Hash()

Check warning on line 1224 in block/manager.go

View check run for this annotation

Codecov / codecov/patch

block/manager.go#L1224

Added line #L1224 was not covered by tests

signature, err = m.getSignature(header.Header)
if err != nil {
Expand Down Expand Up @@ -1497,7 +1498,7 @@
BaseHeader: types.BaseHeader{
ChainID: lastState.ChainID,
Height: height,
Time: uint64(batchData.Time.UnixNano()), //nolint:gosec // why is time unix? (tac0turtle)
Time: uint64(batchData.UnixNano()), //nolint:gosec // why is time unix? (tac0turtle)

Check warning on line 1501 in block/manager.go

View check run for this annotation

Codecov / codecov/patch

block/manager.go#L1501

Added line #L1501 was not covered by tests
},
LastHeaderHash: lastHeaderHash,
DataHash: batchdata,
Expand All @@ -1513,10 +1514,10 @@
}

blockData := &types.Data{
Txs: make(types.Txs, len(batchData.Batch.Transactions)),
Txs: make(types.Txs, len(batchData.Transactions)),

Check warning on line 1517 in block/manager.go

View check run for this annotation

Codecov / codecov/patch

block/manager.go#L1517

Added line #L1517 was not covered by tests
}
for i := range batchData.Batch.Transactions {
blockData.Txs[i] = types.Tx(batchData.Batch.Transactions[i])
for i := range batchData.Transactions {
blockData.Txs[i] = types.Tx(batchData.Transactions[i])

Check warning on line 1520 in block/manager.go

View check run for this annotation

Codecov / codecov/patch

block/manager.go#L1519-L1520

Added lines #L1519 - L1520 were not covered by tests
}

return header, blockData, nil
Expand Down
2 changes: 1 addition & 1 deletion block/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func TestHandleEmptyDataHash(t *testing.T) {
// make sure that the store has the correct data
d := dataCache.GetItem(header.Height())
require.NotNil(d)
require.Equal(d.Metadata.LastDataHash, lastDataHash)
require.Equal(d.LastDataHash, lastDataHash)
require.Equal(d.Metadata.ChainID, header.ChainID())
require.Equal(d.Metadata.Height, header.Height())
require.Equal(d.Metadata.Time, header.BaseHeader.Time)
Expand Down
2 changes: 2 additions & 0 deletions block/reaper.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import (

"cosmossdk.io/log"
ds "github.com/ipfs/go-datastore"

"github.com/rollkit/go-sequencing"

coreexecutor "github.com/rollkit/rollkit/core/execution"
coresequencer "github.com/rollkit/rollkit/core/sequencer"
)
Expand Down
1 change: 1 addition & 0 deletions block/reaper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"cosmossdk.io/log"
ds "github.com/ipfs/go-datastore"
dsync "github.com/ipfs/go-datastore/sync"

execution "github.com/rollkit/rollkit/core/execution"
sequencer "github.com/rollkit/rollkit/core/sequencer"
)
Expand Down
15 changes: 7 additions & 8 deletions docs/cmd/testapp.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ The first sovereign rollup framework that allows you to launch a sovereign, cust

### Synopsis


Rollkit is the first sovereign rollup framework that allows you to launch a sovereign, customizable blockchain as easily as a smart contract.
If the --home flag is not specified, the rollkit command will create a folder "~/.testapp" where it will store node keys, config, and data.

Expand All @@ -20,10 +19,10 @@ If the --home flag is not specified, the rollkit command will create a folder "~

### SEE ALSO

* [testapp completion](testapp_completion.md) - Generate the autocompletion script for the specified shell
* [testapp docs-gen](testapp_docs-gen.md) - Generate documentation for rollkit CLI
* [testapp init](testapp_init.md) - Initialize rollkit config
* [testapp node-info](testapp_node-info.md) - Get information about a running node via RPC
* [testapp start](testapp_start.md) - Run the testapp node
* [testapp unsafe-clean](testapp_unsafe-clean.md) - Remove all contents of the data directory (DANGEROUS: cannot be undone)
* [testapp version](testapp_version.md) - Show version info
* [testapp completion](testapp_completion.md) - Generate the autocompletion script for the specified shell
* [testapp docs-gen](testapp_docs-gen.md) - Generate documentation for rollkit CLI
* [testapp init](testapp_init.md) - Initialize rollkit config
* [testapp node-info](testapp_node-info.md) - Get information about a running node via RPC
* [testapp start](testapp_start.md) - Run the testapp node
* [testapp unsafe-clean](testapp_unsafe-clean.md) - Remove all contents of the data directory (DANGEROUS: cannot be undone)
* [testapp version](testapp_version.md) - Show version info
11 changes: 5 additions & 6 deletions docs/cmd/testapp_completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Generate the autocompletion script for the specified shell
Generate the autocompletion script for testapp for the specified shell.
See each sub-command's help for details on how to use the generated script.


### Options

```
Expand All @@ -25,8 +24,8 @@ See each sub-command's help for details on how to use the generated script.

### SEE ALSO

* [testapp](testapp.md) - The first sovereign rollup framework that allows you to launch a sovereign, customizable blockchain as easily as a smart contract.
* [testapp completion bash](testapp_completion_bash.md) - Generate the autocompletion script for bash
* [testapp completion fish](testapp_completion_fish.md) - Generate the autocompletion script for fish
* [testapp completion powershell](testapp_completion_powershell.md) - Generate the autocompletion script for powershell
* [testapp completion zsh](testapp_completion_zsh.md) - Generate the autocompletion script for zsh
* [testapp](testapp.md) - The first sovereign rollup framework that allows you to launch a sovereign, customizable blockchain as easily as a smart contract.
* [testapp completion bash](testapp_completion_bash.md) - Generate the autocompletion script for bash
* [testapp completion fish](testapp_completion_fish.md) - Generate the autocompletion script for fish
* [testapp completion powershell](testapp_completion_powershell.md) - Generate the autocompletion script for powershell
* [testapp completion zsh](testapp_completion_zsh.md) - Generate the autocompletion script for zsh
7 changes: 3 additions & 4 deletions docs/cmd/testapp_completion_bash.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@ To load completions in your current shell session:

To load completions for every new session, execute once:

#### Linux:
#### Linux

testapp completion bash > /etc/bash_completion.d/testapp

#### macOS:
#### macOS

testapp completion bash > $(brew --prefix)/etc/bash_completion.d/testapp

You will need to start a new shell for this setup to take effect.


```
testapp completion bash
```
Expand All @@ -48,4 +47,4 @@ testapp completion bash

### SEE ALSO

* [testapp completion](testapp_completion.md) - Generate the autocompletion script for the specified shell
* [testapp completion](testapp_completion.md) - Generate the autocompletion script for the specified shell
3 changes: 1 addition & 2 deletions docs/cmd/testapp_completion_fish.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ To load completions for every new session, execute once:

You will need to start a new shell for this setup to take effect.


```
testapp completion fish [flags]
```
Expand All @@ -39,4 +38,4 @@ testapp completion fish [flags]

### SEE ALSO

* [testapp completion](testapp_completion.md) - Generate the autocompletion script for the specified shell
* [testapp completion](testapp_completion.md) - Generate the autocompletion script for the specified shell
3 changes: 1 addition & 2 deletions docs/cmd/testapp_completion_powershell.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ To load completions in your current shell session:
To load completions for every new session, add the output of the above command
to your powershell profile.


```
testapp completion powershell [flags]
```
Expand All @@ -36,4 +35,4 @@ testapp completion powershell [flags]

### SEE ALSO

* [testapp completion](testapp_completion.md) - Generate the autocompletion script for the specified shell
* [testapp completion](testapp_completion.md) - Generate the autocompletion script for the specified shell
7 changes: 3 additions & 4 deletions docs/cmd/testapp_completion_zsh.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@ To load completions in your current shell session:

To load completions for every new session, execute once:

#### Linux:
#### Linux

testapp completion zsh > "${fpath[1]}/_testapp"

#### macOS:
#### macOS

testapp completion zsh > $(brew --prefix)/share/zsh/site-functions/_testapp

You will need to start a new shell for this setup to take effect.


```
testapp completion zsh [flags]
```
Expand All @@ -50,4 +49,4 @@ testapp completion zsh [flags]

### SEE ALSO

* [testapp completion](testapp_completion.md) - Generate the autocompletion script for the specified shell
* [testapp completion](testapp_completion.md) - Generate the autocompletion script for the specified shell
2 changes: 1 addition & 1 deletion docs/cmd/testapp_docs-gen.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ testapp docs-gen [flags]

### SEE ALSO

* [testapp](testapp.md) - The first sovereign rollup framework that allows you to launch a sovereign, customizable blockchain as easily as a smart contract.
* [testapp](testapp.md) - The first sovereign rollup framework that allows you to launch a sovereign, customizable blockchain as easily as a smart contract.
2 changes: 1 addition & 1 deletion docs/cmd/testapp_init.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ testapp init [flags]

### SEE ALSO

* [testapp](testapp.md) - The first sovereign rollup framework that allows you to launch a sovereign, customizable blockchain as easily as a smart contract.
* [testapp](testapp.md) - The first sovereign rollup framework that allows you to launch a sovereign, customizable blockchain as easily as a smart contract.
2 changes: 1 addition & 1 deletion docs/cmd/testapp_node-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ testapp node-info [flags]

### SEE ALSO

* [testapp](testapp.md) - The first sovereign rollup framework that allows you to launch a sovereign, customizable blockchain as easily as a smart contract.
* [testapp](testapp.md) - The first sovereign rollup framework that allows you to launch a sovereign, customizable blockchain as easily as a smart contract.
2 changes: 1 addition & 1 deletion docs/cmd/testapp_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ testapp start [flags]

### SEE ALSO

* [testapp](testapp.md) - The first sovereign rollup framework that allows you to launch a sovereign, customizable blockchain as easily as a smart contract.
* [testapp](testapp.md) - The first sovereign rollup framework that allows you to launch a sovereign, customizable blockchain as easily as a smart contract.
2 changes: 1 addition & 1 deletion docs/cmd/testapp_unsafe-clean.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ testapp unsafe-clean [flags]

### SEE ALSO

* [testapp](testapp.md) - The first sovereign rollup framework that allows you to launch a sovereign, customizable blockchain as easily as a smart contract.
* [testapp](testapp.md) - The first sovereign rollup framework that allows you to launch a sovereign, customizable blockchain as easily as a smart contract.
2 changes: 1 addition & 1 deletion docs/cmd/testapp_version.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ testapp version [flags]

### SEE ALSO

* [testapp](testapp.md) - The first sovereign rollup framework that allows you to launch a sovereign, customizable blockchain as easily as a smart contract.
* [testapp](testapp.md) - The first sovereign rollup framework that allows you to launch a sovereign, customizable blockchain as easily as a smart contract.
22 changes: 11 additions & 11 deletions rollups/evm/single/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ This directory contains the implementation of a single EVM sequencer using Rollk

3. Initialize the sequencer:

```bash
./evm-single init --rollkit.node.aggregator=true --rollkit.signer.passphrase secret
```
```bash
./evm-single init --rollkit.node.aggregator=true --rollkit.signer.passphrase secret
```

4. Start the sequencer:

```bash
./evm-single start \
--evm.jwt-secret $(cat <path_to>/go-execution-evm/docker/jwttoken/jwt.hex) \
--evm.genesis-hash 0x0a962a0d163416829894c89cb604ae422323bcdf02d7ea08b94d68d3e026a380 \
--rollkit.node.block_time 1s \
--rollkit.node.aggregator=true \
--rollkit.signer.passphrase secret
```
```bash
./evm-single start \
--evm.jwt-secret $(cat <path_to>/go-execution-evm/docker/jwttoken/jwt.hex) \
--evm.genesis-hash 0x0a962a0d163416829894c89cb604ae422323bcdf02d7ea08b94d68d3e026a380 \
--rollkit.node.block_time 1s \
--rollkit.node.aggregator=true \
--rollkit.signer.passphrase secret
```

Note: Replace `<path_to>` with the actual path to your go-execution-evm repository.

Expand Down
5 changes: 1 addition & 4 deletions sequencers/based/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This implementation supports EVM execution via `go-execution-evm` and allows con
based start [flags]
```

### Example (Mocha Network with dummy DA):
### Example (Mocha Network with dummy DA)

```bash
based start \
Expand Down Expand Up @@ -103,6 +103,3 @@ based start \
- Use `--based.max-height-drift` to control batching latency.

---



Loading
Loading