From d3ab971de30cca937b06fcba8c7ccad4cee4b09b Mon Sep 17 00:00:00 2001 From: pk910 Date: Sun, 31 Mar 2024 03:51:49 +0200 Subject: [PATCH] linter fixes --- http/proposal.go | 1 + spec/altair/beaconstate.go | 10 +++++----- spec/altair/syncaggregate.go | 2 +- spec/altair/synccommittee.go | 2 +- spec/altair/synccommitteecontribution.go | 2 +- spec/bellatrix/beaconstate.go | 10 +++++----- spec/capella/beaconstate.go | 10 +++++----- spec/deneb/beaconstate.go | 10 +++++----- spec/phase0/beaconstate.go | 8 ++++---- spec/phase0/deposit.go | 2 +- 10 files changed, 29 insertions(+), 28 deletions(-) diff --git a/http/proposal.go b/http/proposal.go index 6e2435fb..3835a4df 100644 --- a/http/proposal.go +++ b/http/proposal.go @@ -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{ diff --git a/spec/altair/beaconstate.go b/spec/altair/beaconstate.go index fdbded3b..0160309a 100644 --- a/spec/altair/beaconstate.go +++ b/spec/altair/beaconstate.go @@ -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"` diff --git a/spec/altair/syncaggregate.go b/spec/altair/syncaggregate.go index cc00ef62..2844bc5c 100644 --- a/spec/altair/syncaggregate.go +++ b/spec/altair/syncaggregate.go @@ -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"` } diff --git a/spec/altair/synccommittee.go b/spec/altair/synccommittee.go index 1887d608..c0ffdfbe 100644 --- a/spec/altair/synccommittee.go +++ b/spec/altair/synccommittee.go @@ -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"` } diff --git a/spec/altair/synccommitteecontribution.go b/spec/altair/synccommitteecontribution.go index 32f482b8..ddedaafb 100644 --- a/spec/altair/synccommitteecontribution.go +++ b/spec/altair/synccommitteecontribution.go @@ -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"` } diff --git a/spec/bellatrix/beaconstate.go b/spec/bellatrix/beaconstate.go index 2a339960..203b8acc 100644 --- a/spec/bellatrix/beaconstate.go +++ b/spec/bellatrix/beaconstate.go @@ -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"` diff --git a/spec/capella/beaconstate.go b/spec/capella/beaconstate.go index 43b04f6b..f04362f5 100644 --- a/spec/capella/beaconstate.go +++ b/spec/capella/beaconstate.go @@ -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"` diff --git a/spec/deneb/beaconstate.go b/spec/deneb/beaconstate.go index cfa0e148..b7c41714 100644 --- a/spec/deneb/beaconstate.go +++ b/spec/deneb/beaconstate.go @@ -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"` diff --git a/spec/phase0/beaconstate.go b/spec/phase0/beaconstate.go index 07c559f2..49098ce2 100644 --- a/spec/phase0/beaconstate.go +++ b/spec/phase0/beaconstate.go @@ -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"` 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"` diff --git a/spec/phase0/deposit.go b/spec/phase0/deposit.go index fb1e6c8b..deb3bd25 100644 --- a/spec/phase0/deposit.go +++ b/spec/phase0/deposit.go @@ -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 }