mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 23:48:06 -05:00
Simplify next Fork boilerplate creation. (#14761)
* Simplify next Fork boilerplate creation. * Update beacon-chain/blockchain/execution_engine.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * Update beacon-chain/blockchain/execution_engine.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * Update beacon-chain/blockchain/execution_engine.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * Update beacon-chain/state/state-native/spec_parameters.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * Update beacon-chain/state/state-native/spec_parameters.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * Update beacon-chain/state/state-native/spec_parameters.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * Update beacon-chain/state/state-native/spec_parameters.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * Fix Radek's comments. --------- Co-authored-by: Radosław Kapka <rkapka@wp.pl>
This commit is contained in:
@@ -25,90 +25,88 @@ import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
var phase0Fields = []types.FieldIndex{
|
||||
types.GenesisTime,
|
||||
types.GenesisValidatorsRoot,
|
||||
types.Slot,
|
||||
types.Fork,
|
||||
types.LatestBlockHeader,
|
||||
types.BlockRoots,
|
||||
types.StateRoots,
|
||||
types.HistoricalRoots,
|
||||
types.Eth1Data,
|
||||
types.Eth1DataVotes,
|
||||
types.Eth1DepositIndex,
|
||||
types.Validators,
|
||||
types.Balances,
|
||||
types.RandaoMixes,
|
||||
types.Slashings,
|
||||
types.PreviousEpochAttestations,
|
||||
types.CurrentEpochAttestations,
|
||||
types.JustificationBits,
|
||||
types.PreviousJustifiedCheckpoint,
|
||||
types.CurrentJustifiedCheckpoint,
|
||||
types.FinalizedCheckpoint,
|
||||
}
|
||||
var (
|
||||
phase0Fields = []types.FieldIndex{
|
||||
types.GenesisTime,
|
||||
types.GenesisValidatorsRoot,
|
||||
types.Slot,
|
||||
types.Fork,
|
||||
types.LatestBlockHeader,
|
||||
types.BlockRoots,
|
||||
types.StateRoots,
|
||||
types.HistoricalRoots,
|
||||
types.Eth1Data,
|
||||
types.Eth1DataVotes,
|
||||
types.Eth1DepositIndex,
|
||||
types.Validators,
|
||||
types.Balances,
|
||||
types.RandaoMixes,
|
||||
types.Slashings,
|
||||
types.PreviousEpochAttestations,
|
||||
types.CurrentEpochAttestations,
|
||||
types.JustificationBits,
|
||||
types.PreviousJustifiedCheckpoint,
|
||||
types.CurrentJustifiedCheckpoint,
|
||||
types.FinalizedCheckpoint,
|
||||
}
|
||||
|
||||
var altairFields = []types.FieldIndex{
|
||||
types.GenesisTime,
|
||||
types.GenesisValidatorsRoot,
|
||||
types.Slot,
|
||||
types.Fork,
|
||||
types.LatestBlockHeader,
|
||||
types.BlockRoots,
|
||||
types.StateRoots,
|
||||
types.HistoricalRoots,
|
||||
types.Eth1Data,
|
||||
types.Eth1DataVotes,
|
||||
types.Eth1DepositIndex,
|
||||
types.Validators,
|
||||
types.Balances,
|
||||
types.RandaoMixes,
|
||||
types.Slashings,
|
||||
types.PreviousEpochParticipationBits,
|
||||
types.CurrentEpochParticipationBits,
|
||||
types.JustificationBits,
|
||||
types.PreviousJustifiedCheckpoint,
|
||||
types.CurrentJustifiedCheckpoint,
|
||||
types.FinalizedCheckpoint,
|
||||
types.InactivityScores,
|
||||
types.CurrentSyncCommittee,
|
||||
types.NextSyncCommittee,
|
||||
}
|
||||
altairFields = []types.FieldIndex{
|
||||
types.GenesisTime,
|
||||
types.GenesisValidatorsRoot,
|
||||
types.Slot,
|
||||
types.Fork,
|
||||
types.LatestBlockHeader,
|
||||
types.BlockRoots,
|
||||
types.StateRoots,
|
||||
types.HistoricalRoots,
|
||||
types.Eth1Data,
|
||||
types.Eth1DataVotes,
|
||||
types.Eth1DepositIndex,
|
||||
types.Validators,
|
||||
types.Balances,
|
||||
types.RandaoMixes,
|
||||
types.Slashings,
|
||||
types.PreviousEpochParticipationBits,
|
||||
types.CurrentEpochParticipationBits,
|
||||
types.JustificationBits,
|
||||
types.PreviousJustifiedCheckpoint,
|
||||
types.CurrentJustifiedCheckpoint,
|
||||
types.FinalizedCheckpoint,
|
||||
types.InactivityScores,
|
||||
types.CurrentSyncCommittee,
|
||||
types.NextSyncCommittee,
|
||||
}
|
||||
|
||||
var bellatrixFields = append(altairFields, types.LatestExecutionPayloadHeader)
|
||||
bellatrixFields = append(altairFields, types.LatestExecutionPayloadHeader)
|
||||
|
||||
var capellaFields = append(
|
||||
altairFields,
|
||||
types.LatestExecutionPayloadHeaderCapella,
|
||||
types.NextWithdrawalIndex,
|
||||
types.NextWithdrawalValidatorIndex,
|
||||
types.HistoricalSummaries,
|
||||
)
|
||||
capellaFields = append(
|
||||
altairFields,
|
||||
types.LatestExecutionPayloadHeaderCapella,
|
||||
types.NextWithdrawalIndex,
|
||||
types.NextWithdrawalValidatorIndex,
|
||||
types.HistoricalSummaries,
|
||||
)
|
||||
|
||||
var denebFields = append(
|
||||
altairFields,
|
||||
types.LatestExecutionPayloadHeaderDeneb,
|
||||
types.NextWithdrawalIndex,
|
||||
types.NextWithdrawalValidatorIndex,
|
||||
types.HistoricalSummaries,
|
||||
)
|
||||
denebFields = append(
|
||||
altairFields,
|
||||
types.LatestExecutionPayloadHeaderDeneb,
|
||||
types.NextWithdrawalIndex,
|
||||
types.NextWithdrawalValidatorIndex,
|
||||
types.HistoricalSummaries,
|
||||
)
|
||||
|
||||
var electraFields = append(
|
||||
altairFields,
|
||||
types.LatestExecutionPayloadHeaderDeneb,
|
||||
types.NextWithdrawalIndex,
|
||||
types.NextWithdrawalValidatorIndex,
|
||||
types.HistoricalSummaries,
|
||||
types.DepositRequestsStartIndex,
|
||||
types.DepositBalanceToConsume,
|
||||
types.ExitBalanceToConsume,
|
||||
types.EarliestExitEpoch,
|
||||
types.ConsolidationBalanceToConsume,
|
||||
types.EarliestConsolidationEpoch,
|
||||
types.PendingDeposits,
|
||||
types.PendingPartialWithdrawals,
|
||||
types.PendingConsolidations,
|
||||
electraFields = append(
|
||||
denebFields,
|
||||
types.DepositRequestsStartIndex,
|
||||
types.DepositBalanceToConsume,
|
||||
types.ExitBalanceToConsume,
|
||||
types.EarliestExitEpoch,
|
||||
types.ConsolidationBalanceToConsume,
|
||||
types.EarliestConsolidationEpoch,
|
||||
types.PendingDeposits,
|
||||
types.PendingPartialWithdrawals,
|
||||
types.PendingConsolidations,
|
||||
)
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
Reference in New Issue
Block a user