Skip to content

Commit

Permalink
increase lint max line-length (berachain#2178)
Browse files Browse the repository at this point in the history
  • Loading branch information
fridrik01 authored Dec 12, 2024
1 parent 36f1a04 commit 21f3fc1
Show file tree
Hide file tree
Showing 44 changed files with 6 additions and 121 deletions.
4 changes: 2 additions & 2 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ linters-settings:
# even if all enum members are not listed.
# Default: false
default-signifies-exhaustive: true

exhaustruct:
# List of regular expressions to exclude struct packages and their names from checks.
# Regular expressions must match complete canonical struct package/name/structname.
Expand Down Expand Up @@ -147,7 +147,7 @@ linters-settings:
# Max line length, lines longer will be reported.
# '\t' is counted as 1 character by default, and can be changed with the tab-width option.
# Default: 120.
line-length: 80
line-length: 140
# Tab width in spaces.
# Default: 1
tab-width: 1
Expand Down
2 changes: 0 additions & 2 deletions beacon/validator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ const (
)

// Config is the validator configuration.
//
//nolint:lll // struct tags.
type Config struct {
// Graffiti is the string that will be included in the
// graffiti field of the beacon block.
Expand Down
2 changes: 0 additions & 2 deletions chain-spec/chain/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
package chain

// SpecData is the underlying data structure for chain-specific parameters.
//
//nolint:lll // struct tags may create long lines.
type SpecData[
DomainTypeT ~[4]byte,
EpochT ~uint64,
Expand Down
1 change: 0 additions & 1 deletion cli/commands/server/rollback.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func NewRollbackCmd[
) *cobra.Command {
var removeBlock bool

//nolint:lll // its okay.
cmd := &cobra.Command{
Use: "rollback",
Short: "rollback Cosmos SDK and CometBFT state by one height",
Expand Down
3 changes: 0 additions & 3 deletions cli/commands/server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ func StartCmdWithOptions[
appCreator types.AppCreator[T, LoggerT],
opts StartCmdOptions[T],
) *cobra.Command {
//nolint:lll // its okay.
cmd := &cobra.Command{
Use: "start",
Short: "Run the node",
Expand Down Expand Up @@ -130,8 +129,6 @@ custom: allow pruning options to be manually specified through 'pruning-keep-rec
}

// addStartNodeFlags should be added to any CLI commands that start the network.
//
//nolint:lll // todo fix.
func addStartNodeFlags[
T interface {
Start(context.Context) error
Expand Down
1 change: 0 additions & 1 deletion config/spec/special_cases.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import "math"
const (
BartioChainID = TestnetEth1ChainID

//nolint:lll // temporary.
BartioValRoot = "0x9147586693b6e8faa837715c0f3071c2000045b54233901c2e7871b15872bc43"
)

Expand Down
5 changes: 2 additions & 3 deletions config/template/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

package template

//nolint:lll // template.
const TomlTemplate = `
###############################################################################
### BeaconKit ###
Expand Down Expand Up @@ -49,7 +48,7 @@ jwt-secret-path = "{{.BeaconKit.Engine.JWTSecretPath}}"
# TimeFormat is a string that defines the format of the time in the logger.
time-format = "{{.BeaconKit.Logger.TimeFormat}}"
# LogLevel is the level of logging. Logger will log messages with verbosity up
# LogLevel is the level of logging. Logger will log messages with verbosity up
# to LogLevel.
log-level = "{{.BeaconKit.Logger.LogLevel}}"
Expand All @@ -68,7 +67,7 @@ implementation = "{{.BeaconKit.KZG.Implementation}}"
# Enabled determines if the local payload builder is enabled.
enabled = {{ .BeaconKit.PayloadBuilder.Enabled }}
# Post bellatrix, this address will receive the transaction fees produced by any blocks
# Post bellatrix, this address will receive the transaction fees produced by any blocks
# from this node.
suggested-fee-recipient = "{{.BeaconKit.PayloadBuilder.SuggestedFeeRecipient}}"
Expand Down
2 changes: 0 additions & 2 deletions consensus-types/types/deposit_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ import (
// DepositMessage represents a deposit message as defined in the Ethereum 2.0
// specification.
// https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#depositmessage
//
//nolint:lll
type DepositMessage struct {
// Public key of the validator specified in the deposit.
Pubkey crypto.BLSPubkey `json:"pubkey"`
Expand Down
2 changes: 0 additions & 2 deletions consensus-types/types/fork.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ var (

// Fork as defined in the Ethereum 2.0 specification:
// https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#fork
//
//nolint:lll
type Fork struct {
// PreviousVersion is the last version before the fork.
PreviousVersion common.Version `json:"previous_version"`
Expand Down
4 changes: 0 additions & 4 deletions consensus-types/types/fork_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ import (

// ForkData as defined in the Ethereum 2.0 specification:
// https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#forkdata
//
//nolint:lll
type ForkData struct {
// CurrentVersion is the current version of the fork.
CurrentVersion common.Version
Expand Down Expand Up @@ -94,8 +92,6 @@ func (fd *ForkData) UnmarshalSSZ(buf []byte) error {

// ComputeDomain as defined in the Ethereum 2.0 specification.
// https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#compute_domain
//
//nolint:lll
func (fd *ForkData) ComputeDomain(
domainType common.DomainType,
) common.Domain {
Expand Down
2 changes: 0 additions & 2 deletions consensus-types/types/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ const (

// Genesis is a struct that contains the genesis information
// need to start the beacon chain.
//
//nolint:lll
type Genesis[
DepositT any,
ExecutionPayloadHeaderT interface {
Expand Down
1 change: 0 additions & 1 deletion consensus-types/types/payload_header_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ func TestExecutionPayloadHeader_Empty(t *testing.T) {
require.Equal(t, version.Deneb, emptyHeader.Version())
}

//nolint:lll
func TestExecutablePayloadHeaderDeneb_UnmarshalJSON_Error(t *testing.T) {
original := generateExecutionPayloadHeader()
validJSON, err := original.MarshalJSON()
Expand Down
4 changes: 0 additions & 4 deletions consensus-types/types/signing_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ import (

// SigningData as defined in the Ethereum 2.0 specification.
// https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#signingdata
//
//nolint:lll // link.
type SigningData struct {
// ObjectRoot is the hash tree root of the object being signed.
ObjectRoot common.Root
Expand Down Expand Up @@ -79,8 +77,6 @@ func (s *SigningData) UnmarshalSSZ(buf []byte) error {

// ComputeSigningRoot as defined in the Ethereum 2.0 specification.
// https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#compute_signing_root
//
//nolint:lll // link.
func ComputeSigningRoot(
sszObject interface{ HashTreeRoot() common.Root },
domain common.Domain,
Expand Down
18 changes: 0 additions & 18 deletions consensus-types/types/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ var (

// Validator as defined in the Ethereum 2.0 Spec
// https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator
//
//nolint:lll
type Validator struct {
// Pubkey is the validator's 48-byte BLS public key.
Pubkey crypto.BLSPubkey `json:"pubkey"`
Expand Down Expand Up @@ -72,8 +70,6 @@ type Validator struct {
//
// As defined in the Ethereum 2.0 specification:
// https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#deposits
//
//nolint:lll
func NewValidatorFromDeposit(
pubkey crypto.BLSPubkey,
withdrawalCredentials WithdrawalCredentials,
Expand Down Expand Up @@ -236,16 +232,12 @@ func (v *Validator) GetEffectiveBalance() math.Gwei {

// IsActive as defined in the Ethereum 2.0 Spec
// https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#is_active_validator
//
//nolint:lll
func (v Validator) IsActive(epoch math.Epoch) bool {
return v.ActivationEpoch <= epoch && epoch < v.ExitEpoch
}

// IsEligibleForActivation as defined in the Ethereum 2.0 Spec
// https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#is_eligible_for_activation_queue
//
//nolint:lll
func (v Validator) IsEligibleForActivation(finalizedEpoch math.Epoch) bool {
return v.ActivationEligibilityEpoch <= finalizedEpoch &&
v.ActivationEpoch == math.Epoch(constants.FarFutureEpoch)
Expand All @@ -254,8 +246,6 @@ func (v Validator) IsEligibleForActivation(finalizedEpoch math.Epoch) bool {
// IsEligibleForActivationQueue is defined slightly differently from Ethereum
// 2.0 Spec
// https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#is_eligible_for_activation_queue
//
//nolint:lll
func (v Validator) IsEligibleForActivationQueue(threshold math.Gwei) bool {
return v.ActivationEligibilityEpoch == math.Epoch(
constants.FarFutureEpoch,
Expand All @@ -265,8 +255,6 @@ func (v Validator) IsEligibleForActivationQueue(threshold math.Gwei) bool {

// IsSlashable as defined in the Ethereum 2.0 Spec
// https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#is_slashable_validator
//
//nolint:lll
func (v Validator) IsSlashable(epoch math.Epoch) bool {
return !v.Slashed && v.ActivationEpoch <= epoch &&
epoch < v.WithdrawableEpoch
Expand All @@ -279,8 +267,6 @@ func (v Validator) IsSlashed() bool {

// IsFullyWithdrawable as defined in the Ethereum 2.0 specification:
// https://github.com/ethereum/consensus-specs/blob/dev/specs/capella/beacon-chain.md#is_fully_withdrawable_validator
//
//nolint:lll
func (v Validator) IsFullyWithdrawable(
balance math.Gwei,
epoch math.Epoch,
Expand All @@ -291,8 +277,6 @@ func (v Validator) IsFullyWithdrawable(

// IsPartiallyWithdrawable as defined in the Ethereum 2.0 specification:
// https://github.com/ethereum/consensus-specs/blob/dev/specs/capella/beacon-chain.md#is_partially_withdrawable_validator
//
//nolint:lll
func (v Validator) IsPartiallyWithdrawable(
balance, maxEffectiveBalance math.Gwei,
) bool {
Expand All @@ -303,8 +287,6 @@ func (v Validator) IsPartiallyWithdrawable(

// HasEth1WithdrawalCredentials as defined in the Ethereum 2.0 specification:
// https://github.com/ethereum/consensus-specs/blob/dev/specs/capella/beacon-chain.md#has_eth1_withdrawal_credential
//
//nolint:lll
func (v Validator) HasEth1WithdrawalCredentials() bool {
return v.WithdrawalCredentials[0] == EthSecp256k1CredentialPrefix
}
Expand Down
2 changes: 0 additions & 2 deletions da/kzg/ckzg/ckzg_no_cgo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ func TestVerifyBlobKZGProof(t *testing.T) {
require.Error(
t,
err,
//nolint:lll
"github.com/ethereum/c-kzg-4844 requires an executable built with CGO_ENABLED=1",
)
} else {
Expand Down Expand Up @@ -119,7 +118,6 @@ func TestVerifyBlobProofBatch(t *testing.T) {
}

err = globalVerifier.VerifyBlobProofBatch(args)
//nolint:lll
require.Error(
t,
err,
Expand Down
2 changes: 0 additions & 2 deletions da/types/sidecar.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ import (

// BlobSidecar as per the Ethereum 2.0 specification:
// https://github.com/ethereum/consensus-specs/blob/dev/specs/deneb/p2p-interface.md?ref=bankless.ghost.io#blobsidecar
//
//nolint:lll
type BlobSidecar struct {
// Index represents the index of the blob in the block.
Index uint64
Expand Down
6 changes: 0 additions & 6 deletions engine-primitives/engine-primitives/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ var (

// ForkchoiceResponseV1 as per the EngineAPI Specification:
// https://github.com/ethereum/execution-apis/blob/main/src/engine/paris.md#response-2
//
//nolint:lll // link.
type ForkchoiceResponseV1 struct {
// PayloadStatus is the payload status.
PayloadStatus PayloadStatusV1 `json:"payloadStatus"`
Expand All @@ -69,8 +67,6 @@ type ForkchoiceResponseV1 struct {

// ForkchoiceStateV1 as per the EngineAPI Specification:
// https://github.com/ethereum/execution-apis/blob/main/src/engine/paris.md#forkchoicestatev1
//
//nolint:lll // link.
type ForkchoiceStateV1 struct {
// HeadBlockHash is the desired block hash of the head of the canonical
// chain.
Expand All @@ -88,8 +84,6 @@ type ForkchoiceStateV1 struct {
// PayloadStatusV1 represents the status of a payload as per the EngineAPI
// Specification. For more details, see:
// https://github.com/ethereum/execution-apis/blob/main/src/engine/paris.md#payloadstatusv1
//
//nolint:lll // link.
type PayloadStatusV1 struct {
// Status string of the payload.
Status string `json:"status"`
Expand Down
4 changes: 0 additions & 4 deletions engine-primitives/engine-primitives/requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ import (

// NewPayloadRequest as per the Ethereum 2.0 specification:
// https://github.com/ethereum/consensus-specs/blob/dev/specs/deneb/beacon-chain.md#modified-newpayloadrequest
//
//nolint:lll
type NewPayloadRequest[
ExecutionPayloadT interface {
constraints.ForkTyped[ExecutionPayloadT]
Expand Down Expand Up @@ -126,8 +124,6 @@ func BuildNewPayloadRequest[
// As per the Ethereum 2.0 specification:
// https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.2/specs/deneb/beacon-chain.md#is_valid_block_hash
// https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.2/specs/deneb/beacon-chain.md#is_valid_versioned_hashes
//
//nolint:lll
func (n *NewPayloadRequest[ExecutionPayloadT, WithdrawalsT]) HasValidVersionedAndBlockHashes() error {
var (
blobHashes = make([]gethprimitives.ExecutionHash, 0)
Expand Down
2 changes: 0 additions & 2 deletions execution/client/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ func DefaultConfig() Config {
}

// Config is the configuration struct for the execution client.
//
//nolint:lll // struct tags.
type Config struct {
// RPCDialURL is the HTTP url of the execution client JSON-RPC endpoint.
RPCDialURL *url.ConnectionURL `mapstructure:"rpc-dial-url"`
Expand Down
2 changes: 0 additions & 2 deletions execution/client/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ import (

// ErrUnauthenticatedConnection indicates that the connection is not
// authenticated.
//
//nolint:lll
const (
UnauthenticatedConnectionErrorStr = `could not verify execution chain ID as your
connection is not authenticated. If connecting to your execution client via HTTP, you
Expand Down
6 changes: 0 additions & 6 deletions node-api/handlers/beacon/types/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,26 +89,20 @@ type GetBlockHeaderRequest struct {
types.BlockIDRequest
}

// TODO: body is big
//
//nolint:lll // tags get long
type PostBlindedBlocksV1Request struct {
EthConsensusVersion string `json:"eth_consensus_version" validate:"required,eth_consensus_version"`
}

//nolint:lll // tags get long
type PostBlindedBlocksV2Request struct {
PostBlindedBlocksV1Request
BroadcastValidation string `json:"broadcast_validation" validate:"required,broadcast_validation"`
}

//nolint:lll // tags get long
type PostBlocksV1Request[BeaconBlockT any] struct {
EthConsensusVersion string `json:"eth_consensus_version" validate:"required,eth_consensus_version"`
BeaconBlock BeaconBlockT `json:"beacon_block"`
}

//nolint:lll // tags get long
type PostBlocksV2Request[BeaconBlockT any] struct {
PostBlocksV1Request[BeaconBlockT]
BroadcastValidation string `json:"broadcast_validation" validate:"required,broadcast_validation"`
Expand Down
2 changes: 0 additions & 2 deletions payload/builder/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ const (
)

// Config is the configuration for the payload builder.
//
//nolint:lll // struct tags.
type Config struct {
// Enabled determines if the local builder is enabled.
Enabled bool `mapstructure:"enabled"`
Expand Down
1 change: 0 additions & 1 deletion primitives/bytes/b32_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
// TITLE.

//nolint:lll // long strings.
package bytes_test

import (
Expand Down
1 change: 0 additions & 1 deletion primitives/bytes/b48_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
// TITLE.

//nolint:lll // long strings.
package bytes_test

import (
Expand Down
Loading

0 comments on commit 21f3fc1

Please sign in to comment.