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

Org-wide linter #131

Merged
merged 4 commits into from
Sep 11, 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
12 changes: 1 addition & 11 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,7 @@ on:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
uses: nspcc-dev/.github/.github/workflows/go-linter.yml@master

test:
name: Test
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/vendor
.golangci.yml
AnnaShaleva marked this conversation as resolved.
Show resolved Hide resolved

# TLC Model Checker files
formal-models/*/*.toolbox/
54 changes: 0 additions & 54 deletions .golangci.yml

This file was deleted.

4 changes: 2 additions & 2 deletions dbft.go
Original file line number Diff line number Diff line change
Expand Up @@ -698,9 +698,9 @@ func (d *DBFT[H]) changeTimer(delay time.Duration) {
d.Timer.Reset(d.BlockIndex, d.ViewNumber, delay)
}

func (d *DBFT[H]) extendTimer(count time.Duration) {
func (d *DBFT[H]) extendTimer(count int) {
if !d.CommitSent() && (!d.isAntiMEVExtensionEnabled() || !d.PreCommitSent()) && !d.ViewChanging() {
d.Timer.Extend(count * d.SecondsPerBlock / time.Duration(d.M()))
d.Timer.Extend(time.Duration(count) * d.SecondsPerBlock / time.Duration(d.M()))
}
}

Expand Down
3 changes: 3 additions & 0 deletions helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,8 @@
msgs.preCommit[m.ValidatorIndex()] = m
case CommitType:
msgs.commit[m.ValidatorIndex()] = m
default:

Check warning on line 59 in helpers.go

View check run for this annotation

Codecov / codecov/patch

helpers.go#L59

Added line #L59 was not covered by tests
// Others are recoveries and we don't currently use them.
// Theoretically messages could be extracted.
}
}
2 changes: 1 addition & 1 deletion internal/consensus/amev_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func NewAMEVBlock(pre dbft.PreBlock[crypto.Uint256], cnData [][]byte, m int) dbf
tx := Tx64(math.MaxInt64 - int64(sum))
res.transactions = append(preB.initialTransactions, &tx)

// Rebuild Merkle root for the new set of transations.
// Rebuild Merkle root for the new set of transactions.
txHashes := make([]crypto.Uint256, len(res.transactions))
for i := range txHashes {
txHashes[i] = res.transactions[i].Hash()
Expand Down
2 changes: 2 additions & 0 deletions internal/consensus/recovery_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
}
copy(cc.Signature[:], p.GetCommit().Signature())
m.commitPayloads = append(m.commitPayloads, cc)
default:

Check warning on line 68 in internal/consensus/recovery_message.go

View check run for this annotation

Codecov / codecov/patch

internal/consensus/recovery_message.go#L68

Added line #L68 was not covered by tests
// Other types (recoveries) can't be packed into recovery.
}
}

Expand Down
Loading