Compare commits

...

19 Commits

Author SHA1 Message Date
Nishant Das
a7c9c76b18 Fix Failures With Prysm Starting Up (#11103) 2022-07-26 13:54:49 +00:00
Leo Lara
5a4edf897f Initialise slasher service using New in slasher test to avoid panics (#11046)
* Initialise slasher service using New in slasher test to avoid panics

* Handle unhanlded error

Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
2022-07-26 12:06:05 +00:00
Nishant Das
2d6b157eea Disable Fuzz Targets (#11060)
* add changes

* fix fuzzer again

* is fixed

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2022-07-26 16:19:30 +08:00
Denys Yaroshenko
32745b5484 Do not send empty block header to slasher in validation (#11071)
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2022-07-25 21:03:48 +00:00
terencechain
bfdaf2ec5a Add feature flags to testnet default (#11098) 2022-07-25 19:22:10 +00:00
Raul Jordan
39c343bcab Enable Only Saving Blinded Beacon Blocks for Prater (#11097) 2022-07-25 17:44:30 +00:00
Potuz
de1ecf2d60 non-canonical IsOptimistic check (#11088)
When requesting with IsOptimistic for a root which is non-canonical and
historic, we should check if it is canonical before returning false.

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2022-07-25 17:05:32 +00:00
Potuz
7aee67af90 Withdrawals: containers and process BLS to ETH1 changes (#11090)
* add proto for withdrawal containers

* process BLSToExecutionChange

* unit tests

* go fmt

* gaz

* unused error

* Fix import error

* Radek's review

* failed test

Co-authored-by: terence tsao <terence@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-07-25 14:10:18 +00:00
terencechain
9830ce43d6 Set invalid roots for bad block (#10982)
* Set invalid roots for bad block

* Update for fcu

* Update for fcu

* Set bad blocks in subscriber

* Update process_block_test.go

* Rename
2022-07-25 13:45:03 +00:00
Raul Jordan
63a8690140 Use More Granular Metrics for P2P Blocks By Range Latency Histogram (#11085)
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-07-22 18:08:21 +00:00
james-prysm
7978a0269b initial commit (#11084) 2022-07-22 13:10:19 -04:00
nixorokish
021df67fdc [README] Add GitPOAP Badge to Display Number of Minted GitPOAPs for Contributors (#11081)
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2022-07-22 15:21:27 +00:00
terencechain
f20e6351f5 Add prater bellatrix fork epoch and ttd (#11072)
* Add prater bellatrix fork epoch and ttd

* Update workspace with tar and fix tests

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-07-22 14:16:35 +00:00
Potuz
a2e834a683 Fix optimistic sync status during init sync (#11074)
Co-authored-by: rkapka <rkapka@wp.pl>
2022-07-21 17:59:51 +02:00
Preston Van Loon
da25624b1d Validator gRPC: Add deprecated endpoint to prevent breaking change from v2.1.3 (#11078)
* Add a deprecated gRPC endpoint to prevent breaking changes from prior release

* Fix validator build, tests still fail

* Fix validator tests

* Fix validator tests

* Fix validator tests

* Update mocks and uncomment the endtoend fee recipient check. Also
updates proto generated files.

* Remove unrelated changes

* Remove unrelated changes

* Stop yelling

* Finish renaming
2022-07-20 11:08:13 -05:00
Radosław Kapka
1a5dd879c5 Change Unable to cache headers... log level to warning (#10956)
* Change `Unable to cache headers...` log level to warning

* better solution

Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2022-07-20 13:56:25 +00:00
james-prysm
65a9ede2d3 Validator-Registration: E2E current release fix and better error handling (#11075)
* initial commit

* removing generated auth-token

* addressing feedback

* removing mev from message

* removing unneeded limitation
2022-07-20 09:15:20 -04:00
Potuz
4b083c2ca9 Fix IsExecutionEnabled for blinded blocks (#11076)
* Fix IsExecutionEnabled for blinded blocks

The TransactionsRoot of a blinded block may be non-zero, anyway we do
not insert the header in the state until IsExecutionEnabled is true.
This last check was failing on blinded blocks because it was actively
checking that the root should be zero, when it needn't be.

Superseeds #11068

* fix test

* test case

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-07-19 20:45:45 +00:00
terencechain
82ae4caca8 Add Goerli as an alias to Prater (#11065)
* Add Goerli as an alias to Parter

* Revert "Add Goerli as an alias to Parter"

This reverts commit 47311ce8b0.

* Preston's feedback
2022-07-19 20:00:16 +00:00
64 changed files with 1483 additions and 296 deletions

View File

@@ -5,6 +5,7 @@
[![Consensus_Spec_Version 1.2.0-rc.1](https://img.shields.io/badge/Consensus%20Spec%20Version-v1.2.0.rc.1-blue.svg)](https://github.com/ethereum/consensus-specs/tree/v1.2.0-rc.1)
[![Execution_API_Version 1.0.0-alpha.9](https://img.shields.io/badge/Execution%20API%20Version-v1.0.0.alpha.9-blue.svg)](https://github.com/ethereum/execution-apis/tree/v1.0.0-alpha.9/src/engine)
[![Discord](https://user-images.githubusercontent.com/7288322/34471967-1df7808a-efbb-11e7-9088-ed0b04151291.png)](https://discord.gg/CTYGPUJ)
[![GitPOAP Badge](https://public-api.gitpoap.io/v1/repo/prysmaticlabs/prysm/badge)](https://www.gitpoap.io/gh/prysmaticlabs/prysm)
This is the core repository for Prysm, a [Golang](https://golang.org/) implementation of the [Ethereum Consensus](https://ethereum.org/en/eth2/) specification, developed by [Prysmatic Labs](https://prysmaticlabs.com). See the [Changelog](https://github.com/prysmaticlabs/prysm/releases) for details of the latest releases and upcoming breaking changes.

View File

@@ -309,9 +309,9 @@ filegroup(
visibility = ["//visibility:public"],
)
""",
sha256 = "4e8a18b21d056c4032605621b1a6632198eabab57cb90c61e273f344c287f1b2",
strip_prefix = "eth2-networks-791a5369c5981e829698b17fbcdcdacbdaba97c8",
url = "https://github.com/eth-clients/eth2-networks/archive/791a5369c5981e829698b17fbcdcdacbdaba97c8.tar.gz",
sha256 = "126b615e3853e29b61f082f6c89c8bc1c38cd92fb84b0004396fc49e7acc8d9f",
strip_prefix = "eth2-networks-f3ccbe0cf5798d5cd23e4e6e7119aefa043c0935",
url = "https://github.com/eth-clients/eth2-networks/archive/f3ccbe0cf5798d5cd23e4e6e7119aefa043c0935.tar.gz",
)
http_archive(

View File

@@ -343,8 +343,14 @@ func (s *Service) IsOptimisticForRoot(ctx context.Context, root [32]byte) (bool,
return true, nil
}
// Historical non-canonical blocks here are returned as optimistic for safety.
isCanonical, err := s.IsCanonical(ctx, root)
if err != nil {
return false, err
}
if slots.ToEpoch(ss.Slot)+1 < validatedCheckpoint.Epoch {
return false, nil
return !isCanonical, nil
}
// Checkpoint root could be zeros before the first finalized epoch. Use genesis root if the case.
@@ -359,13 +365,6 @@ func (s *Service) IsOptimisticForRoot(ctx context.Context, root [32]byte) (bool,
if ss.Slot > lastValidated.Slot {
return true, nil
}
isCanonical, err := s.IsCanonical(ctx, root)
if err != nil {
return false, err
}
// Historical non-canonical blocks here are returned as optimistic for safety.
return !isCanonical, nil
}

View File

@@ -40,12 +40,14 @@ var (
// The block is deemed invalid according to execution layer client.
// The block violates certain fork choice rules (before finalized slot, not finalized ancestor)
type invalidBlock struct {
invalidAncestorRoots [][32]byte
error
root [32]byte
}
type invalidBlockError interface {
Error() string
InvalidAncestorRoots() [][32]byte
BlockRoot() [32]byte
}
@@ -54,6 +56,11 @@ func (e invalidBlock) BlockRoot() [32]byte {
return e.root
}
// InvalidAncestorRoots returns an optional list of invalid roots of the invalid block which leads up last valid root.
func (e invalidBlock) InvalidAncestorRoots() [][32]byte {
return e.invalidAncestorRoots
}
// IsInvalidBlock returns true if the error has `invalidBlock`.
func IsInvalidBlock(e error) bool {
if e == nil {
@@ -78,3 +85,15 @@ func InvalidBlockRoot(e error) [32]byte {
}
return d.BlockRoot()
}
// InvalidAncestorRoots returns a list of invalid roots up to last valid root.
func InvalidAncestorRoots(e error) [][32]byte {
if e == nil {
return [][32]byte{}
}
d, ok := e.(invalidBlockError)
if !ok {
return [][32]byte{}
}
return d.InvalidAncestorRoots()
}

View File

@@ -14,6 +14,7 @@ func TestIsInvalidBlock(t *testing.T) {
newErr := errors.Wrap(err, "wrap me")
require.Equal(t, true, IsInvalidBlock(newErr))
require.DeepEqual(t, [][32]byte(nil), InvalidAncestorRoots(err))
}
func TestInvalidBlockRoot(t *testing.T) {
@@ -22,4 +23,14 @@ func TestInvalidBlockRoot(t *testing.T) {
err := invalidBlock{error: ErrInvalidPayload, root: [32]byte{'a'}}
require.Equal(t, [32]byte{'a'}, InvalidBlockRoot(err))
require.DeepEqual(t, [][32]byte(nil), InvalidAncestorRoots(err))
}
func TestInvalidRoots(t *testing.T) {
roots := [][32]byte{{'d'}, {'b'}, {'c'}}
err := invalidBlock{error: ErrInvalidPayload, root: [32]byte{'a'}, invalidAncestorRoots: roots}
require.Equal(t, true, IsInvalidBlock(err))
require.Equal(t, [32]byte{'a'}, InvalidBlockRoot(err))
require.DeepEqual(t, roots, InvalidAncestorRoots(err))
}

View File

@@ -133,7 +133,7 @@ func (s *Service) notifyForkchoiceUpdate(ctx context.Context, arg *notifyForkcho
"invalidCount": len(invalidRoots),
"newHeadRoot": fmt.Sprintf("%#x", bytesutil.Trunc(r[:])),
}).Warn("Pruned invalid blocks")
return pid, invalidBlock{error: ErrInvalidPayload, root: arg.headRoot}
return pid, invalidBlock{error: ErrInvalidPayload, root: arg.headRoot, invalidAncestorRoots: invalidRoots}
default:
log.WithError(err).Error(ErrUndefinedExecutionEngineError)
@@ -232,7 +232,10 @@ func (s *Service) notifyNewPayload(ctx context.Context, postStateVersion int,
"blockRoot": fmt.Sprintf("%#x", root),
"invalidCount": len(invalidRoots),
}).Warn("Pruned invalid blocks")
return false, ErrInvalidPayload
return false, invalidBlock{
invalidAncestorRoots: invalidRoots,
error: ErrInvalidPayload,
}
case powchain.ErrInvalidBlockHashPayloadStatus:
newPayloadInvalidNodeCount.Inc()
return false, ErrInvalidBlockHashPayloadStatus

View File

@@ -779,7 +779,7 @@ func TestFillForkChoiceMissingBlocks_FinalizedSibling_DoublyLinkedTree(t *testin
err = service.fillInForkChoiceMissingBlocks(
context.Background(), wsb.Block(), beaconState.FinalizedCheckpoint(), beaconState.CurrentJustifiedCheckpoint())
require.ErrorIs(t, errNotDescendantOfFinalized, err)
require.Equal(t, errNotDescendantOfFinalized.Error(), err.Error())
}
// blockTree1 constructs the following tree:

View File

@@ -6,6 +6,7 @@ go_library(
"attestation.go",
"attester_slashing.go",
"deposit.go",
"error.go",
"eth1_data.go",
"exit.go",
"genesis.go",
@@ -15,6 +16,7 @@ go_library(
"proposer_slashing.go",
"randao.go",
"signature.go",
"withdrawals.go",
],
importpath = "github.com/prysmaticlabs/prysm/beacon-chain/core/blocks",
visibility = [
@@ -39,6 +41,7 @@ go_library(
"//contracts/deposit:go_default_library",
"//crypto/bls:go_default_library",
"//crypto/hash:go_default_library",
"//crypto/hash/htr:go_default_library",
"//encoding/bytesutil:go_default_library",
"//math:go_default_library",
"//network/forks:go_default_library",
@@ -74,6 +77,7 @@ go_test(
"proposer_slashing_test.go",
"randao_test.go",
"signature_test.go",
"withdrawals_test.go",
],
data = glob(["testdata/**"]),
embed = [":go_default_library"],
@@ -92,6 +96,7 @@ go_test(
"//consensus-types/wrapper:go_default_library",
"//container/trie:go_default_library",
"//crypto/bls:go_default_library",
"//crypto/hash/htr:go_default_library",
"//encoding/bytesutil:go_default_library",
"//encoding/ssz:go_default_library",
"//proto/engine/v1:go_default_library",

View File

@@ -0,0 +1,8 @@
package blocks
import "github.com/pkg/errors"
var errNilSignedWithdrawalMessage = errors.New("nil SignedBLSToExecutionChange message")
var errNilWithdrawalMessage = errors.New("nil BLSToExecutionChange message")
var errInvalidBLSPrefix = errors.New("withdrawal credential prefix is not a BLS prefix")
var errInvalidWithdrawalCredentials = errors.New("withdrawal credentials do not match")

View File

@@ -101,15 +101,6 @@ func Test_IsMergeComplete(t *testing.T) {
}(),
want: true,
},
{
name: "has tx root",
payload: func() *enginev1.ExecutionPayloadHeader {
h := emptyPayloadHeader()
h.TransactionsRoot = bytesutil.PadTo([]byte{'a'}, fieldparams.RootLength)
return h
}(),
want: true,
},
{
name: "has extra data",
payload: func() *enginev1.ExecutionPayloadHeader {

View File

@@ -0,0 +1,78 @@
package blocks
import (
"bytes"
"github.com/prysmaticlabs/prysm/beacon-chain/core/signing"
"github.com/prysmaticlabs/prysm/beacon-chain/state"
"github.com/prysmaticlabs/prysm/config/params"
"github.com/prysmaticlabs/prysm/crypto/hash/htr"
"github.com/prysmaticlabs/prysm/encoding/bytesutil"
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/time/slots"
)
const executionToBLSPadding = 12
// ProcessBLSToExecutionChange validates a SignedBLSToExecution message and
// changes the validator's withdrawal address accordingly.
//
// Spec pseudocode definition:
//
//def process_bls_to_execution_change(state: BeaconState, signed_address_change: SignedBLSToExecutionChange) -> None:
// validator = state.validators[address_change.validator_index]
//
// assert validator.withdrawal_credentials[:1] == BLS_WITHDRAWAL_PREFIX
// assert validator.withdrawal_credentials[1:] == hash(address_change.from_bls_pubkey)[1:]
//
// domain = get_domain(state, DOMAIN_BLS_TO_EXECUTION_CHANGE)
// signing_root = compute_signing_root(address_change, domain)
// assert bls.Verify(address_change.from_bls_pubkey, signing_root, signed_address_change.signature)
//
// validator.withdrawal_credentials = (
// ETH1_ADDRESS_WITHDRAWAL_PREFIX
// + b'\x00' * 11
// + address_change.to_execution_address
// )
//
func ProcessBLSToExecutionChange(st state.BeaconState, signed *ethpb.SignedBLSToExecutionChange) (state.BeaconState, error) {
if signed == nil {
return st, errNilSignedWithdrawalMessage
}
message := signed.Message
if message == nil {
return st, errNilWithdrawalMessage
}
val, err := st.ValidatorAtIndex(message.ValidatorIndex)
if err != nil {
return nil, err
}
cred := val.WithdrawalCredentials
if cred[0] != params.BeaconConfig().BLSWithdrawalPrefixByte {
return nil, errInvalidBLSPrefix
}
// hash the public key and verify it matches the withdrawal credentials
fromPubkey := message.FromBlsPubkey
pubkeyChunks := [][32]byte{bytesutil.ToBytes32(fromPubkey[:32]), bytesutil.ToBytes32(fromPubkey[32:])}
digest := make([][32]byte, 1)
htr.VectorizedSha256(pubkeyChunks, digest)
if !bytes.Equal(digest[0][1:], cred[1:]) {
return nil, errInvalidWithdrawalCredentials
}
epoch := slots.ToEpoch(st.Slot())
domain, err := signing.Domain(st.Fork(), epoch, params.BeaconConfig().DomainBLSToExecutionChange, st.GenesisValidatorsRoot())
if err != nil {
return nil, err
}
if err := signing.VerifySigningRoot(message, fromPubkey, signed.Signature, domain); err != nil {
return nil, signing.ErrSigFailedToVerify
}
newCredentials := make([]byte, executionToBLSPadding)
newCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte
val.WithdrawalCredentials = append(newCredentials, message.ToExecutionAddress...)
err = st.UpdateValidatorAtIndex(message.ValidatorIndex, val)
return st, err
}

View File

@@ -0,0 +1,193 @@
package blocks_test
import (
"testing"
"github.com/prysmaticlabs/prysm/beacon-chain/core/blocks"
"github.com/prysmaticlabs/prysm/beacon-chain/core/signing"
"github.com/prysmaticlabs/prysm/beacon-chain/core/time"
v1 "github.com/prysmaticlabs/prysm/beacon-chain/state/v1"
"github.com/prysmaticlabs/prysm/config/params"
"github.com/prysmaticlabs/prysm/crypto/bls"
"github.com/prysmaticlabs/prysm/crypto/hash/htr"
"github.com/prysmaticlabs/prysm/encoding/bytesutil"
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/testing/require"
)
func TestProcessBLSToExecutionChange(t *testing.T) {
t.Run("happy case", func(t *testing.T) {
priv, err := bls.RandKey()
require.NoError(t, err)
pubkey := priv.PublicKey().Marshal()
message := &ethpb.BLSToExecutionChange{
ToExecutionAddress: []byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13},
ValidatorIndex: 0,
FromBlsPubkey: pubkey,
}
pubkeyChunks := [][32]byte{bytesutil.ToBytes32(pubkey[:32]), bytesutil.ToBytes32(pubkey[32:])}
digest := make([][32]byte, 1)
htr.VectorizedSha256(pubkeyChunks, digest)
digest[0][0] = params.BeaconConfig().BLSWithdrawalPrefixByte
registry := []*ethpb.Validator{
{
WithdrawalCredentials: digest[0][:],
},
}
st, err := v1.InitializeFromProto(&ethpb.BeaconState{
Validators: registry,
Fork: &ethpb.Fork{
CurrentVersion: params.BeaconConfig().GenesisForkVersion,
PreviousVersion: params.BeaconConfig().GenesisForkVersion,
},
Slot: params.BeaconConfig().SlotsPerEpoch * 5,
})
require.NoError(t, err)
signature, err := signing.ComputeDomainAndSign(st, time.CurrentEpoch(st), message, params.BeaconConfig().DomainBLSToExecutionChange, priv)
require.NoError(t, err)
signed := &ethpb.SignedBLSToExecutionChange{
Message: message,
Signature: signature,
}
st, err = blocks.ProcessBLSToExecutionChange(st, signed)
require.NoError(t, err)
val, err := st.ValidatorAtIndex(0)
require.NoError(t, err)
require.DeepEqual(t, message.ToExecutionAddress, val.WithdrawalCredentials[12:])
})
t.Run("non-existent validator", func(t *testing.T) {
priv, err := bls.RandKey()
require.NoError(t, err)
pubkey := priv.PublicKey().Marshal()
message := &ethpb.BLSToExecutionChange{
ToExecutionAddress: []byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13},
ValidatorIndex: 1,
FromBlsPubkey: pubkey,
}
pubkeyChunks := [][32]byte{bytesutil.ToBytes32(pubkey[:32]), bytesutil.ToBytes32(pubkey[32:])}
digest := make([][32]byte, 1)
htr.VectorizedSha256(pubkeyChunks, digest)
digest[0][0] = params.BeaconConfig().BLSWithdrawalPrefixByte
registry := []*ethpb.Validator{
{
WithdrawalCredentials: digest[0][:],
},
}
st, err := v1.InitializeFromProto(&ethpb.BeaconState{
Validators: registry,
Fork: &ethpb.Fork{
CurrentVersion: params.BeaconConfig().GenesisForkVersion,
PreviousVersion: params.BeaconConfig().GenesisForkVersion,
},
Slot: params.BeaconConfig().SlotsPerEpoch * 5,
})
require.NoError(t, err)
signature, err := signing.ComputeDomainAndSign(st, time.CurrentEpoch(st), message, params.BeaconConfig().DomainBLSToExecutionChange, priv)
require.NoError(t, err)
signed := &ethpb.SignedBLSToExecutionChange{
Message: message,
Signature: signature,
}
_, err = blocks.ProcessBLSToExecutionChange(st, signed)
require.ErrorContains(t, "out of range", err)
})
t.Run("signature does not verify", func(t *testing.T) {
priv, err := bls.RandKey()
require.NoError(t, err)
pubkey := priv.PublicKey().Marshal()
message := &ethpb.BLSToExecutionChange{
ToExecutionAddress: []byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13},
ValidatorIndex: 0,
FromBlsPubkey: pubkey,
}
registry := []*ethpb.Validator{
{
WithdrawalCredentials: params.BeaconConfig().ZeroHash[:],
},
}
st, err := v1.InitializeFromProto(&ethpb.BeaconState{
Validators: registry,
Fork: &ethpb.Fork{
CurrentVersion: params.BeaconConfig().GenesisForkVersion,
PreviousVersion: params.BeaconConfig().GenesisForkVersion,
},
Slot: params.BeaconConfig().SlotsPerEpoch * 5,
})
require.NoError(t, err)
signature, err := signing.ComputeDomainAndSign(st, time.CurrentEpoch(st), message, params.BeaconConfig().DomainBLSToExecutionChange, priv)
require.NoError(t, err)
signed := &ethpb.SignedBLSToExecutionChange{
Message: message,
Signature: signature,
}
_, err = blocks.ProcessBLSToExecutionChange(st, signed)
require.ErrorContains(t, "withdrawal credentials do not match", err)
})
t.Run("invalid BLS prefix", func(t *testing.T) {
priv, err := bls.RandKey()
require.NoError(t, err)
pubkey := priv.PublicKey().Marshal()
message := &ethpb.BLSToExecutionChange{
ToExecutionAddress: []byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13},
ValidatorIndex: 0,
FromBlsPubkey: pubkey,
}
pubkeyChunks := [][32]byte{bytesutil.ToBytes32(pubkey[:32]), bytesutil.ToBytes32(pubkey[32:])}
digest := make([][32]byte, 1)
htr.VectorizedSha256(pubkeyChunks, digest)
digest[0][0] = params.BeaconConfig().BLSWithdrawalPrefixByte
registry := []*ethpb.Validator{
{
WithdrawalCredentials: digest[0][:],
},
}
registry[0].WithdrawalCredentials[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte
st, err := v1.InitializeFromProto(&ethpb.BeaconState{
Validators: registry,
Fork: &ethpb.Fork{
CurrentVersion: params.BeaconConfig().GenesisForkVersion,
PreviousVersion: params.BeaconConfig().GenesisForkVersion,
},
Slot: params.BeaconConfig().SlotsPerEpoch * 5,
})
require.NoError(t, err)
signature, err := signing.ComputeDomainAndSign(st, time.CurrentEpoch(st), message, params.BeaconConfig().DomainBLSToExecutionChange, priv)
require.NoError(t, err)
signed := &ethpb.SignedBLSToExecutionChange{
Message: message,
Signature: signature,
}
_, err = blocks.ProcessBLSToExecutionChange(st, signed)
require.ErrorContains(t, "withdrawal credential prefix is not a BLS prefix", err)
})
}

View File

@@ -20,6 +20,8 @@ const searchThreshold = 5
// amount of times we repeat a failed search till is satisfies the conditional.
const repeatedSearches = 2 * searchThreshold
var errBlockTimeTooLate = errors.New("provided time is later than the current eth1 head")
// BlockExists returns true if the block exists, its height and any possible error encountered.
func (s *Service) BlockExists(ctx context.Context, hash common.Hash) (bool, *big.Int, error) {
ctx, span := trace.StartSpan(ctx, "powchain.BlockExists")
@@ -105,7 +107,7 @@ func (s *Service) BlockByTimestamp(ctx context.Context, time uint64) (*types.Hea
s.latestEth1DataLock.RUnlock()
if time > latestBlkTime {
return nil, errors.Errorf("provided time is later than the current eth1 head. %d > %d", time, latestBlkTime)
return nil, errors.Wrap(errBlockTimeTooLate, fmt.Sprintf("(%d > %d)", time, latestBlkTime))
}
// Initialize a pointer to eth1 chain's history to start our search from.
cursorNum := big.NewInt(0).SetUint64(latestBlkHeight)

View File

@@ -159,6 +159,7 @@ func FuzzExecutionPayload(f *testing.F) {
}
func FuzzExecutionBlock(f *testing.F) {
f.Skip("Is skipped until false positive rate can be resolved.")
logsBloom := [256]byte{'j', 'u', 'n', 'k'}
addr := common.HexToAddress("095e7baea6a6c7c4c2dfeb977efac326af552d87")
innerData := &types.DynamicFeeTx{
@@ -209,7 +210,16 @@ func FuzzExecutionBlock(f *testing.F) {
if gethErr != nil || prysmErr != nil {
return
}
// Exit early if fuzzer is inserting bogus hashes in.
if isBogusTransactionHash(prysmResp, gethResp) {
return
}
// Exit early if fuzzer provides bogus fields.
valid, err := jsonFieldsAreValid(prysmResp, gethResp)
assert.NoError(t, err)
if !valid {
return
}
assert.NoError(t, validateBlockConsistency(prysmResp, gethResp))
gethBlob, gethErr := json.Marshal(gethResp)
@@ -227,6 +237,27 @@ func FuzzExecutionBlock(f *testing.F) {
})
}
func isBogusTransactionHash(blk *pb.ExecutionBlock, jsonMap map[string]interface{}) bool {
if blk.Transactions == nil {
return false
}
for i, tx := range blk.Transactions {
jsonTx, ok := jsonMap["transactions"].([]interface{})[i].(map[string]interface{})
if !ok {
return true
}
// Fuzzer removed hash field.
if _, ok := jsonTx["hash"]; !ok {
return true
}
if tx.Hash().String() != jsonTx["hash"].(string) {
return true
}
}
return false
}
func compareHeaders(t *testing.T, jsonBlob []byte) {
gethResp := &types.Header{}
prysmResp := &pb.ExecutionBlock{}
@@ -284,3 +315,25 @@ func validateBlockConsistency(execBlock *pb.ExecutionBlock, jsonMap map[string]i
}
return nil
}
func jsonFieldsAreValid(execBlock *pb.ExecutionBlock, jsonMap map[string]interface{}) (bool, error) {
bType := reflect.TypeOf(execBlock).Elem()
fieldnum := bType.NumField()
for i := 0; i < fieldnum; i++ {
field := bType.Field(i)
fName := field.Tag.Get("json")
if field.Name == "Header" {
continue
}
if fName == "" {
return false, errors.Errorf("Field %s had no json tag", field.Name)
}
_, ok := jsonMap[fName]
if !ok {
return false, nil
}
}
return true, nil
}

View File

@@ -586,7 +586,11 @@ func (s *Service) initPOWService() {
// Cache eth1 headers from our voting period.
if err := s.cacheHeadersForEth1DataVote(ctx); err != nil {
s.retryExecutionClientConnection(ctx, err)
errorLogger(err, "Unable to cache headers for execution client votes")
if errors.Is(err, errBlockTimeTooLate) {
log.WithError(err).Warn("Unable to cache headers for execution client votes")
} else {
errorLogger(err, "Unable to cache headers for execution client votes")
}
continue
}
// Handle edge case with embedded genesis state by fetching genesis header to determine

View File

@@ -0,0 +1,2 @@
go test fuzz v1
[]byte("{\"baseFeePerGas\":\"0x7fffffffffffffff\",\"difficulty\":\"0x7fffffffffffffff\",\"extraData\":\"0x\",\"gasLimit\":\"0xffffffffffffffff\",\"gasUsed\":\"0xffffffffffffffff\",\"hash\":\"0xff01ff01ff01ff01ff01ff01ff01ff0100000000000000000000000000000000\",\"logsBloom\":\"0x6a756e6b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\"miner\":\"0x0000000000000000000000000000000000000000\",\"mixHash\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"nonce\":\"0x0000000000000000\",\"number\":\"0x7fffffffffffffff\",\"parentHash\":\"0xff01ff01ff01ff01ff01ff01ff01ff0100000000000000000000000000000000\",\"receiptsRoot\":\"0xff01ff01ff01ff01ff01ff01ff01ff0100000000000000000000000000000000\",\"sha3Uncles\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"stateRoot\":\"0xff01ff01ff01ff01ff01ff01ff01ff0100000000000000000000000000000000\",\"timestamp\":\"0x64\",\"totalDifficulty\":\"999999999999999999999999999999999999999\",\"transactions\":[{\"type\":\"0x2\",\"nonce\":\"0xffffffffffffffff\",\"gasPrice\":null,\"maxPriorityFeePerGas\":\"0x7fffffffffffffff\",\"maxFeePerGas\":\"0x7fffffffffffffff\",\"gas\":\"0xffffffffffffffff\",\"value\":\"0x7fffffffffffffff\",\"input\":\"0x72616e646f6d\",\"v\":\"0x0\",\"r\":\"0x7fffffffffffffff\",\"s\":\"0x7fffffffffffffff\",\"to\":\"0x095e7baea6a6c7c4c2dfeb977efac326af552d87\",\"chainId\":\"0x7fffffffffffffff\",\"accessList\":[],\"hash\":\"0x26db3ef2c0e5945b24088d6a4165d0bb2959abd848b57891aa041b72518548ab\"},{\"type\":\"0x2\",\"nonce\":\"0xffffffffffffffff\",\"gasPrice\":null,\"maxPriorityFeePerGas\":\"0x7fffffffffffffff\",\"maxFeePerGas\":\"0x7fffffffffffffff\",\"gas\":\"0xfffffffffffaffff\",\"value\":\"0x7fffffffffffffff\",\"input\":\"0x72616e646f6d\",\"v\":\"0x0\",\"r\":\"0x7fffffffffffffff\",\"s\":\"0x7fffffffffffffff\",\"to\":\"0x095e7baea6a6c7c4c2dfeb977efac326af552d87\",\"chainId\":\"0x7fffffffffffffff\",\"accessList\":[],\"hash\":\"0x26db3ef2c0e5945b24088d6a4165d0bb2959abd848b57891aa041b72518548ab\"}],\"transactionsRoot\":\"0x0000000000000000000000000000000000000000000000000000000000000000\"}")

View File

@@ -0,0 +1,2 @@
go test fuzz v1
[]byte("{\"baseFeePerGas\":\"0x7fffffffffffffff\",\"difficulty\":\"0x7fffffffffffffff\",\"extraData\":\"0x\",\"gasLimit\":\"0xffffffffffffffff\",\"gasUsed\":\"0xffffffffffffffff\",\"hash\":\"0xff01ff01ff01ff01ff01ff01ff01ff0100000000000000000000000000000000\",\"logsBloom\":\"0x6a756e6b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\"miner\":\"0x0000000000000000000000000000000000000000\",\"mixHash\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"nonce\":\"0x0000000000000000\",\"number\":\"0x7fffffffffffffff\",\"parentHash\":\"0xff01ff01ff01ff01ff01ff01ff01ff0100000000000000000000000000000000\",\"receiptsRoot\":\"0xff01ff01ff01ff01ff01ff01ff01ff0100000000000000000000000000000000\",\"sha3Uncles\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"stateRoot\":\"0xff01ff01ff01ff01ff01ff01ff01ff0100000000000000000000000000000000\",\"timestamp\":\"0x64\",\"totalDifficulty\":\"999999999999999999999999999999999999999\",\"tran0sactions\":[{\"type\":\"0x2\",\"nonce\":\"0xffffffffffffffff\",\"gasPrice\":null,\"maxPriorityFeePerGas\":\"0x7fffffffffffffff\",\"maxFeePerGas\":\"0x7fffffffffffffff\",\"gas\":\"0xffffffffffffffff\",\"value\":\"0x7fffffffffffffff\",\"input\":\"0x72616e646f6d\",\"v\":\"0x0\",\"r\":\"0x7fffffffffffffff\",\"s\":\"0x7fffffffffffffff\",\"to\":\"0x095e7baea6a6c7c4c2dfeb9<7efac326af552d87\",\"chainId\":\"0x7fffffffffffffff\",\"accessList\":[],\"hash\":\"0x26db3ef2c0e5945b24088d6a4165d0bb2959abd848b57891aa041b72518548ab\"},{\"type\":\"0x2\",\"nonce\":\"0xffffffffffffffff\",\"gasPrice\":null,\"maxPriorityFeePerGas\":\"0x7fffffffffffffff\",\"maxFeePerGas\":\"0x7fffffffffffffff\",\"gas\":\"0xffffffffffffffff\",\"value\":\"0x7fffffffffffffff\",\"input\":\"0x72616e646f6d\",\"v\":\"0x0\",\"r\":\"0x7fffffffffffffff\",\"s\":\"0x7fffffffffffffff\",\"to\":\"0x095e7baea6a6c7c4c2dfeb977efac326af552d87\",\"chainId\":\"0x7fffffffffffffff\",\"accessList\":[],\"hash\":\"0x26db3ef2c0e5945b24088d6a4165d0bb2959abd848b57891aa041b72518548ab\"}],\"transactionsRoot\":\"0x0000000000000000000000000000000000000000000000000000000000000000\"}")

View File

@@ -0,0 +1,2 @@
go test fuzz v1
[]byte("{\"baseFeePerGas\":\"0x7fffffffffffffff\",\"difficulty\":\"0x7fffffffffffffff\",\"extraData\":\"0x\",\"gasLimit\":\"0xffffffffffffffff\",\"gasUsed\":\"0xffffffffffffffff\",\"hash\":\"0xff01ff01ff01ff01ff01ff01ff01ff0100000000000000000000000000000000\",\"logsBloom\":\"0x6a756e6b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\"miner\":\"0x0000000000000000000000000000000000000000\",\"mixHash\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"nonce\":\"0x0000000000000000\",\"number\":\"0x7fffffffffffffff\",\"parentHash\":\"0xff01ff01ff01ff01ffffff01ff01ff0100000000000000000000000000000000\",\"receiptsRoot\":\"0xff01ff01ff01ff01ff01ff01ff01ff0100000000000000000000000000000000\",\"sha3Uncles\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"stateRoot\":\"0xff01ff01ff01ff01ff01ff01ff01ff0100000000000000000000000000000000\",\"timestamp\":\"0x64\",\"totalDifficulty\":\"999999999999999999999999999999999999999\",\"transactions\":[{\"type\":\"0x2\",\"nonce\":\"0xffffffffff01ffff\",\"gasPrice\":null,\"maxPriorityFeePerGas\":\"0x7fffffffffffffff\",\"maxFeePerGas\":\"0x7fffffffffffffff\",\"gas\":\"0xffffffffffffffff\",\"value\":\"0x7fffffffffffffff\",\"input\":\"0x72616e646f6d\",\"v\":\"0x0\",\"r\":\"0x7fffffffffffffff\",\"s\":\"0x7fffffffffffffff\",\"to\":\"0x095e7baea6a6c7c4c2dfeb977efac326af552d87\",\"chainId\":\"0x7fffffffffffffff\",\"accessList\":[],\"hasM\":\"0x26db3ef2c0e5945b24088d6a4165d0bb2959abd848b57891aa041b72518548ab\"},{\"type\":\"0x2\",\"nonce\":\"0xffffffffffffffff\",\"gasPrice\":null,\"maxPriorityFeePerGas\":\"0x7fffffffffffffff\",\"maxFeePerGas\":\"0x7fffffffffffffff\",\"gas\":\"0xfffffffffffaffff\",\"value\":\"0x7fffffffffffffff\",\"input\":\"0x72616e646f6d\",\"v\":\"0x0\",\"r\":\"0x7fffffffffffffff\",\"s\":\"0x7fffffffffffffff\",\"to\":\"0x095e7baea6a6c7c4c2dfeb977efac326af552d87\",\"chainId\":\"0x7fffffffffffffff\",\"accessList\":[],\"hash\":\"0x26db3ef2c0e5945b24088d6a4165d0bb2959abd848b57891aa041b72518548ab\"}],\"transactionsRoot\":\"0x0000000000000000000000000000000000000000000000000000000000000000\"}")

View File

@@ -55,6 +55,7 @@ func TestGetSpec(t *testing.T) {
config.CapellaForkVersion = []byte("CapellaForkVersion")
config.CapellaForkEpoch = 103
config.BLSWithdrawalPrefixByte = byte('b')
config.ETH1AddressWithdrawalPrefixByte = byte('c')
config.GenesisDelay = 24
config.SecondsPerSlot = 25
config.MinAttestationInclusionDelay = 26
@@ -135,7 +136,7 @@ func TestGetSpec(t *testing.T) {
resp, err := server.GetSpec(context.Background(), &emptypb.Empty{})
require.NoError(t, err)
assert.Equal(t, 101, len(resp.Data))
assert.Equal(t, 102, len(resp.Data))
for k, v := range resp.Data {
switch k {
case "CONFIG_NAME":
@@ -212,6 +213,8 @@ func TestGetSpec(t *testing.T) {
assert.Equal(t, "1000", v)
case "BLS_WITHDRAWAL_PREFIX":
assert.Equal(t, "0x62", v)
case "ETH1_ADDRESS_WITHDRAWAL_PREFIX":
assert.Equal(t, "0x63", v)
case "GENESIS_DELAY":
assert.Equal(t, "24", v)
case "SECONDS_PER_SLOT":

View File

@@ -28,13 +28,7 @@ func ValidateSync(
return nil
}
headSlot := headFetcher.HeadSlot()
isOptimistic := false
headState, err := headFetcher.HeadState(ctx)
if err != nil {
return status.Errorf(codes.Internal, "Could not get head state: %v", err)
}
isOptimistic, err = IsOptimistic(ctx, headState, optimisticModeFetcher)
isOptimistic, err := optimisticModeFetcher.IsOptimistic(ctx)
if err != nil {
return status.Errorf(codes.Internal, "Could not check optimistic status: %v", err)
}

View File

@@ -15,7 +15,6 @@ go_library(
"//beacon-chain/p2p:go_default_library",
"//beacon-chain/p2p/peers:go_default_library",
"//beacon-chain/p2p/peers/peerdata:go_default_library",
"//beacon-chain/rpc/eth/helpers:go_default_library",
"//beacon-chain/sync:go_default_library",
"//proto/eth/v1:go_default_library",
"//proto/migration:go_default_library",

View File

@@ -14,7 +14,6 @@ import (
"github.com/prysmaticlabs/prysm/beacon-chain/p2p"
"github.com/prysmaticlabs/prysm/beacon-chain/p2p/peers"
"github.com/prysmaticlabs/prysm/beacon-chain/p2p/peers/peerdata"
rpchelpers "github.com/prysmaticlabs/prysm/beacon-chain/rpc/eth/helpers"
ethpb "github.com/prysmaticlabs/prysm/proto/eth/v1"
"github.com/prysmaticlabs/prysm/proto/migration"
eth "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
@@ -266,18 +265,12 @@ func (ns *Server) GetSyncStatus(ctx context.Context, _ *emptypb.Empty) (*ethpb.S
ctx, span := trace.StartSpan(ctx, "node.GetSyncStatus")
defer span.End()
headSlot := ns.HeadFetcher.HeadSlot()
headState, err := ns.HeadFetcher.HeadState(ctx)
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not get head state: %v", err)
}
isOptimistic, err := rpchelpers.IsOptimistic(ctx, headState, ns.OptimisticModeFetcher)
isOptimistic, err := ns.OptimisticModeFetcher.IsOptimistic(ctx)
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not check optimistic status: %v", err)
}
headSlot := ns.HeadFetcher.HeadSlot()
return &ethpb.SyncingResponse{
Data: &ethpb.SyncInfo{
HeadSlot: headSlot,

View File

@@ -53,16 +53,15 @@ func (vs *Server) GetAttesterDuties(ctx context.Context, req *ethpbv1.AttesterDu
return nil, status.Errorf(codes.InvalidArgument, "Request epoch %d can not be greater than next epoch %d", req.Epoch, currentEpoch+1)
}
isOptimistic, err := vs.OptimisticModeFetcher.IsOptimistic(ctx)
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not check optimistic status: %v", err)
}
s, err := vs.HeadFetcher.HeadState(ctx)
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not get head state: %v", err)
}
isOptimistic, err := rpchelpers.IsOptimistic(ctx, s, vs.OptimisticModeFetcher)
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not check if slot's block is optimistic: %v", err)
}
s, err = advanceState(ctx, s, req.Epoch, currentEpoch)
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not advance state to requested epoch start slot: %v", err)
@@ -137,16 +136,15 @@ func (vs *Server) GetProposerDuties(ctx context.Context, req *ethpbv1.ProposerDu
return nil, status.Errorf(codes.InvalidArgument, "Request epoch %d can not be greater than next epoch %d", req.Epoch, currentEpoch+1)
}
isOptimistic, err := vs.OptimisticModeFetcher.IsOptimistic(ctx)
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not check optimistic status: %v", err)
}
s, err := vs.HeadFetcher.HeadState(ctx)
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not get head state: %v", err)
}
isOptimistic, err := rpchelpers.IsOptimistic(ctx, s, vs.OptimisticModeFetcher)
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not check if slot's block is optimistic: %v", err)
}
s, err = advanceState(ctx, s, req.Epoch, currentEpoch)
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not advance state to requested epoch start slot: %v", err)

View File

@@ -188,8 +188,14 @@ func (vs *Server) computeStateRoot(ctx context.Context, block interfaces.SignedB
return root[:], nil
}
// SubmitValidatorRegistration submits validator registrations.
func (vs *Server) SubmitValidatorRegistration(ctx context.Context, reg *ethpb.SignedValidatorRegistrationsV1) (*emptypb.Empty, error) {
// SubmitValidatorRegistration submits validator registration.
// Deprecated: Use SubmitValidatorRegistrations instead.
func (vs *Server) SubmitValidatorRegistration(ctx context.Context, reg *ethpb.SignedValidatorRegistrationV1) (*emptypb.Empty, error) {
return vs.SubmitValidatorRegistrations(ctx, &ethpb.SignedValidatorRegistrationsV1{Messages: []*ethpb.SignedValidatorRegistrationV1{reg}})
}
// SubmitValidatorRegistrations submits validator registrations.
func (vs *Server) SubmitValidatorRegistrations(ctx context.Context, reg *ethpb.SignedValidatorRegistrationsV1) (*emptypb.Empty, error) {
// No-op is the builder is nil / not configured. The node should still function without a builder.
if vs.BlockBuilder == nil || !vs.BlockBuilder.Configured() {
return &emptypb.Empty{}, nil

View File

@@ -2506,20 +2506,20 @@ func TestProposer_PrepareBeaconProposer(t *testing.T) {
}
}
func TestProposer_SubmitValidatorRegistration(t *testing.T) {
func TestProposer_SubmitValidatorRegistrations(t *testing.T) {
ctx := context.Background()
proposerServer := &Server{}
reg := &ethpb.SignedValidatorRegistrationsV1{}
_, err := proposerServer.SubmitValidatorRegistration(ctx, reg)
_, err := proposerServer.SubmitValidatorRegistrations(ctx, reg)
require.NoError(t, err)
proposerServer = &Server{BlockBuilder: &builderTest.MockBuilderService{}}
_, err = proposerServer.SubmitValidatorRegistration(ctx, reg)
_, err = proposerServer.SubmitValidatorRegistrations(ctx, reg)
require.NoError(t, err)
proposerServer = &Server{BlockBuilder: &builderTest.MockBuilderService{HasConfigured: true}}
_, err = proposerServer.SubmitValidatorRegistration(ctx, reg)
_, err = proposerServer.SubmitValidatorRegistrations(ctx, reg)
require.NoError(t, err)
proposerServer = &Server{BlockBuilder: &builderTest.MockBuilderService{HasConfigured: true, ErrRegisterValidator: errors.New("bad")}}
_, err = proposerServer.SubmitValidatorRegistration(ctx, reg)
_, err = proposerServer.SubmitValidatorRegistrations(ctx, reg)
require.ErrorContains(t, "bad", err)
}

View File

@@ -232,19 +232,17 @@ func Test_processQueuedAttestations(t *testing.T) {
attestationWrapper.IndexedAttestation.Signature = bls.AggregateSignatures(sigs).Marshal()
}
s := &Service{
serviceCfg: &ServiceConfig{
s, err := New(context.Background(),
&ServiceConfig{
Database: slasherDB,
StateNotifier: &mock.MockStateNotifier{},
HeadStateFetcher: mockChain,
AttestationStateFetcher: mockChain,
SlashingPoolInserter: &slashingsmock.PoolMock{},
},
params: DefaultParams(),
attsQueue: newAttestationsQueue(),
genesisTime: genesisTime,
latestEpochWrittenForValidator: map[types.ValidatorIndex]types.Epoch{},
}
})
require.NoError(t, err)
s.genesisTime = genesisTime
currentSlotChan := make(chan types.Slot)
exitChan := make(chan struct{})
go func() {
@@ -291,19 +289,17 @@ func Test_processQueuedAttestations_MultipleChunkIndices(t *testing.T) {
State: beaconState,
}
s := &Service{
serviceCfg: &ServiceConfig{
s, err := New(context.Background(),
&ServiceConfig{
Database: slasherDB,
StateNotifier: &mock.MockStateNotifier{},
HeadStateFetcher: mockChain,
AttestationStateFetcher: mockChain,
SlashingPoolInserter: &slashingsmock.PoolMock{},
},
params: slasherParams,
attsQueue: newAttestationsQueue(),
genesisTime: genesisTime,
latestEpochWrittenForValidator: map[types.ValidatorIndex]types.Epoch{},
}
})
require.NoError(t, err)
s.genesisTime = genesisTime
currentSlotChan := make(chan types.Slot)
exitChan := make(chan struct{})
go func() {
@@ -358,19 +354,17 @@ func Test_processQueuedAttestations_OverlappingChunkIndices(t *testing.T) {
State: beaconState,
}
s := &Service{
serviceCfg: &ServiceConfig{
s, err := New(context.Background(),
&ServiceConfig{
Database: slasherDB,
StateNotifier: &mock.MockStateNotifier{},
HeadStateFetcher: mockChain,
AttestationStateFetcher: mockChain,
SlashingPoolInserter: &slashingsmock.PoolMock{},
},
params: slasherParams,
attsQueue: newAttestationsQueue(),
genesisTime: genesisTime,
latestEpochWrittenForValidator: map[types.ValidatorIndex]types.Epoch{},
}
})
require.NoError(t, err)
s.genesisTime = genesisTime
currentSlotChan := make(chan types.Slot)
exitChan := make(chan struct{})
go func() {
@@ -477,14 +471,13 @@ func Test_applyAttestationForValidator_MinSpanChunk(t *testing.T) {
ctx := context.Background()
slasherDB := dbtest.SetupSlasherDB(t)
defaultParams := DefaultParams()
srv := &Service{
params: defaultParams,
serviceCfg: &ServiceConfig{
srv, err := New(context.Background(),
&ServiceConfig{
Database: slasherDB,
StateNotifier: &mock.MockStateNotifier{},
},
latestEpochWrittenForValidator: map[types.ValidatorIndex]types.Epoch{},
}
})
require.NoError(t, err)
// We initialize an empty chunks slice.
chunk := EmptyMinSpanChunksSlice(defaultParams)
chunkIdx := uint64(0)
@@ -538,14 +531,13 @@ func Test_applyAttestationForValidator_MaxSpanChunk(t *testing.T) {
ctx := context.Background()
slasherDB := dbtest.SetupSlasherDB(t)
defaultParams := DefaultParams()
srv := &Service{
params: defaultParams,
serviceCfg: &ServiceConfig{
srv, err := New(context.Background(),
&ServiceConfig{
Database: slasherDB,
StateNotifier: &mock.MockStateNotifier{},
},
latestEpochWrittenForValidator: map[types.ValidatorIndex]types.Epoch{},
}
})
require.NoError(t, err)
// We initialize an empty chunks slice.
chunk := EmptyMaxSpanChunksSlice(defaultParams)
chunkIdx := uint64(0)
@@ -606,13 +598,13 @@ func Test_checkDoubleVotes_SlashableInputAttestations(t *testing.T) {
createAttestationWrapper(t, 0, 2, []uint64{1, 2}, []byte{1}),
createAttestationWrapper(t, 0, 2, []uint64{1, 2}, []byte{2}), // Different signing root.
}
srv := &Service{
serviceCfg: &ServiceConfig{
srv, err := New(context.Background(),
&ServiceConfig{
Database: slasherDB,
StateNotifier: &mock.MockStateNotifier{},
},
params: DefaultParams(),
}
})
require.NoError(t, err)
prev1 := createAttestationWrapper(t, 0, 2, []uint64{1, 2}, []byte{1})
cur1 := createAttestationWrapper(t, 0, 2, []uint64{1, 2}, []byte{2})
prev2 := createAttestationWrapper(t, 0, 2, []uint64{1, 2}, []byte{1})
@@ -642,14 +634,14 @@ func Test_checkDoubleVotes_SlashableAttestationsOnDisk(t *testing.T) {
createAttestationWrapper(t, 0, 1, []uint64{1, 2}, []byte{1}),
createAttestationWrapper(t, 0, 2, []uint64{1, 2}, []byte{1}),
}
srv := &Service{
serviceCfg: &ServiceConfig{
srv, err := New(context.Background(),
&ServiceConfig{
Database: slasherDB,
StateNotifier: &mock.MockStateNotifier{},
},
params: DefaultParams(),
}
err := slasherDB.SaveAttestationRecordsForValidators(ctx, prevAtts)
})
require.NoError(t, err)
err = slasherDB.SaveAttestationRecordsForValidators(ctx, prevAtts)
require.NoError(t, err)
prev1 := createAttestationWrapper(t, 0, 2, []uint64{1, 2}, []byte{1})
@@ -687,14 +679,15 @@ func testLoadChunks(t *testing.T, kind slashertypes.ChunkKind) {
ctx := context.Background()
// Check if the chunk at chunk index already exists in-memory.
defaultParams := DefaultParams()
s := &Service{
params: DefaultParams(),
serviceCfg: &ServiceConfig{
s, err := New(context.Background(),
&ServiceConfig{
Database: slasherDB,
StateNotifier: &mock.MockStateNotifier{},
},
}
})
require.NoError(t, err)
defaultParams := s.params
// If a chunk at a chunk index does not exist, ensure it
// is initialized as an empty chunk.
var emptyChunk Chunker
@@ -771,15 +764,13 @@ func TestService_processQueuedAttestations(t *testing.T) {
Slot: &slot,
}
s := &Service{
params: DefaultParams(),
serviceCfg: &ServiceConfig{
s, err := New(context.Background(),
&ServiceConfig{
Database: slasherDB,
StateNotifier: &mock.MockStateNotifier{},
HeadStateFetcher: mockChain,
},
attsQueue: newAttestationsQueue(),
}
})
require.NoError(t, err)
s.attsQueue.extend([]*slashertypes.IndexedAttestationWrapper{
createAttestationWrapper(t, 0, 1, []uint64{0, 1} /* indices */, nil /* signingRoot */),
@@ -810,15 +801,12 @@ func BenchmarkCheckSlashableAttestations(b *testing.B) {
Slot: &slot,
}
s := &Service{
params: DefaultParams(),
serviceCfg: &ServiceConfig{
Database: slasherDB,
StateNotifier: &mock.MockStateNotifier{},
HeadStateFetcher: mockChain,
},
attsQueue: newAttestationsQueue(),
}
s, err := New(context.Background(), &ServiceConfig{
Database: slasherDB,
StateNotifier: &mock.MockStateNotifier{},
HeadStateFetcher: mockChain,
})
require.NoError(b, err)
b.Run("1 attestation 1 validator", func(b *testing.B) {
b.ResetTimer()

View File

@@ -79,7 +79,7 @@ var (
prometheus.HistogramOpts{
Name: "rpc_blocks_by_range_response_latency_milliseconds",
Help: "Captures total time to respond to rpc blocks by range requests in a milliseconds distribution",
Buckets: []float64{250, 500, 1000, 1500, 2000, 3000, 4000, 10000},
Buckets: []float64{5, 10, 50, 100, 150, 250, 500, 1000, 2000},
},
)
arrivalBlockPropagationHistogram = promauto.NewHistogram(

View File

@@ -39,6 +39,10 @@ func (s *Service) beaconBlockSubscriber(ctx context.Context, msg proto.Message)
s.setBadBlock(ctx, root)
}
}
// Set the returned invalid ancestors as bad.
for _, root := range blockchain.InvalidAncestorRoots(err) {
s.setBadBlock(ctx, root)
}
return err
}
return err

View File

@@ -84,6 +84,7 @@ func (s *Service) validateBeaconBlockPubSub(ctx context.Context, pid peer.ID, ms
blockHeader, err := interfaces.SignedBeaconBlockHeaderFromBlockInterface(blk)
if err != nil {
log.WithError(err).WithField("blockSlot", blk.Block().Slot()).Warn("Could not extract block header")
return
}
s.cfg.slasherBlockHeadersFeed.Send(blockHeader)
}()

View File

@@ -348,7 +348,7 @@ var (
// EnableBuilderFlag enables the periodic validator registration API calls that will update the custom builder with validator settings.
EnableBuilderFlag = &cli.BoolFlag{
Name: "enable-builder",
Usage: "Enables MEV Builder validator registration APIs for the validator client to update settings such as fee recipient and gas limit. Note* this flag is not required if using proposer settings config file",
Usage: "Enables Builder validator registration APIs for the validator client to update settings such as fee recipient and gas limit. Note* this flag is not required if using proposer settings config file",
Value: false,
}
)

View File

@@ -116,6 +116,7 @@ func configureTestnet(ctx *cli.Context) error {
if err := params.SetActive(params.PraterConfig().Copy()); err != nil {
return err
}
applyPraterFeatureFlags(ctx)
params.UsePraterNetworkConfig()
} else if ctx.Bool(RopstenTestnet.Name) {
log.Warn("Running on the Ropsten Beacon Chain Testnet")
@@ -144,11 +145,30 @@ func configureTestnet(ctx *cli.Context) error {
return nil
}
// Insert feature flags within the function to be enabled for Prater testnet.
func applyPraterFeatureFlags(ctx *cli.Context) {
if err := ctx.Set(enableVecHTR.Names()[0], "true"); err != nil {
log.WithError(err).Debug("error enabling disable p flag")
}
if err := ctx.Set(enablePullTips.Names()[0], "true"); err != nil {
log.WithError(err).Debug("error enabling disable of boundary checks flag")
}
if err := ctx.Set(enableForkChoiceDoublyLinkedTree.Names()[0], "true"); err != nil {
log.WithError(err).Debug("error enabling doubly linked tree forkchoice flag")
}
if err := ctx.Set(EnableOnlyBlindedBeaconBlocks.Names()[0], "true"); err != nil {
log.WithError(err).Debug("error enabling only saving blinded beacon blocks flag")
}
}
// Insert feature flags within the function to be enabled for Ropsten testnet.
func applyRopstenFeatureFlags(ctx *cli.Context) {
if err := ctx.Set(enableVecHTR.Names()[0], "true"); err != nil {
log.WithError(err).Debug("error enabling vectorized HTR flag")
}
if err := ctx.Set(enablePullTips.Names()[0], "true"); err != nil {
log.WithError(err).Debug("error enabling disable of boundary checks flag")
}
if err := ctx.Set(enableForkChoiceDoublyLinkedTree.Names()[0], "true"); err != nil {
log.WithError(err).Debug("error enabling doubly linked tree forkchoice flag")
}
@@ -159,6 +179,9 @@ func applySepoliaFeatureFlags(ctx *cli.Context) {
if err := ctx.Set(enableVecHTR.Names()[0], "true"); err != nil {
log.WithError(err).Debug("error enabling vectorized HTR flag")
}
if err := ctx.Set(enablePullTips.Names()[0], "true"); err != nil {
log.WithError(err).Debug("error enabling disable of boundary checks flag")
}
if err := ctx.Set(enableForkChoiceDoublyLinkedTree.Names()[0], "true"); err != nil {
log.WithError(err).Debug("error enabling doubly linked tree forkchoice flag")
}

View File

@@ -9,8 +9,9 @@ import (
var (
// PraterTestnet flag for the multiclient Ethereum consensus testnet.
PraterTestnet = &cli.BoolFlag{
Name: "prater",
Usage: "Run Prysm configured for the Prater test network",
Name: "prater",
Usage: "Run Prysm configured for the Prater / Goerli test network",
Aliases: []string{"goerli"},
}
// RopstenTestnet flag for the multiclient Ethereum consensus testnet.
RopstenTestnet = &cli.BoolFlag{

View File

@@ -44,8 +44,9 @@ type BeaconChainConfig struct {
EffectiveBalanceIncrement uint64 `yaml:"EFFECTIVE_BALANCE_INCREMENT" spec:"true"` // EffectiveBalanceIncrement is used for converting the high balance into the low balance for validators.
// Initial value constants.
BLSWithdrawalPrefixByte byte `yaml:"BLS_WITHDRAWAL_PREFIX" spec:"true"` // BLSWithdrawalPrefixByte is used for BLS withdrawal and it's the first byte.
ZeroHash [32]byte // ZeroHash is used to represent a zeroed out 32 byte array.
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.
ZeroHash [32]byte // ZeroHash is used to represent a zeroed out 32 byte array.
// Time parameters constants.
GenesisDelay uint64 `yaml:"GENESIS_DELAY" spec:"true"` // GenesisDelay is the minimum number of seconds to delay starting the Ethereum Beacon Chain genesis. Must be at least 1 second.
@@ -112,6 +113,7 @@ type BeaconChainConfig struct {
DomainContributionAndProof [4]byte `yaml:"DOMAIN_CONTRIBUTION_AND_PROOF" spec:"true"` // DomainAggregateAndProof defines the BLS signature domain for contribution and proof.
DomainApplicationMask [4]byte `yaml:"DOMAIN_APPLICATION_MASK" spec:"true"` // DomainApplicationMask defines the BLS signature domain for application mask.
DomainApplicationBuilder [4]byte // DomainApplicationBuilder defines the BLS signature domain for application builder.
DomainBLSToExecutionChange [4]byte // DomainBLSToExecutionChange defines the BLS signature domain to change withdrawal addresses to ETH1 prefix
// Prysm constants.
GweiPerEth uint64 // GweiPerEth is the amount of gwei corresponding to 1 eth.

View File

@@ -60,6 +60,7 @@ func TestLoadConfigFile(t *testing.T) {
// Initial values.
assert.DeepEqual(t, expected.GenesisForkVersion, actual.GenesisForkVersion, "%s: GenesisForkVersion", name)
assert.DeepEqual(t, expected.BLSWithdrawalPrefixByte, actual.BLSWithdrawalPrefixByte, "%s: BLSWithdrawalPrefixByte", name)
assert.DeepEqual(t, expected.ETH1AddressWithdrawalPrefixByte, actual.ETH1AddressWithdrawalPrefixByte, "%s: ETH1AddressWithdrawalPrefixByte", name)
// Time parameters.
assert.Equal(t, expected.GenesisDelay, actual.GenesisDelay, "%s: GenesisDelay", name)

View File

@@ -94,8 +94,9 @@ var mainnetBeaconConfig = &BeaconChainConfig{
EffectiveBalanceIncrement: 1 * 1e9,
// Initial value constants.
BLSWithdrawalPrefixByte: byte(0),
ZeroHash: [32]byte{},
BLSWithdrawalPrefixByte: byte(0),
ETH1AddressWithdrawalPrefixByte: byte(1),
ZeroHash: [32]byte{},
// Time parameter constants.
MinAttestationInclusionDelay: 1,
@@ -168,6 +169,7 @@ var mainnetBeaconConfig = &BeaconChainConfig{
DomainContributionAndProof: bytesutil.Uint32ToBytes4(0x09000000),
DomainApplicationMask: bytesutil.Uint32ToBytes4(0x00000001),
DomainApplicationBuilder: bytesutil.Uint32ToBytes4(0x00000001),
DomainBLSToExecutionChange: bytesutil.Uint32ToBytes4(0x0A000000),
// Prysm constants.
GweiPerEth: 1000000000,

View File

@@ -29,6 +29,7 @@ func MinimalSpecConfig() *BeaconChainConfig {
// Initial values
minimalConfig.BLSWithdrawalPrefixByte = byte(0)
minimalConfig.ETH1AddressWithdrawalPrefixByte = byte(1)
// Time parameters
minimalConfig.SecondsPerSlot = 6

View File

@@ -35,9 +35,11 @@ func PraterConfig() *BeaconChainConfig {
cfg.DepositNetworkID = eth1Params.GoerliChainConfig.ChainID.Uint64()
cfg.AltairForkEpoch = 36660
cfg.AltairForkVersion = []byte{0x1, 0x0, 0x10, 0x20}
cfg.ShardingForkVersion = []byte{0x3, 0x0, 0x10, 0x20}
cfg.CapellaForkVersion = []byte{0x3, 0x0, 0x10, 0x20}
cfg.ShardingForkVersion = []byte{0x4, 0x0, 0x10, 0x20}
cfg.BellatrixForkEpoch = 112260
cfg.BellatrixForkVersion = []byte{0x2, 0x0, 0x10, 0x20}
cfg.TerminalTotalDifficulty = "4294967296"
cfg.TerminalTotalDifficulty = "10790000"
cfg.DepositContractAddress = "0xff50ed3d0ec03aC01D4C79aAd74928BFF48a7b2b"
cfg.InitializeForkSchedule()
return cfg

View File

@@ -87,5 +87,4 @@ type ExecutionData interface {
BaseFeePerGas() []byte
BlockHash() []byte
Transactions() ([][]byte, error)
TransactionsRoot() ([]byte, error)
}

View File

@@ -398,8 +398,6 @@ func TestBellatrixBeaconBlock_ExecutionPayloadHeader(t *testing.T) {
}
wsb, err := wrapper.WrappedSignedBeaconBlock(sb)
require.NoError(t, err)
exec, err := wsb.Block().Body().Execution()
_, err = wsb.Block().Body().Execution()
require.NoError(t, err)
_, err = exec.TransactionsRoot()
require.ErrorContains(t, "unsupported field for block type", err)
}

View File

@@ -139,11 +139,6 @@ func (e executionPayload) Transactions() ([][]byte, error) {
return e.p.Transactions, nil
}
// TransactionsRoot --
func (executionPayload) TransactionsRoot() ([]byte, error) {
return nil, ErrUnsupportedField
}
// executionPayloadHeader is a convenience wrapper around a blinded beacon block body's execution header data structure
// This wrapper allows us to conform to a common interface so that beacon
// blocks for future forks can also be applied across Prysm without issues.
@@ -270,11 +265,6 @@ func (executionPayloadHeader) Transactions() ([][]byte, error) {
return nil, ErrUnsupportedField
}
// TransactionsRoot --
func (e executionPayloadHeader) TransactionsRoot() ([]byte, error) {
return e.p.TransactionsRoot, nil
}
// PayloadToHeader converts `payload` into execution payload header format.
func PayloadToHeader(payload interfaces.ExecutionData) (*enginev1.ExecutionPayloadHeader, error) {
txs, err := payload.Transactions()
@@ -342,16 +332,6 @@ func IsEmptyExecutionData(data interfaces.ExecutionData) (bool, error) {
}
}
txsRoot, err := data.TransactionsRoot()
switch {
case errors.Is(err, ErrUnsupportedField):
case err != nil:
return false, err
default:
if !bytes.Equal(txsRoot, make([]byte, fieldparams.RootLength)) {
return false, nil
}
}
if len(data.ExtraData()) != 0 {
return false, nil
}

View File

@@ -25,7 +25,14 @@ func ConvertFromInterfacePrivKey(privkey crypto.PrivKey) (*ecdsa.PrivateKey, err
}
func ConvertToInterfacePrivkey(privkey *ecdsa.PrivateKey) (crypto.PrivKey, error) {
return crypto.UnmarshalSecp256k1PrivateKey(privkey.D.Bytes())
privBytes := privkey.D.Bytes()
// In the event the number of bytes outputted by the big-int are less than 32,
// we append bytes to the start of the sequence for the missing most significant
// bytes.
if len(privBytes) < 32 {
privBytes = append(make([]byte, 32-len(privBytes)), privBytes...)
}
return crypto.UnmarshalSecp256k1PrivateKey(privBytes)
}
func ConvertToInterfacePubkey(pubkey *ecdsa.PublicKey) (crypto.PubKey, error) {

View File

@@ -2,6 +2,8 @@ package ecdsa
import (
"crypto/ecdsa"
"crypto/rand"
"math/big"
"testing"
"github.com/btcsuite/btcd/btcec/v2"
@@ -26,3 +28,20 @@ func TestConvertToInterfacePubkey(t *testing.T) {
origRawKey := gcrypto.FromECDSAPub(pubkey)
assert.DeepEqual(t, origRawKey, rawKey)
}
func TestConvertToInterfacePrivkey_HandlesShorterKeys(t *testing.T) {
priv, _, err := crypto.GenerateSecp256k1Key(rand.Reader)
assert.NoError(t, err)
rawBytes, err := priv.Raw()
assert.NoError(t, err)
// Zero-out most significant byte so that the big int normalizes
// it by removing it.
rawBytes[0] = 0
privKey := new(ecdsa.PrivateKey)
k := new(big.Int).SetBytes(rawBytes)
privKey.D = k
privKey.Curve = gcrypto.S256()
privKey.X, privKey.Y = gcrypto.S256().ScalarBaseMult(rawBytes)
_, err = ConvertToInterfacePrivkey(privKey)
assert.NoError(t, err)
}

View File

@@ -1,5 +1,5 @@
// Code generated by fastssz. DO NOT EDIT.
// Hash: 1ff7027b5ff36aabafba387be30535ceee20e61226f5d23ec138769493c9e0be
// Hash: 193ee08fc7deef9db16221d5f9c3bbcc73091e7bfcac407a822546a5207c383e
package enginev1
import (

View File

@@ -48,6 +48,9 @@ func (e *ExecutionBlock) MarshalJSON() ([]byte, error) {
}
func (e *ExecutionBlock) UnmarshalJSON(enc []byte) error {
type transactionJson struct {
Transactions []*gethtypes.Transaction `json:"transactions"`
}
if err := e.Header.UnmarshalJSON(enc); err != nil {
return err
}
@@ -78,26 +81,21 @@ func (e *ExecutionBlock) UnmarshalJSON(enc []byte) error {
return errors.Errorf("expected transaction list to be of a slice interface type.")
}
// If the block contains a list of transactions, we JSON unmarshal
// them into a list of geth transaction objects.
txs := make([]*gethtypes.Transaction, len(txsList))
for i, tx := range txsList {
//
for _, tx := range txsList {
// If the transaction is just a hex string, do not attempt to
// unmarshal into a full transaction object.
if txItem, ok := tx.(string); ok && strings.HasPrefix(txItem, "0x") {
return nil
}
t := &gethtypes.Transaction{}
encodedTx, err := json.Marshal(tx)
if err != nil {
return err
}
if err := json.Unmarshal(encodedTx, &t); err != nil {
return err
}
txs[i] = t
}
e.Transactions = txs
// If the block contains a list of transactions, we JSON unmarshal
// them into a list of geth transaction objects.
txJson := &transactionJson{}
if err := json.Unmarshal(enc, txJson); err != nil {
return err
}
e.Transactions = txJson.Transactions
return nil
}

View File

@@ -1,5 +1,5 @@
// Code generated by fastssz. DO NOT EDIT.
// Hash: 25cabd4ee6b2013aa3ecc4e5560b0db4c755c5c84d208d13861d23731b1ca838
// Hash: 13e1dcc0e4f90172e1c70a3acac7b73b1a2dc02350d950f3222f4626fe8aa20a
package v1
import (

View File

@@ -1,5 +1,5 @@
// Code generated by fastssz. DO NOT EDIT.
// Hash: 041d5d528e07bf99188c39100dc83a4e6ba1f1d4cd190c46fcf27af4ca367fda
// Hash: 16637c49444f2c3a90bcc4587dfbc26b39f45c26129de7d43fea32a2bcf8441e
package eth
import (

View File

@@ -109,6 +109,9 @@ ssz_gen_marshal(
"BlindedBeaconBlockBodyBellatrix",
"SignedValidatorRegistrationV1",
"ValidatorRegistrationV1",
"Withdrawal",
"BLSToExecutionChange",
"SignedBLSToExecutionChange",
],
)
@@ -201,6 +204,7 @@ ssz_proto_files(
"beacon_block.proto",
"beacon_state.proto",
"sync_committee.proto",
"withdrawals.proto",
],
config = select({
"//conditions:default": "mainnet",

View File

@@ -1,5 +1,5 @@
// Code generated by fastssz. DO NOT EDIT.
// Hash: 6da179429d9bb3146b40fa8cc4b1d5d82ed937e745d956c5228c28083fc40ecc
// Hash: 9269b9f1e2bf4b03556c8515d891fcd7f0edd2139c26e87f921c388252769ecf
package eth
import (
@@ -9369,3 +9369,269 @@ func (v *Validator) HashTreeRootWith(hh *ssz.Hasher) (err error) {
}
return
}
// MarshalSSZ ssz marshals the Withdrawal object
func (w *Withdrawal) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(w)
}
// MarshalSSZTo ssz marshals the Withdrawal object to a target array
func (w *Withdrawal) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
// Field (0) 'WithdrawalIndex'
dst = ssz.MarshalUint64(dst, w.WithdrawalIndex)
// Field (1) 'ExecutionAddress'
if size := len(w.ExecutionAddress); size != 20 {
err = ssz.ErrBytesLengthFn("--.ExecutionAddress", size, 20)
return
}
dst = append(dst, w.ExecutionAddress...)
// Field (2) 'Amount'
dst = ssz.MarshalUint64(dst, w.Amount)
return
}
// UnmarshalSSZ ssz unmarshals the Withdrawal object
func (w *Withdrawal) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size != 36 {
return ssz.ErrSize
}
// Field (0) 'WithdrawalIndex'
w.WithdrawalIndex = ssz.UnmarshallUint64(buf[0:8])
// Field (1) 'ExecutionAddress'
if cap(w.ExecutionAddress) == 0 {
w.ExecutionAddress = make([]byte, 0, len(buf[8:28]))
}
w.ExecutionAddress = append(w.ExecutionAddress, buf[8:28]...)
// Field (2) 'Amount'
w.Amount = ssz.UnmarshallUint64(buf[28:36])
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the Withdrawal object
func (w *Withdrawal) SizeSSZ() (size int) {
size = 36
return
}
// HashTreeRoot ssz hashes the Withdrawal object
func (w *Withdrawal) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(w)
}
// HashTreeRootWith ssz hashes the Withdrawal object with a hasher
func (w *Withdrawal) HashTreeRootWith(hh *ssz.Hasher) (err error) {
indx := hh.Index()
// Field (0) 'WithdrawalIndex'
hh.PutUint64(w.WithdrawalIndex)
// Field (1) 'ExecutionAddress'
if size := len(w.ExecutionAddress); size != 20 {
err = ssz.ErrBytesLengthFn("--.ExecutionAddress", size, 20)
return
}
hh.PutBytes(w.ExecutionAddress)
// Field (2) 'Amount'
hh.PutUint64(w.Amount)
if ssz.EnableVectorizedHTR {
hh.MerkleizeVectorizedHTR(indx)
} else {
hh.Merkleize(indx)
}
return
}
// MarshalSSZ ssz marshals the BLSToExecutionChange object
func (b *BLSToExecutionChange) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(b)
}
// MarshalSSZTo ssz marshals the BLSToExecutionChange object to a target array
func (b *BLSToExecutionChange) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
// Field (0) 'ValidatorIndex'
dst = ssz.MarshalUint64(dst, uint64(b.ValidatorIndex))
// Field (1) 'FromBlsPubkey'
if size := len(b.FromBlsPubkey); size != 48 {
err = ssz.ErrBytesLengthFn("--.FromBlsPubkey", size, 48)
return
}
dst = append(dst, b.FromBlsPubkey...)
// Field (2) 'ToExecutionAddress'
if size := len(b.ToExecutionAddress); size != 20 {
err = ssz.ErrBytesLengthFn("--.ToExecutionAddress", size, 20)
return
}
dst = append(dst, b.ToExecutionAddress...)
return
}
// UnmarshalSSZ ssz unmarshals the BLSToExecutionChange object
func (b *BLSToExecutionChange) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size != 76 {
return ssz.ErrSize
}
// Field (0) 'ValidatorIndex'
b.ValidatorIndex = github_com_prysmaticlabs_prysm_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8]))
// Field (1) 'FromBlsPubkey'
if cap(b.FromBlsPubkey) == 0 {
b.FromBlsPubkey = make([]byte, 0, len(buf[8:56]))
}
b.FromBlsPubkey = append(b.FromBlsPubkey, buf[8:56]...)
// Field (2) 'ToExecutionAddress'
if cap(b.ToExecutionAddress) == 0 {
b.ToExecutionAddress = make([]byte, 0, len(buf[56:76]))
}
b.ToExecutionAddress = append(b.ToExecutionAddress, buf[56:76]...)
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the BLSToExecutionChange object
func (b *BLSToExecutionChange) SizeSSZ() (size int) {
size = 76
return
}
// HashTreeRoot ssz hashes the BLSToExecutionChange object
func (b *BLSToExecutionChange) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(b)
}
// HashTreeRootWith ssz hashes the BLSToExecutionChange object with a hasher
func (b *BLSToExecutionChange) HashTreeRootWith(hh *ssz.Hasher) (err error) {
indx := hh.Index()
// Field (0) 'ValidatorIndex'
hh.PutUint64(uint64(b.ValidatorIndex))
// Field (1) 'FromBlsPubkey'
if size := len(b.FromBlsPubkey); size != 48 {
err = ssz.ErrBytesLengthFn("--.FromBlsPubkey", size, 48)
return
}
hh.PutBytes(b.FromBlsPubkey)
// Field (2) 'ToExecutionAddress'
if size := len(b.ToExecutionAddress); size != 20 {
err = ssz.ErrBytesLengthFn("--.ToExecutionAddress", size, 20)
return
}
hh.PutBytes(b.ToExecutionAddress)
if ssz.EnableVectorizedHTR {
hh.MerkleizeVectorizedHTR(indx)
} else {
hh.Merkleize(indx)
}
return
}
// MarshalSSZ ssz marshals the SignedBLSToExecutionChange object
func (s *SignedBLSToExecutionChange) MarshalSSZ() ([]byte, error) {
return ssz.MarshalSSZ(s)
}
// MarshalSSZTo ssz marshals the SignedBLSToExecutionChange object to a target array
func (s *SignedBLSToExecutionChange) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf
// Field (0) 'Message'
if s.Message == nil {
s.Message = new(BLSToExecutionChange)
}
if dst, err = s.Message.MarshalSSZTo(dst); err != nil {
return
}
// Field (1) 'Signature'
if size := len(s.Signature); size != 96 {
err = ssz.ErrBytesLengthFn("--.Signature", size, 96)
return
}
dst = append(dst, s.Signature...)
return
}
// UnmarshalSSZ ssz unmarshals the SignedBLSToExecutionChange object
func (s *SignedBLSToExecutionChange) UnmarshalSSZ(buf []byte) error {
var err error
size := uint64(len(buf))
if size != 172 {
return ssz.ErrSize
}
// Field (0) 'Message'
if s.Message == nil {
s.Message = new(BLSToExecutionChange)
}
if err = s.Message.UnmarshalSSZ(buf[0:76]); err != nil {
return err
}
// Field (1) 'Signature'
if cap(s.Signature) == 0 {
s.Signature = make([]byte, 0, len(buf[76:172]))
}
s.Signature = append(s.Signature, buf[76:172]...)
return err
}
// SizeSSZ returns the ssz encoded size in bytes for the SignedBLSToExecutionChange object
func (s *SignedBLSToExecutionChange) SizeSSZ() (size int) {
size = 172
return
}
// HashTreeRoot ssz hashes the SignedBLSToExecutionChange object
func (s *SignedBLSToExecutionChange) HashTreeRoot() ([32]byte, error) {
return ssz.HashWithDefaultHasher(s)
}
// HashTreeRootWith ssz hashes the SignedBLSToExecutionChange object with a hasher
func (s *SignedBLSToExecutionChange) HashTreeRootWith(hh *ssz.Hasher) (err error) {
indx := hh.Index()
// Field (0) 'Message'
if err = s.Message.HashTreeRootWith(hh); err != nil {
return
}
// Field (1) 'Signature'
if size := len(s.Signature); size != 96 {
err = ssz.ErrBytesLengthFn("--.Signature", size, 96)
return
}
hh.PutBytes(s.Signature)
if ssz.EnableVectorizedHTR {
hh.MerkleizeVectorizedHTR(indx)
} else {
hh.Merkleize(indx)
}
return
}

View File

@@ -3099,7 +3099,7 @@ var file_proto_prysm_v1alpha1_validator_proto_rawDesc = []byte{
0x4c, 0x41, 0x53, 0x48, 0x49, 0x4e, 0x47, 0x10, 0x05, 0x12, 0x0a, 0x0a, 0x06, 0x45, 0x58, 0x49,
0x54, 0x45, 0x44, 0x10, 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44,
0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x50, 0x41, 0x52, 0x54, 0x49, 0x41, 0x4c, 0x4c, 0x59, 0x5f,
0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x45, 0x44, 0x10, 0x08, 0x32, 0xbf, 0x21, 0x0a, 0x13,
0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x45, 0x44, 0x10, 0x08, 0x32, 0xb2, 0x22, 0x0a, 0x13,
0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x4e, 0x6f, 0x64, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61,
0x74, 0x6f, 0x72, 0x12, 0x80, 0x01, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x44, 0x75, 0x74, 0x69, 0x65,
0x73, 0x12, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68,
@@ -3357,27 +3357,34 @@ var file_proto_prysm_v1alpha1_validator_proto_rawDesc = []byte{
0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3,
0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70,
0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x62, 0x6c,
0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x30, 0x01, 0x12, 0x9d, 0x01,
0x0a, 0x1b, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f,
0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x2e,
0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61,
0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69,
0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x56, 0x31, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2f, 0x82, 0xd3,
0xe4, 0x93, 0x02, 0x29, 0x22, 0x24, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70,
0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x72, 0x65,
0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x01, 0x2a, 0x42, 0x90, 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, 0x0e, 0x56, 0x61, 0x6c,
0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 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, 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, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75,
0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 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,
0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x30, 0x01, 0x12, 0x70, 0x0a,
0x1b, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72,
0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x34, 0x2e, 0x65,
0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c,
0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64,
0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x56, 0x31, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x03, 0x88, 0x02, 0x01, 0x12,
0x9e, 0x01, 0x0a, 0x1c, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61,
0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x12, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e,
0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56,
0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x56, 0x31, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22,
0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x22, 0x24, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31,
0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72,
0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x01, 0x2a,
0x42, 0x90, 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, 0x0e,
0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
0x5a, 0x37, 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, 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, 0x0f, 0x45, 0x74, 0x68, 0x65,
0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 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 (
@@ -3448,11 +3455,12 @@ var file_proto_prysm_v1alpha1_validator_proto_goTypes = []interface{}{
(*SignedVoluntaryExit)(nil), // 50: ethereum.eth.v1alpha1.SignedVoluntaryExit
(*SyncCommitteeMessage)(nil), // 51: ethereum.eth.v1alpha1.SyncCommitteeMessage
(*SignedContributionAndProof)(nil), // 52: ethereum.eth.v1alpha1.SignedContributionAndProof
(*SignedValidatorRegistrationsV1)(nil), // 53: ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1
(*BeaconBlock)(nil), // 54: ethereum.eth.v1alpha1.BeaconBlock
(*GenericBeaconBlock)(nil), // 55: ethereum.eth.v1alpha1.GenericBeaconBlock
(*AttestationData)(nil), // 56: ethereum.eth.v1alpha1.AttestationData
(*SyncCommitteeContribution)(nil), // 57: ethereum.eth.v1alpha1.SyncCommitteeContribution
(*SignedValidatorRegistrationV1)(nil), // 53: ethereum.eth.v1alpha1.SignedValidatorRegistrationV1
(*SignedValidatorRegistrationsV1)(nil), // 54: ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1
(*BeaconBlock)(nil), // 55: ethereum.eth.v1alpha1.BeaconBlock
(*GenericBeaconBlock)(nil), // 56: ethereum.eth.v1alpha1.GenericBeaconBlock
(*AttestationData)(nil), // 57: ethereum.eth.v1alpha1.AttestationData
(*SyncCommitteeContribution)(nil), // 58: ethereum.eth.v1alpha1.SyncCommitteeContribution
}
var file_proto_prysm_v1alpha1_validator_proto_depIdxs = []int32{
42, // 0: ethereum.eth.v1alpha1.StreamBlocksResponse.phase0_block:type_name -> ethereum.eth.v1alpha1.SignedBeaconBlock
@@ -3498,36 +3506,38 @@ var file_proto_prysm_v1alpha1_validator_proto_depIdxs = []int32{
3, // 40: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncCommitteeContribution:input_type -> ethereum.eth.v1alpha1.SyncCommitteeContributionRequest
52, // 41: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedContributionAndProof:input_type -> ethereum.eth.v1alpha1.SignedContributionAndProof
35, // 42: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamBlocksAltair:input_type -> ethereum.eth.v1alpha1.StreamBlocksRequest
53, // 43: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitValidatorRegistration:input_type -> ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1
19, // 44: ethereum.eth.v1alpha1.BeaconNodeValidator.GetDuties:output_type -> ethereum.eth.v1alpha1.DutiesResponse
19, // 45: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamDuties:output_type -> ethereum.eth.v1alpha1.DutiesResponse
7, // 46: ethereum.eth.v1alpha1.BeaconNodeValidator.DomainData:output_type -> ethereum.eth.v1alpha1.DomainResponse
10, // 47: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForChainStart:output_type -> ethereum.eth.v1alpha1.ChainStartResponse
9, // 48: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForActivation:output_type -> ethereum.eth.v1alpha1.ValidatorActivationResponse
13, // 49: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorIndex:output_type -> ethereum.eth.v1alpha1.ValidatorIndexResponse
15, // 50: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorStatus:output_type -> ethereum.eth.v1alpha1.ValidatorStatusResponse
17, // 51: ethereum.eth.v1alpha1.BeaconNodeValidator.MultipleValidatorStatus:output_type -> ethereum.eth.v1alpha1.MultipleValidatorStatusResponse
54, // 52: ethereum.eth.v1alpha1.BeaconNodeValidator.GetBlock:output_type -> ethereum.eth.v1alpha1.BeaconBlock
21, // 53: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeBlock:output_type -> ethereum.eth.v1alpha1.ProposeResponse
55, // 54: ethereum.eth.v1alpha1.BeaconNodeValidator.GetBeaconBlock:output_type -> ethereum.eth.v1alpha1.GenericBeaconBlock
21, // 55: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeBeaconBlock:output_type -> ethereum.eth.v1alpha1.ProposeResponse
47, // 56: ethereum.eth.v1alpha1.BeaconNodeValidator.PrepareBeaconProposer:output_type -> google.protobuf.Empty
56, // 57: ethereum.eth.v1alpha1.BeaconNodeValidator.GetAttestationData:output_type -> ethereum.eth.v1alpha1.AttestationData
24, // 58: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeAttestation:output_type -> ethereum.eth.v1alpha1.AttestResponse
26, // 59: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProof:output_type -> ethereum.eth.v1alpha1.AggregateSelectionResponse
28, // 60: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProof:output_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitResponse
22, // 61: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeExit:output_type -> ethereum.eth.v1alpha1.ProposeExitResponse
47, // 62: ethereum.eth.v1alpha1.BeaconNodeValidator.SubscribeCommitteeSubnets:output_type -> google.protobuf.Empty
34, // 63: ethereum.eth.v1alpha1.BeaconNodeValidator.CheckDoppelGanger:output_type -> ethereum.eth.v1alpha1.DoppelGangerResponse
1, // 64: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncMessageBlockRoot:output_type -> ethereum.eth.v1alpha1.SyncMessageBlockRootResponse
47, // 65: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSyncMessage:output_type -> google.protobuf.Empty
4, // 66: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncSubcommitteeIndex:output_type -> ethereum.eth.v1alpha1.SyncSubcommitteeIndexResponse
57, // 67: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncCommitteeContribution:output_type -> ethereum.eth.v1alpha1.SyncCommitteeContribution
47, // 68: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedContributionAndProof:output_type -> google.protobuf.Empty
5, // 69: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamBlocksAltair:output_type -> ethereum.eth.v1alpha1.StreamBlocksResponse
47, // 70: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitValidatorRegistration:output_type -> google.protobuf.Empty
44, // [44:71] is the sub-list for method output_type
17, // [17:44] is the sub-list for method input_type
53, // 43: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitValidatorRegistration:input_type -> ethereum.eth.v1alpha1.SignedValidatorRegistrationV1
54, // 44: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitValidatorRegistrations:input_type -> ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1
19, // 45: ethereum.eth.v1alpha1.BeaconNodeValidator.GetDuties:output_type -> ethereum.eth.v1alpha1.DutiesResponse
19, // 46: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamDuties:output_type -> ethereum.eth.v1alpha1.DutiesResponse
7, // 47: ethereum.eth.v1alpha1.BeaconNodeValidator.DomainData:output_type -> ethereum.eth.v1alpha1.DomainResponse
10, // 48: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForChainStart:output_type -> ethereum.eth.v1alpha1.ChainStartResponse
9, // 49: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForActivation:output_type -> ethereum.eth.v1alpha1.ValidatorActivationResponse
13, // 50: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorIndex:output_type -> ethereum.eth.v1alpha1.ValidatorIndexResponse
15, // 51: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorStatus:output_type -> ethereum.eth.v1alpha1.ValidatorStatusResponse
17, // 52: ethereum.eth.v1alpha1.BeaconNodeValidator.MultipleValidatorStatus:output_type -> ethereum.eth.v1alpha1.MultipleValidatorStatusResponse
55, // 53: ethereum.eth.v1alpha1.BeaconNodeValidator.GetBlock:output_type -> ethereum.eth.v1alpha1.BeaconBlock
21, // 54: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeBlock:output_type -> ethereum.eth.v1alpha1.ProposeResponse
56, // 55: ethereum.eth.v1alpha1.BeaconNodeValidator.GetBeaconBlock:output_type -> ethereum.eth.v1alpha1.GenericBeaconBlock
21, // 56: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeBeaconBlock:output_type -> ethereum.eth.v1alpha1.ProposeResponse
47, // 57: ethereum.eth.v1alpha1.BeaconNodeValidator.PrepareBeaconProposer:output_type -> google.protobuf.Empty
57, // 58: ethereum.eth.v1alpha1.BeaconNodeValidator.GetAttestationData:output_type -> ethereum.eth.v1alpha1.AttestationData
24, // 59: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeAttestation:output_type -> ethereum.eth.v1alpha1.AttestResponse
26, // 60: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProof:output_type -> ethereum.eth.v1alpha1.AggregateSelectionResponse
28, // 61: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProof:output_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitResponse
22, // 62: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeExit:output_type -> ethereum.eth.v1alpha1.ProposeExitResponse
47, // 63: ethereum.eth.v1alpha1.BeaconNodeValidator.SubscribeCommitteeSubnets:output_type -> google.protobuf.Empty
34, // 64: ethereum.eth.v1alpha1.BeaconNodeValidator.CheckDoppelGanger:output_type -> ethereum.eth.v1alpha1.DoppelGangerResponse
1, // 65: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncMessageBlockRoot:output_type -> ethereum.eth.v1alpha1.SyncMessageBlockRootResponse
47, // 66: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSyncMessage:output_type -> google.protobuf.Empty
4, // 67: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncSubcommitteeIndex:output_type -> ethereum.eth.v1alpha1.SyncSubcommitteeIndexResponse
58, // 68: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncCommitteeContribution:output_type -> ethereum.eth.v1alpha1.SyncCommitteeContribution
47, // 69: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedContributionAndProof:output_type -> google.protobuf.Empty
5, // 70: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamBlocksAltair:output_type -> ethereum.eth.v1alpha1.StreamBlocksResponse
47, // 71: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitValidatorRegistration:output_type -> google.protobuf.Empty
47, // 72: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitValidatorRegistrations:output_type -> google.protobuf.Empty
45, // [45:73] is the sub-list for method output_type
17, // [17:45] is the sub-list for method input_type
17, // [17:17] is the sub-list for extension type_name
17, // [17:17] is the sub-list for extension extendee
0, // [0:17] is the sub-list for field type_name
@@ -4102,7 +4112,9 @@ type BeaconNodeValidatorClient interface {
GetSyncCommitteeContribution(ctx context.Context, in *SyncCommitteeContributionRequest, opts ...grpc.CallOption) (*SyncCommitteeContribution, error)
SubmitSignedContributionAndProof(ctx context.Context, in *SignedContributionAndProof, opts ...grpc.CallOption) (*empty.Empty, error)
StreamBlocksAltair(ctx context.Context, in *StreamBlocksRequest, opts ...grpc.CallOption) (BeaconNodeValidator_StreamBlocksAltairClient, error)
SubmitValidatorRegistration(ctx context.Context, in *SignedValidatorRegistrationsV1, opts ...grpc.CallOption) (*empty.Empty, error)
// Deprecated: Do not use.
SubmitValidatorRegistration(ctx context.Context, in *SignedValidatorRegistrationV1, opts ...grpc.CallOption) (*empty.Empty, error)
SubmitValidatorRegistrations(ctx context.Context, in *SignedValidatorRegistrationsV1, opts ...grpc.CallOption) (*empty.Empty, error)
}
type beaconNodeValidatorClient struct {
@@ -4442,7 +4454,8 @@ func (x *beaconNodeValidatorStreamBlocksAltairClient) Recv() (*StreamBlocksRespo
return m, nil
}
func (c *beaconNodeValidatorClient) SubmitValidatorRegistration(ctx context.Context, in *SignedValidatorRegistrationsV1, opts ...grpc.CallOption) (*empty.Empty, error) {
// Deprecated: Do not use.
func (c *beaconNodeValidatorClient) SubmitValidatorRegistration(ctx context.Context, in *SignedValidatorRegistrationV1, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitValidatorRegistration", in, out, opts...)
if err != nil {
@@ -4451,6 +4464,15 @@ func (c *beaconNodeValidatorClient) SubmitValidatorRegistration(ctx context.Cont
return out, nil
}
func (c *beaconNodeValidatorClient) SubmitValidatorRegistrations(ctx context.Context, in *SignedValidatorRegistrationsV1, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitValidatorRegistrations", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// BeaconNodeValidatorServer is the server API for BeaconNodeValidator service.
type BeaconNodeValidatorServer interface {
GetDuties(context.Context, *DutiesRequest) (*DutiesResponse, error)
@@ -4482,7 +4504,9 @@ type BeaconNodeValidatorServer interface {
GetSyncCommitteeContribution(context.Context, *SyncCommitteeContributionRequest) (*SyncCommitteeContribution, error)
SubmitSignedContributionAndProof(context.Context, *SignedContributionAndProof) (*empty.Empty, error)
StreamBlocksAltair(*StreamBlocksRequest, BeaconNodeValidator_StreamBlocksAltairServer) error
SubmitValidatorRegistration(context.Context, *SignedValidatorRegistrationsV1) (*empty.Empty, error)
// Deprecated: Do not use.
SubmitValidatorRegistration(context.Context, *SignedValidatorRegistrationV1) (*empty.Empty, error)
SubmitValidatorRegistrations(context.Context, *SignedValidatorRegistrationsV1) (*empty.Empty, error)
}
// UnimplementedBeaconNodeValidatorServer can be embedded to have forward compatible implementations.
@@ -4567,9 +4591,12 @@ func (*UnimplementedBeaconNodeValidatorServer) SubmitSignedContributionAndProof(
func (*UnimplementedBeaconNodeValidatorServer) StreamBlocksAltair(*StreamBlocksRequest, BeaconNodeValidator_StreamBlocksAltairServer) error {
return status.Errorf(codes.Unimplemented, "method StreamBlocksAltair not implemented")
}
func (*UnimplementedBeaconNodeValidatorServer) SubmitValidatorRegistration(context.Context, *SignedValidatorRegistrationsV1) (*empty.Empty, error) {
func (*UnimplementedBeaconNodeValidatorServer) SubmitValidatorRegistration(context.Context, *SignedValidatorRegistrationV1) (*empty.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method SubmitValidatorRegistration not implemented")
}
func (*UnimplementedBeaconNodeValidatorServer) SubmitValidatorRegistrations(context.Context, *SignedValidatorRegistrationsV1) (*empty.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method SubmitValidatorRegistrations not implemented")
}
func RegisterBeaconNodeValidatorServer(s *grpc.Server, srv BeaconNodeValidatorServer) {
s.RegisterService(&_BeaconNodeValidator_serviceDesc, srv)
@@ -5056,7 +5083,7 @@ func (x *beaconNodeValidatorStreamBlocksAltairServer) Send(m *StreamBlocksRespon
}
func _BeaconNodeValidator_SubmitValidatorRegistration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SignedValidatorRegistrationsV1)
in := new(SignedValidatorRegistrationV1)
if err := dec(in); err != nil {
return nil, err
}
@@ -5068,7 +5095,25 @@ func _BeaconNodeValidator_SubmitValidatorRegistration_Handler(srv interface{}, c
FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitValidatorRegistration",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BeaconNodeValidatorServer).SubmitValidatorRegistration(ctx, req.(*SignedValidatorRegistrationsV1))
return srv.(BeaconNodeValidatorServer).SubmitValidatorRegistration(ctx, req.(*SignedValidatorRegistrationV1))
}
return interceptor(ctx, in, info, handler)
}
func _BeaconNodeValidator_SubmitValidatorRegistrations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SignedValidatorRegistrationsV1)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BeaconNodeValidatorServer).SubmitValidatorRegistrations(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitValidatorRegistrations",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BeaconNodeValidatorServer).SubmitValidatorRegistrations(ctx, req.(*SignedValidatorRegistrationsV1))
}
return interceptor(ctx, in, info, handler)
}
@@ -5169,6 +5214,10 @@ var _BeaconNodeValidator_serviceDesc = grpc.ServiceDesc{
MethodName: "SubmitValidatorRegistration",
Handler: _BeaconNodeValidator_SubmitValidatorRegistration_Handler,
},
{
MethodName: "SubmitValidatorRegistrations",
Handler: _BeaconNodeValidator_SubmitValidatorRegistrations_Handler,
},
},
Streams: []grpc.StreamDesc{
{

View File

@@ -890,7 +890,7 @@ func request_BeaconNodeValidator_StreamBlocksAltair_0(ctx context.Context, marsh
}
func request_BeaconNodeValidator_SubmitValidatorRegistration_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
func request_BeaconNodeValidator_SubmitValidatorRegistrations_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq SignedValidatorRegistrationsV1
var metadata runtime.ServerMetadata
@@ -902,12 +902,12 @@ func request_BeaconNodeValidator_SubmitValidatorRegistration_0(ctx context.Conte
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.SubmitValidatorRegistration(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
msg, err := client.SubmitValidatorRegistrations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_BeaconNodeValidator_SubmitValidatorRegistration_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
func local_request_BeaconNodeValidator_SubmitValidatorRegistrations_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq SignedValidatorRegistrationsV1
var metadata runtime.ServerMetadata
@@ -919,7 +919,7 @@ func local_request_BeaconNodeValidator_SubmitValidatorRegistration_0(ctx context
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.SubmitValidatorRegistration(ctx, &protoReq)
msg, err := server.SubmitValidatorRegistrations(ctx, &protoReq)
return msg, metadata, err
}
@@ -1464,18 +1464,18 @@ func RegisterBeaconNodeValidatorHandlerServer(ctx context.Context, mux *runtime.
return
})
mux.Handle("POST", pattern_BeaconNodeValidator_SubmitValidatorRegistration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("POST", pattern_BeaconNodeValidator_SubmitValidatorRegistrations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitValidatorRegistration")
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitValidatorRegistrations")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_BeaconNodeValidator_SubmitValidatorRegistration_0(rctx, inboundMarshaler, server, req, pathParams)
resp, md, err := local_request_BeaconNodeValidator_SubmitValidatorRegistrations_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
@@ -1483,7 +1483,7 @@ func RegisterBeaconNodeValidatorHandlerServer(ctx context.Context, mux *runtime.
return
}
forward_BeaconNodeValidator_SubmitValidatorRegistration_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_BeaconNodeValidator_SubmitValidatorRegistrations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
@@ -2048,23 +2048,23 @@ func RegisterBeaconNodeValidatorHandlerClient(ctx context.Context, mux *runtime.
})
mux.Handle("POST", pattern_BeaconNodeValidator_SubmitValidatorRegistration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("POST", pattern_BeaconNodeValidator_SubmitValidatorRegistrations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitValidatorRegistration")
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitValidatorRegistrations")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_BeaconNodeValidator_SubmitValidatorRegistration_0(rctx, inboundMarshaler, client, req, pathParams)
resp, md, err := request_BeaconNodeValidator_SubmitValidatorRegistrations_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconNodeValidator_SubmitValidatorRegistration_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_BeaconNodeValidator_SubmitValidatorRegistrations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
@@ -2124,7 +2124,7 @@ var (
pattern_BeaconNodeValidator_StreamBlocksAltair_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "validator", "blocks", "stream"}, ""))
pattern_BeaconNodeValidator_SubmitValidatorRegistration_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "registration"}, ""))
pattern_BeaconNodeValidator_SubmitValidatorRegistrations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "registration"}, ""))
)
var (
@@ -2180,5 +2180,5 @@ var (
forward_BeaconNodeValidator_StreamBlocksAltair_0 = runtime.ForwardResponseStream
forward_BeaconNodeValidator_SubmitValidatorRegistration_0 = runtime.ForwardResponseMessage
forward_BeaconNodeValidator_SubmitValidatorRegistrations_0 = runtime.ForwardResponseMessage
)

View File

@@ -321,7 +321,12 @@ service BeaconNodeValidator {
};
}
rpc SubmitValidatorRegistration(SignedValidatorRegistrationsV1) returns (google.protobuf.Empty) {
rpc SubmitValidatorRegistration(SignedValidatorRegistrationV1) returns (google.protobuf.Empty) {
option deprecated = true; // Use SubmitValidatorRegistrations
}
rpc SubmitValidatorRegistrations(SignedValidatorRegistrationsV1) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/eth/v1alpha1/validator/registration"
body: "*"

349
proto/prysm/v1alpha1/withdrawals.pb.go generated Executable file
View File

@@ -0,0 +1,349 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.15.8
// source: proto/prysm/v1alpha1/withdrawals.proto
package eth
import (
reflect "reflect"
sync "sync"
github_com_prysmaticlabs_prysm_consensus_types_primitives "github.com/prysmaticlabs/prysm/consensus-types/primitives"
_ "github.com/prysmaticlabs/prysm/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 Withdrawal struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
WithdrawalIndex uint64 `protobuf:"varint,1,opt,name=withdrawal_index,json=withdrawalIndex,proto3" json:"withdrawal_index,omitempty"`
ExecutionAddress []byte `protobuf:"bytes,2,opt,name=execution_address,json=executionAddress,proto3" json:"execution_address,omitempty" ssz-size:"20"`
Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"`
}
func (x *Withdrawal) Reset() {
*x = Withdrawal{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_prysm_v1alpha1_withdrawals_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Withdrawal) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Withdrawal) ProtoMessage() {}
func (x *Withdrawal) ProtoReflect() protoreflect.Message {
mi := &file_proto_prysm_v1alpha1_withdrawals_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 Withdrawal.ProtoReflect.Descriptor instead.
func (*Withdrawal) Descriptor() ([]byte, []int) {
return file_proto_prysm_v1alpha1_withdrawals_proto_rawDescGZIP(), []int{0}
}
func (x *Withdrawal) GetWithdrawalIndex() uint64 {
if x != nil {
return x.WithdrawalIndex
}
return 0
}
func (x *Withdrawal) GetExecutionAddress() []byte {
if x != nil {
return x.ExecutionAddress
}
return nil
}
func (x *Withdrawal) GetAmount() uint64 {
if x != nil {
return x.Amount
}
return 0
}
type BLSToExecutionChange struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ValidatorIndex github_com_prysmaticlabs_prysm_consensus_types_primitives.ValidatorIndex `protobuf:"varint,1,opt,name=validator_index,json=validatorIndex,proto3" json:"validator_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/consensus-types/primitives.ValidatorIndex"`
FromBlsPubkey []byte `protobuf:"bytes,2,opt,name=from_bls_pubkey,json=fromBlsPubkey,proto3" json:"from_bls_pubkey,omitempty" ssz-size:"48"`
ToExecutionAddress []byte `protobuf:"bytes,3,opt,name=to_execution_address,json=toExecutionAddress,proto3" json:"to_execution_address,omitempty" ssz-size:"20"`
}
func (x *BLSToExecutionChange) Reset() {
*x = BLSToExecutionChange{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_prysm_v1alpha1_withdrawals_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BLSToExecutionChange) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BLSToExecutionChange) ProtoMessage() {}
func (x *BLSToExecutionChange) ProtoReflect() protoreflect.Message {
mi := &file_proto_prysm_v1alpha1_withdrawals_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 BLSToExecutionChange.ProtoReflect.Descriptor instead.
func (*BLSToExecutionChange) Descriptor() ([]byte, []int) {
return file_proto_prysm_v1alpha1_withdrawals_proto_rawDescGZIP(), []int{1}
}
func (x *BLSToExecutionChange) GetValidatorIndex() github_com_prysmaticlabs_prysm_consensus_types_primitives.ValidatorIndex {
if x != nil {
return x.ValidatorIndex
}
return github_com_prysmaticlabs_prysm_consensus_types_primitives.ValidatorIndex(0)
}
func (x *BLSToExecutionChange) GetFromBlsPubkey() []byte {
if x != nil {
return x.FromBlsPubkey
}
return nil
}
func (x *BLSToExecutionChange) GetToExecutionAddress() []byte {
if x != nil {
return x.ToExecutionAddress
}
return nil
}
type SignedBLSToExecutionChange struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Message *BLSToExecutionChange `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 *SignedBLSToExecutionChange) Reset() {
*x = SignedBLSToExecutionChange{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_prysm_v1alpha1_withdrawals_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SignedBLSToExecutionChange) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SignedBLSToExecutionChange) ProtoMessage() {}
func (x *SignedBLSToExecutionChange) ProtoReflect() protoreflect.Message {
mi := &file_proto_prysm_v1alpha1_withdrawals_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 SignedBLSToExecutionChange.ProtoReflect.Descriptor instead.
func (*SignedBLSToExecutionChange) Descriptor() ([]byte, []int) {
return file_proto_prysm_v1alpha1_withdrawals_proto_rawDescGZIP(), []int{2}
}
func (x *SignedBLSToExecutionChange) GetMessage() *BLSToExecutionChange {
if x != nil {
return x.Message
}
return nil
}
func (x *SignedBLSToExecutionChange) GetSignature() []byte {
if x != nil {
return x.Signature
}
return nil
}
var File_proto_prysm_v1alpha1_withdrawals_proto protoreflect.FileDescriptor
var file_proto_prysm_v1alpha1_withdrawals_proto_rawDesc = []byte{
0x0a, 0x26, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31,
0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61,
0x6c, 0x73, 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, 0x84, 0x01, 0x0a,
0x0a, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x12, 0x29, 0x0a, 0x10, 0x77,
0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18,
0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61,
0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x33, 0x0a, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74,
0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28,
0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75,
0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61,
0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f,
0x75, 0x6e, 0x74, 0x22, 0xf7, 0x01, 0x0a, 0x14, 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, 0x65,
0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x75, 0x0a, 0x0f,
0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18,
0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4c, 0x82, 0xb5, 0x18, 0x48, 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, 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, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e,
0x64, 0x65, 0x78, 0x12, 0x2e, 0x0a, 0x0f, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x62, 0x6c, 0x73, 0x5f,
0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5,
0x18, 0x02, 0x34, 0x38, 0x52, 0x0d, 0x66, 0x72, 0x6f, 0x6d, 0x42, 0x6c, 0x73, 0x50, 0x75, 0x62,
0x6b, 0x65, 0x79, 0x12, 0x38, 0x0a, 0x14, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74,
0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28,
0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x12, 0x74, 0x6f, 0x45, 0x78, 0x65,
0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x89, 0x01,
0x0a, 0x1a, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, 0x65,
0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x45, 0x0a, 0x07,
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e,
0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61,
0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x4c, 0x53, 0x54, 0x6f, 0x45, 0x78, 0x65, 0x63, 0x75,
0x74, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 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, 0x42, 0x98, 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, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61,
0x77, 0x61, 0x6c, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 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, 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_withdrawals_proto_rawDescOnce sync.Once
file_proto_prysm_v1alpha1_withdrawals_proto_rawDescData = file_proto_prysm_v1alpha1_withdrawals_proto_rawDesc
)
func file_proto_prysm_v1alpha1_withdrawals_proto_rawDescGZIP() []byte {
file_proto_prysm_v1alpha1_withdrawals_proto_rawDescOnce.Do(func() {
file_proto_prysm_v1alpha1_withdrawals_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_prysm_v1alpha1_withdrawals_proto_rawDescData)
})
return file_proto_prysm_v1alpha1_withdrawals_proto_rawDescData
}
var file_proto_prysm_v1alpha1_withdrawals_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_proto_prysm_v1alpha1_withdrawals_proto_goTypes = []interface{}{
(*Withdrawal)(nil), // 0: ethereum.eth.v1alpha1.Withdrawal
(*BLSToExecutionChange)(nil), // 1: ethereum.eth.v1alpha1.BLSToExecutionChange
(*SignedBLSToExecutionChange)(nil), // 2: ethereum.eth.v1alpha1.SignedBLSToExecutionChange
}
var file_proto_prysm_v1alpha1_withdrawals_proto_depIdxs = []int32{
1, // 0: ethereum.eth.v1alpha1.SignedBLSToExecutionChange.message:type_name -> ethereum.eth.v1alpha1.BLSToExecutionChange
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_withdrawals_proto_init() }
func file_proto_prysm_v1alpha1_withdrawals_proto_init() {
if File_proto_prysm_v1alpha1_withdrawals_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_proto_prysm_v1alpha1_withdrawals_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Withdrawal); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_prysm_v1alpha1_withdrawals_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BLSToExecutionChange); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_prysm_v1alpha1_withdrawals_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SignedBLSToExecutionChange); 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_withdrawals_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_proto_prysm_v1alpha1_withdrawals_proto_goTypes,
DependencyIndexes: file_proto_prysm_v1alpha1_withdrawals_proto_depIdxs,
MessageInfos: file_proto_prysm_v1alpha1_withdrawals_proto_msgTypes,
}.Build()
File_proto_prysm_v1alpha1_withdrawals_proto = out.File
file_proto_prysm_v1alpha1_withdrawals_proto_rawDesc = nil
file_proto_prysm_v1alpha1_withdrawals_proto_goTypes = nil
file_proto_prysm_v1alpha1_withdrawals_proto_depIdxs = nil
}

View File

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

View File

@@ -0,0 +1,60 @@
// Copyright 2022 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/proto/prysm/v1alpha1;eth";
option java_multiple_files = true;
option java_outer_classname = "WithdrawalsProto";
option java_package = "org.ethereum.eth.v1alpha1";
option php_namespace = "Ethereum\\Eth\\v1alpha1";
// The withdrawal receipt with the recipient address and amount withdrawn
message Withdrawal {
// Withdrawal index for accounting purposes
uint64 withdrawal_index = 1;
// The execution address receiving the funds
bytes execution_address = 2 [(ethereum.eth.ext.ssz_size) = "20"];
// The withdrawn amount in Gwei
uint64 amount = 3;
}
// The message requesting a BLS to execution withdrawal credentials change
message BLSToExecutionChange {
// The validator index requesting the change
uint64 validator_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/consensus-types/primitives.ValidatorIndex"];
// The public key of the BLS address requesting the change
bytes from_bls_pubkey = 2 [(ethereum.eth.ext.ssz_size) = "48"];
// The new execution address to be the withdrawal credentials
bytes to_execution_address = 3 [(ethereum.eth.ext.ssz_size) = "20"];
}
// The signed version of a BLSToExecutionChange
message SignedBLSToExecutionChange {
// The BLSToExecutionChange message itself
BLSToExecutionChange message = 1;
// The 96 byte BLS signature from the withdrawal address requesting the change
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}

View File

@@ -8,7 +8,6 @@ import (
"github.com/prysmaticlabs/prysm/config/params"
ev "github.com/prysmaticlabs/prysm/testing/endtoend/evaluators"
"github.com/prysmaticlabs/prysm/testing/endtoend/helpers"
e2eParams "github.com/prysmaticlabs/prysm/testing/endtoend/params"
"github.com/prysmaticlabs/prysm/testing/endtoend/types"
"github.com/prysmaticlabs/prysm/testing/require"
@@ -104,11 +103,6 @@ func e2eMainnet(t *testing.T, usePrysmSh, useMultiClient bool, cfgo ...types.E2E
require.NoError(t, err)
}
_, crossClient := os.LookupEnv("RUN_CROSS_CLIENT")
if usePrysmSh {
// If using prysm.sh, run for only 6 epochs.
// TODO(#9166): remove this block once v2 changes are live.
epochsToRun = helpers.AltairE2EForkEpoch - 1
}
seed := 0
seedStr, isValid := os.LookupEnv("E2E_SEED")
if isValid {

View File

@@ -459,7 +459,7 @@ func (mr *MockBeaconNodeValidatorClientMockRecorder) SubmitSyncMessage(arg0, arg
}
// SubmitValidatorRegistration mocks base method.
func (m *MockBeaconNodeValidatorClient) SubmitValidatorRegistration(arg0 context.Context, arg1 *eth.SignedValidatorRegistrationsV1, arg2 ...grpc.CallOption) (*emptypb.Empty, error) {
func (m *MockBeaconNodeValidatorClient) SubmitValidatorRegistration(arg0 context.Context, arg1 *eth.SignedValidatorRegistrationV1, arg2 ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
@@ -478,6 +478,26 @@ func (mr *MockBeaconNodeValidatorClientMockRecorder) SubmitValidatorRegistration
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitValidatorRegistration", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).SubmitValidatorRegistration), varargs...)
}
// SubmitValidatorRegistrations mocks base method.
func (m *MockBeaconNodeValidatorClient) SubmitValidatorRegistrations(arg0 context.Context, arg1 *eth.SignedValidatorRegistrationsV1, arg2 ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "SubmitValidatorRegistrations", varargs...)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// SubmitValidatorRegistrations indicates an expected call of SubmitValidatorRegistrations.
func (mr *MockBeaconNodeValidatorClientMockRecorder) SubmitValidatorRegistrations(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitValidatorRegistrations", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).SubmitValidatorRegistrations), varargs...)
}
// SubscribeCommitteeSubnets mocks base method.
func (m *MockBeaconNodeValidatorClient) SubscribeCommitteeSubnets(arg0 context.Context, arg1 *eth.CommitteeSubnetsSubscribeRequest, arg2 ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()

View File

@@ -351,7 +351,7 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) SubmitSyncMessage(arg0, arg
}
// SubmitValidatorRegistration mocks base method.
func (m *MockBeaconNodeValidatorServer) SubmitValidatorRegistration(arg0 context.Context, arg1 *eth.SignedValidatorRegistrationsV1) (*emptypb.Empty, error) {
func (m *MockBeaconNodeValidatorServer) SubmitValidatorRegistration(arg0 context.Context, arg1 *eth.SignedValidatorRegistrationV1) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SubmitValidatorRegistration", arg0, arg1)
ret0, _ := ret[0].(*emptypb.Empty)
@@ -365,6 +365,21 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) SubmitValidatorRegistration
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitValidatorRegistration", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).SubmitValidatorRegistration), arg0, arg1)
}
// SubmitValidatorRegistrations mocks base method.
func (m *MockBeaconNodeValidatorServer) SubmitValidatorRegistrations(arg0 context.Context, arg1 *eth.SignedValidatorRegistrationsV1) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SubmitValidatorRegistrations", arg0, arg1)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// SubmitValidatorRegistrations indicates an expected call of SubmitValidatorRegistrations.
func (mr *MockBeaconNodeValidatorServerMockRecorder) SubmitValidatorRegistrations(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitValidatorRegistrations", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).SubmitValidatorRegistrations), arg0, arg1)
}
// SubscribeCommitteeSubnets mocks base method.
func (m *MockBeaconNodeValidatorServer) SubscribeCommitteeSubnets(arg0 context.Context, arg1 *eth.CommitteeSubnetsSubscribeRequest) (*emptypb.Empty, error) {
m.ctrl.T.Helper()

View File

@@ -14,20 +14,20 @@ import (
"go.opencensus.io/trace"
)
// SubmitValidatorRegistration signs validator registration object and submits it to the beacon node.
func SubmitValidatorRegistration(
// SubmitValidatorRegistrations signs validator registration objects and submits it to the beacon node.
func SubmitValidatorRegistrations(
ctx context.Context,
validatorClient ethpb.BeaconNodeValidatorClient,
signedRegs []*ethpb.SignedValidatorRegistrationV1,
) error {
ctx, span := trace.StartSpan(ctx, "validator.SubmitBuilderValidatorRegistration")
ctx, span := trace.StartSpan(ctx, "validator.SubmitValidatorRegistrations")
defer span.End()
if len(signedRegs) == 0 {
return nil
}
if _, err := validatorClient.SubmitValidatorRegistration(ctx, &ethpb.SignedValidatorRegistrationsV1{
if _, err := validatorClient.SubmitValidatorRegistrations(ctx, &ethpb.SignedValidatorRegistrationsV1{
Messages: signedRegs,
}); err != nil {
return errors.Wrap(err, "could not submit signed registrations to beacon node")

View File

@@ -16,12 +16,12 @@ import (
"github.com/prysmaticlabs/prysm/testing/require"
)
func TestSubmitValidatorRegistration(t *testing.T) {
func TestSubmitValidatorRegistrations(t *testing.T) {
_, m, validatorKey, finish := setup(t)
defer finish()
ctx := context.Background()
require.NoError(t, nil, SubmitValidatorRegistration(ctx, m.validatorClient, []*ethpb.SignedValidatorRegistrationV1{}))
require.NoError(t, nil, SubmitValidatorRegistrations(ctx, m.validatorClient, []*ethpb.SignedValidatorRegistrationV1{}))
reg := &ethpb.ValidatorRegistrationV1{
FeeRecipient: bytesutil.PadTo([]byte("fee"), 20),
@@ -31,14 +31,14 @@ func TestSubmitValidatorRegistration(t *testing.T) {
}
m.validatorClient.EXPECT().
SubmitValidatorRegistration(gomock.Any(), &ethpb.SignedValidatorRegistrationsV1{
SubmitValidatorRegistrations(gomock.Any(), &ethpb.SignedValidatorRegistrationsV1{
Messages: []*ethpb.SignedValidatorRegistrationV1{
{Message: reg,
Signature: params.BeaconConfig().ZeroHash[:]},
},
}).
Return(nil, nil)
require.NoError(t, nil, SubmitValidatorRegistration(ctx, m.validatorClient, []*ethpb.SignedValidatorRegistrationV1{
require.NoError(t, nil, SubmitValidatorRegistrations(ctx, m.validatorClient, []*ethpb.SignedValidatorRegistrationV1{
{Message: reg,
Signature: params.BeaconConfig().ZeroHash[:]},
}))
@@ -57,14 +57,14 @@ func TestSubmitValidatorRegistration_CantSign(t *testing.T) {
}
m.validatorClient.EXPECT().
SubmitValidatorRegistration(gomock.Any(), &ethpb.SignedValidatorRegistrationsV1{
SubmitValidatorRegistrations(gomock.Any(), &ethpb.SignedValidatorRegistrationsV1{
Messages: []*ethpb.SignedValidatorRegistrationV1{
{Message: reg,
Signature: params.BeaconConfig().ZeroHash[:]},
},
}).
Return(nil, errors.New("could not sign"))
require.ErrorContains(t, "could not sign", SubmitValidatorRegistration(ctx, m.validatorClient, []*ethpb.SignedValidatorRegistrationV1{
require.ErrorContains(t, "could not sign", SubmitValidatorRegistrations(ctx, m.validatorClient, []*ethpb.SignedValidatorRegistrationV1{
{Message: reg,
Signature: params.BeaconConfig().ZeroHash[:]},
}))

View File

@@ -56,7 +56,11 @@ func run(ctx context.Context, v iface.Validator) {
sub := km.SubscribeAccountChanges(accountsChangedChan)
// Set properties on the beacon node like the fee recipient for validators that are being used & active.
if err := v.PushProposerSettings(ctx, km); err != nil {
log.Fatalf("Failed to update proposer settings: %v", err) // allow fatal. skipcq
if errors.Is(err, ErrBuilderValidatorRegistration) {
log.Warnf("Push proposer settings error, %v", err)
} else {
log.Fatalf("Failed to update proposer settings: %v", err) // allow fatal. skipcq
}
}
for {
_, cancel := context.WithCancel(ctx)

View File

@@ -2,10 +2,10 @@ package client
import (
"context"
"errors"
"testing"
"time"
"github.com/pkg/errors"
"github.com/prysmaticlabs/prysm/async/event"
fieldparams "github.com/prysmaticlabs/prysm/config/fieldparams"
"github.com/prysmaticlabs/prysm/config/params"
@@ -263,3 +263,23 @@ func TestUpdateProposerSettingsAt_EpochStart(t *testing.T) {
run(ctx, v)
assert.LogsContain(t, hook, "updated proposer settings")
}
func TestUpdateProposerSettings_ContinuesAfterValidatorRegistrationFails(t *testing.T) {
errSomeotherError := errors.New("some internal error")
v := &testutil.FakeValidator{
ProposerSettingsErr: errors.Wrap(ErrBuilderValidatorRegistration, errSomeotherError.Error()),
Km: &mockKeymanager{accountsChangedFeed: &event.Feed{}},
}
ctx, cancel := context.WithCancel(context.Background())
hook := logTest.NewGlobal()
slot := params.BeaconConfig().SlotsPerEpoch
ticker := make(chan types.Slot)
v.NextSlotRet = ticker
go func() {
ticker <- slot
cancel()
}()
run(ctx, v)
assert.LogsContain(t, hook, ErrBuilderValidatorRegistration.Error())
}

View File

@@ -45,6 +45,7 @@ type FakeValidator struct {
NextSlotRet <-chan types.Slot
PublicKey string
UpdateDutiesRet error
ProposerSettingsErr error
RolesAtRet []iface.ValidatorRole
Balances map[[fieldparams.BLSPubkeyLength]byte]uint64
IndexToPubkeyMap map[uint64][fieldparams.BLSPubkeyLength]byte
@@ -252,7 +253,10 @@ func (_ *FakeValidator) SubmitSignedContributionAndProof(_ context.Context, _ ty
}
// PushProposerSettings for mocking
func (_ *FakeValidator) PushProposerSettings(_ context.Context, _ keymanager.IKeymanager) error {
func (fv *FakeValidator) PushProposerSettings(_ context.Context, _ keymanager.IKeymanager) error {
if fv.ProposerSettingsErr != nil {
return fv.ProposerSettingsErr
}
log.Infoln("Mock updated proposer settings")
return nil
}

View File

@@ -51,7 +51,8 @@ import (
// keyFetchPeriod is the frequency that we try to refetch validating keys
// in case no keys were fetched previously.
var (
keyRefetchPeriod = 30 * time.Second
keyRefetchPeriod = 30 * time.Second
ErrBuilderValidatorRegistration = errors.New("Builder API validator registration unsuccessful")
)
var (
@@ -987,8 +988,8 @@ func (v *validator) PushProposerSettings(ctx context.Context, km keymanager.IKey
}
log.Infoln("Prepared beacon proposer with fee recipient to validator index mapping")
if err := SubmitValidatorRegistration(ctx, v.validatorClient, signedRegisterValidatorRequests); err != nil {
return err
if err := SubmitValidatorRegistrations(ctx, v.validatorClient, signedRegisterValidatorRequests); err != nil {
return errors.Wrap(ErrBuilderValidatorRegistration, err.Error())
}
return nil
@@ -1078,7 +1079,7 @@ func (v *validator) buildProposerSettingsRequests(ctx context.Context, pubkeys [
if len(signedRegisterValidatorRequests) != len(pubkeys) && anyValidatorRegistrationEnabled {
log.WithFields(logrus.Fields{
"totalNonActivePubkeys": len(pubkeys) - len(signedRegisterValidatorRequests),
}).Warnln("will not be included in MEV builder validator registration until a validator index is assigned")
}).Warnln("will not be included in builder validator registration until a validator index is assigned")
}
return proposerFeeRecipientRequests, signedRegisterValidatorRequests, nil

View File

@@ -1521,7 +1521,7 @@ func TestValidator_PushProposerSettings(t *testing.T) {
},
},
}
client.EXPECT().SubmitValidatorRegistration(
client.EXPECT().SubmitValidatorRegistrations(
gomock.Any(),
gomock.Any(),
).Return(&empty.Empty{}, nil)
@@ -1601,7 +1601,7 @@ func TestValidator_PushProposerSettings(t *testing.T) {
},
},
}
client.EXPECT().SubmitValidatorRegistration(
client.EXPECT().SubmitValidatorRegistrations(
gomock.Any(),
gomock.Any(),
).Return(&empty.Empty{}, nil)
@@ -1618,7 +1618,7 @@ func TestValidator_PushProposerSettings(t *testing.T) {
GasLimit: uint64(40000000),
},
},
logMessages: []string{"will not be included in MEV builder validator registration"},
logMessages: []string{"will not be included in builder validator registration"},
},
{
name: " Happy Path default doesn't send any validator registrations",
@@ -1676,7 +1676,7 @@ func TestValidator_PushProposerSettings(t *testing.T) {
1: "0x055Fb65722E7b2455043BFEBf6177F1D2e9738D9",
2: defaultFeeHex,
},
logMessages: []string{"will not be included in MEV builder validator registration"},
logMessages: []string{"will not be included in builder validator registration"},
doesntContainLogs: true,
},
{
@@ -1721,7 +1721,7 @@ func TestValidator_PushProposerSettings(t *testing.T) {
Index: 1,
}, nil)
client.EXPECT().SubmitValidatorRegistration(
client.EXPECT().SubmitValidatorRegistrations(
gomock.Any(),
gomock.Any(),
).Return(&empty.Empty{}, nil)
@@ -1780,7 +1780,7 @@ func TestValidator_PushProposerSettings(t *testing.T) {
).Return(&ethpb.ValidatorIndexResponse{
Index: 1,
}, nil)
client.EXPECT().SubmitValidatorRegistration(
client.EXPECT().SubmitValidatorRegistrations(
gomock.Any(),
gomock.Any(),
).Return(&empty.Empty{}, nil)
@@ -1976,7 +1976,7 @@ func TestValidator_PushProposerSettings(t *testing.T) {
{FeeRecipient: common.HexToAddress("0x0").Bytes(), ValidatorIndex: 1},
},
}).Return(nil, nil)
client.EXPECT().SubmitValidatorRegistration(
client.EXPECT().SubmitValidatorRegistrations(
gomock.Any(),
gomock.Any(),
).Return(&empty.Empty{}, errors.New("request failed"))
@@ -2031,7 +2031,7 @@ func TestValidator_PushProposerSettings(t *testing.T) {
&ethpb.ValidatorIndexRequest{PublicKey: keys[1][:]},
).Times(2).Return(nil, errors.New("Could not find validator index"))
client.EXPECT().SubmitValidatorRegistration(
client.EXPECT().SubmitValidatorRegistrations(
gomock.Any(),
gomock.Any(),
).Return(&empty.Empty{}, nil)
@@ -2053,7 +2053,7 @@ func TestValidator_PushProposerSettings(t *testing.T) {
},
logMessages: []string{
"prepare beacon proposer and update fee recipient until a validator index is assigned",
"will not be included in MEV builder validator registration until a validator index is assigned",
"will not be included in builder validator registration until a validator index is assigned",
},
},
}