Skip to content

Commit

Permalink
linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Mar 31, 2024
1 parent 374c61d commit d3ab971
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 28 deletions.
1 change: 1 addition & 0 deletions http/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ func (s *Service) Proposal(ctx context.Context,
return response, nil
}

//nolint:nestif
func (s *Service) beaconBlockProposalFromSSZ(res *httpResponse) (*api.Response[*api.VersionedProposal], error) {
response := &api.Response[*api.VersionedProposal]{
Data: &api.VersionedProposal{
Expand Down
10 changes: 5 additions & 5 deletions spec/altair/beaconstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ type BeaconState struct {
Slot phase0.Slot
Fork *phase0.Fork
LatestBlockHeader *phase0.BeaconBlockHeader
BlockRoots []phase0.Root `ssz-size:"8192,32" dynssz-size:"SLOTS_PER_HISTORICAL_ROOT,32"`
StateRoots []phase0.Root `ssz-size:"8192,32" dynssz-size:"SLOTS_PER_HISTORICAL_ROOT,32"`
HistoricalRoots []phase0.Root `ssz-max:"16777216" ssz-size:"?,32"`
BlockRoots []phase0.Root `dynssz-size:"SLOTS_PER_HISTORICAL_ROOT,32" ssz-size:"8192,32"`
StateRoots []phase0.Root `dynssz-size:"SLOTS_PER_HISTORICAL_ROOT,32" ssz-size:"8192,32"`
HistoricalRoots []phase0.Root `ssz-max:"16777216" ssz-size:"?,32"`
ETH1Data *phase0.ETH1Data
ETH1DataVotes []*phase0.ETH1Data `ssz-max:"2048"`
ETH1DepositIndex uint64
Validators []*phase0.Validator `ssz-max:"1099511627776"`
Balances []phase0.Gwei `ssz-max:"1099511627776"`
RANDAOMixes []phase0.Root `ssz-size:"65536,32" dynssz-size:"EPOCHS_PER_HISTORICAL_VECTOR,32"`
Slashings []phase0.Gwei `ssz-size:"8192" dynssz-size:"EPOCHS_PER_SLASHINGS_VECTOR"`
RANDAOMixes []phase0.Root `dynssz-size:"EPOCHS_PER_HISTORICAL_VECTOR,32" ssz-size:"65536,32"`
Slashings []phase0.Gwei `dynssz-size:"EPOCHS_PER_SLASHINGS_VECTOR" ssz-size:"8192"`
PreviousEpochParticipation []ParticipationFlags `ssz-max:"1099511627776"`
CurrentEpochParticipation []ParticipationFlags `ssz-max:"1099511627776"`
JustificationBits bitfield.Bitvector4 `ssz-size:"1"`
Expand Down
2 changes: 1 addition & 1 deletion spec/altair/syncaggregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (

// SyncAggregate is the Ethereum 2 sync aggregate structure.
type SyncAggregate struct {
SyncCommitteeBits bitfield.Bitvector512 `ssz-size:"64" dynssz-size:"SYNC_COMMITTEE_SIZE/8"`
SyncCommitteeBits bitfield.Bitvector512 `dynssz-size:"SYNC_COMMITTEE_SIZE/8" ssz-size:"64"`
SyncCommitteeSignature phase0.BLSSignature `ssz-size:"96"`
}

Expand Down
2 changes: 1 addition & 1 deletion spec/altair/synccommittee.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

// SyncCommittee is the Ethereum 2 sync committee structure.
type SyncCommittee struct {
Pubkeys []phase0.BLSPubKey `ssz-size:"512,48" dynssz-size:"SYNC_COMMITTEE_SIZE,48"`
Pubkeys []phase0.BLSPubKey `dynssz-size:"SYNC_COMMITTEE_SIZE,48" ssz-size:"512,48"`
AggregatePubkey phase0.BLSPubKey `ssz-size:"48"`
}

Expand Down
2 changes: 1 addition & 1 deletion spec/altair/synccommitteecontribution.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type SyncCommitteeContribution struct {
BeaconBlockRoot phase0.Root `ssz-size:"32"`
SubcommitteeIndex uint64
// AggregationBits size is SYNC_COMMITTEE_SIZE // SYNC_COMMITTEE_SUBNET_COUNT
AggregationBits bitfield.Bitvector128 `ssz-size:"16" dynssz-size:"SYNC_COMMITTEE_SIZE/SYNC_COMMITTEE_SUBNET_COUNT"`
AggregationBits bitfield.Bitvector128 `dynssz-size:"SYNC_COMMITTEE_SIZE/SYNC_COMMITTEE_SUBNET_COUNT" ssz-size:"16"`
Signature phase0.BLSSignature `ssz-size:"96"`
}

Expand Down
10 changes: 5 additions & 5 deletions spec/bellatrix/beaconstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ type BeaconState struct {
Slot phase0.Slot
Fork *phase0.Fork
LatestBlockHeader *phase0.BeaconBlockHeader
BlockRoots []phase0.Root `ssz-size:"8192,32" dynssz-size:"SLOTS_PER_HISTORICAL_ROOT,32"`
StateRoots []phase0.Root `ssz-size:"8192,32" dynssz-size:"SLOTS_PER_HISTORICAL_ROOT,32"`
HistoricalRoots []phase0.Root `ssz-max:"16777216" ssz-size:"?,32"`
BlockRoots []phase0.Root `dynssz-size:"SLOTS_PER_HISTORICAL_ROOT,32" ssz-size:"8192,32"`
StateRoots []phase0.Root `dynssz-size:"SLOTS_PER_HISTORICAL_ROOT,32" ssz-size:"8192,32"`
HistoricalRoots []phase0.Root `ssz-max:"16777216" ssz-size:"?,32"`
ETH1Data *phase0.ETH1Data
ETH1DataVotes []*phase0.ETH1Data `ssz-max:"2048"`
ETH1DepositIndex uint64
Validators []*phase0.Validator `ssz-max:"1099511627776"`
Balances []phase0.Gwei `ssz-max:"1099511627776"`
RANDAOMixes []phase0.Root `ssz-size:"65536,32" dynssz-size:"EPOCHS_PER_HISTORICAL_VECTOR,32"`
Slashings []phase0.Gwei `ssz-size:"8192" dynssz-size:"EPOCHS_PER_SLASHINGS_VECTOR"`
RANDAOMixes []phase0.Root `dynssz-size:"EPOCHS_PER_HISTORICAL_VECTOR,32" ssz-size:"65536,32"`
Slashings []phase0.Gwei `dynssz-size:"EPOCHS_PER_SLASHINGS_VECTOR" ssz-size:"8192"`
PreviousEpochParticipation []altair.ParticipationFlags `ssz-max:"1099511627776"`
CurrentEpochParticipation []altair.ParticipationFlags `ssz-max:"1099511627776"`
JustificationBits bitfield.Bitvector4 `ssz-size:"1"`
Expand Down
10 changes: 5 additions & 5 deletions spec/capella/beaconstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ type BeaconState struct {
Slot phase0.Slot
Fork *phase0.Fork
LatestBlockHeader *phase0.BeaconBlockHeader
BlockRoots []phase0.Root `ssz-size:"8192,32" dynssz-size:"SLOTS_PER_HISTORICAL_ROOT,32"`
StateRoots []phase0.Root `ssz-size:"8192,32" dynssz-size:"SLOTS_PER_HISTORICAL_ROOT,32"`
HistoricalRoots []phase0.Root `ssz-max:"16777216" ssz-size:"?,32"`
BlockRoots []phase0.Root `dynssz-size:"SLOTS_PER_HISTORICAL_ROOT,32" ssz-size:"8192,32"`
StateRoots []phase0.Root `dynssz-size:"SLOTS_PER_HISTORICAL_ROOT,32" ssz-size:"8192,32"`
HistoricalRoots []phase0.Root `ssz-max:"16777216" ssz-size:"?,32"`
ETH1Data *phase0.ETH1Data
ETH1DataVotes []*phase0.ETH1Data `ssz-max:"2048"`
ETH1DepositIndex uint64
Validators []*phase0.Validator `ssz-max:"1099511627776"`
Balances []phase0.Gwei `ssz-max:"1099511627776"`
RANDAOMixes []phase0.Root `ssz-size:"65536,32" dynssz-size:"EPOCHS_PER_HISTORICAL_VECTOR,32"`
Slashings []phase0.Gwei `ssz-size:"8192" dynssz-size:"EPOCHS_PER_SLASHINGS_VECTOR"`
RANDAOMixes []phase0.Root `dynssz-size:"EPOCHS_PER_HISTORICAL_VECTOR,32" ssz-size:"65536,32"`
Slashings []phase0.Gwei `dynssz-size:"EPOCHS_PER_SLASHINGS_VECTOR" ssz-size:"8192"`
PreviousEpochParticipation []altair.ParticipationFlags `ssz-max:"1099511627776"`
CurrentEpochParticipation []altair.ParticipationFlags `ssz-max:"1099511627776"`
JustificationBits bitfield.Bitvector4 `ssz-size:"1"`
Expand Down
10 changes: 5 additions & 5 deletions spec/deneb/beaconstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ type BeaconState struct {
Slot phase0.Slot
Fork *phase0.Fork
LatestBlockHeader *phase0.BeaconBlockHeader
BlockRoots []phase0.Root `ssz-size:"8192,32" dynssz-size:"SLOTS_PER_HISTORICAL_ROOT,32"`
StateRoots []phase0.Root `ssz-size:"8192,32" dynssz-size:"SLOTS_PER_HISTORICAL_ROOT,32"`
HistoricalRoots []phase0.Root `ssz-max:"16777216" ssz-size:"?,32"`
BlockRoots []phase0.Root `dynssz-size:"SLOTS_PER_HISTORICAL_ROOT,32" ssz-size:"8192,32"`
StateRoots []phase0.Root `dynssz-size:"SLOTS_PER_HISTORICAL_ROOT,32" ssz-size:"8192,32"`
HistoricalRoots []phase0.Root `ssz-max:"16777216" ssz-size:"?,32"`
ETH1Data *phase0.ETH1Data
ETH1DataVotes []*phase0.ETH1Data `ssz-max:"2048"`
ETH1DepositIndex uint64
Validators []*phase0.Validator `ssz-max:"1099511627776"`
Balances []phase0.Gwei `ssz-max:"1099511627776"`
RANDAOMixes []phase0.Root `ssz-size:"65536,32" dynssz-size:"EPOCHS_PER_HISTORICAL_VECTOR,32"`
Slashings []phase0.Gwei `ssz-size:"8192" dynssz-size:"EPOCHS_PER_SLASHINGS_VECTOR"`
RANDAOMixes []phase0.Root `dynssz-size:"EPOCHS_PER_HISTORICAL_VECTOR,32" ssz-size:"65536,32"`
Slashings []phase0.Gwei `dynssz-size:"EPOCHS_PER_SLASHINGS_VECTOR" ssz-size:"8192"`
PreviousEpochParticipation []altair.ParticipationFlags `ssz-max:"1099511627776"`
CurrentEpochParticipation []altair.ParticipationFlags `ssz-max:"1099511627776"`
JustificationBits bitfield.Bitvector4 `ssz-size:"1"`
Expand Down
8 changes: 4 additions & 4 deletions spec/phase0/beaconstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ type BeaconState struct {
Slot Slot
Fork *Fork
LatestBlockHeader *BeaconBlockHeader
BlockRoots []Root `ssz-size:"8192,32" dynssz-size:"SLOTS_PER_HISTORICAL_ROOT,32"`
StateRoots []Root `ssz-size:"8192,32" dynssz-size:"SLOTS_PER_HISTORICAL_ROOT,32"`
BlockRoots []Root `dynssz-size:"SLOTS_PER_HISTORICAL_ROOT,32" ssz-size:"8192,32"`
StateRoots []Root `dynssz-size:"SLOTS_PER_HISTORICAL_ROOT,32" ssz-size:"8192,32"`
HistoricalRoots []Root `ssz-max:"16777216" ssz-size:"?,32"`

Check failure on line 38 in spec/phase0/beaconstate.go

View workflow job for this annotation

GitHub Actions / lint

tag is not aligned, should be: ssz-max:"16777216" ssz-size:"?,32" (tagalign)
ETH1Data *ETH1Data
ETH1DataVotes []*ETH1Data `ssz-max:"2048"`
ETH1DepositIndex uint64
Validators []*Validator `ssz-max:"1099511627776"`
Balances []Gwei `ssz-max:"1099511627776"`
RANDAOMixes []Root `ssz-size:"65536,32" dynssz-size:"EPOCHS_PER_HISTORICAL_VECTOR,32"`
Slashings []Gwei `ssz-size:"8192" dynssz-size:"EPOCHS_PER_SLASHINGS_VECTOR"`
RANDAOMixes []Root `dynssz-size:"EPOCHS_PER_HISTORICAL_VECTOR,32" ssz-size:"65536,32"`
Slashings []Gwei `dynssz-size:"EPOCHS_PER_SLASHINGS_VECTOR" ssz-size:"8192"`
PreviousEpochAttestations []*PendingAttestation `ssz-max:"4096"`
CurrentEpochAttestations []*PendingAttestation `ssz-max:"4096"`
JustificationBits bitfield.Bitvector4 `ssz-size:"1"`
Expand Down
2 changes: 1 addition & 1 deletion spec/phase0/deposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

// Deposit provides information about a deposit.
type Deposit struct {
Proof [][]byte `ssz-size:"33,32" dynssz-size:"DEPOSIT_CONTRACT_TREE_DEPTH+1,32"`
Proof [][]byte `dynssz-size:"DEPOSIT_CONTRACT_TREE_DEPTH+1,32" ssz-size:"33,32"`
Data *DepositData
}

Expand Down

0 comments on commit d3ab971

Please sign in to comment.