Compare commits

..

5 Commits

Author SHA1 Message Date
nisdas
6a8ac948a2 Preston's Review 2024-05-28 21:40:19 +08:00
nisdas
7a9a026cef Add Flag To Configure Dials 2024-05-28 20:49:32 +08:00
nisdas
f52c29489d Slow Down Lookups 2024-05-27 17:12:25 +08:00
nisdas
3c6ea738f4 Handle backoff in Iterator 2024-05-23 19:07:19 +08:00
nisdas
4ce1261197 Fix Excessive Subnet Dials 2024-05-21 21:18:14 +08:00
87 changed files with 2758 additions and 13738 deletions

View File

@@ -31,7 +31,6 @@ type GetForkChoiceDumpResponse struct {
type ForkChoiceDumpExtraData struct {
UnrealizedJustifiedCheckpoint *Checkpoint `json:"unrealized_justified_checkpoint"`
UnrealizedFinalizedCheckpoint *Checkpoint `json:"unrealized_finalized_checkpoint"`
SafeHeadRoot string `json:"safe_head_root"`
ProposerBoostRoot string `json:"proposer_boost_root"`
PreviousProposerBoostRoot string `json:"previous_proposer_boost_root"`
HeadRoot string `json:"head_root"`

View File

@@ -41,7 +41,6 @@ type ForkchoiceFetcher interface {
Ancestor(context.Context, []byte, primitives.Slot) ([]byte, error)
CachedHeadRoot() [32]byte
GetProposerHead() [32]byte
SafeHeadPayloadBlockHash() [32]byte
SetForkChoiceGenesisTime(uint64)
UpdateHead(context.Context, primitives.Slot)
HighestReceivedBlockSlot() primitives.Slot

View File

@@ -93,13 +93,6 @@ func (s *Service) UnrealizedJustifiedPayloadBlockHash() [32]byte {
return s.cfg.ForkChoiceStore.UnrealizedJustifiedPayloadBlockHash()
}
// SafeHeadPayloadBlockHash returns safe head payload block hash from forkchoice.
func (s *Service) SafeHeadPayloadBlockHash() [32]byte {
s.cfg.ForkChoiceStore.RLock()
defer s.cfg.ForkChoiceStore.RUnlock()
return s.cfg.ForkChoiceStore.SafeHeadPayloadBlockHash()
}
// FinalizedBlockHash returns finalized payload block hash from forkchoice.
func (s *Service) FinalizedBlockHash() [32]byte {
s.cfg.ForkChoiceStore.RLock()

View File

@@ -63,15 +63,10 @@ func (s *Service) notifyForkchoiceUpdate(ctx context.Context, arg *fcuConfig) (*
return nil, nil
}
finalizedHash := s.cfg.ForkChoiceStore.FinalizedPayloadBlockHash()
safeBlockHash := [32]byte{}
if features.Get().SafeHeadFCU {
safeBlockHash = s.cfg.ForkChoiceStore.SafeHeadPayloadBlockHash()
} else {
safeBlockHash = s.cfg.ForkChoiceStore.UnrealizedJustifiedPayloadBlockHash()
}
justifiedHash := s.cfg.ForkChoiceStore.UnrealizedJustifiedPayloadBlockHash()
fcs := &enginev1.ForkchoiceState{
HeadBlockHash: headPayload.BlockHash(),
SafeBlockHash: safeBlockHash[:],
SafeBlockHash: justifiedHash[:],
FinalizedBlockHash: finalizedHash[:],
}
if arg.attributes == nil {

View File

@@ -544,11 +544,6 @@ func (s *ChainService) CachedHeadRoot() [32]byte {
return [32]byte{}
}
// SafeHeadPayloadBlockHash mocks the same method in the chain service
func (s *ChainService) SafeHeadPayloadBlockHash() [32]byte {
return [32]byte{}
}
// GetProposerHead mocks the same method in the chain service
func (s *ChainService) GetProposerHead() [32]byte {
if s.ForkChoiceStore != nil {

View File

@@ -6,7 +6,6 @@ go_library(
"active_balance.go",
"active_balance_disabled.go", # keep
"attestation_data.go",
"balance_cache_key.go",
"checkpoint_state.go",
"committee.go",
"committee_disabled.go", # keep
@@ -71,7 +70,6 @@ go_test(
"committee_fuzz_test.go",
"committee_test.go",
"payload_id_test.go",
"private_access_test.go",
"proposer_indices_test.go",
"registration_test.go",
"skip_slot_cache_test.go",
@@ -95,7 +93,6 @@ go_test(
"//testing/util:go_default_library",
"@com_github_ethereum_go_ethereum//common/hexutil:go_default_library",
"@com_github_google_gofuzz//:go_default_library",
"@com_github_hashicorp_golang_lru//:go_default_library",
"@com_github_stretchr_testify//require:go_default_library",
"@org_golang_google_protobuf//proto:go_default_library",
],

View File

@@ -3,13 +3,17 @@
package cache
import (
"encoding/binary"
"sync"
lru "github.com/hashicorp/golang-lru"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/state"
lruwrpr "github.com/prysmaticlabs/prysm/v5/cache/lru"
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
)
const (
@@ -82,3 +86,36 @@ func (c *BalanceCache) Get(st state.ReadOnlyBeaconState) (uint64, error) {
balanceCacheHit.Inc()
return value.(uint64), nil
}
// Given input state `st`, balance key is constructed as:
// (block_root in `st` at epoch_start_slot - 1) + current_epoch + validator_count
func balanceCacheKey(st state.ReadOnlyBeaconState) (string, error) {
slotsPerEpoch := params.BeaconConfig().SlotsPerEpoch
currentEpoch := st.Slot().DivSlot(slotsPerEpoch)
epochStartSlot, err := slotsPerEpoch.SafeMul(uint64(currentEpoch))
if err != nil {
// impossible condition due to early division
return "", errors.Errorf("start slot calculation overflows: %v", err)
}
prevSlot := primitives.Slot(0)
if epochStartSlot > 1 {
prevSlot = epochStartSlot - 1
}
r, err := st.BlockRootAtIndex(uint64(prevSlot % params.BeaconConfig().SlotsPerHistoricalRoot))
if err != nil {
// impossible condition because index is always constrained within state
return "", err
}
// Mix in current epoch
b := make([]byte, 8)
binary.LittleEndian.PutUint64(b, uint64(currentEpoch))
key := append(r, b...)
// Mix in validator count
b = make([]byte, 8)
binary.LittleEndian.PutUint64(b, uint64(st.NumValidators()))
key = append(key, b...)
return string(key), nil
}

View File

@@ -1,13 +1,12 @@
//go:build !fuzz
package cache_test
package cache
import (
"encoding/binary"
"math"
"testing"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/cache"
state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native"
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
@@ -28,33 +27,33 @@ func TestBalanceCache_AddGetBalance(t *testing.T) {
st, err := state_native.InitializeFromProtoPhase0(raw)
require.NoError(t, err)
cc := cache.NewEffectiveBalanceCache()
_, err = cc.Get(st)
require.ErrorContains(t, cache.ErrNotFound.Error(), err)
cache := NewEffectiveBalanceCache()
_, err = cache.Get(st)
require.ErrorContains(t, ErrNotFound.Error(), err)
b := uint64(100)
require.NoError(t, cc.AddTotalEffectiveBalance(st, b))
cachedB, err := cc.Get(st)
require.NoError(t, cache.AddTotalEffectiveBalance(st, b))
cachedB, err := cache.Get(st)
require.NoError(t, err)
require.Equal(t, b, cachedB)
require.NoError(t, st.SetSlot(1000))
_, err = cc.Get(st)
require.ErrorContains(t, cache.ErrNotFound.Error(), err)
_, err = cache.Get(st)
require.ErrorContains(t, ErrNotFound.Error(), err)
b = uint64(200)
require.NoError(t, cc.AddTotalEffectiveBalance(st, b))
cachedB, err = cc.Get(st)
require.NoError(t, cache.AddTotalEffectiveBalance(st, b))
cachedB, err = cache.Get(st)
require.NoError(t, err)
require.Equal(t, b, cachedB)
require.NoError(t, st.SetSlot(1000+params.BeaconConfig().SlotsPerHistoricalRoot))
_, err = cc.Get(st)
require.ErrorContains(t, cache.ErrNotFound.Error(), err)
_, err = cache.Get(st)
require.ErrorContains(t, ErrNotFound.Error(), err)
b = uint64(300)
require.NoError(t, cc.AddTotalEffectiveBalance(st, b))
cachedB, err = cc.Get(st)
require.NoError(t, cache.AddTotalEffectiveBalance(st, b))
cachedB, err = cache.Get(st)
require.NoError(t, err)
require.Equal(t, b, cachedB)
}
@@ -73,6 +72,6 @@ func TestBalanceCache_BalanceKey(t *testing.T) {
require.NoError(t, err)
require.NoError(t, st.SetSlot(primitives.Slot(math.MaxUint64)))
_, err = cache.BalanceCacheKey(st)
_, err = balanceCacheKey(st)
require.NoError(t, err)
}

View File

@@ -1,43 +0,0 @@
package cache
import (
"encoding/binary"
"fmt"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/state"
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
)
// Given input state `st`, balance key is constructed as:
// (block_root in `st` at epoch_start_slot - 1) + current_epoch + validator_count
func balanceCacheKey(st state.ReadOnlyBeaconState) (string, error) {
slotsPerEpoch := params.BeaconConfig().SlotsPerEpoch
currentEpoch := st.Slot().DivSlot(slotsPerEpoch)
epochStartSlot, err := slotsPerEpoch.SafeMul(uint64(currentEpoch))
if err != nil {
// impossible condition due to early division
return "", fmt.Errorf("start slot calculation overflows: %w", err)
}
prevSlot := primitives.Slot(0)
if epochStartSlot > 1 {
prevSlot = epochStartSlot - 1
}
r, err := st.BlockRootAtIndex(uint64(prevSlot % params.BeaconConfig().SlotsPerHistoricalRoot))
if err != nil {
// impossible condition because index is always constrained within state
return "", err
}
// Mix in current epoch
b := make([]byte, 8)
binary.LittleEndian.PutUint64(b, uint64(currentEpoch))
key := append(r, b...)
// Mix in validator count
b = make([]byte, 8)
binary.LittleEndian.PutUint64(b, uint64(st.NumValidators()))
key = append(key, b...)
return string(key), nil
}

View File

@@ -1,9 +1,8 @@
package cache_test
package cache
import (
"testing"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/cache"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/state"
state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native"
"github.com/prysmaticlabs/prysm/v5/config/params"
@@ -16,7 +15,7 @@ import (
)
func TestCheckpointStateCache_StateByCheckpoint(t *testing.T) {
cache := cache.NewCheckpointStateCache()
cache := NewCheckpointStateCache()
cp1 := &ethpb.Checkpoint{Epoch: 1, Root: bytesutil.PadTo([]byte{'A'}, 32)}
st, err := state_native.InitializeFromProtoPhase0(&ethpb.BeaconState{
@@ -59,16 +58,16 @@ func TestCheckpointStateCache_StateByCheckpoint(t *testing.T) {
}
func TestCheckpointStateCache_MaxSize(t *testing.T) {
c := cache.NewCheckpointStateCache()
c := NewCheckpointStateCache()
st, err := state_native.InitializeFromProtoPhase0(&ethpb.BeaconState{
Slot: 0,
})
require.NoError(t, err)
for i := uint64(0); i < uint64(cache.MaxCheckpointStateSize()+100); i++ {
for i := uint64(0); i < uint64(maxCheckpointStateSize+100); i++ {
require.NoError(t, st.SetSlot(primitives.Slot(i)))
require.NoError(t, c.AddCheckpointState(&ethpb.Checkpoint{Epoch: primitives.Epoch(i), Root: make([]byte, 32)}, st))
}
assert.Equal(t, cache.MaxCheckpointStateSize(), len(c.Cache().Keys()))
assert.Equal(t, maxCheckpointStateSize, len(c.cache.Keys()))
}

View File

@@ -1,18 +0,0 @@
package cache
import (
lru "github.com/hashicorp/golang-lru"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/state"
)
func BalanceCacheKey(st state.ReadOnlyBeaconState) (string, error) {
return balanceCacheKey(st)
}
func MaxCheckpointStateSize() int {
return maxCheckpointStateSize
}
func (c *CheckpointStateCache) Cache() *lru.Cache {
return c.cache
}

View File

@@ -1,9 +1,8 @@
package cache_test
package cache
import (
"testing"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/cache"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/state"
state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native"
"github.com/prysmaticlabs/prysm/v5/config/params"
@@ -126,7 +125,7 @@ func TestSyncCommitteeHeadState(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
c := cache.NewSyncCommitteeHeadState()
c := NewSyncCommitteeHeadState()
if tt.put != nil {
err := c.Put(tt.put.slot, tt.put.state)
if (err != nil) != tt.wantPutErr {

View File

@@ -250,12 +250,12 @@ func TestProcessBlindWithdrawals(t *testing.T) {
maxEffectiveBalance := params.BeaconConfig().MaxEffectiveBalance
type args struct {
Name string
NextWithdrawalValidatorIndex primitives.ValidatorIndex
NextWithdrawalIndex uint64
FullWithdrawalIndices []primitives.ValidatorIndex
PendingPartialWithdrawalIndices []primitives.ValidatorIndex
Withdrawals []*enginev1.Withdrawal
Name string
NextWithdrawalValidatorIndex primitives.ValidatorIndex
NextWithdrawalIndex uint64
FullWithdrawalIndices []primitives.ValidatorIndex
PartialWithdrawalIndices []primitives.ValidatorIndex
Withdrawals []*enginev1.Withdrawal
}
type control struct {
NextWithdrawalValidatorIndex primitives.ValidatorIndex
@@ -283,7 +283,7 @@ func TestProcessBlindWithdrawals(t *testing.T) {
Amount: withdrawalAmount(i),
}
}
PendingPartialWithdrawal := func(i primitives.ValidatorIndex, idx uint64) *enginev1.Withdrawal {
partialWithdrawal := func(i primitives.ValidatorIndex, idx uint64) *enginev1.Withdrawal {
return &enginev1.Withdrawal{
Index: idx,
ValidatorIndex: i,
@@ -321,12 +321,12 @@ func TestProcessBlindWithdrawals(t *testing.T) {
},
{
Args: args{
Name: "success one partial withdrawal",
NextWithdrawalIndex: 21,
NextWithdrawalValidatorIndex: 120,
PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{7},
Name: "success one partial withdrawal",
NextWithdrawalIndex: 21,
NextWithdrawalValidatorIndex: 120,
PartialWithdrawalIndices: []primitives.ValidatorIndex{7},
Withdrawals: []*enginev1.Withdrawal{
PendingPartialWithdrawal(7, 21),
partialWithdrawal(7, 21),
},
},
Control: control{
@@ -386,12 +386,12 @@ func TestProcessBlindWithdrawals(t *testing.T) {
},
{
Args: args{
Name: "success many partial withdrawals",
NextWithdrawalIndex: 22,
NextWithdrawalValidatorIndex: 4,
PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{7, 19, 28},
Name: "success many partial withdrawals",
NextWithdrawalIndex: 22,
NextWithdrawalValidatorIndex: 4,
PartialWithdrawalIndices: []primitives.ValidatorIndex{7, 19, 28},
Withdrawals: []*enginev1.Withdrawal{
PendingPartialWithdrawal(7, 22), PendingPartialWithdrawal(19, 23), PendingPartialWithdrawal(28, 24),
partialWithdrawal(7, 22), partialWithdrawal(19, 23), partialWithdrawal(28, 24),
},
},
Control: control{
@@ -406,14 +406,14 @@ func TestProcessBlindWithdrawals(t *testing.T) {
},
{
Args: args{
Name: "success many withdrawals",
NextWithdrawalIndex: 22,
NextWithdrawalValidatorIndex: 88,
FullWithdrawalIndices: []primitives.ValidatorIndex{7, 19, 28},
PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{2, 1, 89, 15},
Name: "success many withdrawals",
NextWithdrawalIndex: 22,
NextWithdrawalValidatorIndex: 88,
FullWithdrawalIndices: []primitives.ValidatorIndex{7, 19, 28},
PartialWithdrawalIndices: []primitives.ValidatorIndex{2, 1, 89, 15},
Withdrawals: []*enginev1.Withdrawal{
PendingPartialWithdrawal(89, 22), PendingPartialWithdrawal(1, 23), PendingPartialWithdrawal(2, 24),
fullWithdrawal(7, 25), PendingPartialWithdrawal(15, 26), fullWithdrawal(19, 27),
partialWithdrawal(89, 22), partialWithdrawal(1, 23), partialWithdrawal(2, 24),
fullWithdrawal(7, 25), partialWithdrawal(15, 26), fullWithdrawal(19, 27),
fullWithdrawal(28, 28),
},
},
@@ -453,17 +453,17 @@ func TestProcessBlindWithdrawals(t *testing.T) {
},
{
Args: args{
Name: "success more than max partially withdrawals",
NextWithdrawalIndex: 22,
NextWithdrawalValidatorIndex: 0,
PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{1, 2, 3, 4, 5, 6, 7, 8, 9, 21, 22, 23, 24, 25, 26, 27, 29, 35, 89},
Name: "success more than max partially withdrawals",
NextWithdrawalIndex: 22,
NextWithdrawalValidatorIndex: 0,
PartialWithdrawalIndices: []primitives.ValidatorIndex{1, 2, 3, 4, 5, 6, 7, 8, 9, 21, 22, 23, 24, 25, 26, 27, 29, 35, 89},
Withdrawals: []*enginev1.Withdrawal{
PendingPartialWithdrawal(1, 22), PendingPartialWithdrawal(2, 23), PendingPartialWithdrawal(3, 24),
PendingPartialWithdrawal(4, 25), PendingPartialWithdrawal(5, 26), PendingPartialWithdrawal(6, 27),
PendingPartialWithdrawal(7, 28), PendingPartialWithdrawal(8, 29), PendingPartialWithdrawal(9, 30),
PendingPartialWithdrawal(21, 31), PendingPartialWithdrawal(22, 32), PendingPartialWithdrawal(23, 33),
PendingPartialWithdrawal(24, 34), PendingPartialWithdrawal(25, 35), PendingPartialWithdrawal(26, 36),
PendingPartialWithdrawal(27, 37),
partialWithdrawal(1, 22), partialWithdrawal(2, 23), partialWithdrawal(3, 24),
partialWithdrawal(4, 25), partialWithdrawal(5, 26), partialWithdrawal(6, 27),
partialWithdrawal(7, 28), partialWithdrawal(8, 29), partialWithdrawal(9, 30),
partialWithdrawal(21, 31), partialWithdrawal(22, 32), partialWithdrawal(23, 33),
partialWithdrawal(24, 34), partialWithdrawal(25, 35), partialWithdrawal(26, 36),
partialWithdrawal(27, 37),
},
},
Control: control{
@@ -491,12 +491,12 @@ func TestProcessBlindWithdrawals(t *testing.T) {
},
{
Args: args{
Name: "failure wrong number of partial withdrawal",
NextWithdrawalIndex: 21,
NextWithdrawalValidatorIndex: 37,
PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{7},
Name: "failure wrong number of partial withdrawal",
NextWithdrawalIndex: 21,
NextWithdrawalValidatorIndex: 37,
PartialWithdrawalIndices: []primitives.ValidatorIndex{7},
Withdrawals: []*enginev1.Withdrawal{
PendingPartialWithdrawal(7, 21), PendingPartialWithdrawal(9, 22),
partialWithdrawal(7, 21), partialWithdrawal(9, 22),
},
},
Control: control{
@@ -540,7 +540,7 @@ func TestProcessBlindWithdrawals(t *testing.T) {
NextWithdrawalValidatorIndex: 4,
FullWithdrawalIndices: []primitives.ValidatorIndex{7, 19, 28, 1},
Withdrawals: []*enginev1.Withdrawal{
fullWithdrawal(7, 22), fullWithdrawal(19, 23), PendingPartialWithdrawal(28, 24),
fullWithdrawal(7, 22), fullWithdrawal(19, 23), partialWithdrawal(28, 24),
fullWithdrawal(1, 25),
},
},
@@ -564,10 +564,10 @@ func TestProcessBlindWithdrawals(t *testing.T) {
},
{
Args: args{
Name: "failure validator not partially withdrawable",
NextWithdrawalIndex: 22,
NextWithdrawalValidatorIndex: 4,
PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{notPartiallyWithdrawable},
Name: "failure validator not partially withdrawable",
NextWithdrawalIndex: 22,
NextWithdrawalValidatorIndex: 4,
PartialWithdrawalIndices: []primitives.ValidatorIndex{notPartiallyWithdrawable},
Withdrawals: []*enginev1.Withdrawal{
fullWithdrawal(notPartiallyWithdrawable, 22),
},
@@ -611,7 +611,7 @@ func TestProcessBlindWithdrawals(t *testing.T) {
st.Balances[idx] = withdrawalAmount(idx)
validators[idx].WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte
}
for _, idx := range arguments.PendingPartialWithdrawalIndices {
for _, idx := range arguments.PartialWithdrawalIndices {
validators[idx].WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte
st.Balances[idx] = withdrawalAmount(idx)
}
@@ -629,8 +629,8 @@ func TestProcessBlindWithdrawals(t *testing.T) {
if test.Args.FullWithdrawalIndices == nil {
test.Args.FullWithdrawalIndices = make([]primitives.ValidatorIndex, 0)
}
if test.Args.PendingPartialWithdrawalIndices == nil {
test.Args.PendingPartialWithdrawalIndices = make([]primitives.ValidatorIndex, 0)
if test.Args.PartialWithdrawalIndices == nil {
test.Args.PartialWithdrawalIndices = make([]primitives.ValidatorIndex, 0)
}
slot, err := slots.EpochStart(currentEpoch)
require.NoError(t, err)
@@ -673,12 +673,12 @@ func TestProcessWithdrawals(t *testing.T) {
maxEffectiveBalance := params.BeaconConfig().MaxEffectiveBalance
type args struct {
Name string
NextWithdrawalValidatorIndex primitives.ValidatorIndex
NextWithdrawalIndex uint64
FullWithdrawalIndices []primitives.ValidatorIndex
PendingPartialWithdrawalIndices []primitives.ValidatorIndex
Withdrawals []*enginev1.Withdrawal
Name string
NextWithdrawalValidatorIndex primitives.ValidatorIndex
NextWithdrawalIndex uint64
FullWithdrawalIndices []primitives.ValidatorIndex
PartialWithdrawalIndices []primitives.ValidatorIndex
Withdrawals []*enginev1.Withdrawal
}
type control struct {
NextWithdrawalValidatorIndex primitives.ValidatorIndex
@@ -706,7 +706,7 @@ func TestProcessWithdrawals(t *testing.T) {
Amount: withdrawalAmount(i),
}
}
PendingPartialWithdrawal := func(i primitives.ValidatorIndex, idx uint64) *enginev1.Withdrawal {
partialWithdrawal := func(i primitives.ValidatorIndex, idx uint64) *enginev1.Withdrawal {
return &enginev1.Withdrawal{
Index: idx,
ValidatorIndex: i,
@@ -744,12 +744,12 @@ func TestProcessWithdrawals(t *testing.T) {
},
{
Args: args{
Name: "success one partial withdrawal",
NextWithdrawalIndex: 21,
NextWithdrawalValidatorIndex: 120,
PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{7},
Name: "success one partial withdrawal",
NextWithdrawalIndex: 21,
NextWithdrawalValidatorIndex: 120,
PartialWithdrawalIndices: []primitives.ValidatorIndex{7},
Withdrawals: []*enginev1.Withdrawal{
PendingPartialWithdrawal(7, 21),
partialWithdrawal(7, 21),
},
},
Control: control{
@@ -809,12 +809,12 @@ func TestProcessWithdrawals(t *testing.T) {
},
{
Args: args{
Name: "success many partial withdrawals",
NextWithdrawalIndex: 22,
NextWithdrawalValidatorIndex: 4,
PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{7, 19, 28},
Name: "success many partial withdrawals",
NextWithdrawalIndex: 22,
NextWithdrawalValidatorIndex: 4,
PartialWithdrawalIndices: []primitives.ValidatorIndex{7, 19, 28},
Withdrawals: []*enginev1.Withdrawal{
PendingPartialWithdrawal(7, 22), PendingPartialWithdrawal(19, 23), PendingPartialWithdrawal(28, 24),
partialWithdrawal(7, 22), partialWithdrawal(19, 23), partialWithdrawal(28, 24),
},
},
Control: control{
@@ -829,14 +829,14 @@ func TestProcessWithdrawals(t *testing.T) {
},
{
Args: args{
Name: "success many withdrawals",
NextWithdrawalIndex: 22,
NextWithdrawalValidatorIndex: 88,
FullWithdrawalIndices: []primitives.ValidatorIndex{7, 19, 28},
PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{2, 1, 89, 15},
Name: "success many withdrawals",
NextWithdrawalIndex: 22,
NextWithdrawalValidatorIndex: 88,
FullWithdrawalIndices: []primitives.ValidatorIndex{7, 19, 28},
PartialWithdrawalIndices: []primitives.ValidatorIndex{2, 1, 89, 15},
Withdrawals: []*enginev1.Withdrawal{
PendingPartialWithdrawal(89, 22), PendingPartialWithdrawal(1, 23), PendingPartialWithdrawal(2, 24),
fullWithdrawal(7, 25), PendingPartialWithdrawal(15, 26), fullWithdrawal(19, 27),
partialWithdrawal(89, 22), partialWithdrawal(1, 23), partialWithdrawal(2, 24),
fullWithdrawal(7, 25), partialWithdrawal(15, 26), fullWithdrawal(19, 27),
fullWithdrawal(28, 28),
},
},
@@ -876,17 +876,17 @@ func TestProcessWithdrawals(t *testing.T) {
},
{
Args: args{
Name: "success more than max partially withdrawals",
NextWithdrawalIndex: 22,
NextWithdrawalValidatorIndex: 0,
PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{1, 2, 3, 4, 5, 6, 7, 8, 9, 21, 22, 23, 24, 25, 26, 27, 29, 35, 89},
Name: "success more than max partially withdrawals",
NextWithdrawalIndex: 22,
NextWithdrawalValidatorIndex: 0,
PartialWithdrawalIndices: []primitives.ValidatorIndex{1, 2, 3, 4, 5, 6, 7, 8, 9, 21, 22, 23, 24, 25, 26, 27, 29, 35, 89},
Withdrawals: []*enginev1.Withdrawal{
PendingPartialWithdrawal(1, 22), PendingPartialWithdrawal(2, 23), PendingPartialWithdrawal(3, 24),
PendingPartialWithdrawal(4, 25), PendingPartialWithdrawal(5, 26), PendingPartialWithdrawal(6, 27),
PendingPartialWithdrawal(7, 28), PendingPartialWithdrawal(8, 29), PendingPartialWithdrawal(9, 30),
PendingPartialWithdrawal(21, 31), PendingPartialWithdrawal(22, 32), PendingPartialWithdrawal(23, 33),
PendingPartialWithdrawal(24, 34), PendingPartialWithdrawal(25, 35), PendingPartialWithdrawal(26, 36),
PendingPartialWithdrawal(27, 37),
partialWithdrawal(1, 22), partialWithdrawal(2, 23), partialWithdrawal(3, 24),
partialWithdrawal(4, 25), partialWithdrawal(5, 26), partialWithdrawal(6, 27),
partialWithdrawal(7, 28), partialWithdrawal(8, 29), partialWithdrawal(9, 30),
partialWithdrawal(21, 31), partialWithdrawal(22, 32), partialWithdrawal(23, 33),
partialWithdrawal(24, 34), partialWithdrawal(25, 35), partialWithdrawal(26, 36),
partialWithdrawal(27, 37),
},
},
Control: control{
@@ -914,12 +914,12 @@ func TestProcessWithdrawals(t *testing.T) {
},
{
Args: args{
Name: "failure wrong number of partial withdrawal",
NextWithdrawalIndex: 21,
NextWithdrawalValidatorIndex: 37,
PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{7},
Name: "failure wrong number of partial withdrawal",
NextWithdrawalIndex: 21,
NextWithdrawalValidatorIndex: 37,
PartialWithdrawalIndices: []primitives.ValidatorIndex{7},
Withdrawals: []*enginev1.Withdrawal{
PendingPartialWithdrawal(7, 21), PendingPartialWithdrawal(9, 22),
partialWithdrawal(7, 21), partialWithdrawal(9, 22),
},
},
Control: control{
@@ -963,7 +963,7 @@ func TestProcessWithdrawals(t *testing.T) {
NextWithdrawalValidatorIndex: 4,
FullWithdrawalIndices: []primitives.ValidatorIndex{7, 19, 28, 1},
Withdrawals: []*enginev1.Withdrawal{
fullWithdrawal(7, 22), fullWithdrawal(19, 23), PendingPartialWithdrawal(28, 24),
fullWithdrawal(7, 22), fullWithdrawal(19, 23), partialWithdrawal(28, 24),
fullWithdrawal(1, 25),
},
},
@@ -987,10 +987,10 @@ func TestProcessWithdrawals(t *testing.T) {
},
{
Args: args{
Name: "failure validator not partially withdrawable",
NextWithdrawalIndex: 22,
NextWithdrawalValidatorIndex: 4,
PendingPartialWithdrawalIndices: []primitives.ValidatorIndex{notPartiallyWithdrawable},
Name: "failure validator not partially withdrawable",
NextWithdrawalIndex: 22,
NextWithdrawalValidatorIndex: 4,
PartialWithdrawalIndices: []primitives.ValidatorIndex{notPartiallyWithdrawable},
Withdrawals: []*enginev1.Withdrawal{
fullWithdrawal(notPartiallyWithdrawable, 22),
},
@@ -1034,7 +1034,7 @@ func TestProcessWithdrawals(t *testing.T) {
st.Balances[idx] = withdrawalAmount(idx)
validators[idx].WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte
}
for _, idx := range arguments.PendingPartialWithdrawalIndices {
for _, idx := range arguments.PartialWithdrawalIndices {
validators[idx].WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte
st.Balances[idx] = withdrawalAmount(idx)
}
@@ -1052,8 +1052,8 @@ func TestProcessWithdrawals(t *testing.T) {
if test.Args.FullWithdrawalIndices == nil {
test.Args.FullWithdrawalIndices = make([]primitives.ValidatorIndex, 0)
}
if test.Args.PendingPartialWithdrawalIndices == nil {
test.Args.PendingPartialWithdrawalIndices = make([]primitives.ValidatorIndex, 0)
if test.Args.PartialWithdrawalIndices == nil {
test.Args.PartialWithdrawalIndices = make([]primitives.ValidatorIndex, 0)
}
slot, err := slots.EpochStart(currentEpoch)
require.NoError(t, err)

View File

@@ -18,12 +18,10 @@ go_library(
"//config/params:go_default_library",
"//consensus-types/blocks:go_default_library",
"//consensus-types/primitives:go_default_library",
"//encoding/bytesutil:go_default_library",
"//io/file:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",
"//runtime/logging:go_default_library",
"//time/slots:go_default_library",
"@com_github_ethereum_go_ethereum//common/hexutil:go_default_library",
"@com_github_pkg_errors//:go_default_library",
"@com_github_prometheus_client_golang//prometheus:go_default_library",
"@com_github_prometheus_client_golang//prometheus/promauto:go_default_library",

View File

@@ -10,13 +10,11 @@ import (
"strings"
"time"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/pkg/errors"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/verification"
fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams"
"github.com/prysmaticlabs/prysm/v5/consensus-types/blocks"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v5/encoding/bytesutil"
"github.com/prysmaticlabs/prysm/v5/io/file"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/runtime/logging"
@@ -29,7 +27,6 @@ var (
errEmptyBlobWritten = errors.New("zero bytes written to disk when saving blob sidecar")
errSidecarEmptySSZData = errors.New("sidecar marshalled to an empty ssz byte slice")
errNoBasePath = errors.New("BlobStorage base path not specified in init")
errInvalidRootString = errors.New("Could not parse hex string as a [32]byte")
)
const (
@@ -336,11 +333,3 @@ func (p blobNamer) path() string {
func rootString(root [32]byte) string {
return fmt.Sprintf("%#x", root)
}
func stringToRoot(str string) ([32]byte, error) {
slice, err := hexutil.Decode(str)
if err != nil {
return [32]byte{}, errors.Wrapf(errInvalidRootString, "input=%s", str)
}
return bytesutil.ToBytes32(slice), nil
}

View File

@@ -48,26 +48,27 @@ type BlobStorageSummarizer interface {
type blobStorageCache struct {
mu sync.RWMutex
nBlobs float64
cache map[[32]byte]BlobStorageSummary
cache map[string]BlobStorageSummary
}
var _ BlobStorageSummarizer = &blobStorageCache{}
func newBlobStorageCache() *blobStorageCache {
return &blobStorageCache{
cache: make(map[[32]byte]BlobStorageSummary, params.BeaconConfig().MinEpochsForBlobsSidecarsRequest*fieldparams.SlotsPerEpoch),
cache: make(map[string]BlobStorageSummary, params.BeaconConfig().MinEpochsForBlobsSidecarsRequest*fieldparams.SlotsPerEpoch),
}
}
// Summary returns the BlobStorageSummary for `root`. The BlobStorageSummary can be used to check for the presence of
// BlobSidecars based on Index.
func (s *blobStorageCache) Summary(root [32]byte) BlobStorageSummary {
k := rootString(root)
s.mu.RLock()
defer s.mu.RUnlock()
return s.cache[root]
return s.cache[k]
}
func (s *blobStorageCache) ensure(key [32]byte, slot primitives.Slot, idx uint64) error {
func (s *blobStorageCache) ensure(key string, slot primitives.Slot, idx uint64) error {
if idx >= fieldparams.MaxBlobsPerBlock {
return errIndexOutOfBounds
}
@@ -83,7 +84,7 @@ func (s *blobStorageCache) ensure(key [32]byte, slot primitives.Slot, idx uint64
return nil
}
func (s *blobStorageCache) slot(key [32]byte) (primitives.Slot, bool) {
func (s *blobStorageCache) slot(key string) (primitives.Slot, bool) {
s.mu.RLock()
defer s.mu.RUnlock()
v, ok := s.cache[key]
@@ -93,7 +94,7 @@ func (s *blobStorageCache) slot(key [32]byte) (primitives.Slot, bool) {
return v.slot, ok
}
func (s *blobStorageCache) evict(key [32]byte) {
func (s *blobStorageCache) evict(key string) {
var deleted float64
s.mu.Lock()
v, ok := s.cache[key]

View File

@@ -48,7 +48,7 @@ func TestSlotByRoot_Summary(t *testing.T) {
sc := newBlobStorageCache()
for _, c := range cases {
if c.expected != nil {
key := bytesutil.ToBytes32([]byte(c.name))
key := rootString(bytesutil.ToBytes32([]byte(c.name)))
sc.cache[key] = BlobStorageSummary{slot: 0, mask: *c.expected}
}
}

View File

@@ -66,7 +66,7 @@ func NewMockBlobStorageSummarizer(t *testing.T, set map[[32]byte][]int) BlobStor
c := newBlobStorageCache()
for k, v := range set {
for i := range v {
if err := c.ensure(k, 0, uint64(v[i])); err != nil {
if err := c.ensure(rootString(k), 0, uint64(v[i])); err != nil {
t.Fatal(err)
}
}

View File

@@ -64,7 +64,7 @@ func newBlobPruner(fs afero.Fs, retain primitives.Epoch, opts ...prunerOpt) (*bl
// notify updates the pruner's view of root->blob mappings. This allows the pruner to build a cache
// of root->slot mappings and decide when to evict old blobs based on the age of present blobs.
func (p *blobPruner) notify(root [32]byte, latest primitives.Slot, idx uint64) error {
if err := p.cache.ensure(root, latest, idx); err != nil {
if err := p.cache.ensure(rootString(root), latest, idx); err != nil {
return err
}
pruned := uint64(windowMin(latest, p.windowSize))
@@ -160,10 +160,7 @@ func shouldRetain(slot, pruneBefore primitives.Slot) bool {
}
func (p *blobPruner) tryPruneDir(dir string, pruneBefore primitives.Slot) (int, error) {
root, err := rootFromDir(dir)
if err != nil {
return 0, errors.Wrapf(err, "invalid directory, could not parse subdir as root %s", dir)
}
root := rootFromDir(dir)
slot, slotCached := p.cache.slot(root)
// Return early if the slot is cached and doesn't need pruning.
if slotCached && shouldRetain(slot, pruneBefore) {
@@ -221,7 +218,7 @@ func (p *blobPruner) tryPruneDir(dir string, pruneBefore primitives.Slot) (int,
return removed, errors.Wrapf(err, "unable to remove blob directory %s", dir)
}
p.cache.evict(root)
p.cache.evict(rootFromDir(dir))
return len(scFiles), nil
}
@@ -238,13 +235,8 @@ func idxFromPath(fname string) (uint64, error) {
return strconv.ParseUint(parts[0], 10, 64)
}
func rootFromDir(dir string) ([32]byte, error) {
subdir := filepath.Base(dir) // end of the path should be the blob directory, named by hex encoding of root
root, err := stringToRoot(subdir)
if err != nil {
return root, errors.Wrapf(err, "invalid directory, could not parse subdir as root %s", dir)
}
return root, nil
func rootFromDir(dir string) string {
return filepath.Base(dir) // end of the path should be the blob directory, named by hex encoding of root
}
// Read slot from marshaled BlobSidecar data in the given file. See slotFromBlob for details.

View File

@@ -25,11 +25,11 @@ func TestTryPruneDir_CachedNotExpired(t *testing.T) {
_, sidecars := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, slot, fieldparams.MaxBlobsPerBlock)
sc, err := verification.BlobSidecarNoop(sidecars[0])
require.NoError(t, err)
rootStr := rootString(sc.BlockRoot())
root := fmt.Sprintf("%#x", sc.BlockRoot())
// This slot is right on the edge of what would need to be pruned, so by adding it to the cache and
// skipping any other test setup, we can be certain the hot cache path never touches the filesystem.
require.NoError(t, pr.cache.ensure(sc.BlockRoot(), sc.Slot(), 0))
pruned, err := pr.tryPruneDir(rootStr, pr.windowSize)
require.NoError(t, pr.cache.ensure(root, sc.Slot(), 0))
pruned, err := pr.tryPruneDir(root, pr.windowSize)
require.NoError(t, err)
require.Equal(t, 0, pruned)
}
@@ -43,10 +43,10 @@ func TestTryPruneDir_CachedExpired(t *testing.T) {
_, sidecars := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, slot, 1)
sc, err := verification.BlobSidecarNoop(sidecars[0])
require.NoError(t, err)
rootStr := rootString(sc.BlockRoot())
require.NoError(t, fs.Mkdir(rootStr, directoryPermissions)) // make empty directory
require.NoError(t, pr.cache.ensure(sc.BlockRoot(), sc.Slot(), 0))
pruned, err := pr.tryPruneDir(rootStr, slot+1)
root := fmt.Sprintf("%#x", sc.BlockRoot())
require.NoError(t, fs.Mkdir(root, directoryPermissions)) // make empty directory
require.NoError(t, pr.cache.ensure(root, sc.Slot(), 0))
pruned, err := pr.tryPruneDir(root, slot+1)
require.NoError(t, err)
require.Equal(t, 0, pruned)
})
@@ -61,21 +61,20 @@ func TestTryPruneDir_CachedExpired(t *testing.T) {
require.NoError(t, bs.Save(scs[1]))
// check that the root->slot is cached
root := scs[0].BlockRoot()
rootStr := rootString(root)
cs, cok := bs.pruner.cache.slot(scs[0].BlockRoot())
root := fmt.Sprintf("%#x", scs[0].BlockRoot())
cs, cok := bs.pruner.cache.slot(root)
require.Equal(t, true, cok)
require.Equal(t, slot, cs)
// ensure that we see the saved files in the filesystem
files, err := listDir(fs, rootStr)
files, err := listDir(fs, root)
require.NoError(t, err)
require.Equal(t, 2, len(files))
pruned, err := bs.pruner.tryPruneDir(rootStr, slot+1)
pruned, err := bs.pruner.tryPruneDir(root, slot+1)
require.NoError(t, err)
require.Equal(t, 2, pruned)
files, err = listDir(fs, rootStr)
files, err = listDir(fs, root)
require.ErrorIs(t, err, os.ErrNotExist)
require.Equal(t, 0, len(files))
})
@@ -93,8 +92,7 @@ func TestTryPruneDir_SlotFromFile(t *testing.T) {
require.NoError(t, bs.Save(scs[1]))
// check that the root->slot is cached
root := scs[0].BlockRoot()
rootStr := rootString(root)
root := fmt.Sprintf("%#x", scs[0].BlockRoot())
cs, ok := bs.pruner.cache.slot(root)
require.Equal(t, true, ok)
require.Equal(t, slot, cs)
@@ -104,14 +102,14 @@ func TestTryPruneDir_SlotFromFile(t *testing.T) {
require.Equal(t, false, ok)
// ensure that we see the saved files in the filesystem
files, err := listDir(fs, rootStr)
files, err := listDir(fs, root)
require.NoError(t, err)
require.Equal(t, 2, len(files))
pruned, err := bs.pruner.tryPruneDir(rootStr, slot+1)
pruned, err := bs.pruner.tryPruneDir(root, slot+1)
require.NoError(t, err)
require.Equal(t, 2, pruned)
files, err = listDir(fs, rootStr)
files, err = listDir(fs, root)
require.ErrorIs(t, err, os.ErrNotExist)
require.Equal(t, 0, len(files))
})
@@ -127,25 +125,24 @@ func TestTryPruneDir_SlotFromFile(t *testing.T) {
require.NoError(t, bs.Save(scs[1]))
// Evict slot mapping from the cache so that we trigger the file read path.
root := scs[0].BlockRoot()
rootStr := rootString(root)
root := fmt.Sprintf("%#x", scs[0].BlockRoot())
bs.pruner.cache.evict(root)
_, ok := bs.pruner.cache.slot(root)
require.Equal(t, false, ok)
// Ensure that we see the saved files in the filesystem.
files, err := listDir(fs, rootStr)
files, err := listDir(fs, root)
require.NoError(t, err)
require.Equal(t, 2, len(files))
// This should use the slotFromFile code (simulating restart).
// Setting pruneBefore == slot, so that the slot will be outside the window (at the boundary).
pruned, err := bs.pruner.tryPruneDir(rootStr, slot)
pruned, err := bs.pruner.tryPruneDir(root, slot)
require.NoError(t, err)
require.Equal(t, 0, pruned)
// Ensure files are still present.
files, err = listDir(fs, rootStr)
files, err = listDir(fs, root)
require.NoError(t, err)
require.Equal(t, 2, len(files))
})
@@ -319,45 +316,3 @@ func TestListDir(t *testing.T) {
})
}
}
func TestRootFromDir(t *testing.T) {
cases := []struct {
name string
dir string
err error
root [32]byte
}{
{
name: "happy path",
dir: "0xffff875e1d985c5ccb214894983f2428edb271f0f87b68ba7010e4a99df3b5cb",
root: [32]byte{255, 255, 135, 94, 29, 152, 92, 92, 203, 33, 72, 148, 152, 63, 36, 40,
237, 178, 113, 240, 248, 123, 104, 186, 112, 16, 228, 169, 157, 243, 181, 203},
},
{
name: "too short",
dir: "0xffff875e1d985c5ccb214894983f2428edb271f0f87b68ba7010e4a99df3b5c",
err: errInvalidRootString,
},
{
name: "too log",
dir: "0xffff875e1d985c5ccb214894983f2428edb271f0f87b68ba7010e4a99df3b5cbb",
err: errInvalidRootString,
},
{
name: "missing prefix",
dir: "ffff875e1d985c5ccb214894983f2428edb271f0f87b68ba7010e4a99df3b5cb",
err: errInvalidRootString,
},
}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
root, err := stringToRoot(c.dir)
if c.err != nil {
require.ErrorIs(t, err, c.err)
return
}
require.NoError(t, err)
require.Equal(t, c.root, root)
})
}
}

View File

@@ -33,7 +33,6 @@ go_library(
"//consensus-types/forkchoice:go_default_library",
"//consensus-types/primitives:go_default_library",
"//encoding/bytesutil:go_default_library",
"//math:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",
"//runtime/version:go_default_library",
"//time/slots:go_default_library",

View File

@@ -2,7 +2,6 @@ package doublylinkedtree
import (
"context"
goErrors "errors"
"fmt"
"time"
@@ -16,7 +15,6 @@ import (
forkchoice2 "github.com/prysmaticlabs/prysm/v5/consensus-types/forkchoice"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v5/encoding/bytesutil"
prysmMath "github.com/prysmaticlabs/prysm/v5/math"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/runtime/version"
"github.com/prysmaticlabs/prysm/v5/time/slots"
@@ -32,7 +30,6 @@ func New() *ForkChoice {
unrealizedFinalizedCheckpoint: &forkchoicetypes.Checkpoint{},
prevJustifiedCheckpoint: &forkchoicetypes.Checkpoint{},
finalizedCheckpoint: &forkchoicetypes.Checkpoint{},
safeHeadRoot: [32]byte{},
proposerBoostRoot: [32]byte{},
nodeByRoot: make(map[[fieldparams.RootLength]byte]*Node),
nodeByPayload: make(map[[fieldparams.RootLength]byte]*Node),
@@ -68,97 +65,17 @@ func (f *ForkChoice) Head(
return [32]byte{}, errors.Wrap(err, "could not apply proposer boost score")
}
if err := f.store.treeRootNode.applyWeightChanges(ctx, f.store.proposerBoostRoot, f.store.previousProposerBoostScore); err != nil {
if err := f.store.treeRootNode.applyWeightChanges(ctx); err != nil {
return [32]byte{}, errors.Wrap(err, "could not apply weight changes")
}
jc := f.JustifiedCheckpoint()
fc := f.FinalizedCheckpoint()
currentSlot := slots.CurrentSlot(f.store.genesisTime)
secondsSinceSlotStart, err := slots.SecondsSinceSlotStart(currentSlot, f.store.genesisTime, uint64(time.Now().Unix()))
if err != nil {
log.WithError(err).Error("could not compute seconds since slot start")
secondsSinceSlotStart = 0
}
if err := f.store.treeRootNode.updateBestDescendant(ctx, jc.Epoch, fc.Epoch, currentSlot, secondsSinceSlotStart, f.store.committeeWeight); err != nil {
currentEpoch := slots.EpochsSinceGenesis(time.Unix(int64(f.store.genesisTime), 0))
if err := f.store.treeRootNode.updateBestDescendant(ctx, jc.Epoch, fc.Epoch, currentEpoch); err != nil {
return [32]byte{}, errors.Wrap(err, "could not update best descendant")
}
safeHeadUpdateErr := f.UpdateSafeHead(ctx)
head, err := f.store.head(ctx)
return head, goErrors.Join(err, safeHeadUpdateErr)
}
// UpdateSafeHead updates the safe head in the fork choice store.
func (f *ForkChoice) UpdateSafeHead(
ctx context.Context,
) error {
oldSafeHeadRoot := f.store.safeHeadRoot
newSafeHeadRoot, err := f.store.safeHead(ctx)
if err != nil {
return errors.WithMessage(err, "could not update safe head")
}
// The safe head root has changed.
if oldSafeHeadRoot != newSafeHeadRoot {
newSafeHeadNode, ok := f.store.nodeByRoot[newSafeHeadRoot]
if !ok || newSafeHeadNode == nil {
return ErrNilNode
}
newSafeHeadSlot := newSafeHeadNode.slot
currentSlot := slots.CurrentSlot(f.store.genesisTime)
secondsSinceSlotStart, err := slots.SecondsSinceSlotStart(currentSlot, f.store.genesisTime, uint64(time.Now().Unix()))
if err != nil {
log.WithError(err).Error("could not compute seconds since slot start")
}
log.WithFields(logrus.Fields{
"currentSlot": fmt.Sprintf("%d", currentSlot),
"sinceSlotStartTime": fmt.Sprintf("%d", secondsSinceSlotStart),
"newSafeHeadSlot": fmt.Sprintf("%d", newSafeHeadSlot),
"newSafeHeadRoot": fmt.Sprintf("%#x", newSafeHeadRoot),
"oldSafeHeadRoot": fmt.Sprintf("%#x", oldSafeHeadRoot),
}).Info("Safe head has changed")
// Update metrics.
safeHeadChangesCount.Inc()
safeHeadSlotNumber.Set(float64(newSafeHeadSlot))
// Check if the safe head reorged.
commonRoot, forkSlot, err := f.CommonAncestor(ctx, oldSafeHeadRoot, newSafeHeadRoot)
if err != nil {
log.WithError(err).Error("Could not find common ancestor root")
commonRoot = params.BeaconConfig().ZeroHash
}
if oldSafeHeadRoot != [32]byte{} && commonRoot != oldSafeHeadRoot {
// The safe head has reorged.
// Calculate reorg metrics.
oldSafeHeadNode, ok := f.store.nodeByRoot[oldSafeHeadRoot]
if !ok || oldSafeHeadNode == nil {
return ErrNilNode
}
oldSafeHeadSlot := oldSafeHeadNode.slot
dis := oldSafeHeadSlot + newSafeHeadSlot - 2*forkSlot
dep := prysmMath.Max(uint64(oldSafeHeadSlot-forkSlot), uint64(newSafeHeadSlot-forkSlot))
log.WithFields(logrus.Fields{
"currentSlot": fmt.Sprintf("%d", currentSlot),
"sinceSlotStartTime": fmt.Sprintf("%d", secondsSinceSlotStart),
"newSafeHeadSlot": fmt.Sprintf("%d", newSafeHeadSlot),
"newSafeHeadRoot": fmt.Sprintf("%#x", newSafeHeadRoot),
"oldSafeHeadSlot": fmt.Sprintf("%d", oldSafeHeadSlot),
"oldSafeHeadRoot": fmt.Sprintf("%#x", oldSafeHeadRoot),
"commonAncestorRoot": fmt.Sprintf("%#x", commonRoot),
"distance": dis,
"depth": dep,
}).Debug("Safe head reorg occurred")
// Update reorg metrics.
safeHeadReorgDistance.Observe(float64(dis))
safeHeadReorgDepth.Observe(float64(dep))
safeHeadReorgCount.Inc()
}
// Update safe head
f.store.safeHeadRoot = newSafeHeadRoot
}
return nil
return f.store.head(ctx)
}
// ProcessAttestation processes attestation for vote accounting, it iterates around validator indices
@@ -636,17 +553,6 @@ func (f *ForkChoice) UnrealizedJustifiedPayloadBlockHash() [32]byte {
return node.payloadHash
}
// SafeHeadPayloadBlockHash returns the hash of the payload at the safe head
func (f *ForkChoice) SafeHeadPayloadBlockHash() [32]byte {
safeHeadRoot := f.store.safeHeadRoot
node, ok := f.store.nodeByRoot[safeHeadRoot]
if !ok || node == nil {
// This should not happen
return [32]byte{}
}
return node.payloadHash
}
// ForkChoiceDump returns a full dump of forkchoice.
func (f *ForkChoice) ForkChoiceDump(ctx context.Context) (*forkchoice2.Dump, error) {
jc := &ethpb.Checkpoint{
@@ -680,7 +586,6 @@ func (f *ForkChoice) ForkChoiceDump(ctx context.Context) (*forkchoice2.Dump, err
resp := &forkchoice2.Dump{
JustifiedCheckpoint: jc,
UnrealizedJustifiedCheckpoint: ujc,
SafeHeadRoot: f.store.safeHeadRoot[:],
FinalizedCheckpoint: fc,
UnrealizedFinalizedCheckpoint: ufc,
ProposerBoostRoot: f.store.proposerBoostRoot[:],

View File

@@ -19,7 +19,6 @@ import (
"github.com/prysmaticlabs/prysm/v5/testing/assert"
"github.com/prysmaticlabs/prysm/v5/testing/require"
"github.com/prysmaticlabs/prysm/v5/testing/util"
"github.com/prysmaticlabs/prysm/v5/time/slots"
)
// prepareForkchoiceState prepares a beacon State with the given data to mock
@@ -207,11 +206,11 @@ func TestForkChoice_IsCanonicalReorg(t *testing.T) {
require.NoError(t, f.InsertNode(ctx, st, blkRoot))
f.store.nodeByRoot[[32]byte{'3'}].balance = 10
require.NoError(t, f.store.treeRootNode.applyWeightChanges(ctx, params.BeaconConfig().ZeroHash, 0))
require.NoError(t, f.store.treeRootNode.applyWeightChanges(ctx))
require.Equal(t, uint64(10), f.store.nodeByRoot[[32]byte{'1'}].weight)
require.Equal(t, uint64(0), f.store.nodeByRoot[[32]byte{'2'}].weight)
require.NoError(t, f.store.treeRootNode.updateBestDescendant(ctx, 1, 1, 6, 0, f.store.committeeWeight))
require.NoError(t, f.store.treeRootNode.updateBestDescendant(ctx, 1, 1, 1))
require.DeepEqual(t, [32]byte{'3'}, f.store.treeRootNode.bestDescendant.root)
r1 := [32]byte{'1'}
@@ -862,80 +861,3 @@ func TestForkChoiceSlot(t *testing.T) {
require.NoError(t, err)
require.Equal(t, primitives.Slot(3), slot)
}
func TestForkChoiceSafeHead(t *testing.T) {
f := setup(0, 0)
ctx := context.Background()
balances := []uint64{32, 32, 32, 32, 32, 32, 32, 32, 32, 32}
f.balancesByRoot = func(context.Context, [32]byte) ([]uint64, error) {
return balances, nil
}
require.NoError(t, f.updateJustifiedBalances(context.Background(), [32]byte{}))
require.Equal(t, uint64(len(balances)), f.numActiveValidators)
require.Equal(t, uint64(10), f.store.committeeWeight)
require.DeepEqual(t, balances, f.justifiedBalances)
proposerScoreBoost := params.BeaconConfig().ProposerScoreBoost
require.Equal(t, uint64(40), proposerScoreBoost)
slotsPerEpoch := params.BeaconConfig().SlotsPerEpoch
require.Equal(t, primitives.Slot(32), slotsPerEpoch)
driftGenesisTime(f, primitives.Slot(11), 0)
st, blkRoot, err := prepareForkchoiceState(ctx, 1, indexToHash(1), params.BeaconConfig().ZeroHash, params.BeaconConfig().ZeroHash, 0, 0)
require.NoError(t, err)
require.NoError(t, f.InsertNode(ctx, st, blkRoot))
for i := 2; i < 10; i++ {
st, blkRoot, err = prepareForkchoiceState(ctx, primitives.Slot(i), indexToHash(uint64(i)), indexToHash(uint64(i-1)), params.BeaconConfig().ZeroHash, 0, 0)
require.NoError(t, err)
require.NoError(t, f.InsertNode(ctx, st, blkRoot))
}
tests := []struct {
name string
currentSlot primitives.Slot
nodeBalances []uint64
wantRoot [32]byte
}{
{
name: "safeHead is head-1",
currentSlot: primitives.Slot(11),
nodeBalances: []uint64{10, 10, 10, 10, 10, 10, 10, 10, 10, 14},
wantRoot: indexToHash(9),
},
{
name: "safeHead is head-2",
currentSlot: primitives.Slot(11),
nodeBalances: []uint64{10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
wantRoot: indexToHash(8),
},
{
name: "safeHead is head-3",
currentSlot: primitives.Slot(11),
nodeBalances: []uint64{10, 10, 10, 10, 10, 10, 10, 10, 10, 0},
wantRoot: indexToHash(6),
},
{
name: "safeHead is justified",
currentSlot: primitives.Slot(11),
nodeBalances: []uint64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
wantRoot: params.BeaconConfig().ZeroHash,
},
}
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
driftGenesisTime(f, tc.currentSlot, 0)
require.Equal(t, tc.currentSlot, slots.CurrentSlot(f.store.genesisTime))
s := f.store
s.nodeByRoot[params.BeaconConfig().ZeroHash].balance = tc.nodeBalances[0]
for i := 1; i < 10; i++ {
s.nodeByRoot[indexToHash(uint64(i))].balance = tc.nodeBalances[i]
}
_, err = f.Head(ctx)
require.NoError(t, err)
safeHead := f.store.safeHeadRoot
require.Equal(t, tc.wantRoot, safeHead)
})
}
}

View File

@@ -51,34 +51,4 @@ var (
Help: "The number of times pruning happened.",
},
)
safeHeadSlotNumber = promauto.NewGauge(
prometheus.GaugeOpts{
Name: "doublylinkedtree_safe_head_slot",
Help: "The slot number of the current safe head.",
},
)
safeHeadChangesCount = promauto.NewCounter(
prometheus.CounterOpts{
Name: "doublylinkedtree_safe_head_changed_count",
Help: "The number of times safe head changes.",
},
)
safeHeadReorgCount = promauto.NewCounter(prometheus.CounterOpts{
Name: "safe_head_reorgs_total",
Help: "Count the number of safe head reorgs",
})
safeHeadReorgDistance = promauto.NewHistogram(
prometheus.HistogramOpts{
Name: "safe_head_reorg_distance",
Help: "Captures distance of safe head reorgs. Distance is defined as the number of blocks between the old safe head and the new safe head",
Buckets: []float64{1, 2, 4, 8, 16, 32, 64},
},
)
safeHeadReorgDepth = promauto.NewHistogram(
prometheus.HistogramOpts{
Name: "safe_head_reorg_depth",
Help: "Captures depth of safe head reorgs. Depth is defined as the number of blocks between the safe heads and the common ancestor",
Buckets: []float64{1, 2, 4, 8, 16, 32},
},
)
)

View File

@@ -3,7 +3,6 @@ package doublylinkedtree
import (
"bytes"
"context"
"fmt"
"github.com/pkg/errors"
"github.com/prysmaticlabs/prysm/v5/config/params"
@@ -18,91 +17,33 @@ const ProcessAttestationsThreshold = 10
// applyWeightChanges recomputes the weight of the node passed as an argument and all of its descendants,
// using the current balance stored in each node.
func (n *Node) applyWeightChanges(ctx context.Context, proposerBoostRoot [32]byte, proposerBootScore uint64) error {
func (n *Node) applyWeightChanges(ctx context.Context) error {
// Recursively calling the children to sum their weights.
childrenWeight := uint64(0)
childrenVoteOnlyWeight := uint64(0)
for _, child := range n.children {
if ctx.Err() != nil {
return ctx.Err()
}
if err := child.applyWeightChanges(ctx, proposerBoostRoot, proposerBootScore); err != nil {
if err := child.applyWeightChanges(ctx); err != nil {
return err
}
childrenWeight += child.weight
childrenVoteOnlyWeight += child.voteOnlyWeight
}
if n.root == params.BeaconConfig().ZeroHash {
return nil
}
n.weight = n.balance + childrenWeight
n.voteOnlyWeight = n.balance + childrenVoteOnlyWeight
if n.root == proposerBoostRoot {
if n.balance < proposerBootScore {
return errors.New(fmt.Sprintf("invalid node weight %d is lesser than proposer boost score %d for root %#x", n.balance, proposerBoostRoot, n.root))
}
n.voteOnlyWeight -= proposerBootScore
}
return nil
}
// getMaxPossibleSupport computes the maximum possible voting weight for this node
func (n *Node) getMaxPossibleSupport(currentSlot primitives.Slot, committeeWeight uint64) float64 {
startSlot := n.slot
if n.parent != nil {
startSlot = n.parent.slot + 1
}
if startSlot > currentSlot {
return 0
}
startEpoch := slots.ToEpoch(startSlot)
currentEpoch := slots.ToEpoch(currentSlot)
slotsPerEpoch := uint64(params.BeaconConfig().SlotsPerEpoch)
// If the span of slots does not cover an epoch boundary, simply return the number of slots times committee weight.
if startEpoch == currentEpoch {
return float64(committeeWeight * uint64(currentSlot-startSlot+1))
}
// If the entire validator set is covered between startSlot and currentSlot,
// return the 32 * committeeWeight
if currentEpoch > startEpoch+1 ||
(currentEpoch == startEpoch+1 && uint64(startSlot)%slotsPerEpoch == 0) {
return float64(committeeWeight * slotsPerEpoch)
}
// The span of slots goes across an epoch boundary, but does not cover any full epoch.
// Do a pro-rata calculation of how many committees are contained.
slotsInStartEpoch := slotsPerEpoch - (uint64(startSlot) % slotsPerEpoch)
slotsInCurrentEpoch := (uint64(currentSlot) % slotsPerEpoch) + 1
slotsRemainingInCurrentEpoch := slotsPerEpoch - slotsInCurrentEpoch
weightFromCurrentEpoch := float64(committeeWeight * slotsInCurrentEpoch)
weightFromStartEpoch := float64(committeeWeight*slotsInStartEpoch*slotsRemainingInCurrentEpoch) / float64(slotsPerEpoch)
return weightFromCurrentEpoch + weightFromStartEpoch
}
// isOneConfirmed computes whether this node individually satisfies the LMD safety rule.
func (n *Node) isOneConfirmed(currentSlot primitives.Slot, committeeWeight uint64) bool {
if n.slot >= currentSlot {
return false
}
proposerBoostWeight := float64(committeeWeight*params.BeaconConfig().ProposerScoreBoost) / 100
maxPossibleSupport := n.getMaxPossibleSupport(currentSlot, committeeWeight)
safeThreshold := (maxPossibleSupport + proposerBoostWeight) / 2
return float64(n.voteOnlyWeight) > safeThreshold
}
// updateBestDescendant updates the best descendant of this node and its
// children.
func (n *Node) updateBestDescendant(ctx context.Context,
justifiedEpoch primitives.Epoch, finalizedEpoch primitives.Epoch,
currentSlot primitives.Slot, secondsSinceSlotStart uint64, committeeWeight uint64) error {
func (n *Node) updateBestDescendant(ctx context.Context, justifiedEpoch, finalizedEpoch, currentEpoch primitives.Epoch) error {
if ctx.Err() != nil {
return ctx.Err()
}
if len(n.children) == 0 {
n.bestDescendant = nil
n.bestConfirmedDescendant = nil
return nil
}
@@ -113,12 +54,9 @@ func (n *Node) updateBestDescendant(ctx context.Context,
if child == nil {
return errors.Wrap(ErrNilNode, "could not update best descendant")
}
if err := child.updateBestDescendant(ctx,
justifiedEpoch, finalizedEpoch,
currentSlot, secondsSinceSlotStart, committeeWeight); err != nil {
if err := child.updateBestDescendant(ctx, justifiedEpoch, finalizedEpoch, currentEpoch); err != nil {
return err
}
currentEpoch := slots.ToEpoch(currentSlot)
childLeadsToViableHead := child.leadsToViableHead(justifiedEpoch, currentEpoch)
if childLeadsToViableHead && !hasViableDescendant {
// The child leads to a viable head, but the current
@@ -140,35 +78,13 @@ func (n *Node) updateBestDescendant(ctx context.Context,
}
}
if hasViableDescendant {
// This node has a viable descendant.
if bestChild.bestDescendant == nil {
// The best descendant is the best child.
n.bestDescendant = bestChild
} else {
// The best descendant is more than 1 hop away.
n.bestDescendant = bestChild.bestDescendant
}
// Compute safe head only if we are in the first interval of the slot.
// This prevents current epoch attestations from affecting the node's weight for safe head computation.
if secondsSinceSlotStart < params.BeaconConfig().SecondsPerSlot/params.BeaconConfig().IntervalsPerSlot {
// Attestations from the current slot are not accounted for in the fork choice - so compute safe head on the basis of the previous slot
if bestChild.isOneConfirmed(currentSlot-1, committeeWeight) {
// The best child is confirmed.
if bestChild.bestConfirmedDescendant == nil {
// The best child does not have confirmed descendants.
n.bestConfirmedDescendant = bestChild
} else {
// The best child has confirmed descendants.
n.bestConfirmedDescendant = bestChild.bestConfirmedDescendant
}
} else {
// The best child is not confirmed. There is no confirmed descendant.
n.bestConfirmedDescendant = nil
}
}
} else {
n.bestDescendant = nil
n.bestConfirmedDescendant = nil
}
return nil
}

View File

@@ -9,7 +9,6 @@ import (
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v5/testing/assert"
"github.com/prysmaticlabs/prysm/v5/testing/require"
"github.com/prysmaticlabs/prysm/v5/time/slots"
)
func TestNode_ApplyWeightChanges_PositiveChange(t *testing.T) {
@@ -32,7 +31,7 @@ func TestNode_ApplyWeightChanges_PositiveChange(t *testing.T) {
s.nodeByRoot[indexToHash(2)].balance = 100
s.nodeByRoot[indexToHash(3)].balance = 100
assert.NoError(t, s.treeRootNode.applyWeightChanges(ctx, params.BeaconConfig().ZeroHash, 0))
assert.NoError(t, s.treeRootNode.applyWeightChanges(ctx))
assert.Equal(t, uint64(300), s.nodeByRoot[indexToHash(1)].weight)
assert.Equal(t, uint64(200), s.nodeByRoot[indexToHash(2)].weight)
@@ -62,7 +61,7 @@ func TestNode_ApplyWeightChanges_NegativeChange(t *testing.T) {
s.nodeByRoot[indexToHash(2)].balance = 100
s.nodeByRoot[indexToHash(3)].balance = 100
assert.NoError(t, s.treeRootNode.applyWeightChanges(ctx, params.BeaconConfig().ZeroHash, 0))
assert.NoError(t, s.treeRootNode.applyWeightChanges(ctx))
assert.Equal(t, uint64(300), s.nodeByRoot[indexToHash(1)].weight)
assert.Equal(t, uint64(200), s.nodeByRoot[indexToHash(2)].weight)
@@ -111,7 +110,7 @@ func TestNode_UpdateBestDescendant_HigherWeightChild(t *testing.T) {
s := f.store
s.nodeByRoot[indexToHash(1)].weight = 100
s.nodeByRoot[indexToHash(2)].weight = 200
assert.NoError(t, s.treeRootNode.updateBestDescendant(ctx, 1, 1, 2, 0, f.store.committeeWeight))
assert.NoError(t, s.treeRootNode.updateBestDescendant(ctx, 1, 1, 1))
assert.Equal(t, 2, len(s.treeRootNode.children))
assert.Equal(t, s.treeRootNode.children[1], s.treeRootNode.bestDescendant)
@@ -131,7 +130,7 @@ func TestNode_UpdateBestDescendant_LowerWeightChild(t *testing.T) {
s := f.store
s.nodeByRoot[indexToHash(1)].weight = 200
s.nodeByRoot[indexToHash(2)].weight = 100
assert.NoError(t, s.treeRootNode.updateBestDescendant(ctx, 1, 1, 2, 0, f.store.committeeWeight))
assert.NoError(t, s.treeRootNode.updateBestDescendant(ctx, 1, 1, 1))
assert.Equal(t, 2, len(s.treeRootNode.children))
assert.Equal(t, s.treeRootNode.children[0], s.treeRootNode.bestDescendant)
@@ -328,76 +327,3 @@ func TestNode_TimeStampsChecks(t *testing.T) {
require.ErrorContains(t, "invalid timestamp", err)
require.Equal(t, false, late)
}
func TestNode_MaxPossibleSupport(t *testing.T) {
f := setup(0, 0)
ctx := context.Background()
slotsPerEpoch := params.BeaconConfig().SlotsPerEpoch
require.Equal(t, primitives.Slot(32), slotsPerEpoch)
state, blkRoot, err := prepareForkchoiceState(ctx, 1, indexToHash(1), params.BeaconConfig().ZeroHash, params.BeaconConfig().ZeroHash, 0, 0)
require.NoError(t, err)
require.NoError(t, f.InsertNode(ctx, state, blkRoot))
for i := 2; i < 64; i++ {
state, blkRoot, err = prepareForkchoiceState(ctx, primitives.Slot(i), indexToHash(uint64(i)), indexToHash(uint64(i-1)), params.BeaconConfig().ZeroHash, 0, 0)
require.NoError(t, err)
require.NoError(t, f.InsertNode(ctx, state, blkRoot))
}
tests := []struct {
name string
nodeIndex uint64
currentSlot primitives.Slot
committeeWeight uint64
wantValue float64
}{
{
name: "2 slots in same epoch",
nodeIndex: 32,
currentSlot: 33,
committeeWeight: 1,
wantValue: 2,
},
{
name: "31 slots in same epoch",
nodeIndex: 32,
currentSlot: 63,
committeeWeight: 1,
wantValue: 32,
},
{
name: "one full epoch",
nodeIndex: 32,
currentSlot: 64,
committeeWeight: 100,
wantValue: 3200,
},
{
name: "more than one full epoch",
nodeIndex: 32,
currentSlot: 100,
committeeWeight: 100,
wantValue: 3200,
},
{
name: "epoch mid to epoch mid",
nodeIndex: 16,
currentSlot: 48,
committeeWeight: 100,
wantValue: 2450,
},
}
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
driftGenesisTime(f, tc.currentSlot, 0)
require.Equal(t, tc.currentSlot, slots.CurrentSlot(f.store.genesisTime))
s := f.store
node := s.nodeByRoot[indexToHash(tc.nodeIndex)]
mps := node.getMaxPossibleSupport(tc.currentSlot, tc.committeeWeight)
require.Equal(t, tc.wantValue, mps)
})
}
}

View File

@@ -60,39 +60,6 @@ func (s *Store) head(ctx context.Context) ([32]byte, error) {
return bestDescendant.root, nil
}
// safeHead starts from justified root and then follows the best descendant links
// to find the best safe head block.
func (s *Store) safeHead(ctx context.Context) ([32]byte, error) {
ctx, span := trace.StartSpan(ctx, "doublyLinkedForkchoice.safeHead")
defer span.End()
if err := ctx.Err(); err != nil {
return [32]byte{}, err
}
// JustifiedRoot has to be known
justifiedNode, ok := s.nodeByRoot[s.justifiedCheckpoint.Root]
if !ok || justifiedNode == nil {
// If the justifiedCheckpoint is from genesis, then the root is
// zeroHash. In this case it should be the root of forkchoice
// tree.
if s.justifiedCheckpoint.Epoch == params.BeaconConfig().GenesisEpoch {
justifiedNode = s.treeRootNode
} else {
return [32]byte{}, errors.WithMessage(errUnknownJustifiedRoot, fmt.Sprintf("%#x", s.justifiedCheckpoint.Root))
}
}
// If the justified node doesn't have a best confirmed descendant,
// the best node is itself.
bestConfirmedDescendant := justifiedNode.bestConfirmedDescendant
if bestConfirmedDescendant == nil {
bestConfirmedDescendant = justifiedNode
}
return bestConfirmedDescendant.root, nil
}
// insert registers a new block node to the fork choice store's node list.
// It then updates the new node's parent with the best child and descendant node.
func (s *Store) insert(ctx context.Context,
@@ -160,12 +127,7 @@ func (s *Store) insert(ctx context.Context,
// Update best descendants
jEpoch := s.justifiedCheckpoint.Epoch
fEpoch := s.finalizedCheckpoint.Epoch
secondsSinceSlotStart, err := slots.SecondsSinceSlotStart(currentSlot, s.genesisTime, uint64(time.Now().Unix()))
if err != nil {
log.WithError(err).Error("could not compute seconds since slot start")
secondsSinceSlotStart = 0
}
if err := s.treeRootNode.updateBestDescendant(ctx, jEpoch, fEpoch, currentSlot, secondsSinceSlotStart, s.committeeWeight); err != nil {
if err := s.treeRootNode.updateBestDescendant(ctx, jEpoch, fEpoch, slots.ToEpoch(currentSlot)); err != nil {
return n, err
}
}

View File

@@ -27,7 +27,6 @@ type Store struct {
unrealizedFinalizedCheckpoint *forkchoicetypes.Checkpoint // best unrealized finalized checkpoint in store.
prevJustifiedCheckpoint *forkchoicetypes.Checkpoint // previous justified checkpoint in store.
finalizedCheckpoint *forkchoicetypes.Checkpoint // latest finalized epoch in store.
safeHeadRoot [fieldparams.RootLength]byte // safe head root in store.
proposerBoostRoot [fieldparams.RootLength]byte // latest block root that was boosted after being received in a timely manner.
previousProposerBoostRoot [fieldparams.RootLength]byte // previous block root that was boosted after being received in a timely manner.
previousProposerBoostScore uint64 // previous proposer boosted root score.
@@ -59,11 +58,9 @@ type Node struct {
unrealizedFinalizedEpoch primitives.Epoch // the epoch that would be finalized if the block would be advanced to the next epoch.
balance uint64 // the balance that voted for this node directly
weight uint64 // weight of this node: the total balance including children
voteOnlyWeight uint64 // weight of this node from attestations only - no proposer boost score
bestDescendant *Node // bestDescendant node of this node.
optimistic bool // whether the block has been fully validated or not
timestamp uint64 // The timestamp when the node was inserted.
bestConfirmedDescendant *Node // bestConfirmedDescendant node of this node.
}
// Vote defines an individual validator's vote.

View File

@@ -79,7 +79,6 @@ type FastGetter interface {
Slot([32]byte) (primitives.Slot, error)
TargetRootForEpoch([32]byte, primitives.Epoch) ([32]byte, error)
UnrealizedJustifiedPayloadBlockHash() [32]byte
SafeHeadPayloadBlockHash() [32]byte
Weight(root [32]byte) (uint64, error)
}

View File

@@ -100,13 +100,6 @@ func (ro *ROForkChoice) UnrealizedJustifiedPayloadBlockHash() [32]byte {
return ro.getter.UnrealizedJustifiedPayloadBlockHash()
}
// SafeHeadPayloadBlockHash delegates to the underlying forkchoice call, under a lock.
func (ro *ROForkChoice) SafeHeadPayloadBlockHash() [32]byte {
ro.l.RLock()
defer ro.l.RUnlock()
return ro.getter.SafeHeadPayloadBlockHash()
}
// NodeCount delegates to the underlying forkchoice call, under a lock.
func (ro *ROForkChoice) NodeCount() int {
ro.l.RLock()

View File

@@ -27,7 +27,6 @@ const (
previousJustifiedCheckpointCalled
justifiedPayloadBlockHashCalled
unrealizedJustifiedPayloadBlockHashCalled
safeHeadPayloadBlockHashCalled
nodeCountCalled
highestReceivedBlockSlotCalled
highestReceivedBlockDelayCalled
@@ -105,11 +104,6 @@ func TestROLocking(t *testing.T) {
call: unrealizedJustifiedPayloadBlockHashCalled,
cb: func(g FastGetter) { g.UnrealizedJustifiedPayloadBlockHash() },
},
{
name: "safeHeadPayloadBlockHashCalled",
call: safeHeadPayloadBlockHashCalled,
cb: func(g FastGetter) { g.SafeHeadPayloadBlockHash() },
},
{
name: "nodeCountCalled",
call: nodeCountCalled,
@@ -247,11 +241,6 @@ func (ro *mockROForkchoice) UnrealizedJustifiedPayloadBlockHash() [32]byte {
return [32]byte{}
}
func (ro *mockROForkchoice) SafeHeadPayloadBlockHash() [32]byte {
ro.calls = append(ro.calls, safeHeadPayloadBlockHashCalled)
return [32]byte{}
}
func (ro *mockROForkchoice) NodeCount() int {
ro.calls = append(ro.calls, nodeCountCalled)
return 0

View File

@@ -4,6 +4,7 @@ import (
"bytes"
"crypto/ecdsa"
"net"
"sync"
"time"
"github.com/ethereum/go-ethereum/p2p/discover"
@@ -15,9 +16,11 @@ import (
"github.com/pkg/errors"
"github.com/prysmaticlabs/go-bitfield"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/cache"
"github.com/prysmaticlabs/prysm/v5/cmd/beacon-chain/flags"
"github.com/prysmaticlabs/prysm/v5/config/features"
"github.com/prysmaticlabs/prysm/v5/config/params"
ecdsaprysm "github.com/prysmaticlabs/prysm/v5/crypto/ecdsa"
"github.com/prysmaticlabs/prysm/v5/math"
"github.com/prysmaticlabs/prysm/v5/runtime/version"
"github.com/prysmaticlabs/prysm/v5/time/slots"
)
@@ -106,7 +109,7 @@ func (s *Service) RefreshENR() {
// listen for new nodes watches for new nodes in the network and adds them to the peerstore.
func (s *Service) listenForNewNodes() {
iterator := enode.Filter(s.dv5Listener.RandomNodes(), s.filterPeer)
iterator := filterNodes(s.ctx, s.dv5Listener.RandomNodes(), s.filterPeer)
defer iterator.Close()
for {
@@ -122,29 +125,47 @@ func (s *Service) listenForNewNodes() {
time.Sleep(pollingPeriod)
continue
}
if exists := iterator.Next(); !exists {
break
}
node := iterator.Node()
peerInfo, _, err := convertToAddrInfo(node)
if err != nil {
log.WithError(err).Error("Could not convert to peer info")
wantedCount := s.wantedPeerDials()
if wantedCount == 0 {
log.Trace("Not looking for peers, at peer limit")
time.Sleep(pollingPeriod)
continue
}
if peerInfo == nil {
continue
}
// Make sure that peer is not dialed too often, for each connection attempt there's a backoff period.
s.Peers().RandomizeBackOff(peerInfo.ID)
go func(info *peer.AddrInfo) {
if err := s.connectWithPeer(s.ctx, *info); err != nil {
log.WithError(err).Tracef("Could not connect with peer %s", info.String())
// Restrict dials if limit is applied.
if flags.MaxDialIsActive() {
var err error
wantedICount := math.Min(uint64(wantedCount), uint64(flags.Get().MaxConcurrentDials))
wantedCount, err = math.Int(wantedICount)
if err != nil {
log.WithError(err).Error("Could not get wanted count")
continue
}
}(peerInfo)
}
wantedNodes := enode.ReadNodes(iterator, wantedCount)
wg := new(sync.WaitGroup)
for i := 0; i < len(wantedNodes); i++ {
node := wantedNodes[i]
peerInfo, _, err := convertToAddrInfo(node)
if err != nil {
log.WithError(err).Error("Could not convert to peer info")
continue
}
if peerInfo == nil {
continue
}
// Make sure that peer is not dialed too often, for each connection attempt there's a backoff period.
s.Peers().RandomizeBackOff(peerInfo.ID)
wg.Add(1)
go func(info *peer.AddrInfo) {
if err := s.connectWithPeer(s.ctx, *info); err != nil {
log.WithError(err).Tracef("Could not connect with peer %s", info.String())
}
wg.Done()
}(peerInfo)
}
wg.Wait()
}
}
@@ -384,6 +405,17 @@ func (s *Service) isPeerAtLimit(inbound bool) bool {
return activePeers >= maxPeers || numOfConns >= maxPeers
}
func (s *Service) wantedPeerDials() int {
maxPeers := int(s.cfg.MaxPeers)
activePeers := len(s.Peers().Active())
wantedCount := 0
if maxPeers > activePeers {
wantedCount = maxPeers - activePeers
}
return wantedCount
}
// PeersFromStringAddrs converts peer raw ENRs into multiaddrs for p2p.
func PeersFromStringAddrs(addrs []string) ([]ma.Multiaddr, error) {
var allAddrs []ma.Multiaddr

View File

@@ -2,10 +2,14 @@ package p2p
import (
"context"
"runtime"
"time"
"github.com/ethereum/go-ethereum/p2p/enode"
)
const backOffCounter = 50
// filterNodes wraps an iterator such that Next only returns nodes for which
// the 'check' function returns true. This custom implementation also
// checks for context deadlines so that in the event the parent context has
@@ -24,13 +28,21 @@ type filterIter struct {
// Next looks up for the next valid node according to our
// filter criteria.
func (f *filterIter) Next() bool {
lookupCounter := 0
for f.Iterator.Next() {
// Do not excessively perform lookups if we constantly receive non-viable peers.
if lookupCounter > backOffCounter {
lookupCounter = 0
runtime.Gosched()
time.Sleep(30 * time.Second)
}
if f.Context.Err() != nil {
return false
}
if f.check(f.Node()) {
return true
}
lookupCounter++
}
return false
}

View File

@@ -87,7 +87,18 @@ func (s *Service) FindPeersWithSubnet(ctx context.Context, topic string,
return false, errors.Errorf("unable to find requisite number of peers for topic %s - "+
"only %d out of %d peers were able to be found", topic, currNum, threshold)
}
nodes := enode.ReadNodes(iterator, int(params.BeaconNetworkConfig().MinimumPeersInSubnetSearch))
nodeCount := int(params.BeaconNetworkConfig().MinimumPeersInSubnetSearch)
// Restrict dials if limit is applied.
if flags.MaxDialIsActive() {
var err error
wantedICount := mathutil.Min(uint64(nodeCount), uint64(flags.Get().MaxConcurrentDials))
nodeCount, err = mathutil.Int(wantedICount)
if err != nil {
log.WithError(err).Error("Could not get wanted count")
continue
}
}
nodes := enode.ReadNodes(iterator, nodeCount)
for _, node := range nodes {
info, _, err := convertToAddrInfo(node)
if err != nil {

View File

@@ -133,21 +133,6 @@ func TestGetSpec(t *testing.T) {
config.MaxWithdrawalsPerPayload = 74
config.MaxBlsToExecutionChanges = 75
config.MaxValidatorsPerWithdrawalsSweep = 76
config.MinSlashingPenaltyQuotientElectra = 77
config.MaxEffectiveBalanceElectra = 78
config.CompoundingWithdrawalPrefixByte = byte('d')
config.WhistleBlowerRewardQuotientElectra = 79
config.PendingPartialWithdrawalsLimit = 80
config.MinActivationBalance = 81
config.PendingBalanceDepositLimit = 82
config.MaxPendingPartialsPerWithdrawalSweep = 83
config.PendingConsolidationsLimit = 84
config.MaxPartialWithdrawalsPerPayload = 85
config.FullExitRequestAmount = 86
config.MaxConsolidations = 87
config.MaxAttesterSlashingsElectra = 88
config.MaxAttestationsElectra = 89
config.MaxWithdrawalRequestsPerPayload = 90
var dbp [4]byte
copy(dbp[:], []byte{'0', '0', '0', '1'})
@@ -173,9 +158,6 @@ func TestGetSpec(t *testing.T) {
var dam [4]byte
copy(dam[:], []byte{'1', '0', '0', '0'})
config.DomainApplicationMask = dam
var dc [4]byte
copy(dc[:], []byte{'1', '1', '0', '0'})
config.DomainConsolidation = dc
params.OverrideBeaconConfig(config)
@@ -190,7 +172,7 @@ func TestGetSpec(t *testing.T) {
data, ok := resp.Data.(map[string]interface{})
require.Equal(t, true, ok)
assert.Equal(t, 152, len(data))
assert.Equal(t, 136, len(data))
for k, v := range data {
t.Run(k, func(t *testing.T) {
switch k {
@@ -489,38 +471,6 @@ func TestGetSpec(t *testing.T) {
assert.Equal(t, "32", v)
case "MAX_REQUEST_DATA_COLUMN_SIDECARS":
assert.Equal(t, "16384", v)
case "MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA":
assert.Equal(t, "77", v)
case "MAX_EFFECTIVE_BALANCE_ELECTRA":
assert.Equal(t, "78", v)
case "COMPOUNDING_WITHDRAWAL_PREFIX":
assert.Equal(t, "0x64", v)
case "WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA":
assert.Equal(t, "79", v)
case "PENDING_PARTIAL_WITHDRAWALS_LIMIT":
assert.Equal(t, "80", v)
case "MIN_ACTIVATION_BALANCE":
assert.Equal(t, "81", v)
case "PENDING_BALANCE_DEPOSITS_LIMIT":
assert.Equal(t, "82", v)
case "MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP":
assert.Equal(t, "83", v)
case "PENDING_CONSOLIDATIONS_LIMIT":
assert.Equal(t, "84", v)
case "MAX_PARTIAL_WITHDRAWALS_PER_PAYLOAD":
assert.Equal(t, "85", v)
case "FULL_EXIT_REQUEST_AMOUNT":
assert.Equal(t, "86", v)
case "MAX_CONSOLIDATIONS":
assert.Equal(t, "87", v)
case "DOMAIN_CONSOLIDATION":
assert.Equal(t, "0x31313030", v)
case "MAX_ATTESTER_SLASHINGS_ELECTRA":
assert.Equal(t, "88", v)
case "MAX_ATTESTATIONS_ELECTRA":
assert.Equal(t, "89", v)
case "MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD":
assert.Equal(t, "90", v)
default:
t.Errorf("Incorrect key: %s", k)
}

View File

@@ -189,7 +189,6 @@ func (s *Server) GetForkChoice(w http.ResponseWriter, r *http.Request) {
ExtraData: &structs.ForkChoiceDumpExtraData{
UnrealizedJustifiedCheckpoint: structs.CheckpointFromConsensus(dump.UnrealizedJustifiedCheckpoint),
UnrealizedFinalizedCheckpoint: structs.CheckpointFromConsensus(dump.UnrealizedFinalizedCheckpoint),
SafeHeadRoot: hexutil.Encode(dump.SafeHeadRoot),
ProposerBoostRoot: hexutil.Encode(dump.ProposerBoostRoot),
PreviousProposerBoostRoot: hexutil.Encode(dump.PreviousProposerBoostRoot),
HeadRoot: hexutil.Encode(dump.HeadRoot),

View File

@@ -13,7 +13,6 @@ import (
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/state"
"github.com/prysmaticlabs/prysm/v5/config/features"
fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams"
"github.com/prysmaticlabs/prysm/v5/config/params"
consensusblocks "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks"
@@ -109,20 +108,16 @@ func (vs *Server) getLocalPayload(ctx context.Context, blk interfaces.ReadOnlyBe
}
finalizedBlockHash := [32]byte{}
safeBlockHash := [32]byte{}
justifiedBlockHash := [32]byte{}
// Blocks before Bellatrix don't have execution payloads. Use zeros as the hash.
if st.Version() >= version.Bellatrix {
finalizedBlockHash = vs.FinalizationFetcher.FinalizedBlockHash()
if features.Get().SafeHeadFCU {
safeBlockHash = vs.ForkchoiceFetcher.SafeHeadPayloadBlockHash()
} else {
safeBlockHash = vs.FinalizationFetcher.UnrealizedJustifiedPayloadBlockHash()
}
justifiedBlockHash = vs.FinalizationFetcher.UnrealizedJustifiedPayloadBlockHash()
}
f := &enginev1.ForkchoiceState{
HeadBlockHash: parentHash,
SafeBlockHash: safeBlockHash[:],
SafeBlockHash: justifiedBlockHash[:],
FinalizedBlockHash: finalizedBlockHash[:],
}

View File

@@ -150,7 +150,6 @@ func TestServer_getExecutionPayload(t *testing.T) {
ExecutionEngineCaller: &powtesting.EngineClient{PayloadIDBytes: tt.payloadID, ErrForkchoiceUpdated: tt.forkchoiceErr, ExecutionPayload: &pb.ExecutionPayload{}, BuilderOverride: tt.override},
HeadFetcher: &chainMock.ChainService{State: tt.st},
FinalizationFetcher: &chainMock.ChainService{},
ForkchoiceFetcher: &chainMock.ChainService{},
BeaconDB: beaconDB,
PayloadIDCache: cache.NewPayloadIDCache(),
TrackedValidatorsCache: cache.NewTrackedValidatorsCache(),
@@ -249,7 +248,6 @@ func TestServer_getExecutionPayload_UnexpectedFeeRecipient(t *testing.T) {
},
HeadFetcher: &chainMock.ChainService{State: transitionSt},
FinalizationFetcher: &chainMock.ChainService{},
ForkchoiceFetcher: &chainMock.ChainService{},
BeaconDB: beaconDB,
PayloadIDCache: cache.NewPayloadIDCache(),
TrackedValidatorsCache: cache.NewTrackedValidatorsCache(),

View File

@@ -227,6 +227,12 @@ var (
Usage: "Sets the minimum number of peers that a node will attempt to peer with that are subscribed to a subnet.",
Value: 6,
}
// MaxConcurrentDials defines a flag to set the maximum number of peers that a node will attempt to dial with from discovery.
MaxConcurrentDials = &cli.Uint64Flag{
Name: "max-concurrent-dials",
Usage: "Sets the maximum number of peers that a node will attempt to dial with from discovery. By default we will dials as" +
"many peers as possible.",
}
// SuggestedFeeRecipient specifies the fee recipient for the transaction fees.
SuggestedFeeRecipient = &cli.StringFlag{
Name: "suggested-fee-recipient",

View File

@@ -11,6 +11,7 @@ type GlobalFlags struct {
SubscribeToAllSubnets bool
MinimumSyncPeers int
MinimumPeersPerSubnet int
MaxConcurrentDials int
BlockBatchLimit int
BlockBatchLimitBurstFactor int
BlobBatchLimit int
@@ -45,11 +46,17 @@ func ConfigureGlobalFlags(ctx *cli.Context) {
cfg.BlobBatchLimit = ctx.Int(BlobBatchLimit.Name)
cfg.BlobBatchLimitBurstFactor = ctx.Int(BlobBatchLimitBurstFactor.Name)
cfg.MinimumPeersPerSubnet = ctx.Int(MinPeersPerSubnet.Name)
cfg.MaxConcurrentDials = ctx.Int(MaxConcurrentDials.Name)
configureMinimumPeers(ctx, cfg)
Init(cfg)
}
// MaxDialIsActive checks if the user has enabled the max dial flag.
func MaxDialIsActive() bool {
return Get().MaxConcurrentDials > 0
}
func configureMinimumPeers(ctx *cli.Context, cfg *GlobalFlags) {
cfg.MinimumSyncPeers = ctx.Int(MinSyncPeers.Name)
maxPeers := ctx.Int(cmd.P2PMaxPeers.Name)

View File

@@ -72,6 +72,7 @@ var appFlags = []cli.Flag{
flags.WeakSubjectivityCheckpoint,
flags.Eth1HeaderReqLimit,
flags.MinPeersPerSubnet,
flags.MaxConcurrentDials,
flags.SuggestedFeeRecipient,
flags.TerminalTotalDifficultyOverride,
flags.TerminalBlockHashOverride,

View File

@@ -124,6 +124,7 @@ var appHelpFlagGroups = []flagGroup{
flags.WeakSubjectivityCheckpoint,
flags.Eth1HeaderReqLimit,
flags.MinPeersPerSubnet,
flags.MaxConcurrentDials,
flags.MevRelayEndpoint,
flags.MaxBuilderEpochMissedSlots,
flags.MaxBuilderConsecutiveMissedSlots,

View File

@@ -43,7 +43,6 @@ type Flags struct {
EnablePeerScorer bool // EnablePeerScorer enables experimental peer scoring in p2p.
EnableLightClient bool // EnableLightClient enables light client APIs.
EnableQUIC bool // EnableQUIC specifies whether to enable QUIC transport for libp2p.
SafeHeadFCU bool // SafeHeadFCU enables passing safe head into FCU instead of justified block
WriteWalletPasswordOnWebOnboarding bool // WriteWalletPasswordOnWebOnboarding writes the password to disk after Prysm web signup.
EnableDoppelGanger bool // EnableDoppelGanger enables doppelganger protection on startup for the validator.
EnableHistoricalSpaceRepresentation bool // EnableHistoricalSpaceRepresentation enables the saving of registry validators in separate buckets to save space
@@ -196,10 +195,6 @@ func ConfigureBeaconChain(ctx *cli.Context) error {
cfg.DisableGRPCConnectionLogs = true
}
if ctx.Bool(safeHeadFCU.Name) {
log.WithField(safeHeadFCU.Name, safeHeadFCU.Usage).Warn(enabledFeatureFlag)
cfg.SafeHeadFCU = true
}
cfg.EnablePeerScorer = true
if ctx.Bool(disablePeerScorer.Name) {
logDisabled(disablePeerScorer)

View File

@@ -48,10 +48,6 @@ var (
Name: "disable-grpc-connection-logging",
Usage: "Disables displaying logs for newly connected grpc clients.",
}
safeHeadFCU = &cli.BoolFlag{
Name: "safe-head-fcu",
Usage: "Enables safe head block instead of justified block in FCU updates.",
}
disablePeerScorer = &cli.BoolFlag{
Name: "disable-peer-scorer",
Usage: "(Danger): Disables P2P peer scorer. Do NOT use this in production!",
@@ -209,7 +205,6 @@ var BeaconChainFlags = append(deprecatedBeaconFlags, append(deprecatedFlags, []c
HoleskyTestnet,
SepoliaTestnet,
Mainnet,
safeHeadFCU,
disablePeerScorer,
disableBroadcastSlashingFlag,
enableSlasherFlag,

View File

@@ -33,9 +33,4 @@ const (
BlobSize = 131072 // defined to match blob.size in bazel ssz codegen
KzgCommitmentInclusionProofDepth = 17 // Merkle proof depth for blob_kzg_commitments list item
NextSyncCommitteeBranchDepth = 5 // NextSyncCommitteeBranchDepth defines the depth of the next sync committee branch.
PendingBalanceDepositsLimit = 134217728 // Maximum number of pending balance deposits in the beacon state.
PendingPartialWithdrawalsLimit = 134217728 // Maximum number of pending partial withdrawals in the beacon state.
PendingConsolidationsLimit = 262144 // Maximum number of pending consolidations in the beacon state.
MaxDepositReceiptsPerPayload = 8192 // Maximum number of deposit receipts in an execution payload.
MaxWithdrawalRequestsPerPayload = 16 // Maximum number of execution layer withdrawal requests in an execution payload.
)

View File

@@ -33,9 +33,4 @@ const (
BlobSize = 131072 // defined to match blob.size in bazel ssz codegen
KzgCommitmentInclusionProofDepth = 17 // Merkle proof depth for blob_kzg_commitments list item
NextSyncCommitteeBranchDepth = 5 // NextSyncCommitteeBranchDepth defines the depth of the next sync committee branch.
PendingBalanceDepositsLimit = 134217728 // Maximum number of pending balance deposits in the beacon state.
PendingPartialWithdrawalsLimit = 64 // Maximum number of pending partial withdrawals in the beacon state.
PendingConsolidationsLimit = 64 // Maximum number of pending consolidations in the beacon state.
MaxDepositReceiptsPerPayload = 4 // Maximum number of deposit receipts in an execution payload.
MaxWithdrawalRequestsPerPayload = 2 // Maximum number of execution layer withdrawal requests in an execution payload.
)

View File

@@ -41,7 +41,6 @@ type BeaconChainConfig struct {
// Gwei value constants.
MinDepositAmount uint64 `yaml:"MIN_DEPOSIT_AMOUNT" spec:"true"` // MinDepositAmount is the minimum amount of Gwei a validator can send to the deposit contract at once (lower amounts will be reverted).
MinActivationBalance uint64 `yaml:"MIN_ACTIVATION_BALANCE" spec:"true"` // MinActivationBalance is the minimum amount of Gwei a validator must have to be activated in the beacon state.
MaxEffectiveBalance uint64 `yaml:"MAX_EFFECTIVE_BALANCE" spec:"true"` // MaxEffectiveBalance is the maximal amount of Gwei that is effective for staking.
EjectionBalance uint64 `yaml:"EJECTION_BALANCE" spec:"true"` // EjectionBalance is the minimal GWei a validator needs to have before ejected.
EffectiveBalanceIncrement uint64 `yaml:"EFFECTIVE_BALANCE_INCREMENT" spec:"true"` // EffectiveBalanceIncrement is used for converting the high balance into the low balance for validators.
@@ -49,7 +48,6 @@ type BeaconChainConfig struct {
// Initial value constants.
BLSWithdrawalPrefixByte byte `yaml:"BLS_WITHDRAWAL_PREFIX" spec:"true"` // BLSWithdrawalPrefixByte is used for BLS withdrawal and it's the first byte.
ETH1AddressWithdrawalPrefixByte byte `yaml:"ETH1_ADDRESS_WITHDRAWAL_PREFIX" spec:"true"` // ETH1AddressWithdrawalPrefixByte is used for withdrawals and it's the first byte.
CompoundingWithdrawalPrefixByte byte `yaml:"COMPOUNDING_WITHDRAWAL_PREFIX" spec:"true"` // CompoundingWithdrawalPrefixByteByte is used for compounding withdrawals and it's the first byte.
ZeroHash [32]byte // ZeroHash is used to represent a zeroed out 32 byte array.
// Time parameters constants.
@@ -99,15 +97,12 @@ type BeaconChainConfig struct {
ProportionalSlashingMultiplier uint64 `yaml:"PROPORTIONAL_SLASHING_MULTIPLIER" spec:"true"` // ProportionalSlashingMultiplier is used as a multiplier on slashed penalties.
// Max operations per block constants.
MaxProposerSlashings uint64 `yaml:"MAX_PROPOSER_SLASHINGS" spec:"true"` // MaxProposerSlashings defines the maximum number of slashings of proposers possible in a block.
MaxAttesterSlashings uint64 `yaml:"MAX_ATTESTER_SLASHINGS" spec:"true"` // MaxAttesterSlashings defines the maximum number of casper FFG slashings possible in a block.
MaxAttesterSlashingsElectra uint64 `yaml:"MAX_ATTESTER_SLASHINGS_ELECTRA" spec:"true"` // MaxAttesterSlashingsElectra defines the maximum number of casper FFG slashings possible in a block post Electra hard fork.
MaxAttestations uint64 `yaml:"MAX_ATTESTATIONS" spec:"true"` // MaxAttestations defines the maximum allowed attestations in a beacon block.
MaxAttestationsElectra uint64 `yaml:"MAX_ATTESTATIONS_ELECTRA" spec:"true"` // MaxAttestationsElectra defines the maximum allowed attestations in a beacon block post Electra hard fork.
MaxDeposits uint64 `yaml:"MAX_DEPOSITS" spec:"true"` // MaxDeposits defines the maximum number of validator deposits in a block.
MaxVoluntaryExits uint64 `yaml:"MAX_VOLUNTARY_EXITS" spec:"true"` // MaxVoluntaryExits defines the maximum number of validator exits in a block.
MaxWithdrawalsPerPayload uint64 `yaml:"MAX_WITHDRAWALS_PER_PAYLOAD" spec:"true"` // MaxWithdrawalsPerPayload defines the maximum number of withdrawals in a block.
MaxPartialWithdrawalsPerPayload uint64 `yaml:"MAX_PARTIAL_WITHDRAWALS_PER_PAYLOAD" spec:"true"`
MaxProposerSlashings uint64 `yaml:"MAX_PROPOSER_SLASHINGS" spec:"true"` // MaxProposerSlashings defines the maximum number of slashings of proposers possible in a block.
MaxAttesterSlashings uint64 `yaml:"MAX_ATTESTER_SLASHINGS" spec:"true"` // MaxAttesterSlashings defines the maximum number of casper FFG slashings possible in a block.
MaxAttestations uint64 `yaml:"MAX_ATTESTATIONS" spec:"true"` // MaxAttestations defines the maximum allowed attestations in a beacon block.
MaxDeposits uint64 `yaml:"MAX_DEPOSITS" spec:"true"` // MaxDeposits defines the maximum number of validator deposits in a block.
MaxVoluntaryExits uint64 `yaml:"MAX_VOLUNTARY_EXITS" spec:"true"` // MaxVoluntaryExits defines the maximum number of validator exits in a block.
MaxWithdrawalsPerPayload uint64 `yaml:"MAX_WITHDRAWALS_PER_PAYLOAD" spec:"true"` // MaxWithdrawalsPerPayload defines the maximum number of withdrawals in a block.
MaxBlsToExecutionChanges uint64 `yaml:"MAX_BLS_TO_EXECUTION_CHANGES" spec:"true"` // MaxBlsToExecutionChanges defines the maximum number of BLS-to-execution-change objects in a block.
MaxValidatorsPerWithdrawalsSweep uint64 `yaml:"MAX_VALIDATORS_PER_WITHDRAWALS_SWEEP" spec:"true"` // MaxValidatorsPerWithdrawalsSweep bounds the size of the sweep searching for withdrawals per slot.
@@ -125,7 +120,6 @@ type BeaconChainConfig struct {
DomainApplicationMask [4]byte `yaml:"DOMAIN_APPLICATION_MASK" spec:"true"` // DomainApplicationMask defines the BLS signature domain for application mask.
DomainApplicationBuilder [4]byte `yaml:"DOMAIN_APPLICATION_BUILDER" spec:"true"` // DomainApplicationBuilder defines the BLS signature domain for application builder.
DomainBLSToExecutionChange [4]byte `yaml:"DOMAIN_BLS_TO_EXECUTION_CHANGE" spec:"true"` // DomainBLSToExecutionChange defines the BLS signature domain to change withdrawal addresses to ETH1 prefix
DomainConsolidation [4]byte `yaml:"DOMAIN_CONSOLIDATION" spec:"true"`
// Prysm constants.
GweiPerEth uint64 // GweiPerEth is the amount of gwei corresponding to 1 eth.
@@ -145,7 +139,6 @@ type BeaconChainConfig struct {
BeaconStateBellatrixFieldCount int // BeaconStateBellatrixFieldCount defines how many fields are in beacon state post upgrade to Bellatrix.
BeaconStateCapellaFieldCount int // BeaconStateCapellaFieldCount defines how many fields are in beacon state post upgrade to Capella.
BeaconStateDenebFieldCount int // BeaconStateDenebFieldCount defines how many fields are in beacon state post upgrade to Deneb.
BeaconStateElectraFieldCount int // BeaconStateElectraFieldCount defines how many fields are in beacon state post upgrade to Electra.
// Slasher constants.
WeakSubjectivityPeriod primitives.Epoch // WeakSubjectivityPeriod defines the time period expressed in number of epochs were proof of stake network should validate block headers and attestations for slashable events.
@@ -236,20 +229,11 @@ type BeaconChainConfig struct {
MaxRequestBlocksDeneb uint64 `yaml:"MAX_REQUEST_BLOCKS_DENEB" spec:"true"` // MaxRequestBlocksDeneb is the maximum number of blocks in a single request after the deneb epoch.
// Values introduce in Electra upgrade
DataColumnSidecarSubnetCount uint64 `yaml:"DATA_COLUMN_SIDECAR_SUBNET_COUNT" spec:"true"` // DataColumnSidecarSubnetCount is the number of data column sidecar subnets used in the gossipsub protocol
MaxPerEpochActivationExitChurnLimit uint64 `yaml:"MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT" spec:"true"` // MaxPerEpochActivationExitChurnLimit represents the maximum combined activation and exit churn.
MinPerEpochChurnLimitElectra uint64 `yaml:"MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA" spec:"true"` // MinPerEpochChurnLimitElectra is the minimum amount of churn allotted for validator rotations for electra.
MaxRequestDataColumnSidecars uint64 `yaml:"MAX_REQUEST_DATA_COLUMN_SIDECARS" spec:"true"` // MaxRequestDataColumnSidecars is the maximum number of data column sidecars in a single request
MaxEffectiveBalanceElectra uint64 `yaml:"MAX_EFFECTIVE_BALANCE_ELECTRA" spec:"true"` // MaxEffectiveBalanceElectra is the maximal amount of Gwei that is effective for staking, increased in electra.
MinSlashingPenaltyQuotientElectra uint64 `yaml:"MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA" spec:"true"` // MinSlashingPenaltyQuotientElectra is used to calculate the minimum penalty to prevent DoS attacks, modified for electra.
WhistleBlowerRewardQuotientElectra uint64 `yaml:"WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA" spec:"true"` // WhistleBlowerRewardQuotientElectra is used to calculate whistle blower reward, modified in electra.
PendingBalanceDepositLimit uint64 `yaml:"PENDING_BALANCE_DEPOSITS_LIMIT" spec:"true"` // PendingBalanceDepositLimit is the maximum number of pending balance deposits allowed in the beacon state.
PendingPartialWithdrawalsLimit uint64 `yaml:"PENDING_PARTIAL_WITHDRAWALS_LIMIT" spec:"true"` // PendingPartialWithdrawalsLimit is the maximum number of pending partial withdrawals allowed in the beacon state.
PendingConsolidationsLimit uint64 `yaml:"PENDING_CONSOLIDATIONS_LIMIT" spec:"true"` // PendingConsolidationsLimit is the maximum number of pending validator consolidations allowed in the beacon state.
MaxConsolidations uint64 `yaml:"MAX_CONSOLIDATIONS" spec:"true"` // MaxConsolidations is the maximum number of consolidations in a block.
MaxPendingPartialsPerWithdrawalSweep uint64 `yaml:"MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP" spec:"true"` // MaxPendingPartialsPerWithdrawalSweep is the maximum number of pending partial withdrawals to process per payload.
FullExitRequestAmount uint64 `yaml:"FULL_EXIT_REQUEST_AMOUNT" spec:"true"` // FullExitRequestAmount is the amount of Gwei required to request a full exit.
MaxWithdrawalRequestsPerPayload uint64 `yaml:"MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD" spec:"true"` // MaxWithdrawalRequestsPerPayload is the maximum number of execution layer withdrawal requests in each payload.
NumberOfColumns uint64 `yaml:"NUMBER_OF_COLUMNS" spec:"true"` // NumberOfColumns in the extended data matrix.
DataColumnSidecarSubnetCount uint64 `yaml:"DATA_COLUMN_SIDECAR_SUBNET_COUNT" spec:"true"` // DataColumnSidecarSubnetCount is the number of data column sidecar subnets used in the gossipsub protocol
MaxPerEpochActivationExitChurnLimit uint64 `yaml:"MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT" spec:"true"` // MaxPerEpochActivationExitChurnLimit represents the maximum combined activation and exit churn.
MinPerEpochChurnLimitElectra uint64 `yaml:"MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA" spec:"true"` // MinPerEpochChurnLimitElectra is the minimum amount of churn allotted for validator rotations for electra.
MaxRequestDataColumnSidecars uint64 `yaml:"MAX_REQUEST_DATA_COLUMN_SIDECARS" spec:"true"` // MaxRequestDataColumnSidecars is the maximum number of data column sidecars in a single request
// Networking Specific Parameters
GossipMaxSize uint64 `yaml:"GOSSIP_MAX_SIZE" spec:"true"` // GossipMaxSize is the maximum allowed size of uncompressed gossip messages.
@@ -268,9 +252,6 @@ type BeaconChainConfig struct {
AttestationSubnetPrefixBits uint64 `yaml:"ATTESTATION_SUBNET_PREFIX_BITS" spec:"true"` // AttestationSubnetPrefixBits is defined as (ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS).
SubnetsPerNode uint64 `yaml:"SUBNETS_PER_NODE" spec:"true"` // SubnetsPerNode is the number of long-lived subnets a beacon node should be subscribed to.
NodeIdBits uint64 `yaml:"NODE_ID_BITS" spec:"true"` // NodeIdBits defines the bit length of a node id.
// PeerDAS
NumberOfColumns uint64 `yaml:"NUMBER_OF_COLUMNS" spec:"true"` // NumberOfColumns in the extended data matrix.
}
// InitializeForkSchedule initializes the schedules forks baked into the config.

View File

@@ -24,21 +24,13 @@ import (
// These are variables that we don't use in Prysm. (i.e. future hardfork, light client... etc)
// IMPORTANT: Use one field per line and sort these alphabetically to reduce conflicts.
var placeholderFields = []string{
"BYTES_PER_LOGS_BLOOM", // Compile time constant on ExecutionPayload.logs_bloom.
"EIP6110_FORK_EPOCH",
"EIP6110_FORK_VERSION",
"EIP7002_FORK_EPOCH",
"EIP7002_FORK_VERSION",
"EIP7594_FORK_EPOCH",
"EIP7594_FORK_VERSION",
"FIELD_ELEMENTS_PER_BLOB", // Compile time constant.
"KZG_COMMITMENT_INCLUSION_PROOF_DEPTH", // Compile time constant on BlobSidecar.commitment_inclusion_proof.
"MAX_BLOBS_PER_BLOCK",
"MAX_BLOB_COMMITMENTS_PER_BLOCK", // Compile time constant on BeaconBlockBodyDeneb.blob_kzg_commitments.
"MAX_BYTES_PER_TRANSACTION", // Used for ssz of EL transactions. Unused in Prysm.
"MAX_DEPOSIT_RECEIPTS_PER_PAYLOAD", // Compile time constant on ExecutionPayload.deposit_receipts.
"MAX_EXTRA_DATA_BYTES", // Compile time constant on ExecutionPayload.extra_data.
"MAX_TRANSACTIONS_PER_PAYLOAD", // Compile time constant on ExecutionPayload.transactions.
"REORG_HEAD_WEIGHT_THRESHOLD",
"UPDATE_TIMEOUT",
"WHISK_EPOCHS_PER_SHUFFLING_PHASE",
@@ -350,14 +342,9 @@ func configFilePath(t *testing.T, config string) string {
func presetsFilePath(t *testing.T, config string) []string {
fPath, err := bazel.Runfile("external/consensus_spec")
require.NoError(t, err)
return []string{
path.Join(fPath, "presets", config, "phase0.yaml"),
path.Join(fPath, "presets", config, "altair.yaml"),
path.Join(fPath, "presets", config, "bellatrix.yaml"),
path.Join(fPath, "presets", config, "capella.yaml"),
path.Join(fPath, "presets", config, "deneb.yaml"),
path.Join(fPath, "presets", config, "electra.yaml"),
}
}

View File

@@ -90,7 +90,6 @@ var mainnetBeaconConfig = &BeaconChainConfig{
// Initial value constants.
BLSWithdrawalPrefixByte: byte(0),
ETH1AddressWithdrawalPrefixByte: byte(1),
CompoundingWithdrawalPrefixByte: byte(2),
ZeroHash: [32]byte{},
// Time parameter constants.
@@ -148,9 +147,7 @@ var mainnetBeaconConfig = &BeaconChainConfig{
// Max operations per block constants.
MaxProposerSlashings: 16,
MaxAttesterSlashings: 2,
MaxAttesterSlashingsElectra: 1,
MaxAttestations: 128,
MaxAttestationsElectra: 8,
MaxDeposits: 16,
MaxVoluntaryExits: 16,
MaxWithdrawalsPerPayload: 16,
@@ -171,7 +168,6 @@ var mainnetBeaconConfig = &BeaconChainConfig{
DomainApplicationMask: bytesutil.Uint32ToBytes4(0x00000001),
DomainApplicationBuilder: bytesutil.Uint32ToBytes4(0x00000001),
DomainBLSToExecutionChange: bytesutil.Uint32ToBytes4(0x0A000000),
DomainConsolidation: bytesutil.Uint32ToBytes4(0x0B000000),
// Prysm constants.
GweiPerEth: 1000000000,
@@ -193,7 +189,6 @@ var mainnetBeaconConfig = &BeaconChainConfig{
BeaconStateBellatrixFieldCount: 25,
BeaconStateCapellaFieldCount: 28,
BeaconStateDenebFieldCount: 28,
BeaconStateElectraFieldCount: 37,
// Slasher related values.
WeakSubjectivityPeriod: 54000,
@@ -275,21 +270,11 @@ var mainnetBeaconConfig = &BeaconChainConfig{
MaxRequestBlocksDeneb: 128,
// Values related to electra
MaxRequestDataColumnSidecars: 16384,
DataColumnSidecarSubnetCount: 32,
MinPerEpochChurnLimitElectra: 128_000_000_000,
MaxPerEpochActivationExitChurnLimit: 256_000_000_000,
MaxEffectiveBalanceElectra: 2048_000_000_000,
MinSlashingPenaltyQuotientElectra: 4096,
WhistleBlowerRewardQuotientElectra: 4096,
PendingBalanceDepositLimit: 134_217_728,
PendingPartialWithdrawalsLimit: 134_217_728,
PendingConsolidationsLimit: 262_144,
MinActivationBalance: 32_000_000_000,
MaxConsolidations: 1,
MaxPendingPartialsPerWithdrawalSweep: 8,
FullExitRequestAmount: 0,
MaxWithdrawalRequestsPerPayload: 16,
NumberOfColumns: 128,
MaxRequestDataColumnSidecars: 16384,
DataColumnSidecarSubnetCount: 32,
MinPerEpochChurnLimitElectra: 128000000000,
MaxPerEpochActivationExitChurnLimit: 256000000000,
// Values related to networking parameters.
GossipMaxSize: 10 * 1 << 20, // 10 MiB
@@ -308,9 +293,6 @@ var mainnetBeaconConfig = &BeaconChainConfig{
AttestationSubnetPrefixBits: 6,
SubnetsPerNode: 2,
NodeIdBits: 256,
// PeerDAS
NumberOfColumns: 128,
}
// MainnetTestConfig provides a version of the mainnet config that has a different name

View File

@@ -64,9 +64,7 @@ func MinimalSpecConfig() *BeaconChainConfig {
// Max operations per block
minimalConfig.MaxProposerSlashings = 16
minimalConfig.MaxAttesterSlashings = 2
minimalConfig.MaxAttesterSlashingsElectra = 1
minimalConfig.MaxAttestations = 128
minimalConfig.MaxAttestationsElectra = 8
minimalConfig.MaxDeposits = 16
minimalConfig.MaxVoluntaryExits = 16
minimalConfig.MaxWithdrawalsPerPayload = 4
@@ -94,7 +92,7 @@ func MinimalSpecConfig() *BeaconChainConfig {
minimalConfig.DenebForkVersion = []byte{4, 0, 0, 1}
minimalConfig.DenebForkEpoch = math.MaxUint64
minimalConfig.ElectraForkVersion = []byte{5, 0, 0, 1}
minimalConfig.ElectraForkEpoch = math.MaxUint64
minimalConfig.AltairForkEpoch = math.MaxUint64
minimalConfig.SyncCommitteeSize = 32
minimalConfig.InactivityScoreBias = 4
@@ -104,11 +102,6 @@ func MinimalSpecConfig() *BeaconChainConfig {
// New Electra params
minimalConfig.MinPerEpochChurnLimitElectra = 64000000000
minimalConfig.MaxPerEpochActivationExitChurnLimit = 128000000000
minimalConfig.PendingConsolidationsLimit = 64
minimalConfig.MaxPartialWithdrawalsPerPayload = 1
minimalConfig.MaxWithdrawalRequestsPerPayload = 2
minimalConfig.PendingPartialWithdrawalsLimit = 64
minimalConfig.MaxPendingPartialsPerWithdrawalSweep = 1
// Ethereum PoW parameters.
minimalConfig.DepositChainID = 5 // Chain ID of eth1 goerli.

View File

@@ -31,7 +31,6 @@ type Dump struct {
FinalizedCheckpoint *eth.Checkpoint
UnrealizedJustifiedCheckpoint *eth.Checkpoint
UnrealizedFinalizedCheckpoint *eth.Checkpoint
SafeHeadRoot []byte
ProposerBoostRoot []byte
PreviousProposerBoostRoot []byte
HeadRoot []byte

View File

@@ -40,7 +40,6 @@ go_test(
"//config/fieldparams:go_default_library",
"//config/params:go_default_library",
"//crypto/hash:go_default_library",
"//encoding/bytesutil:go_default_library",
"//proto/engine/v1:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",
"//testing/assert:go_default_library",

View File

@@ -141,56 +141,6 @@ func WithdrawalSliceRoot(withdrawals []*enginev1.Withdrawal, limit uint64) ([32]
return MixInLength(bytesRoot, bytesRootBufRoot), nil
}
// DepositReceiptSliceRoot computes the HTR of a slice of deposit receipts.
// The limit parameter is used as input to the bitwise merkleization algorithm.
func DepositReceiptSliceRoot(depositReceipts []*enginev1.DepositReceipt, limit uint64) ([32]byte, error) {
roots := make([][32]byte, len(depositReceipts))
for i := 0; i < len(depositReceipts); i++ {
r, err := depositReceipts[i].HashTreeRoot()
if err != nil {
return [32]byte{}, err
}
roots[i] = r
}
bytesRoot, err := BitwiseMerkleize(roots, uint64(len(roots)), limit)
if err != nil {
return [32]byte{}, errors.Wrap(err, "could not compute merkleization")
}
bytesRootBuf := new(bytes.Buffer)
if err := binary.Write(bytesRootBuf, binary.LittleEndian, uint64(len(depositReceipts))); err != nil {
return [32]byte{}, errors.Wrap(err, "could not marshal length")
}
bytesRootBufRoot := make([]byte, 32)
copy(bytesRootBufRoot, bytesRootBuf.Bytes())
return MixInLength(bytesRoot, bytesRootBufRoot), nil
}
// WithdrawalRequestSliceRoot computes the HTR of a slice of withdrawal requests from the EL.
// The limit parameter is used as input to the bitwise merkleization algorithm.
func WithdrawalRequestSliceRoot(withdrawalRequests []*enginev1.ExecutionLayerWithdrawalRequest, limit uint64) ([32]byte, error) {
roots := make([][32]byte, len(withdrawalRequests))
for i := 0; i < len(withdrawalRequests); i++ {
r, err := withdrawalRequests[i].HashTreeRoot()
if err != nil {
return [32]byte{}, err
}
roots[i] = r
}
bytesRoot, err := BitwiseMerkleize(roots, uint64(len(roots)), limit)
if err != nil {
return [32]byte{}, errors.Wrap(err, "could not compute merkleization")
}
bytesRootBuf := new(bytes.Buffer)
if err := binary.Write(bytesRootBuf, binary.LittleEndian, uint64(len(withdrawalRequests))); err != nil {
return [32]byte{}, errors.Wrap(err, "could not marshal length")
}
bytesRootBufRoot := make([]byte, 32)
copy(bytesRootBufRoot, bytesRootBuf.Bytes())
return MixInLength(bytesRoot, bytesRootBufRoot), nil
}
// ByteSliceRoot is a helper func to merkleize an arbitrary List[Byte, N]
// this func runs Chunkify + MerkleizeVector
// max length is dividable by 32 ( root length )

View File

@@ -5,7 +5,6 @@ import (
"testing"
fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams"
"github.com/prysmaticlabs/prysm/v5/encoding/bytesutil"
"github.com/prysmaticlabs/prysm/v5/encoding/ssz"
enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
@@ -280,75 +279,3 @@ func TestWithrawalSliceRoot(t *testing.T) {
})
}
}
func TestDepositReceiptSliceRoot(t *testing.T) {
tests := []struct {
name string
input []*enginev1.DepositReceipt
limit uint64
want [32]byte
}{
{
name: "empty",
input: make([]*enginev1.DepositReceipt, 0),
want: [32]byte{0xf5, 0xa5, 0xfd, 0x42, 0xd1, 0x6a, 0x20, 0x30, 0x27, 0x98, 0xef, 0x6e, 0xd3, 0x9, 0x97, 0x9b, 0x43, 0x0, 0x3d, 0x23, 0x20, 0xd9, 0xf0, 0xe8, 0xea, 0x98, 0x31, 0xa9, 0x27, 0x59, 0xfb, 0x4b},
},
{
name: "non-empty",
input: []*enginev1.DepositReceipt{
{
Pubkey: bytesutil.PadTo([]byte{0x01, 0x02}, 48),
WithdrawalCredentials: bytesutil.PadTo([]byte{0x03, 0x04}, 32),
Amount: 5,
Signature: bytesutil.PadTo([]byte{0x06, 0x07}, 96),
Index: 8,
},
},
limit: 16,
want: [32]byte{0x34, 0xe3, 0x76, 0x5, 0xe5, 0x12, 0xe4, 0x75, 0x14, 0xf6, 0x72, 0x1c, 0x56, 0x5a, 0xa7, 0xf8, 0x8d, 0xaf, 0x84, 0xb7, 0xd7, 0x3e, 0xe6, 0x5f, 0x3f, 0xb1, 0x9f, 0x41, 0xf0, 0x10, 0x2b, 0xe6},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := ssz.DepositReceiptSliceRoot(tt.input, tt.limit)
require.NoError(t, err)
require.DeepSSZEqual(t, tt.want, got)
})
}
}
func TestWithdrawalRequestSliceRoot(t *testing.T) {
tests := []struct {
name string
input []*enginev1.ExecutionLayerWithdrawalRequest
limit uint64
want [32]byte
}{
{
name: "empty",
input: make([]*enginev1.ExecutionLayerWithdrawalRequest, 0),
want: [32]byte{0xf5, 0xa5, 0xfd, 0x42, 0xd1, 0x6a, 0x20, 0x30, 0x27, 0x98, 0xef, 0x6e, 0xd3, 0x9, 0x97, 0x9b, 0x43, 0x0, 0x3d, 0x23, 0x20, 0xd9, 0xf0, 0xe8, 0xea, 0x98, 0x31, 0xa9, 0x27, 0x59, 0xfb, 0x4b},
},
{
name: "non-empty",
input: []*enginev1.ExecutionLayerWithdrawalRequest{
{
SourceAddress: bytesutil.PadTo([]byte{0x01, 0x02}, 20),
ValidatorPubkey: bytesutil.PadTo([]byte{0x03, 0x04}, 48),
Amount: 5,
},
},
limit: 16,
want: [32]byte{0xa8, 0xab, 0xb2, 0x20, 0xe6, 0xd6, 0x5a, 0x7e, 0x56, 0x60, 0xe4, 0x9d, 0xae, 0x36, 0x17, 0x3d, 0x8b, 0xd, 0xde, 0x28, 0x96, 0x5, 0x82, 0x72, 0x18, 0xda, 0xc7, 0x5a, 0x53, 0xe0, 0x35, 0xf7},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := ssz.WithdrawalRequestSliceRoot(tt.input, tt.limit)
require.NoError(t, err)
require.DeepSSZEqual(t, tt.want, got)
})
}
}

View File

@@ -41,13 +41,9 @@ ssz_gen_marshal(
"ExecutionPayloadHeaderCapella",
"ExecutionPayloadHeaderDeneb",
"ExecutionPayloadDeneb",
"ExecutionPayloadHeaderElectra",
"ExecutionPayloadElectra",
"BlindedBlobsBundle",
"BlobsBundle",
"Withdrawal",
"ExecutionLayerWithdrawalRequest",
"DepositReceipt",
],
)

File diff suppressed because it is too large Load Diff

View File

@@ -86,29 +86,6 @@ message ExecutionPayloadDeneb {
uint64 excess_blob_gas = 17;
}
message ExecutionPayloadElectra {
bytes parent_hash = 1 [(ethereum.eth.ext.ssz_size) = "32"];
bytes fee_recipient = 2 [(ethereum.eth.ext.ssz_size) = "20"];
bytes state_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
bytes receipts_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
bytes logs_bloom = 5 [(ethereum.eth.ext.ssz_size) = "logs_bloom.size"];
bytes prev_randao = 6 [(ethereum.eth.ext.ssz_size) = "32"];
uint64 block_number = 7;
uint64 gas_limit = 8;
uint64 gas_used = 9;
uint64 timestamp = 10;
bytes extra_data = 11 [(ethereum.eth.ext.ssz_max) = "extra_data.size"];
bytes base_fee_per_gas = 12 [(ethereum.eth.ext.ssz_size) = "32"];
bytes block_hash = 13 [(ethereum.eth.ext.ssz_size) = "32"];
repeated bytes transactions = 14 [(ethereum.eth.ext.ssz_size) = "?,?", (ethereum.eth.ext.ssz_max) = "1048576,1073741824"];
// MAX_WITHDRAWALS_PER_PAYLOAD
repeated Withdrawal withdrawals = 15 [(ethereum.eth.ext.ssz_max) = "withdrawal.size"];
uint64 blob_gas_used = 16;
uint64 excess_blob_gas = 17;
repeated DepositReceipt deposit_receipts = 18 [(ethereum.eth.ext.ssz_max) = "max_deposit_receipts"]; // new in electra, eip6110
repeated ExecutionLayerWithdrawalRequest withdrawal_requests = 19 [(ethereum.eth.ext.ssz_max) = "max_withdrawal_requests_per_payload.size"]; // new in electra, eip7002, eip7251
}
message ExecutionPayloadCapellaWithValue {
ExecutionPayloadCapella payload = 1;
bytes value = 2;
@@ -177,28 +154,6 @@ message ExecutionPayloadHeaderDeneb {
uint64 excess_blob_gas = 17;
}
message ExecutionPayloadHeaderElectra {
bytes parent_hash = 1 [(ethereum.eth.ext.ssz_size) = "32"];
bytes fee_recipient = 2 [(ethereum.eth.ext.ssz_size) = "20"];
bytes state_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
bytes receipts_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
bytes logs_bloom = 5 [(ethereum.eth.ext.ssz_size) = "logs_bloom.size"];
bytes prev_randao = 6 [(ethereum.eth.ext.ssz_size) = "32"];
uint64 block_number = 7;
uint64 gas_limit = 8;
uint64 gas_used = 9;
uint64 timestamp = 10;
bytes extra_data = 11 [(ethereum.eth.ext.ssz_max) = "extra_data.size"];
bytes base_fee_per_gas = 12 [(ethereum.eth.ext.ssz_size) = "32"];
bytes block_hash = 13 [(ethereum.eth.ext.ssz_size) = "32"];
bytes transactions_root = 14 [(ethereum.eth.ext.ssz_size) = "32"];
bytes withdrawals_root = 15 [(ethereum.eth.ext.ssz_size) = "32"];
uint64 blob_gas_used = 16;
uint64 excess_blob_gas = 17;
bytes deposit_receipts_root = 18 [(ethereum.eth.ext.ssz_size) = "32"]; // new in electra, eip6110
bytes withdrawal_requests_root = 19 [(ethereum.eth.ext.ssz_size) = "32"]; // new in electra, eip7002, eip7251
}
message PayloadAttributes {
uint64 timestamp = 1;
bytes prev_randao = 2 [(ethereum.eth.ext.ssz_size) = "32"];
@@ -277,26 +232,3 @@ message Blob {
message ExchangeCapabilities {
repeated string supported_methods = 1;
}
// ExecutionLayerWithdrawalRequest is the message from the execution layer to trigger the withdrawal of a validator's balance to its withdrawal address
// new in Electra
message ExecutionLayerWithdrawalRequest {
// The execution address receiving the funds
bytes source_address = 1 [(ethereum.eth.ext.ssz_size) = "20"];
// 48 byte BLS public key of the validator.
bytes validator_pubkey = 2 [(ethereum.eth.ext.ssz_size) = "48"];
// Deposit amount in gwei.
uint64 amount = 3;
}
// DepositReceipt is the message from the execution layer to trigger the deposit of a validator's balance to its balance
// new in Electra
message DepositReceipt {
bytes pubkey = 1 [(ethereum.eth.ext.ssz_size) = "48"];
bytes withdrawal_credentials = 2 [(ethereum.eth.ext.ssz_size) = "32"];
uint64 amount = 3;
bytes signature = 4 [(ethereum.eth.ext.ssz_size) = "96"];
uint64 index = 5;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
// Code generated by fastssz. DO NOT EDIT.
// Hash: 13c946aa898cca1afa84687b619bc5a10fc79a46340e98dcfb07dde835d39a0c
// Hash: 5890b3492dbdff08d332879e83ae45e7bd9f94da0716b1b0517f1766028a8d67
package v1
import (

View File

@@ -1,5 +1,5 @@
// Code generated by fastssz. DO NOT EDIT.
// Hash: 6b214399116c0ca31026da23db2b85fccd78e16d7b9113c83b4a9ee4e60977f6
// Hash: 2ed480e3c144fb091e0aa2757a79e78da573f90b18d0d8acd35fa9705f6c1b08
package eth
import (

View File

@@ -18,7 +18,6 @@ proto_library(
srcs = [
"beacon_chain.proto",
"debug.proto",
"eip_7251.proto",
"finalized_block_root_container.proto",
"health.proto",
"node.proto",
@@ -68,9 +67,6 @@ ssz_gen_marshal(
"BeaconBlockDeneb",
"BeaconBlockBodyDeneb",
"SignedBeaconBlockDeneb",
"BeaconBlockElectra",
"BeaconBlockElectra",
"SignedBeaconBlockElectra",
"SignedBlindedBeaconBlockCapella",
"BlindedBeaconBlockCapella",
"BlindedBeaconBlockBodyCapella",
@@ -79,9 +75,6 @@ ssz_gen_marshal(
"SignedBeaconBlockContentsDeneb",
"BlindedBeaconBlockDeneb",
"BlindedBeaconBlockBodyDeneb",
"SignedBlindedBeaconBlockElectra",
"BlindedBeaconBlockElectra",
"BlindedBeaconBlockBodyElectra",
"SyncAggregate",
"SyncCommitteeMessage",
"SyncCommitteeContribution",
@@ -94,22 +87,17 @@ ssz_gen_marshal(
"MetaDataV1",
"Status",
"AggregateAttestationAndProof",
"AggregateAttestationAndProofElectra",
"Attestation",
"AttestationElectra",
"AttestationData",
"AttesterSlashing",
"AttesterSlashingElectra",
"BeaconBlock",
"BeaconBlockHeader",
"Checkpoint",
"Deposit",
"Eth1Data",
"IndexedAttestation",
"IndexedAttestationElectra",
"ProposerSlashing",
"SignedAggregateAttestationAndProof",
"SignedAggregateAttestationAndProofElectra",
"SignedBeaconBlock",
"SignedBeaconBlockHeader",
"SignedVoluntaryExit",
@@ -127,7 +115,6 @@ ssz_gen_marshal(
"BeaconStateBellatrix",
"BeaconStateCapella",
"BeaconStateDeneb",
"BeaconStateElectra",
"SigningData",
"SyncCommittee",
"SyncAggregatorSelectionData",
@@ -144,11 +131,6 @@ ssz_gen_marshal(
"BlobSidecars",
"BlobIdentifier",
"DepositSnapshot",
"PendingBalanceDeposit",
"PendingPartialWithdrawal",
"Consolidation",
"SignedConsolidation",
"PendingConsolidation",
],
)
@@ -206,7 +188,6 @@ go_library(
name = "go_default_library",
srcs = [
"cloners.go",
"eip_7251.go",
"sync_committee_mainnet.go",
"sync_committee_minimal.go", # keep
":ssz_generated_files", # keep
@@ -260,10 +241,7 @@ ssz_proto_files(
go_test(
name = "go_default_test",
srcs = [
"cloners_test.go",
"eip_7251_test.go",
],
srcs = ["cloners_test.go"],
embed = [":go_default_library"],
deps = [
"//testing/assert:go_default_library",

View File

@@ -1 +0,0 @@
package eth

View File

@@ -87,77 +87,6 @@ func (x *Attestation) GetSignature() []byte {
return nil
}
type AttestationElectra struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
AggregationBits github_com_prysmaticlabs_go_bitfield.Bitlist `protobuf:"bytes,1,opt,name=aggregation_bits,json=aggregationBits,proto3" json:"aggregation_bits,omitempty" cast-type:"github.com/prysmaticlabs/go-bitfield.Bitlist" ssz-max:"131072"`
Data *AttestationData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
CommitteeBits github_com_prysmaticlabs_go_bitfield.Bitvector64 `protobuf:"bytes,4,opt,name=committee_bits,json=committeeBits,proto3" json:"committee_bits,omitempty" cast-type:"github.com/prysmaticlabs/go-bitfield.Bitvector64" ssz-size:"8"`
Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"`
}
func (x *AttestationElectra) Reset() {
*x = AttestationElectra{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AttestationElectra) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AttestationElectra) ProtoMessage() {}
func (x *AttestationElectra) ProtoReflect() protoreflect.Message {
mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AttestationElectra.ProtoReflect.Descriptor instead.
func (*AttestationElectra) Descriptor() ([]byte, []int) {
return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{1}
}
func (x *AttestationElectra) GetAggregationBits() github_com_prysmaticlabs_go_bitfield.Bitlist {
if x != nil {
return x.AggregationBits
}
return github_com_prysmaticlabs_go_bitfield.Bitlist(nil)
}
func (x *AttestationElectra) GetData() *AttestationData {
if x != nil {
return x.Data
}
return nil
}
func (x *AttestationElectra) GetCommitteeBits() github_com_prysmaticlabs_go_bitfield.Bitvector64 {
if x != nil {
return x.CommitteeBits
}
return github_com_prysmaticlabs_go_bitfield.Bitvector64(nil)
}
func (x *AttestationElectra) GetSignature() []byte {
if x != nil {
return x.Signature
}
return nil
}
type AggregateAttestationAndProof struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -171,7 +100,7 @@ type AggregateAttestationAndProof struct {
func (x *AggregateAttestationAndProof) Reset() {
*x = AggregateAttestationAndProof{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[2]
mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -184,7 +113,7 @@ func (x *AggregateAttestationAndProof) String() string {
func (*AggregateAttestationAndProof) ProtoMessage() {}
func (x *AggregateAttestationAndProof) ProtoReflect() protoreflect.Message {
mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[2]
mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -197,7 +126,7 @@ func (x *AggregateAttestationAndProof) ProtoReflect() protoreflect.Message {
// Deprecated: Use AggregateAttestationAndProof.ProtoReflect.Descriptor instead.
func (*AggregateAttestationAndProof) Descriptor() ([]byte, []int) {
return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{2}
return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{1}
}
func (x *AggregateAttestationAndProof) GetAggregatorIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex {
@@ -221,69 +150,6 @@ func (x *AggregateAttestationAndProof) GetSelectionProof() []byte {
return nil
}
type AggregateAttestationAndProofElectra struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
AggregatorIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,1,opt,name=aggregator_index,json=aggregatorIndex,proto3" json:"aggregator_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"`
Aggregate *AttestationElectra `protobuf:"bytes,3,opt,name=aggregate,proto3" json:"aggregate,omitempty"`
SelectionProof []byte `protobuf:"bytes,2,opt,name=selection_proof,json=selectionProof,proto3" json:"selection_proof,omitempty" ssz-size:"96"`
}
func (x *AggregateAttestationAndProofElectra) Reset() {
*x = AggregateAttestationAndProofElectra{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AggregateAttestationAndProofElectra) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AggregateAttestationAndProofElectra) ProtoMessage() {}
func (x *AggregateAttestationAndProofElectra) ProtoReflect() protoreflect.Message {
mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AggregateAttestationAndProofElectra.ProtoReflect.Descriptor instead.
func (*AggregateAttestationAndProofElectra) Descriptor() ([]byte, []int) {
return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{3}
}
func (x *AggregateAttestationAndProofElectra) GetAggregatorIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex {
if x != nil {
return x.AggregatorIndex
}
return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0)
}
func (x *AggregateAttestationAndProofElectra) GetAggregate() *AttestationElectra {
if x != nil {
return x.Aggregate
}
return nil
}
func (x *AggregateAttestationAndProofElectra) GetSelectionProof() []byte {
if x != nil {
return x.SelectionProof
}
return nil
}
type SignedAggregateAttestationAndProof struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -296,7 +162,7 @@ type SignedAggregateAttestationAndProof struct {
func (x *SignedAggregateAttestationAndProof) Reset() {
*x = SignedAggregateAttestationAndProof{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[4]
mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -309,7 +175,7 @@ func (x *SignedAggregateAttestationAndProof) String() string {
func (*SignedAggregateAttestationAndProof) ProtoMessage() {}
func (x *SignedAggregateAttestationAndProof) ProtoReflect() protoreflect.Message {
mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[4]
mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -322,7 +188,7 @@ func (x *SignedAggregateAttestationAndProof) ProtoReflect() protoreflect.Message
// Deprecated: Use SignedAggregateAttestationAndProof.ProtoReflect.Descriptor instead.
func (*SignedAggregateAttestationAndProof) Descriptor() ([]byte, []int) {
return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{4}
return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{2}
}
func (x *SignedAggregateAttestationAndProof) GetMessage() *AggregateAttestationAndProof {
@@ -339,61 +205,6 @@ func (x *SignedAggregateAttestationAndProof) GetSignature() []byte {
return nil
}
type SignedAggregateAttestationAndProofElectra struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Message *AggregateAttestationAndProofElectra `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"`
}
func (x *SignedAggregateAttestationAndProofElectra) Reset() {
*x = SignedAggregateAttestationAndProofElectra{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SignedAggregateAttestationAndProofElectra) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SignedAggregateAttestationAndProofElectra) ProtoMessage() {}
func (x *SignedAggregateAttestationAndProofElectra) ProtoReflect() protoreflect.Message {
mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SignedAggregateAttestationAndProofElectra.ProtoReflect.Descriptor instead.
func (*SignedAggregateAttestationAndProofElectra) Descriptor() ([]byte, []int) {
return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{5}
}
func (x *SignedAggregateAttestationAndProofElectra) GetMessage() *AggregateAttestationAndProofElectra {
if x != nil {
return x.Message
}
return nil
}
func (x *SignedAggregateAttestationAndProofElectra) GetSignature() []byte {
if x != nil {
return x.Signature
}
return nil
}
type AttestationData struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -409,7 +220,7 @@ type AttestationData struct {
func (x *AttestationData) Reset() {
*x = AttestationData{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[6]
mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -422,7 +233,7 @@ func (x *AttestationData) String() string {
func (*AttestationData) ProtoMessage() {}
func (x *AttestationData) ProtoReflect() protoreflect.Message {
mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[6]
mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -435,7 +246,7 @@ func (x *AttestationData) ProtoReflect() protoreflect.Message {
// Deprecated: Use AttestationData.ProtoReflect.Descriptor instead.
func (*AttestationData) Descriptor() ([]byte, []int) {
return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{6}
return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{3}
}
func (x *AttestationData) GetSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot {
@@ -485,7 +296,7 @@ type Checkpoint struct {
func (x *Checkpoint) Reset() {
*x = Checkpoint{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[7]
mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -498,7 +309,7 @@ func (x *Checkpoint) String() string {
func (*Checkpoint) ProtoMessage() {}
func (x *Checkpoint) ProtoReflect() protoreflect.Message {
mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[7]
mi := &file_proto_prysm_v1alpha1_attestation_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -511,7 +322,7 @@ func (x *Checkpoint) ProtoReflect() protoreflect.Message {
// Deprecated: Use Checkpoint.ProtoReflect.Descriptor instead.
func (*Checkpoint) Descriptor() ([]byte, []int) {
return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{7}
return file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP(), []int{4}
}
func (x *Checkpoint) GetEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch {
@@ -550,58 +361,20 @@ var file_proto_prysm_v1alpha1_attestation_proto_rawDesc = []byte{
0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x24, 0x0a,
0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c,
0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74,
0x75, 0x72, 0x65, 0x22, 0xbf, 0x02, 0x0a, 0x12, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x65, 0x0a, 0x10, 0x61, 0x67,
0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0c, 0x42, 0x3a, 0x82, 0xb5, 0x18, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61,
0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x42,
0x69, 0x74, 0x6c, 0x69, 0x73, 0x74, 0x92, 0xb5, 0x18, 0x06, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32,
0x52, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74,
0x73, 0x12, 0x3a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76,
0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x60, 0x0a,
0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18,
0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x39, 0x82, 0xb5, 0x18, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75,
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c,
0x61, 0x62, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e,
0x42, 0x69, 0x74, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x36, 0x34, 0x8a, 0xb5, 0x18, 0x01, 0x38,
0x52, 0x0d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x42, 0x69, 0x74, 0x73, 0x12,
0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01,
0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e,
0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x8d, 0x02, 0x0a, 0x1c, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67,
0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e,
0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x7a, 0x0a, 0x10, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67,
0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04,
0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70,
0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75,
0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76,
0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65,
0x78, 0x52, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64,
0x65, 0x78, 0x12, 0x40, 0x0a, 0x09, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18,
0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d,
0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74,
0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x61, 0x67, 0x67, 0x72, 0x65,
0x67, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x0f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f,
0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a,
0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x0e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x9b, 0x02, 0x0a, 0x23, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67,
0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e,
0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x7a, 0x0a,
0x10, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65,
0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74,
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69,
0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63,
0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70,
0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61,
0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67,
0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x47, 0x0a, 0x09, 0x61, 0x67, 0x67,
0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65,
0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c,
0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x09, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61,
0x75, 0x72, 0x65, 0x22, 0x8d, 0x02, 0x0a, 0x1c, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74,
0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50,
0x72, 0x6f, 0x6f, 0x66, 0x12, 0x7a, 0x0a, 0x10, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74,
0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f,
0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70,
0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79,
0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d,
0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73,
0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52,
0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78,
0x12, 0x40, 0x0a, 0x09, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65,
0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65,
0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61,
0x74, 0x65, 0x12, 0x2f, 0x0a, 0x0f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18,
0x02, 0x39, 0x36, 0x52, 0x0e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72,
@@ -615,61 +388,51 @@ var file_proto_prysm_v1alpha1_attestation_proto_rawDesc = []byte{
0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67,
0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5,
0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22,
0xa7, 0x01, 0x0a, 0x29, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67,
0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e,
0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x54, 0x0a,
0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a,
0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31,
0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65,
0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x50, 0x72,
0x6f, 0x6f, 0x66, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09,
0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x90, 0x03, 0x0a, 0x0f, 0x41, 0x74,
0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x59, 0x0a,
0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18,
0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73,
0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f,
0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70,
0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c,
0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x78, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x6d,
0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28,
0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x90, 0x03, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44,
0x61, 0x74, 0x61, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f,
0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73,
0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69,
0x76, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64,
0x65, 0x78, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x49, 0x6e, 0x64,
0x65, 0x78, 0x12, 0x32, 0x0a, 0x11, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f,
0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a,
0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f,
0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x39, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75,
0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43,
0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63,
0x65, 0x12, 0x39, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68,
0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70,
0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0x86, 0x01, 0x0a,
0x0a, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x5c, 0x0a, 0x05, 0x65,
0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42,
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d,
0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76,
0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65,
0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f,
0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x04, 0x72, 0x6f, 0x6f,
0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52,
0x04, 0x72, 0x6f, 0x6f, 0x74, 0x42, 0x9b, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74,
0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70,
0x68, 0x61, 0x31, 0x42, 0x10, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62,
0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b,
0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45,
0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74,
0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70,
0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x78,
0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65,
0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74,
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69,
0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63,
0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70,
0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
0x74, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x32, 0x0a, 0x11, 0x62, 0x65, 0x61, 0x63,
0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20,
0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x62, 0x65, 0x61,
0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x39, 0x0a, 0x06,
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65,
0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c,
0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52,
0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65,
0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65,
0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e,
0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67,
0x65, 0x74, 0x22, 0x86, 0x01, 0x0a, 0x0a, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e,
0x74, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04,
0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70,
0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75,
0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76,
0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12,
0x1a, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a,
0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x42, 0x9b, 0x01, 0x0a, 0x19,
0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68,
0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x41, 0x74, 0x74, 0x65, 0x73,
0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61,
0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35,
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61,
0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65,
0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61,
0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68,
0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (
@@ -684,31 +447,25 @@ func file_proto_prysm_v1alpha1_attestation_proto_rawDescGZIP() []byte {
return file_proto_prysm_v1alpha1_attestation_proto_rawDescData
}
var file_proto_prysm_v1alpha1_attestation_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_proto_prysm_v1alpha1_attestation_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_proto_prysm_v1alpha1_attestation_proto_goTypes = []interface{}{
(*Attestation)(nil), // 0: ethereum.eth.v1alpha1.Attestation
(*AttestationElectra)(nil), // 1: ethereum.eth.v1alpha1.AttestationElectra
(*AggregateAttestationAndProof)(nil), // 2: ethereum.eth.v1alpha1.AggregateAttestationAndProof
(*AggregateAttestationAndProofElectra)(nil), // 3: ethereum.eth.v1alpha1.AggregateAttestationAndProofElectra
(*SignedAggregateAttestationAndProof)(nil), // 4: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof
(*SignedAggregateAttestationAndProofElectra)(nil), // 5: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProofElectra
(*AttestationData)(nil), // 6: ethereum.eth.v1alpha1.AttestationData
(*Checkpoint)(nil), // 7: ethereum.eth.v1alpha1.Checkpoint
(*Attestation)(nil), // 0: ethereum.eth.v1alpha1.Attestation
(*AggregateAttestationAndProof)(nil), // 1: ethereum.eth.v1alpha1.AggregateAttestationAndProof
(*SignedAggregateAttestationAndProof)(nil), // 2: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof
(*AttestationData)(nil), // 3: ethereum.eth.v1alpha1.AttestationData
(*Checkpoint)(nil), // 4: ethereum.eth.v1alpha1.Checkpoint
}
var file_proto_prysm_v1alpha1_attestation_proto_depIdxs = []int32{
6, // 0: ethereum.eth.v1alpha1.Attestation.data:type_name -> ethereum.eth.v1alpha1.AttestationData
6, // 1: ethereum.eth.v1alpha1.AttestationElectra.data:type_name -> ethereum.eth.v1alpha1.AttestationData
0, // 2: ethereum.eth.v1alpha1.AggregateAttestationAndProof.aggregate:type_name -> ethereum.eth.v1alpha1.Attestation
1, // 3: ethereum.eth.v1alpha1.AggregateAttestationAndProofElectra.aggregate:type_name -> ethereum.eth.v1alpha1.AttestationElectra
2, // 4: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof.message:type_name -> ethereum.eth.v1alpha1.AggregateAttestationAndProof
3, // 5: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProofElectra.message:type_name -> ethereum.eth.v1alpha1.AggregateAttestationAndProofElectra
7, // 6: ethereum.eth.v1alpha1.AttestationData.source:type_name -> ethereum.eth.v1alpha1.Checkpoint
7, // 7: ethereum.eth.v1alpha1.AttestationData.target:type_name -> ethereum.eth.v1alpha1.Checkpoint
8, // [8:8] is the sub-list for method output_type
8, // [8:8] is the sub-list for method input_type
8, // [8:8] is the sub-list for extension type_name
8, // [8:8] is the sub-list for extension extendee
0, // [0:8] is the sub-list for field type_name
3, // 0: ethereum.eth.v1alpha1.Attestation.data:type_name -> ethereum.eth.v1alpha1.AttestationData
0, // 1: ethereum.eth.v1alpha1.AggregateAttestationAndProof.aggregate:type_name -> ethereum.eth.v1alpha1.Attestation
1, // 2: ethereum.eth.v1alpha1.SignedAggregateAttestationAndProof.message:type_name -> ethereum.eth.v1alpha1.AggregateAttestationAndProof
4, // 3: ethereum.eth.v1alpha1.AttestationData.source:type_name -> ethereum.eth.v1alpha1.Checkpoint
4, // 4: ethereum.eth.v1alpha1.AttestationData.target:type_name -> ethereum.eth.v1alpha1.Checkpoint
5, // [5:5] is the sub-list for method output_type
5, // [5:5] is the sub-list for method input_type
5, // [5:5] is the sub-list for extension type_name
5, // [5:5] is the sub-list for extension extendee
0, // [0:5] is the sub-list for field type_name
}
func init() { file_proto_prysm_v1alpha1_attestation_proto_init() }
@@ -730,18 +487,6 @@ func file_proto_prysm_v1alpha1_attestation_proto_init() {
}
}
file_proto_prysm_v1alpha1_attestation_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AttestationElectra); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_prysm_v1alpha1_attestation_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AggregateAttestationAndProof); i {
case 0:
return &v.state
@@ -753,19 +498,7 @@ func file_proto_prysm_v1alpha1_attestation_proto_init() {
return nil
}
}
file_proto_prysm_v1alpha1_attestation_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AggregateAttestationAndProofElectra); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_prysm_v1alpha1_attestation_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_proto_prysm_v1alpha1_attestation_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SignedAggregateAttestationAndProof); i {
case 0:
return &v.state
@@ -777,19 +510,7 @@ func file_proto_prysm_v1alpha1_attestation_proto_init() {
return nil
}
}
file_proto_prysm_v1alpha1_attestation_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SignedAggregateAttestationAndProofElectra); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_prysm_v1alpha1_attestation_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_proto_prysm_v1alpha1_attestation_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AttestationData); i {
case 0:
return &v.state
@@ -801,7 +522,7 @@ func file_proto_prysm_v1alpha1_attestation_proto_init() {
return nil
}
}
file_proto_prysm_v1alpha1_attestation_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_proto_prysm_v1alpha1_attestation_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Checkpoint); i {
case 0:
return &v.state
@@ -820,7 +541,7 @@ func file_proto_prysm_v1alpha1_attestation_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_proto_prysm_v1alpha1_attestation_proto_rawDesc,
NumEnums: 0,
NumMessages: 8,
NumMessages: 5,
NumExtensions: 0,
NumServices: 0,
},

View File

@@ -35,20 +35,6 @@ message Attestation {
bytes signature = 3 [(ethereum.eth.ext.ssz_size) = "96"];
}
message AttestationElectra {
// A bitfield representation of validator indices that have voted exactly
// the same vote and have been aggregated into this attestation.
bytes aggregation_bits = 1 [(ethereum.eth.ext.ssz_max) = "max_attesting_indices.size", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitlist"];
AttestationData data = 2;
// TODO: doc
bytes committee_bits = 4 [(ethereum.eth.ext.ssz_size) = "committee_bits.size", (ethereum.eth.ext.cast_type) = "committee_bits.type"];
// 96 byte BLS aggregate signature.
bytes signature = 3 [(ethereum.eth.ext.ssz_size) = "96"];
}
message AggregateAttestationAndProof {
// The aggregator index that submitted this aggregated attestation and proof.
uint64 aggregator_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"];
@@ -60,17 +46,6 @@ message AggregateAttestationAndProof {
bytes selection_proof = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
message AggregateAttestationAndProofElectra {
// The aggregator index that submitted this aggregated attestation and proof.
uint64 aggregator_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"];
// The aggregated attestation that was submitted.
AttestationElectra aggregate = 3;
// 96 byte selection proof signed by the aggregator, which is the signature of the slot to aggregate.
bytes selection_proof = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
message SignedAggregateAttestationAndProof {
// The aggregated attestation and selection proof itself.
AggregateAttestationAndProof message = 1;
@@ -79,14 +54,6 @@ message SignedAggregateAttestationAndProof {
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
message SignedAggregateAttestationAndProofElectra {
// The aggregated attestation and selection proof itself.
AggregateAttestationAndProofElectra message = 1;
// 96 byte BLS aggregate signature signed by the aggregator over the message.
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
message AttestationData {
// Attestation data includes information on Casper the Friendly Finality Gadget's votes
// See: https://arxiv.org/pdf/1710.09437.pdf

File diff suppressed because it is too large Load Diff

View File

@@ -19,7 +19,6 @@ import "proto/eth/ext/options.proto";
import "proto/prysm/v1alpha1/attestation.proto";
import "proto/prysm/v1alpha1/withdrawals.proto";
import "proto/engine/v1/execution_engine.proto";
import "proto/prysm/v1alpha1/eip_7251.proto";
option csharp_namespace = "Ethereum.Eth.v1alpha1";
option go_package = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1;eth";
@@ -51,14 +50,7 @@ message GenericSignedBeaconBlock {
// Representing a signed, post-Deneb fork beacon block content.
SignedBeaconBlockContentsDeneb deneb = 7;
// Representing a signed, post-Deneb fork blinded beacon block.
SignedBlindedBeaconBlockDeneb blinded_deneb = 8;
// Representing a signed, post-Electra fork beacon block content.
SignedBeaconBlockContentsElectra electra = 9;
// Representing a signed, post-Electra fork blinded beacon block.
SignedBlindedBeaconBlockElectra blinded_electra = 10;
}
bool is_blinded = 100;
reserved 101; // Deprecated fields
@@ -87,14 +79,7 @@ message GenericBeaconBlock {
// Representing a signed, post-Deneb fork beacon block content.
BeaconBlockContentsDeneb deneb = 7;
// Representing a post-Deneb fork blinded beacon block.
BlindedBeaconBlockDeneb blinded_deneb = 8;
// Representing a signed, post-Electra fork beacon block content.
BeaconBlockContentsElectra electra = 9;
// Representing a post-Electra fork blinded beacon block.
BlindedBeaconBlockElectra blinded_electra = 10;
}
bool is_blinded = 100;
string payload_value = 101;
@@ -241,14 +226,6 @@ message AttesterSlashing {
IndexedAttestation attestation_2 = 2;
}
message AttesterSlashingElectra {
// First conflicting attestation.
IndexedAttestationElectra attestation_1 = 1;
// Second conflicting attestation.
IndexedAttestationElectra attestation_2 = 2;
}
// Deposit into the Ethereum consensus from the Ethereum 1.x deposit contract.
message Deposit {
// DepositData that is encoded into a deposit signature.
@@ -344,15 +321,6 @@ message IndexedAttestation {
bytes signature = 3 [(ethereum.eth.ext.ssz_size) = "96"];
}
message IndexedAttestationElectra {
repeated uint64 attesting_indices = 1 [(ethereum.eth.ext.ssz_max) = "max_attesting_indices.size"];
AttestationData data = 2;
// 96 bytes aggregate signature.
bytes signature = 3 [(ethereum.eth.ext.ssz_size) = "96"];
}
// The sync aggregate object for the beacon chain to track sync committee votes and to
// support light client infra.
message SyncAggregate {
@@ -748,151 +716,6 @@ message BlindedBeaconBlockBodyDeneb {
repeated bytes blob_kzg_commitments = 12 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "max_blob_commitments.size"];
}
message SignedBeaconBlockContentsElectra {
SignedBeaconBlockElectra block = 1;
repeated bytes kzg_proofs = 2 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "4096"];
repeated bytes blobs = 3 [(ethereum.eth.ext.ssz_size) = "?,blob.size", (ethereum.eth.ext.ssz_max) = "4096"];
}
message BeaconBlockContentsElectra {
BeaconBlockElectra block = 1;
repeated bytes kzg_proofs = 2 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "4096"];
repeated bytes blobs = 3 [(ethereum.eth.ext.ssz_size) = "?,blob.size", (ethereum.eth.ext.ssz_max) = "4096"];
}
message SignedBeaconBlockElectra {
// The unsigned beacon block itself.
BeaconBlockElectra block = 1;
// 96 byte BLS signature from the validator that produced this block.
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
message BeaconBlockElectra {
// Beacon chain slot that this block represents.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"];
// Validator index of the validator that proposed the block header.
uint64 proposer_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"];
// 32 byte root of the parent block.
bytes parent_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// 32 byte root of the resulting state after processing this block.
bytes state_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
// The beacon block body.
BeaconBlockBodyElectra body = 5;
}
message BeaconBlockBodyElectra {
// The validators RANDAO reveal 96 byte value.
bytes randao_reveal = 1 [(ethereum.eth.ext.ssz_size) = "96"];
// A reference to the Ethereum 1.x chain.
Eth1Data eth1_data = 2;
// 32 byte field of arbitrary data. This field may contain any data and
// is not used for anything other than a fun message.
bytes graffiti = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// Block operations
// Refer to spec constants at https://github.com/ethereum/consensus-specs/blob/dev/specs/core/0_beacon-chain.md#max-operations-per-block
// At most MAX_PROPOSER_SLASHINGS.
repeated ProposerSlashing proposer_slashings = 4 [(ethereum.eth.ext.ssz_max) = "16"];
// At most MAX_ATTESTER_SLASHINGS_ELECTRA.
repeated AttesterSlashingElectra attester_slashings = 5 [(ethereum.eth.ext.ssz_max) = "1"];
// At most MAX_ATTESTATIONS_ELECTRA.
repeated AttestationElectra attestations = 6 [(ethereum.eth.ext.ssz_max) = "8"];
// At most MAX_DEPOSITS.
repeated Deposit deposits = 7 [(ethereum.eth.ext.ssz_max) = "16"];
// At most MAX_VOLUNTARY_EXITS.
repeated SignedVoluntaryExit voluntary_exits = 8 [(ethereum.eth.ext.ssz_max) = "16"];
// Sync aggregate object for the beacon chain to track sync committee votes. New in Altair network upgrade.
SyncAggregate sync_aggregate = 9;
// Execution payload from the execution chain. New in Bellatrix network upgrade.
ethereum.engine.v1.ExecutionPayloadElectra execution_payload = 10;
// At most MAX_BLS_TO_EXECUTION_CHANGES. New in Capella network upgrade.
repeated SignedBLSToExecutionChange bls_to_execution_changes = 11 [(ethereum.eth.ext.ssz_max) = "16"];
repeated bytes blob_kzg_commitments = 12 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "max_blob_commitments.size"];
repeated SignedConsolidation consolidations = 13 [(ethereum.eth.ext.ssz_max) = "1"]; // New in Electra EIP-7251.
}
message SignedBlindedBeaconBlockElectra {
// The unsigned blinded beacon block itself.
BlindedBeaconBlockElectra message = 1;
// 96 byte BLS signature from the validator that produced this blinded block.
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
message BlindedBeaconBlockElectra {
// Beacon chain slot that this blinded block represents.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"];
// Validator index of the validator that proposed the block header.
uint64 proposer_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"];
// 32 byte root of the parent block.
bytes parent_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// 32 byte root of the resulting state after processing this blinded block.
bytes state_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
// The blinded beacon block body.
BlindedBeaconBlockBodyElectra body = 5;
}
message BlindedBeaconBlockBodyElectra {
// The validators RANDAO reveal 96 byte value.
bytes randao_reveal = 1 [(ethereum.eth.ext.ssz_size) = "96"];
// A reference to the Ethereum 1.x chain.
Eth1Data eth1_data = 2;
// 32 byte field of arbitrary data. This field may contain any data and
// is not used for anything other than a fun message.
bytes graffiti = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// At most MAX_PROPOSER_SLASHINGS.
repeated ProposerSlashing proposer_slashings = 4 [(ethereum.eth.ext.ssz_max) = "16"];
// At most MAX_ATTESTER_SLASHINGS_ELECTRA.
repeated AttesterSlashingElectra attester_slashings = 5 [(ethereum.eth.ext.ssz_max) = "1"];
// At most MAX_ATTESTATIONS_ELECTRA.
repeated AttestationElectra attestations = 6 [(ethereum.eth.ext.ssz_max) = "8"];
// At most MAX_DEPOSITS.
repeated Deposit deposits = 7 [(ethereum.eth.ext.ssz_max) = "16"];
// At most MAX_VOLUNTARY_EXITS.
repeated SignedVoluntaryExit voluntary_exits = 8 [(ethereum.eth.ext.ssz_max) = "16"];
// Sync aggregate object for the beacon chain to track sync committee votes. New in Altair network upgrade.
SyncAggregate sync_aggregate = 9;
// Execution payload header from the execution chain. New in Bellatrix network upgrade to accommodate MEV interaction.
ethereum.engine.v1.ExecutionPayloadHeaderElectra execution_payload_header = 10;
// At most MAX_BLS_TO_EXECUTION_CHANGES. New in Capella network upgrade.
repeated SignedBLSToExecutionChange bls_to_execution_changes = 11 [(ethereum.eth.ext.ssz_max) = "16"];
repeated bytes blob_kzg_commitments = 12 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "max_blob_commitments.size"];
repeated SignedConsolidation consolidations = 13 [(ethereum.eth.ext.ssz_max) = "1"]; // New in Electra EIP-7251.
}
message ValidatorRegistrationV1 {
bytes fee_recipient = 1 [(ethereum.eth.ext.ssz_size) = "20"];
uint64 gas_limit = 2;
@@ -954,4 +777,4 @@ message BlobSidecar {
message BlobSidecars {
repeated BlobSidecar sidecars = 1 [(ethereum.eth.ext.ssz_max) = "max_blobs_per_block.size"];
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,6 @@ import "proto/prysm/v1alpha1/beacon_block.proto";
import "proto/prysm/v1alpha1/validator.proto";
import "proto/engine/v1/execution_engine.proto";
import "proto/eth/ext/options.proto";
import "proto/prysm/v1alpha1/eip_7251.proto";
option csharp_namespace = "Ethereum.Eth.V1Alpha1";
option go_package = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1;eth";
@@ -343,70 +342,6 @@ message BeaconStateDeneb {
repeated HistoricalSummary historical_summaries = 11003 [(ethereum.eth.ext.ssz_max) = "16777216"];
}
message BeaconStateElectra {
// Versioning [1001-2000]
uint64 genesis_time = 1001;
bytes genesis_validators_root = 1002 [(ethereum.eth.ext.ssz_size) = "32"];
uint64 slot = 1003 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"];
Fork fork = 1004;
// History [2001-3000]
BeaconBlockHeader latest_block_header = 2001;
repeated bytes block_roots = 2002 [(ethereum.eth.ext.ssz_size) = "block_roots.size"];
repeated bytes state_roots = 2003 [(ethereum.eth.ext.ssz_size) = "state_roots.size"];
repeated bytes historical_roots = 2004 [(ethereum.eth.ext.ssz_size) = "?,32", (ethereum.eth.ext.ssz_max) = "16777216"];
// Eth1 [3001-4000]
Eth1Data eth1_data = 3001;
repeated Eth1Data eth1_data_votes = 3002 [(ethereum.eth.ext.ssz_max) = "eth1_data_votes.size"];
uint64 eth1_deposit_index = 3003;
// Registry [4001-5000]
repeated Validator validators = 4001 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
repeated uint64 balances = 4002 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
// Randomness [5001-6000]
repeated bytes randao_mixes = 5001 [(ethereum.eth.ext.ssz_size) = "randao_mixes.size"];
// Slashings [6001-7000]
repeated uint64 slashings = 6001 [(ethereum.eth.ext.ssz_size) = "slashings.size"];
// Participation [7001-8000]
bytes previous_epoch_participation = 7001 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
bytes current_epoch_participation = 7002 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
// Finality [8001-9000]
// Spec type [4]Bitvector which means this would be a fixed size of 4 bits.
bytes justification_bits = 8001 [(ethereum.eth.ext.ssz_size) = "1", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitvector4"];
Checkpoint previous_justified_checkpoint = 8002;
Checkpoint current_justified_checkpoint = 8003;
Checkpoint finalized_checkpoint = 8004;
// Fields introduced in Altair fork [9001-10000]
repeated uint64 inactivity_scores = 9001 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
SyncCommittee current_sync_committee = 9002;
SyncCommittee next_sync_committee = 9003;
// Fields introduced in Bellatrix fork [10001-11000]
ethereum.engine.v1.ExecutionPayloadHeaderElectra latest_execution_payload_header = 10001; // [New in Electra]
// Fields introduced in Capella fork [11001-12000]
uint64 next_withdrawal_index = 11001;
uint64 next_withdrawal_validator_index = 11002 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"];
repeated HistoricalSummary historical_summaries = 11003 [(ethereum.eth.ext.ssz_max) = "16777216"];
// Fields introduced in EIP-7251 fork [12001-13000]
uint64 deposit_receipts_start_index = 12001;
uint64 deposit_balance_to_consume = 12002;
uint64 exit_balance_to_consume = 12003;
uint64 earliest_exit_epoch = 12004 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"];
uint64 consolidation_balance_to_consume = 12005;
uint64 earliest_consolidation_epoch = 12006 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"];
repeated PendingBalanceDeposit pending_balance_deposits = 12007 [(ethereum.eth.ext.ssz_max) = "pending_balance_deposits_limit"];
repeated PendingPartialWithdrawal pending_partial_withdrawals = 12008 [(ethereum.eth.ext.ssz_max) = "pending_partial_withdrawals_limit"];
repeated PendingConsolidation pending_consolidations = 12009 [(ethereum.eth.ext.ssz_max) = "pending_consolidations_limit"];
}
// PowBlock is a definition from Bellatrix fork choice spec to represent a block with total difficulty in the PoW chain.
// Spec:
// class PowBlock(Container):
@@ -423,4 +358,4 @@ message PowBlock {
message HistoricalSummary {
bytes block_summary_root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
bytes state_summary_root = 2 [(ethereum.eth.ext.ssz_size) = "32"];
}
}

View File

@@ -56,19 +56,6 @@ func CopyAttestation(att *Attestation) *Attestation {
}
}
// CopyAttestationElectra copies the provided attestation object.
func CopyAttestationElectra(att *AttestationElectra) *AttestationElectra {
if att == nil {
return nil
}
return &AttestationElectra{
AggregationBits: bytesutil.SafeCopyBytes(att.AggregationBits),
CommitteeBits: bytesutil.SafeCopyBytes(att.CommitteeBits),
Data: CopyAttestationData(att.Data),
Signature: bytesutil.SafeCopyBytes(att.Signature),
}
}
// CopyAttestationData copies the provided AttestationData object.
func CopyAttestationData(attData *AttestationData) *AttestationData {
if attData == nil {
@@ -245,21 +232,6 @@ func CopyAttesterSlashings(slashings []*AttesterSlashing) []*AttesterSlashing {
return newSlashings
}
// CopyAttesterSlashingsElectra copies the provided AttesterSlashings array.
func CopyAttesterSlashingsElectra(slashings []*AttesterSlashingElectra) []*AttesterSlashingElectra {
if slashings == nil {
return nil
}
newSlashings := make([]*AttesterSlashingElectra, len(slashings))
for i, slashing := range slashings {
newSlashings[i] = &AttesterSlashingElectra{
Attestation_1: CopyIndexedAttestationElectra(slashing.Attestation_1),
Attestation_2: CopyIndexedAttestationElectra(slashing.Attestation_2),
}
}
return newSlashings
}
// CopyIndexedAttestation copies the provided IndexedAttestation.
func CopyIndexedAttestation(indexedAtt *IndexedAttestation) *IndexedAttestation {
var indices []uint64
@@ -276,22 +248,6 @@ func CopyIndexedAttestation(indexedAtt *IndexedAttestation) *IndexedAttestation
}
}
// CopyIndexedAttestationElectra copies the provided IndexedAttestation.
func CopyIndexedAttestationElectra(indexedAtt *IndexedAttestationElectra) *IndexedAttestationElectra {
var indices []uint64
if indexedAtt == nil {
return nil
} else if indexedAtt.AttestingIndices != nil {
indices = make([]uint64, len(indexedAtt.AttestingIndices))
copy(indices, indexedAtt.AttestingIndices)
}
return &IndexedAttestationElectra{
AttestingIndices: indices,
Data: CopyAttestationData(indexedAtt.Data),
Signature: bytesutil.SafeCopyBytes(indexedAtt.Signature),
}
}
// CopyAttestations copies the provided Attestation array.
func CopyAttestations(attestations []*Attestation) []*Attestation {
if attestations == nil {
@@ -304,18 +260,6 @@ func CopyAttestations(attestations []*Attestation) []*Attestation {
return newAttestations
}
// CopyAttestations copies the provided AttestationElectra array.
func CopyAttestationsElectra(attestations []*AttestationElectra) []*AttestationElectra {
if attestations == nil {
return nil
}
newAttestations := make([]*AttestationElectra, len(attestations))
for i, att := range attestations {
newAttestations[i] = CopyAttestationElectra(att)
}
return newAttestations
}
// CopyDeposits copies the provided deposit array.
func CopyDeposits(deposits []*Deposit) []*Deposit {
if deposits == nil {
@@ -614,78 +558,6 @@ func CopyBlindedBeaconBlockBodyDeneb(body *BlindedBeaconBlockBodyDeneb) *Blinded
}
}
// CopySignedBlindedBeaconBlockElectra copies the provided SignedBlindedBeaconBlockElectra.
func CopySignedBlindedBeaconBlockElectra(sigBlock *SignedBlindedBeaconBlockElectra) *SignedBlindedBeaconBlockElectra {
if sigBlock == nil {
return nil
}
return &SignedBlindedBeaconBlockElectra{
Message: CopyBlindedBeaconBlockElectra(sigBlock.Message),
Signature: bytesutil.SafeCopyBytes(sigBlock.Signature),
}
}
// CopyBlindedBeaconBlockElectra copies the provided BlindedBeaconBlockElectra.
func CopyBlindedBeaconBlockElectra(block *BlindedBeaconBlockElectra) *BlindedBeaconBlockElectra {
if block == nil {
return nil
}
return &BlindedBeaconBlockElectra{
Slot: block.Slot,
ProposerIndex: block.ProposerIndex,
ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot),
StateRoot: bytesutil.SafeCopyBytes(block.StateRoot),
Body: CopyBlindedBeaconBlockBodyElectra(block.Body),
}
}
// CopyBlindedBeaconBlockBodyElectra copies the provided BlindedBeaconBlockBodyElectra.
func CopyBlindedBeaconBlockBodyElectra(body *BlindedBeaconBlockBodyElectra) *BlindedBeaconBlockBodyElectra {
if body == nil {
return nil
}
return &BlindedBeaconBlockBodyElectra{
RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal),
Eth1Data: CopyETH1Data(body.Eth1Data),
Graffiti: bytesutil.SafeCopyBytes(body.Graffiti),
ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings),
AttesterSlashings: CopyAttesterSlashingsElectra(body.AttesterSlashings),
Attestations: CopyAttestationsElectra(body.Attestations),
Deposits: CopyDeposits(body.Deposits),
VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits),
SyncAggregate: CopySyncAggregate(body.SyncAggregate),
ExecutionPayloadHeader: CopyExecutionPayloadHeaderElectra(body.ExecutionPayloadHeader),
BlsToExecutionChanges: CopyBLSToExecutionChanges(body.BlsToExecutionChanges),
BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments),
Consolidations: CopySignedConsolidations(body.Consolidations),
}
}
func CopySignedConsolidations(c []*SignedConsolidation) []*SignedConsolidation {
if c == nil {
return nil
}
newC := make([]*SignedConsolidation, len(c))
for i, cc := range c {
newC[i] = CopySignedConsolidation(cc)
}
return newC
}
func CopySignedConsolidation(c *SignedConsolidation) *SignedConsolidation {
if c == nil {
return nil
}
return &SignedConsolidation{
Message: &Consolidation{
SourceIndex: c.Message.SourceIndex,
TargetIndex: c.Message.TargetIndex,
Epoch: c.Message.Epoch,
},
Signature: bytesutil.SafeCopyBytes(c.Signature),
}
}
// CopyExecutionPayload copies the provided execution payload.
func CopyExecutionPayload(payload *enginev1.ExecutionPayload) *enginev1.ExecutionPayload {
if payload == nil {
@@ -976,142 +848,6 @@ func CopyExecutionPayloadDeneb(payload *enginev1.ExecutionPayloadDeneb) *enginev
}
}
// CopySignedBeaconBlockElectra copies the provided SignedBeaconBlockElectra.
func CopySignedBeaconBlockElectra(sigBlock *SignedBeaconBlockElectra) *SignedBeaconBlockElectra {
if sigBlock == nil {
return nil
}
return &SignedBeaconBlockElectra{
Block: CopyBeaconBlockElectra(sigBlock.Block),
Signature: bytesutil.SafeCopyBytes(sigBlock.Signature),
}
}
// CopyBeaconBlockElectra copies the provided BeaconBlockElectra.
func CopyBeaconBlockElectra(block *BeaconBlockElectra) *BeaconBlockElectra {
if block == nil {
return nil
}
return &BeaconBlockElectra{
Slot: block.Slot,
ProposerIndex: block.ProposerIndex,
ParentRoot: bytesutil.SafeCopyBytes(block.ParentRoot),
StateRoot: bytesutil.SafeCopyBytes(block.StateRoot),
Body: CopyBeaconBlockBodyElectra(block.Body),
}
}
// CopyBeaconBlockBodyElectra copies the provided BeaconBlockBodyElectra.
func CopyBeaconBlockBodyElectra(body *BeaconBlockBodyElectra) *BeaconBlockBodyElectra {
if body == nil {
return nil
}
return &BeaconBlockBodyElectra{
RandaoReveal: bytesutil.SafeCopyBytes(body.RandaoReveal),
Eth1Data: CopyETH1Data(body.Eth1Data),
Graffiti: bytesutil.SafeCopyBytes(body.Graffiti),
ProposerSlashings: CopyProposerSlashings(body.ProposerSlashings),
AttesterSlashings: CopyAttesterSlashingsElectra(body.AttesterSlashings),
Attestations: CopyAttestationsElectra(body.Attestations),
Deposits: CopyDeposits(body.Deposits),
VoluntaryExits: CopySignedVoluntaryExits(body.VoluntaryExits),
SyncAggregate: CopySyncAggregate(body.SyncAggregate),
ExecutionPayload: CopyExecutionPayloadElectra(body.ExecutionPayload),
BlsToExecutionChanges: CopyBLSToExecutionChanges(body.BlsToExecutionChanges),
BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments),
Consolidations: CopySignedConsolidations(body.Consolidations),
}
}
// CopyExecutionPayloadElectra copies the provided execution payload.
func CopyExecutionPayloadElectra(payload *enginev1.ExecutionPayloadElectra) *enginev1.ExecutionPayloadElectra {
if payload == nil {
return nil
}
return &enginev1.ExecutionPayloadElectra{
ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash),
FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient),
StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot),
ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot),
LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom),
PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao),
BlockNumber: payload.BlockNumber,
GasLimit: payload.GasLimit,
GasUsed: payload.GasUsed,
Timestamp: payload.Timestamp,
ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData),
BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas),
BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash),
Transactions: bytesutil.SafeCopy2dBytes(payload.Transactions),
Withdrawals: CopyWithdrawalSlice(payload.Withdrawals),
BlobGasUsed: payload.BlobGasUsed,
ExcessBlobGas: payload.ExcessBlobGas,
DepositReceipts: CopyDepositReceipts(payload.DepositReceipts),
WithdrawalRequests: CopyWithdrawalRequests(payload.WithdrawalRequests),
}
}
func CopyDepositReceipts(dr []*enginev1.DepositReceipt) []*enginev1.DepositReceipt {
if dr == nil {
return nil
}
newDr := make([]*enginev1.DepositReceipt, len(dr))
for i, d := range dr {
newDr[i] = &enginev1.DepositReceipt{
Pubkey: bytesutil.SafeCopyBytes(d.Pubkey),
WithdrawalCredentials: bytesutil.SafeCopyBytes(d.WithdrawalCredentials),
Amount: d.Amount,
Signature: bytesutil.SafeCopyBytes(d.Signature),
Index: d.Index,
}
}
return newDr
}
func CopyWithdrawalRequests(wr []*enginev1.ExecutionLayerWithdrawalRequest) []*enginev1.ExecutionLayerWithdrawalRequest {
if wr == nil {
return nil
}
newWr := make([]*enginev1.ExecutionLayerWithdrawalRequest, len(wr))
for i, w := range wr {
newWr[i] = &enginev1.ExecutionLayerWithdrawalRequest{
SourceAddress: bytesutil.SafeCopyBytes(w.SourceAddress),
ValidatorPubkey: bytesutil.SafeCopyBytes(w.ValidatorPubkey),
Amount: w.Amount,
}
}
return newWr
}
func CopyExecutionPayloadHeaderElectra(payload *enginev1.ExecutionPayloadHeaderElectra) *enginev1.ExecutionPayloadHeaderElectra {
if payload == nil {
return nil
}
return &enginev1.ExecutionPayloadHeaderElectra{
ParentHash: bytesutil.SafeCopyBytes(payload.ParentHash),
FeeRecipient: bytesutil.SafeCopyBytes(payload.FeeRecipient),
StateRoot: bytesutil.SafeCopyBytes(payload.StateRoot),
ReceiptsRoot: bytesutil.SafeCopyBytes(payload.ReceiptsRoot),
LogsBloom: bytesutil.SafeCopyBytes(payload.LogsBloom),
PrevRandao: bytesutil.SafeCopyBytes(payload.PrevRandao),
BlockNumber: payload.BlockNumber,
GasLimit: payload.GasLimit,
GasUsed: payload.GasUsed,
Timestamp: payload.Timestamp,
ExtraData: bytesutil.SafeCopyBytes(payload.ExtraData),
BaseFeePerGas: bytesutil.SafeCopyBytes(payload.BaseFeePerGas),
BlockHash: bytesutil.SafeCopyBytes(payload.BlockHash),
TransactionsRoot: bytesutil.SafeCopyBytes(payload.TransactionsRoot),
WithdrawalsRoot: bytesutil.SafeCopyBytes(payload.WithdrawalsRoot),
BlobGasUsed: payload.BlobGasUsed,
ExcessBlobGas: payload.ExcessBlobGas,
DepositReceiptsRoot: bytesutil.SafeCopyBytes(payload.DepositReceiptsRoot),
WithdrawalRequestsRoot: bytesutil.SafeCopyBytes(payload.WithdrawalRequestsRoot),
}
}
// CopyHistoricalSummaries copies the historical summaries.
func CopyHistoricalSummaries(summaries []*HistoricalSummary) []*HistoricalSummary {
if summaries == nil {
@@ -1126,47 +862,3 @@ func CopyHistoricalSummaries(summaries []*HistoricalSummary) []*HistoricalSummar
}
return newSummaries
}
// CopyPartialWithdrawals copies the provided partial withdrawals.
func CopyPendingPartialWithdrawals(pws []*PendingPartialWithdrawal) []*PendingPartialWithdrawal {
if pws == nil {
return nil
}
newPws := make([]*PendingPartialWithdrawal, len(pws))
for i, pw := range pws {
newPws[i] = &PendingPartialWithdrawal{
Index: pw.Index,
Amount: pw.Amount,
WithdrawableEpoch: pw.WithdrawableEpoch,
}
}
return newPws
}
func CopyPendingConsolidations(pcs []*PendingConsolidation) []*PendingConsolidation {
if pcs == nil {
return nil
}
newPcs := make([]*PendingConsolidation, len(pcs))
for i, pc := range pcs {
newPcs[i] = &PendingConsolidation{
SourceIndex: pc.SourceIndex,
TargetIndex: pc.TargetIndex,
}
}
return newPcs
}
func CopyPendingBalanceDeposits(pbd []*PendingBalanceDeposit) []*PendingBalanceDeposit {
if pbd == nil {
return nil
}
newPbd := make([]*PendingBalanceDeposit, len(pbd))
for i, pb := range pbd {
newPbd[i] = &PendingBalanceDeposit{
Index: pb.Index,
Amount: pb.Amount,
}
}
return newPbd
}

View File

@@ -568,177 +568,6 @@ func TestCopyHistoricalSummaries(t *testing.T) {
}
}
func TestCopyAttestationElectra(t *testing.T) {
att := genAttestationElectra()
got := v1alpha1.CopyAttestationElectra(att)
if !reflect.DeepEqual(got, att) {
t.Errorf("TestCopyAttestationElectra() = %v, want %v", got, att)
}
}
func TestCopyAttesterSlashingsElectra(t *testing.T) {
as := genAttesterSlashingsElectra(10)
got := v1alpha1.CopyAttesterSlashingsElectra(as)
if !reflect.DeepEqual(got, as) {
t.Errorf("TestCopyAttesterSlashingsElectra() = %v, want %v", got, as)
}
}
func TestCopyIndexedAttestationElectra(t *testing.T) {
ia := genIndexedAttestationElectra()
got := v1alpha1.CopyIndexedAttestationElectra(ia)
if !reflect.DeepEqual(got, ia) {
t.Errorf("TestCopyIndexedAttestationElectra() = %v, want %v", got, ia)
}
}
func TestCopyAttestationsElectra(t *testing.T) {
atts := genAttestationsElectra(10)
got := v1alpha1.CopyAttestationsElectra(atts)
if !reflect.DeepEqual(got, atts) {
t.Errorf("TestCopyAttestationsElectra() = %v, want %v", got, atts)
}
}
func TestCopySignedBlindedBeaconBlockElectra(t *testing.T) {
sbb := genSignedBlindedBeaconBlockElectra()
got := v1alpha1.CopySignedBlindedBeaconBlockElectra(sbb)
if !reflect.DeepEqual(got, sbb) {
t.Errorf("TestCopySignedBlindedBeaconBlockElectra() = %v, want %v", got, sbb)
}
}
func TestCopyBlindedBeaconBlockElectra(t *testing.T) {
b := genBlindedBeaconBlockElectra()
got := v1alpha1.CopyBlindedBeaconBlockElectra(b)
if !reflect.DeepEqual(got, b) {
t.Errorf("TestCopyBlindedBeaconBlockElectra() = %v, want %v", got, b)
}
}
func TestCopyBlindedBeaconBlockBodyElectra(t *testing.T) {
bb := genBlindedBeaconBlockBodyElectra()
got := v1alpha1.CopyBlindedBeaconBlockBodyElectra(bb)
if !reflect.DeepEqual(got, bb) {
t.Errorf("TestCopyBlindedBeaconBlockBodyElectra() = %v, want %v", got, bb)
}
}
func TestCopySignedConsolidations(t *testing.T) {
cs := genSignedConsolidations(10)
got := v1alpha1.CopySignedConsolidations(cs)
if !reflect.DeepEqual(got, cs) {
t.Errorf("TestCopySignedConsolidations() = %v, want %v", got, cs)
}
}
func TestCopySignedConsolidation(t *testing.T) {
c := genSignedConsolidation()
got := v1alpha1.CopySignedConsolidation(c)
if !reflect.DeepEqual(got, c) {
t.Errorf("TestCopySignedConsolidation() = %v, want %v", got, c)
}
}
func TestCopySignedBeaconBlockElectra(t *testing.T) {
sbb := genSignedBeaconBlockElectra()
got := v1alpha1.CopySignedBeaconBlockElectra(sbb)
if !reflect.DeepEqual(got, sbb) {
t.Errorf("TestCopySignedBeaconBlockElectra() = %v, want %v", got, sbb)
}
}
func TestCopyBeaconBlockElectra(t *testing.T) {
b := genBeaconBlockElectra()
got := v1alpha1.CopyBeaconBlockElectra(b)
if !reflect.DeepEqual(got, b) {
t.Errorf("TestCopyBeaconBlockElectra() = %v, want %v", got, b)
}
}
func TestCopyBeaconBlockBodyElectra(t *testing.T) {
bb := genBeaconBlockBodyElectra()
got := v1alpha1.CopyBeaconBlockBodyElectra(bb)
if !reflect.DeepEqual(got, bb) {
t.Errorf("TestCopyBeaconBlockBodyElectra() = %v, want %v", got, bb)
}
}
func TestCopyExecutionPayloadElectra(t *testing.T) {
p := genExecutionPayloadElectra()
got := v1alpha1.CopyExecutionPayloadElectra(p)
if !reflect.DeepEqual(got, p) {
t.Errorf("TestCopyExecutionPayloadElectra() = %v, want %v", got, p)
}
}
func TestCopyDepositReceipts(t *testing.T) {
drs := genDepositReceipts(10)
got := v1alpha1.CopyDepositReceipts(drs)
if !reflect.DeepEqual(got, drs) {
t.Errorf("TestCopyDepositReceipts() = %v, want %v", got, drs)
}
}
func TestCopyWithdrawalRequests(t *testing.T) {
wrs := genWithdrawalRequests(10)
got := v1alpha1.CopyWithdrawalRequests(wrs)
if !reflect.DeepEqual(got, wrs) {
t.Errorf("TestCopyWithdrawalRequests() = %v, want %v", got, wrs)
}
}
func TestCopyExecutionPayloadHeaderElectra(t *testing.T) {
p := genExecutionPayloadHeaderElectra()
got := v1alpha1.CopyExecutionPayloadHeaderElectra(p)
if !reflect.DeepEqual(got, p) {
t.Errorf("TestCopyExecutionPayloadHeaderElectra() = %v, want %v", got, p)
}
}
func TestCopyPendingPartialWithdrawals(t *testing.T) {
ppws := genPendingPartialWithdrawals(10)
got := v1alpha1.CopyPendingPartialWithdrawals(ppws)
if !reflect.DeepEqual(got, ppws) {
t.Errorf("TestCopyPendingPartialWithdrawals() = %v, want %v", got, ppws)
}
}
func TestCopyPendingConsolidations(t *testing.T) {
pcs := genPendingConsolidations(10)
got := v1alpha1.CopyPendingConsolidations(pcs)
if !reflect.DeepEqual(got, pcs) {
t.Errorf("TestCopyPendingConsolidations() = %v, want %v", got, pcs)
}
}
func TestCopyPendingBalanceDeposits(t *testing.T) {
pbds := genPendingBalanceDeposits(10)
got := v1alpha1.CopyPendingBalanceDeposits(pbds)
if !reflect.DeepEqual(got, pbds) {
t.Errorf("TestCopyPendingBalanceDeposits() = %v, want %v", got, pbds)
}
}
func genAttestation() *v1alpha1.Attestation {
return &v1alpha1.Attestation{
AggregationBits: bytes(32),
@@ -1347,264 +1176,3 @@ func genBLSToExecutionChange() *v1alpha1.SignedBLSToExecutionChange {
Signature: bytes(96),
}
}
func genAttestationElectra() *v1alpha1.AttestationElectra {
return &v1alpha1.AttestationElectra{
AggregationBits: bytes(32),
CommitteeBits: bytes(8),
Data: genAttData(),
Signature: bytes(96),
}
}
func genAttesterSlashingsElectra(num int) []*v1alpha1.AttesterSlashingElectra {
as := make([]*v1alpha1.AttesterSlashingElectra, num)
for i := 0; i < num; i++ {
as[i] = genAttesterSlashingElectra()
}
return as
}
func genAttesterSlashingElectra() *v1alpha1.AttesterSlashingElectra {
return &v1alpha1.AttesterSlashingElectra{
Attestation_1: genIndexedAttestationElectra(),
Attestation_2: genIndexedAttestationElectra(),
}
}
func genIndexedAttestationElectra() *v1alpha1.IndexedAttestationElectra {
return &v1alpha1.IndexedAttestationElectra{
AttestingIndices: []uint64{1, 2, 3},
Data: genAttData(),
Signature: bytes(96),
}
}
func genAttestationsElectra(num int) []*v1alpha1.AttestationElectra {
atts := make([]*v1alpha1.AttestationElectra, num)
for i := 0; i < num; i++ {
atts[i] = genAttestationElectra()
}
return atts
}
func genSignedBlindedBeaconBlockElectra() *v1alpha1.SignedBlindedBeaconBlockElectra {
return &v1alpha1.SignedBlindedBeaconBlockElectra{
Message: genBlindedBeaconBlockElectra(),
Signature: bytes(96),
}
}
func genBlindedBeaconBlockElectra() *v1alpha1.BlindedBeaconBlockElectra {
return &v1alpha1.BlindedBeaconBlockElectra{
Slot: 123455,
ProposerIndex: 55433,
ParentRoot: bytes(32),
StateRoot: bytes(32),
Body: genBlindedBeaconBlockBodyElectra(),
}
}
func genBlindedBeaconBlockBodyElectra() *v1alpha1.BlindedBeaconBlockBodyElectra {
return &v1alpha1.BlindedBeaconBlockBodyElectra{
RandaoReveal: bytes(96),
Eth1Data: genEth1Data(),
Graffiti: bytes(32),
ProposerSlashings: genProposerSlashings(5),
AttesterSlashings: genAttesterSlashingsElectra(5),
Attestations: genAttestationsElectra(10),
Deposits: genDeposits(5),
VoluntaryExits: genSignedVoluntaryExits(12),
SyncAggregate: genSyncAggregate(),
ExecutionPayloadHeader: genExecutionPayloadHeaderElectra(),
BlsToExecutionChanges: genBLSToExecutionChanges(10),
BlobKzgCommitments: getKZGCommitments(4),
Consolidations: genSignedConsolidations(5),
}
}
func genExecutionPayloadHeaderElectra() *enginev1.ExecutionPayloadHeaderElectra {
return &enginev1.ExecutionPayloadHeaderElectra{
ParentHash: bytes(32),
FeeRecipient: bytes(20),
StateRoot: bytes(32),
ReceiptsRoot: bytes(32),
LogsBloom: bytes(256),
PrevRandao: bytes(32),
BlockNumber: 1,
GasLimit: 2,
GasUsed: 3,
Timestamp: 4,
ExtraData: bytes(32),
BaseFeePerGas: bytes(32),
BlockHash: bytes(32),
TransactionsRoot: bytes(32),
WithdrawalsRoot: bytes(32),
BlobGasUsed: 5,
ExcessBlobGas: 6,
DepositReceiptsRoot: bytes(32),
WithdrawalRequestsRoot: bytes(32),
}
}
func genSignedConsolidations(num int) []*v1alpha1.SignedConsolidation {
cs := make([]*v1alpha1.SignedConsolidation, num)
for i := 0; i < num; i++ {
cs[i] = genSignedConsolidation()
}
return cs
}
func genSignedConsolidation() *v1alpha1.SignedConsolidation {
return &v1alpha1.SignedConsolidation{
Message: genConsolidation(),
Signature: bytes(96),
}
}
func genConsolidation() *v1alpha1.Consolidation {
return &v1alpha1.Consolidation{
SourceIndex: 1,
TargetIndex: 2,
Epoch: 3,
}
}
func genSignedBeaconBlockElectra() *v1alpha1.SignedBeaconBlockElectra {
return &v1alpha1.SignedBeaconBlockElectra{
Block: genBeaconBlockElectra(),
Signature: bytes(96),
}
}
func genBeaconBlockElectra() *v1alpha1.BeaconBlockElectra {
return &v1alpha1.BeaconBlockElectra{
Slot: 123455,
ProposerIndex: 55433,
ParentRoot: bytes(32),
StateRoot: bytes(32),
Body: genBeaconBlockBodyElectra(),
}
}
func genBeaconBlockBodyElectra() *v1alpha1.BeaconBlockBodyElectra {
return &v1alpha1.BeaconBlockBodyElectra{
RandaoReveal: bytes(96),
Eth1Data: genEth1Data(),
Graffiti: bytes(32),
ProposerSlashings: genProposerSlashings(5),
AttesterSlashings: genAttesterSlashingsElectra(5),
Attestations: genAttestationsElectra(10),
Deposits: genDeposits(5),
VoluntaryExits: genSignedVoluntaryExits(12),
SyncAggregate: genSyncAggregate(),
ExecutionPayload: genExecutionPayloadElectra(),
BlsToExecutionChanges: genBLSToExecutionChanges(10),
BlobKzgCommitments: getKZGCommitments(4),
Consolidations: genSignedConsolidations(5),
}
}
func genExecutionPayloadElectra() *enginev1.ExecutionPayloadElectra {
return &enginev1.ExecutionPayloadElectra{
ParentHash: bytes(32),
FeeRecipient: bytes(20),
StateRoot: bytes(32),
ReceiptsRoot: bytes(32),
LogsBloom: bytes(256),
PrevRandao: bytes(32),
BlockNumber: 1,
GasLimit: 2,
GasUsed: 3,
Timestamp: 4,
ExtraData: bytes(32),
BaseFeePerGas: bytes(32),
BlockHash: bytes(32),
Transactions: [][]byte{{'a'}, {'b'}, {'c'}},
Withdrawals: genWithdrawals(10),
BlobGasUsed: 5,
ExcessBlobGas: 6,
DepositReceipts: genDepositReceipts(10),
WithdrawalRequests: genWithdrawalRequests(10),
}
}
func genDepositReceipts(num int) []*enginev1.DepositReceipt {
drs := make([]*enginev1.DepositReceipt, num)
for i := 0; i < num; i++ {
drs[i] = genDepositReceipt()
}
return drs
}
func genDepositReceipt() *enginev1.DepositReceipt {
return &enginev1.DepositReceipt{
Pubkey: bytes(48),
WithdrawalCredentials: bytes(32),
Amount: 55555,
Signature: bytes(96),
Index: 123444,
}
}
func genWithdrawalRequests(num int) []*enginev1.ExecutionLayerWithdrawalRequest {
wrs := make([]*enginev1.ExecutionLayerWithdrawalRequest, num)
for i := 0; i < num; i++ {
wrs[i] = genWithdrawalRequest()
}
return wrs
}
func genWithdrawalRequest() *enginev1.ExecutionLayerWithdrawalRequest {
return &enginev1.ExecutionLayerWithdrawalRequest{
SourceAddress: bytes(20),
ValidatorPubkey: bytes(48),
Amount: 55555,
}
}
func genPendingPartialWithdrawals(num int) []*v1alpha1.PendingPartialWithdrawal {
ppws := make([]*v1alpha1.PendingPartialWithdrawal, num)
for i := 0; i < num; i++ {
ppws[i] = genPendingPartialWithdrawal()
}
return ppws
}
func genPendingPartialWithdrawal() *v1alpha1.PendingPartialWithdrawal {
return &v1alpha1.PendingPartialWithdrawal{
Index: 123456,
Amount: 55555,
WithdrawableEpoch: 444444,
}
}
func genPendingConsolidations(num int) []*v1alpha1.PendingConsolidation {
pcs := make([]*v1alpha1.PendingConsolidation, num)
for i := 0; i < num; i++ {
pcs[i] = genPendingConsolidation()
}
return pcs
}
func genPendingConsolidation() *v1alpha1.PendingConsolidation {
return &v1alpha1.PendingConsolidation{
SourceIndex: 1,
TargetIndex: 2,
}
}
func genPendingBalanceDeposits(num int) []*v1alpha1.PendingBalanceDeposit {
pbds := make([]*v1alpha1.PendingBalanceDeposit, num)
for i := 0; i < num; i++ {
pbds[i] = genPendingBalanceDeposit()
}
return pbds
}
func genPendingBalanceDeposit() *v1alpha1.PendingBalanceDeposit {
return &v1alpha1.PendingBalanceDeposit{
Index: 123456,
Amount: 55555,
}
}

View File

@@ -1,12 +0,0 @@
package eth
func (c *Consolidation) ToPendingConsolidation() *PendingConsolidation {
if c == nil {
return nil
}
p := &PendingConsolidation{
SourceIndex: c.SourceIndex,
TargetIndex: c.TargetIndex,
}
return p
}

View File

@@ -1,524 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v4.25.1
// source: proto/prysm/v1alpha1/eip_7251.proto
package eth
import (
reflect "reflect"
sync "sync"
github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
_ "github.com/prysmaticlabs/prysm/v5/proto/eth/ext"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type PendingBalanceDeposit struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Index github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"`
Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
}
func (x *PendingBalanceDeposit) Reset() {
*x = PendingBalanceDeposit{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PendingBalanceDeposit) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PendingBalanceDeposit) ProtoMessage() {}
func (x *PendingBalanceDeposit) ProtoReflect() protoreflect.Message {
mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PendingBalanceDeposit.ProtoReflect.Descriptor instead.
func (*PendingBalanceDeposit) Descriptor() ([]byte, []int) {
return file_proto_prysm_v1alpha1_eip_7251_proto_rawDescGZIP(), []int{0}
}
func (x *PendingBalanceDeposit) GetIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex {
if x != nil {
return x.Index
}
return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0)
}
func (x *PendingBalanceDeposit) GetAmount() uint64 {
if x != nil {
return x.Amount
}
return 0
}
type PendingPartialWithdrawal struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Index github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"`
Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
WithdrawableEpoch github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch `protobuf:"varint,3,opt,name=withdrawable_epoch,json=withdrawableEpoch,proto3" json:"withdrawable_epoch,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"`
}
func (x *PendingPartialWithdrawal) Reset() {
*x = PendingPartialWithdrawal{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PendingPartialWithdrawal) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PendingPartialWithdrawal) ProtoMessage() {}
func (x *PendingPartialWithdrawal) ProtoReflect() protoreflect.Message {
mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PendingPartialWithdrawal.ProtoReflect.Descriptor instead.
func (*PendingPartialWithdrawal) Descriptor() ([]byte, []int) {
return file_proto_prysm_v1alpha1_eip_7251_proto_rawDescGZIP(), []int{1}
}
func (x *PendingPartialWithdrawal) GetIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex {
if x != nil {
return x.Index
}
return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0)
}
func (x *PendingPartialWithdrawal) GetAmount() uint64 {
if x != nil {
return x.Amount
}
return 0
}
func (x *PendingPartialWithdrawal) GetWithdrawableEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch {
if x != nil {
return x.WithdrawableEpoch
}
return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(0)
}
type Consolidation struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
SourceIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,1,opt,name=source_index,json=sourceIndex,proto3" json:"source_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"`
TargetIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,2,opt,name=target_index,json=targetIndex,proto3" json:"target_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"`
Epoch github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch `protobuf:"varint,3,opt,name=epoch,proto3" json:"epoch,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"`
}
func (x *Consolidation) Reset() {
*x = Consolidation{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Consolidation) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Consolidation) ProtoMessage() {}
func (x *Consolidation) ProtoReflect() protoreflect.Message {
mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Consolidation.ProtoReflect.Descriptor instead.
func (*Consolidation) Descriptor() ([]byte, []int) {
return file_proto_prysm_v1alpha1_eip_7251_proto_rawDescGZIP(), []int{2}
}
func (x *Consolidation) GetSourceIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex {
if x != nil {
return x.SourceIndex
}
return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0)
}
func (x *Consolidation) GetTargetIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex {
if x != nil {
return x.TargetIndex
}
return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0)
}
func (x *Consolidation) GetEpoch() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch {
if x != nil {
return x.Epoch
}
return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(0)
}
type SignedConsolidation struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Message *Consolidation `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"`
}
func (x *SignedConsolidation) Reset() {
*x = SignedConsolidation{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SignedConsolidation) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SignedConsolidation) ProtoMessage() {}
func (x *SignedConsolidation) ProtoReflect() protoreflect.Message {
mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SignedConsolidation.ProtoReflect.Descriptor instead.
func (*SignedConsolidation) Descriptor() ([]byte, []int) {
return file_proto_prysm_v1alpha1_eip_7251_proto_rawDescGZIP(), []int{3}
}
func (x *SignedConsolidation) GetMessage() *Consolidation {
if x != nil {
return x.Message
}
return nil
}
func (x *SignedConsolidation) GetSignature() []byte {
if x != nil {
return x.Signature
}
return nil
}
type PendingConsolidation struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
SourceIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,1,opt,name=source_index,json=sourceIndex,proto3" json:"source_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"`
TargetIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,2,opt,name=target_index,json=targetIndex,proto3" json:"target_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"`
}
func (x *PendingConsolidation) Reset() {
*x = PendingConsolidation{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PendingConsolidation) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PendingConsolidation) ProtoMessage() {}
func (x *PendingConsolidation) ProtoReflect() protoreflect.Message {
mi := &file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PendingConsolidation.ProtoReflect.Descriptor instead.
func (*PendingConsolidation) Descriptor() ([]byte, []int) {
return file_proto_prysm_v1alpha1_eip_7251_proto_rawDescGZIP(), []int{4}
}
func (x *PendingConsolidation) GetSourceIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex {
if x != nil {
return x.SourceIndex
}
return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0)
}
func (x *PendingConsolidation) GetTargetIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex {
if x != nil {
return x.TargetIndex
}
return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0)
}
var File_proto_prysm_v1alpha1_eip_7251_proto protoreflect.FileDescriptor
var file_proto_prysm_v1alpha1_eip_7251_proto_rawDesc = []byte{
0x0a, 0x23, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31,
0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x65, 0x69, 0x70, 0x5f, 0x37, 0x32, 0x35, 0x31, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e,
0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x1b, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x65, 0x78, 0x74, 0x2f, 0x6f, 0x70, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x96, 0x01, 0x0a, 0x15, 0x50, 0x65,
0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x70, 0x6f,
0x73, 0x69, 0x74, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01,
0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73,
0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e,
0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74,
0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e,
0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d,
0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75,
0x6e, 0x74, 0x22, 0x90, 0x02, 0x0a, 0x18, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61,
0x72, 0x74, 0x69, 0x61, 0x6c, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x12,
0x65, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f,
0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70,
0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79,
0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d,
0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73,
0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52,
0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74,
0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x75,
0x0a, 0x12, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x65,
0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42,
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d,
0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76,
0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65,
0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f,
0x63, 0x68, 0x52, 0x11, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65,
0x45, 0x70, 0x6f, 0x63, 0x68, 0x22, 0xd5, 0x02, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c,
0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x72, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63,
0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82,
0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72,
0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73,
0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74,
0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e,
0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0b,
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x72, 0x0a, 0x0c, 0x74,
0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28,
0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f,
0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73,
0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69,
0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64,
0x65, 0x78, 0x52, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12,
0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46,
0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70,
0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79,
0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d,
0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73,
0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x22, 0x7b, 0x0a,
0x13, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d,
0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f,
0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6d, 0x65, 0x73,
0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52,
0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xfe, 0x01, 0x0a, 0x14, 0x50,
0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x12, 0x72, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x6e,
0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61,
0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35,
0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73,
0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69,
0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x72, 0x0a, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65,
0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82,
0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72,
0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73,
0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74,
0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e,
0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0b,
0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x97, 0x01, 0x0a, 0x19,
0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68,
0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0c, 0x45, 0x49, 0x50, 0x37, 0x32,
0x35, 0x31, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75,
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c,
0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61,
0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d,
0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15,
0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61,
0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_proto_prysm_v1alpha1_eip_7251_proto_rawDescOnce sync.Once
file_proto_prysm_v1alpha1_eip_7251_proto_rawDescData = file_proto_prysm_v1alpha1_eip_7251_proto_rawDesc
)
func file_proto_prysm_v1alpha1_eip_7251_proto_rawDescGZIP() []byte {
file_proto_prysm_v1alpha1_eip_7251_proto_rawDescOnce.Do(func() {
file_proto_prysm_v1alpha1_eip_7251_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_prysm_v1alpha1_eip_7251_proto_rawDescData)
})
return file_proto_prysm_v1alpha1_eip_7251_proto_rawDescData
}
var file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_proto_prysm_v1alpha1_eip_7251_proto_goTypes = []interface{}{
(*PendingBalanceDeposit)(nil), // 0: ethereum.eth.v1alpha1.PendingBalanceDeposit
(*PendingPartialWithdrawal)(nil), // 1: ethereum.eth.v1alpha1.PendingPartialWithdrawal
(*Consolidation)(nil), // 2: ethereum.eth.v1alpha1.Consolidation
(*SignedConsolidation)(nil), // 3: ethereum.eth.v1alpha1.SignedConsolidation
(*PendingConsolidation)(nil), // 4: ethereum.eth.v1alpha1.PendingConsolidation
}
var file_proto_prysm_v1alpha1_eip_7251_proto_depIdxs = []int32{
2, // 0: ethereum.eth.v1alpha1.SignedConsolidation.message:type_name -> ethereum.eth.v1alpha1.Consolidation
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_proto_prysm_v1alpha1_eip_7251_proto_init() }
func file_proto_prysm_v1alpha1_eip_7251_proto_init() {
if File_proto_prysm_v1alpha1_eip_7251_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PendingBalanceDeposit); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PendingPartialWithdrawal); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Consolidation); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SignedConsolidation); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PendingConsolidation); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_proto_prysm_v1alpha1_eip_7251_proto_rawDesc,
NumEnums: 0,
NumMessages: 5,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_proto_prysm_v1alpha1_eip_7251_proto_goTypes,
DependencyIndexes: file_proto_prysm_v1alpha1_eip_7251_proto_depIdxs,
MessageInfos: file_proto_prysm_v1alpha1_eip_7251_proto_msgTypes,
}.Build()
File_proto_prysm_v1alpha1_eip_7251_proto = out.File
file_proto_prysm_v1alpha1_eip_7251_proto_rawDesc = nil
file_proto_prysm_v1alpha1_eip_7251_proto_goTypes = nil
file_proto_prysm_v1alpha1_eip_7251_proto_depIdxs = nil
}

View File

@@ -1,4 +0,0 @@
//go:build ignore
// +build ignore
package ignore

View File

@@ -1,68 +0,0 @@
// Copyright 2020 Prysmatic Labs.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package ethereum.eth.v1alpha1;
import "proto/eth/ext/options.proto";
option csharp_namespace = "Ethereum.Eth.v1alpha1";
option go_package = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1;eth";
option java_multiple_files = true;
option java_outer_classname = "EIP7251Proto";
option java_package = "org.ethereum.eth.v1alpha1";
option php_namespace = "Ethereum\\Eth\\v1alpha1";
message PendingBalanceDeposit {
// Validator index for the deposit.
uint64 index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"];
// The amount of the deposit (gwei).
uint64 amount = 2;
}
message PendingPartialWithdrawal {
// Validator index for the withdrawal.
uint64 index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"];
// The amount of the withdrawal (gwei).
uint64 amount = 2;
// A partial withdrawal is valid at this epoch or later.
uint64 withdrawable_epoch = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"];
}
message Consolidation {
// Validator from which the funds will be moved.
uint64 source_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"];
// Validator to which the funds will be moved.
uint64 target_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"];
// A consolidation is valid at this epoch or later.
uint64 epoch = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"];
}
message SignedConsolidation {
// The unsigned consolidation itself.
Consolidation message = 1;
// Validator's 96 byte signature
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
message PendingConsolidation {
// Validator from which the funds will be moved.
uint64 source_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"];
// Validator to which the funds will be moved.
uint64 target_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"];
}

View File

@@ -1,21 +0,0 @@
package eth_test
import (
"testing"
v1alpha1 "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/testing/assert"
)
func TestConsolidation_ToPendingConsolidation(t *testing.T) {
c := v1alpha1.Consolidation{
SourceIndex: 1,
TargetIndex: 2,
Epoch: 3,
}
pc := c.ToPendingConsolidation()
assert.Equal(t, c.SourceIndex, pc.SourceIndex)
assert.Equal(t, c.TargetIndex, pc.TargetIndex)
}

File diff suppressed because it is too large Load Diff

View File

@@ -105,8 +105,6 @@ type SignRequest struct {
// *SignRequest_BlindedBlockCapella
// *SignRequest_BlockDeneb
// *SignRequest_BlindedBlockDeneb
// *SignRequest_BlockElectra
// *SignRequest_BlindedBlockElectra
Object isSignRequest_Object `protobuf_oneof:"object"`
SigningSlot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,6,opt,name=signing_slot,json=signingSlot,proto3" json:"signing_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"`
}
@@ -290,20 +288,6 @@ func (x *SignRequest) GetBlindedBlockDeneb() *v1alpha1.BlindedBeaconBlockDeneb {
return nil
}
func (x *SignRequest) GetBlockElectra() *v1alpha1.BeaconBlockElectra {
if x, ok := x.GetObject().(*SignRequest_BlockElectra); ok {
return x.BlockElectra
}
return nil
}
func (x *SignRequest) GetBlindedBlockElectra() *v1alpha1.BlindedBeaconBlockElectra {
if x, ok := x.GetObject().(*SignRequest_BlindedBlockElectra); ok {
return x.BlindedBlockElectra
}
return nil
}
func (x *SignRequest) GetSigningSlot() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot {
if x != nil {
return x.SigningSlot
@@ -383,14 +367,6 @@ type SignRequest_BlindedBlockDeneb struct {
BlindedBlockDeneb *v1alpha1.BlindedBeaconBlockDeneb `protobuf:"bytes,117,opt,name=blinded_block_deneb,json=blindedBlockDeneb,proto3,oneof"`
}
type SignRequest_BlockElectra struct {
BlockElectra *v1alpha1.BeaconBlockElectra `protobuf:"bytes,118,opt,name=block_electra,json=blockElectra,proto3,oneof"`
}
type SignRequest_BlindedBlockElectra struct {
BlindedBlockElectra *v1alpha1.BlindedBeaconBlockElectra `protobuf:"bytes,119,opt,name=blinded_block_electra,json=blindedBlockElectra,proto3,oneof"`
}
func (*SignRequest_Block) isSignRequest_Object() {}
func (*SignRequest_AttestationData) isSignRequest_Object() {}
@@ -425,10 +401,6 @@ func (*SignRequest_BlockDeneb) isSignRequest_Object() {}
func (*SignRequest_BlindedBlockDeneb) isSignRequest_Object() {}
func (*SignRequest_BlockElectra) isSignRequest_Object() {}
func (*SignRequest_BlindedBlockElectra) isSignRequest_Object() {}
type SignResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -687,7 +659,7 @@ var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_rawDesc = []byte
0x63, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x29, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61,
0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69,
0x74, 0x74, 0x65, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa8, 0x0f, 0x0a, 0x0b, 0x53,
0x74, 0x74, 0x65, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xee, 0x0d, 0x0a, 0x0b, 0x53,
0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75,
0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09,
0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x69, 0x67,
@@ -790,97 +762,85 @@ var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_rawDesc = []byte
0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42,
0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63,
0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x48, 0x00, 0x52, 0x11, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65,
0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x50, 0x0a, 0x0d, 0x62,
0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x18, 0x76, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74,
0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f,
0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x48, 0x00, 0x52,
0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x66, 0x0a,
0x15, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x65,
0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x18, 0x77, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65,
0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c,
0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x65, 0x61, 0x63,
0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x61, 0x48, 0x00,
0x52, 0x13, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6c,
0x65, 0x63, 0x74, 0x72, 0x61, 0x12, 0x68, 0x0a, 0x0c, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67,
0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18,
0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73,
0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f,
0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70,
0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c,
0x6f, 0x74, 0x52, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x53, 0x6c, 0x6f, 0x74, 0x42,
0x08, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a,
0x04, 0x08, 0x05, 0x10, 0x06, 0x22, 0xb7, 0x01, 0x0a, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74,
0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61,
0x74, 0x75, 0x72, 0x65, 0x12, 0x4b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0e, 0x32, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e,
0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e,
0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75,
0x73, 0x22, 0x3c, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55,
0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x55, 0x43, 0x43,
0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4e, 0x49, 0x45,
0x44, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x03, 0x22,
0xb3, 0x01, 0x0a, 0x15, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69,
0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x65, 0x65,
0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x47,
0x0a, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64,
0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32,
0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07,
0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66,
0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x67, 0x72, 0x61,
0x66, 0x66, 0x69, 0x74, 0x69, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x67, 0x72, 0x61,
0x66, 0x66, 0x69, 0x74, 0x69, 0x22, 0xa6, 0x01, 0x0a, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65,
0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c,
0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65,
0x64, 0x12, 0x63, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02,
0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61,
0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73,
0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x69,
0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x08, 0x67, 0x61,
0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73,
0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x22, 0xe7,
0x02, 0x0a, 0x17, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69,
0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x74, 0x0a, 0x0f, 0x70, 0x72,
0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x4b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76,
0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
0x73, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74,
0x74, 0x69, 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x50, 0x72, 0x6f,
0x70, 0x6f, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79,
0x52, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x12, 0x5c, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72,
0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73,
0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52,
0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x78,
0x0a, 0x13, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x4b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75,
0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f,
0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72,
0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0xce, 0x01, 0x0a, 0x22, 0x6f, 0x72, 0x67,
0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x68, 0x0a, 0x0c, 0x73,
0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28,
0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f,
0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73,
0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69,
0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e,
0x67, 0x53, 0x6c, 0x6f, 0x74, 0x42, 0x08, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4a,
0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x22, 0xb7, 0x01, 0x0a, 0x0c,
0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09,
0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52,
0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x4b, 0x0a, 0x06, 0x73, 0x74,
0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x33, 0x2e, 0x65, 0x74, 0x68,
0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e,
0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69, 0x67, 0x6e,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52,
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3c, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75,
0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d,
0x0a, 0x09, 0x53, 0x55, 0x43, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a,
0x06, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49,
0x4c, 0x45, 0x44, 0x10, 0x03, 0x22, 0xb3, 0x01, 0x0a, 0x15, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73,
0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12,
0x23, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70,
0x69, 0x65, 0x6e, 0x74, 0x12, 0x47, 0x0a, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x18,
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d,
0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75,
0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x43, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a,
0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48,
0x00, 0x52, 0x08, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x88, 0x01, 0x01, 0x42, 0x0b,
0x0a, 0x09, 0x5f, 0x67, 0x72, 0x61, 0x66, 0x66, 0x69, 0x74, 0x69, 0x22, 0xa6, 0x01, 0x0a, 0x0d,
0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a,
0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07,
0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x63, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c,
0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42,
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d,
0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76,
0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65,
0x73, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x55, 0x69, 0x6e, 0x74,
0x36, 0x34, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06,
0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65,
0x6c, 0x61, 0x79, 0x73, 0x22, 0xe7, 0x02, 0x0a, 0x17, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65,
0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64,
0x12, 0x74, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e,
0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4b, 0x2e, 0x65, 0x74, 0x68, 0x65,
0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61,
0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f,
0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f,
0x61, 0x64, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69,
0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72,
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x5c, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c,
0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35,
0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61,
0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x42,
0x0f, 0x4b, 0x65, 0x79, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f,
0x50, 0x01, 0x5a, 0x53, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70,
0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79,
0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73,
0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64,
0x61, 0x74, 0x6f, 0x72, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3b, 0x76, 0x61, 0x6c, 0x69,
0x64, 0x61, 0x74, 0x6f, 0x72, 0x70, 0x62, 0xaa, 0x02, 0x1e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65,
0x75, 0x6d, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x63, 0x63,
0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x1e, 0x45, 0x74, 0x68, 0x65, 0x72,
0x65, 0x75, 0x6d, 0x5c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5c, 0x41, 0x63,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e,
0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61,
0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x1a, 0x78, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72,
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b,
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x4b, 0x0a,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x65,
0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f,
0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72,
0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c,
0x6f, 0x61, 0x64, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0xce,
0x01, 0x0a, 0x22, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e,
0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e,
0x74, 0x73, 0x2e, 0x76, 0x32, 0x42, 0x0f, 0x4b, 0x65, 0x79, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65,
0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x53, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61,
0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31,
0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e,
0x74, 0x3b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x70, 0x62, 0xaa, 0x02, 0x1e,
0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74,
0x6f, 0x72, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x56, 0x32, 0xca, 0x02,
0x1e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61,
0x74, 0x6f, 0x72, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x56, 0x32, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -919,8 +879,6 @@ var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_goTypes = []inte
(*v1alpha1.BlindedBeaconBlockCapella)(nil), // 18: ethereum.eth.v1alpha1.BlindedBeaconBlockCapella
(*v1alpha1.BeaconBlockDeneb)(nil), // 19: ethereum.eth.v1alpha1.BeaconBlockDeneb
(*v1alpha1.BlindedBeaconBlockDeneb)(nil), // 20: ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb
(*v1alpha1.BeaconBlockElectra)(nil), // 21: ethereum.eth.v1alpha1.BeaconBlockElectra
(*v1alpha1.BlindedBeaconBlockElectra)(nil), // 22: ethereum.eth.v1alpha1.BlindedBeaconBlockElectra
}
var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_depIdxs = []int32{
7, // 0: ethereum.validator.accounts.v2.SignRequest.block:type_name -> ethereum.eth.v1alpha1.BeaconBlock
@@ -937,18 +895,16 @@ var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_depIdxs = []int3
18, // 11: ethereum.validator.accounts.v2.SignRequest.blinded_block_capella:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockCapella
19, // 12: ethereum.validator.accounts.v2.SignRequest.block_deneb:type_name -> ethereum.eth.v1alpha1.BeaconBlockDeneb
20, // 13: ethereum.validator.accounts.v2.SignRequest.blinded_block_deneb:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb
21, // 14: ethereum.validator.accounts.v2.SignRequest.block_electra:type_name -> ethereum.eth.v1alpha1.BeaconBlockElectra
22, // 15: ethereum.validator.accounts.v2.SignRequest.blinded_block_electra:type_name -> ethereum.eth.v1alpha1.BlindedBeaconBlockElectra
0, // 16: ethereum.validator.accounts.v2.SignResponse.status:type_name -> ethereum.validator.accounts.v2.SignResponse.Status
4, // 17: ethereum.validator.accounts.v2.ProposerOptionPayload.builder:type_name -> ethereum.validator.accounts.v2.BuilderConfig
6, // 18: ethereum.validator.accounts.v2.ProposerSettingsPayload.proposer_config:type_name -> ethereum.validator.accounts.v2.ProposerSettingsPayload.ProposerConfigEntry
3, // 19: ethereum.validator.accounts.v2.ProposerSettingsPayload.default_config:type_name -> ethereum.validator.accounts.v2.ProposerOptionPayload
3, // 20: ethereum.validator.accounts.v2.ProposerSettingsPayload.ProposerConfigEntry.value:type_name -> ethereum.validator.accounts.v2.ProposerOptionPayload
21, // [21:21] is the sub-list for method output_type
21, // [21:21] is the sub-list for method input_type
21, // [21:21] is the sub-list for extension type_name
21, // [21:21] is the sub-list for extension extendee
0, // [0:21] is the sub-list for field type_name
0, // 14: ethereum.validator.accounts.v2.SignResponse.status:type_name -> ethereum.validator.accounts.v2.SignResponse.Status
4, // 15: ethereum.validator.accounts.v2.ProposerOptionPayload.builder:type_name -> ethereum.validator.accounts.v2.BuilderConfig
6, // 16: ethereum.validator.accounts.v2.ProposerSettingsPayload.proposer_config:type_name -> ethereum.validator.accounts.v2.ProposerSettingsPayload.ProposerConfigEntry
3, // 17: ethereum.validator.accounts.v2.ProposerSettingsPayload.default_config:type_name -> ethereum.validator.accounts.v2.ProposerOptionPayload
3, // 18: ethereum.validator.accounts.v2.ProposerSettingsPayload.ProposerConfigEntry.value:type_name -> ethereum.validator.accounts.v2.ProposerOptionPayload
19, // [19:19] is the sub-list for method output_type
19, // [19:19] is the sub-list for method input_type
19, // [19:19] is the sub-list for extension type_name
19, // [19:19] is the sub-list for extension extendee
0, // [0:19] is the sub-list for field type_name
}
func init() { file_proto_prysm_v1alpha1_validator_client_keymanager_proto_init() }
@@ -1036,8 +992,6 @@ func file_proto_prysm_v1alpha1_validator_client_keymanager_proto_init() {
(*SignRequest_BlindedBlockCapella)(nil),
(*SignRequest_BlockDeneb)(nil),
(*SignRequest_BlindedBlockDeneb)(nil),
(*SignRequest_BlockElectra)(nil),
(*SignRequest_BlindedBlockElectra)(nil),
}
file_proto_prysm_v1alpha1_validator_client_keymanager_proto_msgTypes[2].OneofWrappers = []interface{}{}
type x struct{}

View File

@@ -61,10 +61,6 @@ message SignRequest {
// Deneb objects.
ethereum.eth.v1alpha1.BeaconBlockDeneb block_deneb = 116;
ethereum.eth.v1alpha1.BlindedBeaconBlockDeneb blinded_block_deneb = 117;
// Electra objects.
ethereum.eth.v1alpha1.BeaconBlockElectra block_electra = 118;
ethereum.eth.v1alpha1.BlindedBeaconBlockElectra blinded_block_electra = 119;
}
reserved 4, 5; // Reserving old, deleted fields.
uint64 signing_slot = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"];
@@ -106,4 +102,4 @@ message BuilderConfig {
message ProposerSettingsPayload {
map<string, ProposerOptionPayload> proposer_config = 1;
ProposerOptionPayload default_config = 2;
}
}

View File

@@ -26,15 +26,6 @@ mainnet = {
"max_blobs_per_block.size": "6",
"max_blob_commitments.size": "4096",
"kzg_commitment_inclusion_proof_depth.size": "17",
"max_withdrawal_requests_per_payload.size":"16",
"max_deposit_receipts": "8192",
"max_attesting_indices.size": "131072",
"max_committees_per_slot.size": "64",
"committee_bits.size": "8",
"committee_bits.type": "github.com/prysmaticlabs/go-bitfield.Bitvector64",
"pending_balance_deposits_limit": "134217728",
"pending_partial_withdrawals_limit": "134217728",
"pending_consolidations_limit": "262144",
}
minimal = {
@@ -57,15 +48,6 @@ minimal = {
"max_blobs_per_block.size": "6",
"max_blob_commitments.size": "16",
"kzg_commitment_inclusion_proof_depth.size": "9",
"max_withdrawal_requests_per_payload.size":"2",
"max_deposit_receipts": "4",
"max_attesting_indices.size": "8192",
"max_committees_per_slot.size": "4",
"committee_bits.size": "1",
"committee_bits.type": "github.com/prysmaticlabs/go-bitfield.Bitvector4",
"pending_balance_deposits_limit": "134217728",
"pending_partial_withdrawals_limit": "64",
"pending_consolidations_limit": "64",
}
###### Rules definitions #######

View File

@@ -1,12 +0,0 @@
load("@prysm//tools/go:def.bzl", "go_test")
go_test(
name = "go_default_test",
size = "small",
srcs = ["ssz_static_test.go"],
data = glob(["*.yaml"]) + [
"@consensus_spec_tests_mainnet//:test_data",
],
tags = ["spectest"],
deps = ["//testing/spectest/shared/electra/ssz_static:go_default_library"],
)

View File

@@ -1,11 +0,0 @@
package ssz_static
import (
"testing"
"github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/ssz_static"
)
func TestMainnet_Electra_SSZStatic(t *testing.T) {
ssz_static.RunSSZStaticTests(t, "mainnet")
}

View File

@@ -1,16 +0,0 @@
load("@prysm//tools/go:def.bzl", "go_test")
go_test(
name = "go_default_test",
size = "small",
srcs = ["ssz_static_test.go"],
data = glob(["*.yaml"]) + [
"@consensus_spec_tests_minimal//:test_data",
],
eth_network = "minimal",
tags = [
"minimal",
"spectest",
],
deps = ["//testing/spectest/shared/electra/ssz_static:go_default_library"],
)

View File

@@ -1,11 +0,0 @@
package ssz_static
import (
"testing"
"github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/ssz_static"
)
func TestMinimal_Electra_SSZStatic(t *testing.T) {
ssz_static.RunSSZStaticTests(t, "minimal")
}

View File

@@ -1,15 +0,0 @@
load("@prysm//tools/go:def.bzl", "go_library")
go_library(
name = "go_default_library",
testonly = True,
srcs = ["ssz_static.go"],
importpath = "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/electra/ssz_static",
visibility = ["//testing/spectest:__subpackages__"],
deps = [
"//proto/engine/v1:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",
"//testing/spectest/shared/common/ssz_static:go_default_library",
"@com_github_prysmaticlabs_fastssz//:go_default_library",
],
)

View File

@@ -1,170 +0,0 @@
package ssz_static
import (
"errors"
"testing"
fssz "github.com/prysmaticlabs/fastssz"
enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
common "github.com/prysmaticlabs/prysm/v5/testing/spectest/shared/common/ssz_static"
)
// RunSSZStaticTests executes "ssz_static" tests.
func RunSSZStaticTests(t *testing.T, config string) {
common.RunSSZStaticTests(t, config, "electra", UnmarshalledSSZ, customHtr)
}
func customHtr(t *testing.T, htrs []common.HTR, object interface{}) []common.HTR {
// TODO: Replace BeaconStateDeneb with BeaconStateElectra below and uncomment the code
//_, ok := object.(*ethpb.BeaconStateDeneb)
//if !ok {
// return htrs
//}
//
//htrs = append(htrs, func(s interface{}) ([32]byte, error) {
// beaconState, err := state_native.InitializeFromProtoDeneb(s.(*ethpb.BeaconStateDeneb))
// require.NoError(t, err)
// return beaconState.HashTreeRoot(context.Background())
//})
return htrs
}
// UnmarshalledSSZ unmarshalls serialized input.
func UnmarshalledSSZ(t *testing.T, serializedBytes []byte, folderName string) (interface{}, error) {
// TODO: Remove this check once BeaconState custom HTR function is ready
if folderName == "BeaconState" {
t.Skip("BeaconState is not ready")
}
var obj interface{}
switch folderName {
case "ExecutionPayload":
obj = &enginev1.ExecutionPayloadElectra{}
case "ExecutionPayloadHeader":
obj = &enginev1.ExecutionPayloadHeaderElectra{}
case "Attestation":
obj = &ethpb.AttestationElectra{}
case "AttestationData":
obj = &ethpb.AttestationData{}
case "AttesterSlashing":
obj = &ethpb.AttesterSlashingElectra{}
case "AggregateAndProof":
obj = &ethpb.AggregateAttestationAndProofElectra{}
case "BeaconBlock":
obj = &ethpb.BeaconBlockElectra{}
case "BeaconBlockBody":
obj = &ethpb.BeaconBlockBodyElectra{}
case "BeaconBlockHeader":
obj = &ethpb.BeaconBlockHeader{}
case "BeaconState":
obj = &ethpb.BeaconStateElectra{}
case "Checkpoint":
obj = &ethpb.Checkpoint{}
case "Deposit":
obj = &ethpb.Deposit{}
case "DepositMessage":
obj = &ethpb.DepositMessage{}
case "DepositData":
obj = &ethpb.Deposit_Data{}
case "Eth1Data":
obj = &ethpb.Eth1Data{}
case "Eth1Block":
t.Skip("Unused type")
return nil, nil
case "Fork":
obj = &ethpb.Fork{}
case "ForkData":
obj = &ethpb.ForkData{}
case "HistoricalBatch":
obj = &ethpb.HistoricalBatch{}
case "IndexedAttestation":
obj = &ethpb.IndexedAttestationElectra{}
case "PendingAttestation":
obj = &ethpb.PendingAttestation{}
case "ProposerSlashing":
obj = &ethpb.ProposerSlashing{}
case "SignedAggregateAndProof":
obj = &ethpb.SignedAggregateAttestationAndProofElectra{}
case "SignedBeaconBlock":
obj = &ethpb.SignedBeaconBlockElectra{}
case "SignedBeaconBlockHeader":
obj = &ethpb.SignedBeaconBlockHeader{}
case "SignedVoluntaryExit":
obj = &ethpb.SignedVoluntaryExit{}
case "SigningData":
obj = &ethpb.SigningData{}
case "Validator":
obj = &ethpb.Validator{}
case "VoluntaryExit":
obj = &ethpb.VoluntaryExit{}
case "SyncCommitteeMessage":
obj = &ethpb.SyncCommitteeMessage{}
case "SyncCommitteeContribution":
obj = &ethpb.SyncCommitteeContribution{}
case "ContributionAndProof":
obj = &ethpb.ContributionAndProof{}
case "SignedContributionAndProof":
obj = &ethpb.SignedContributionAndProof{}
case "SyncAggregate":
obj = &ethpb.SyncAggregate{}
case "SyncAggregatorSelectionData":
obj = &ethpb.SyncAggregatorSelectionData{}
case "SyncCommittee":
obj = &ethpb.SyncCommittee{}
case "LightClientOptimisticUpdate":
t.Skip("not a beacon node type, this is a light node type")
return nil, nil
case "LightClientFinalityUpdate":
t.Skip("not a beacon node type, this is a light node type")
return nil, nil
case "LightClientBootstrap":
t.Skip("not a beacon node type, this is a light node type")
return nil, nil
case "LightClientSnapshot":
t.Skip("not a beacon node type, this is a light node type")
return nil, nil
case "LightClientUpdate":
t.Skip("not a beacon node type, this is a light node type")
return nil, nil
case "LightClientHeader":
t.Skip("not a beacon node type, this is a light node type")
return nil, nil
case "BlobIdentifier":
obj = &ethpb.BlobIdentifier{}
case "BlobSidecar":
obj = &ethpb.BlobSidecar{}
case "PowBlock":
obj = &ethpb.PowBlock{}
case "Withdrawal":
obj = &enginev1.Withdrawal{}
case "HistoricalSummary":
obj = &ethpb.HistoricalSummary{}
case "BLSToExecutionChange":
obj = &ethpb.BLSToExecutionChange{}
case "SignedBLSToExecutionChange":
obj = &ethpb.SignedBLSToExecutionChange{}
case "PendingBalanceDeposit":
obj = &ethpb.PendingBalanceDeposit{}
case "PendingPartialWithdrawal":
obj = &ethpb.PendingPartialWithdrawal{}
case "Consolidation":
obj = &ethpb.Consolidation{}
case "SignedConsolidation":
obj = &ethpb.SignedConsolidation{}
case "PendingConsolidation":
obj = &ethpb.PendingConsolidation{}
case "ExecutionLayerWithdrawalRequest":
obj = &enginev1.ExecutionLayerWithdrawalRequest{}
case "DepositReceipt":
obj = &enginev1.DepositReceipt{}
default:
return nil, errors.New("type not found")
}
var err error
if o, ok := obj.(fssz.Unmarshaler); ok {
err = o.UnmarshalSSZ(serializedBytes)
} else {
err = errors.New("could not unmarshal object, not a fastssz compatible object")
}
return obj, err
}

View File

@@ -21,8 +21,8 @@ import (
// MockNodeClient is a mock of NodeClient interface.
type MockNodeClient struct {
ctrl *gomock.Controller
recorder *MockNodeClientMockRecorder
ctrl *gomock.Controller
recorder *MockNodeClientMockRecorder
healthTracker *beacon.NodeHealthTracker
}

View File

@@ -76,4 +76,3 @@ func (mr *MockJsonRestHandlerMockRecorder) Post(ctx, endpoint, headers, data, re
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Post", reflect.TypeOf((*MockJsonRestHandler)(nil).Post), ctx, endpoint, headers, data, resp)
}