mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-11 06:18:05 -05:00
Compare commits
26 Commits
db-tool-su
...
lateBlocks
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f4bd1678b0 | ||
|
|
78c55019e6 | ||
|
|
1601972625 | ||
|
|
e5ab259ee1 | ||
|
|
9e74c3d641 | ||
|
|
59dcea81c2 | ||
|
|
9149dc2aae | ||
|
|
a7c9c76b18 | ||
|
|
5a4edf897f | ||
|
|
2d6b157eea | ||
|
|
32745b5484 | ||
|
|
bfdaf2ec5a | ||
|
|
39c343bcab | ||
|
|
de1ecf2d60 | ||
|
|
7aee67af90 | ||
|
|
9830ce43d6 | ||
|
|
63a8690140 | ||
|
|
7978a0269b | ||
|
|
021df67fdc | ||
|
|
f20e6351f5 | ||
|
|
a2e834a683 | ||
|
|
da25624b1d | ||
|
|
1a5dd879c5 | ||
|
|
65a9ede2d3 | ||
|
|
7b07ad3083 | ||
|
|
59cccedf33 |
@@ -5,6 +5,7 @@
|
||||
[](https://github.com/ethereum/consensus-specs/tree/v1.2.0-rc.1)
|
||||
[](https://github.com/ethereum/execution-apis/tree/v1.0.0-alpha.9/src/engine)
|
||||
[](https://discord.gg/CTYGPUJ)
|
||||
[](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.
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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",
|
||||
|
||||
8
beacon-chain/core/blocks/error.go
Normal file
8
beacon-chain/core/blocks/error.go
Normal 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")
|
||||
78
beacon-chain/core/blocks/withdrawals.go
Normal file
78
beacon-chain/core/blocks/withdrawals.go
Normal 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
|
||||
}
|
||||
193
beacon-chain/core/blocks/withdrawals_test.go
Normal file
193
beacon-chain/core/blocks/withdrawals_test.go
Normal 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 := ðpb.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(ðpb.BeaconState{
|
||||
Validators: registry,
|
||||
Fork: ðpb.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 := ðpb.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 := ðpb.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(ðpb.BeaconState{
|
||||
Validators: registry,
|
||||
Fork: ðpb.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 := ðpb.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 := ðpb.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(ðpb.BeaconState{
|
||||
Validators: registry,
|
||||
Fork: ðpb.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 := ðpb.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 := ðpb.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(ðpb.BeaconState{
|
||||
Validators: registry,
|
||||
Fork: ðpb.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 := ðpb.SignedBLSToExecutionChange{
|
||||
Message: message,
|
||||
Signature: signature,
|
||||
}
|
||||
|
||||
_, err = blocks.ProcessBLSToExecutionChange(st, signed)
|
||||
require.ErrorContains(t, "withdrawal credential prefix is not a BLS prefix", err)
|
||||
|
||||
})
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package db
|
||||
|
||||
import (
|
||||
"context"
|
||||
types "github.com/prysmaticlabs/prysm/consensus-types/primitives"
|
||||
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
|
||||
"github.com/prysmaticlabs/prysm/time/slots"
|
||||
)
|
||||
|
||||
type CanonicalChecker interface {
|
||||
IsCanonical(ctx context.Context, blockRoot [32]byte) (bool, error)
|
||||
}
|
||||
|
||||
type FinalizedChecker interface {
|
||||
IsFinalizedBlock(ctx context.Context, blockRoot [32]byte) bool
|
||||
}
|
||||
|
||||
type canonicalChecker struct {
|
||||
fc FinalizedChecker
|
||||
}
|
||||
|
||||
func (cc *canonicalChecker) IsCanonical(ctx context.Context, root [32]byte) (bool, error) {
|
||||
return cc.fc.IsFinalizedBlock(ctx, root), nil
|
||||
}
|
||||
|
||||
func NewCanonicalChecker(fc FinalizedChecker) CanonicalChecker {
|
||||
return &canonicalChecker{fc: fc}
|
||||
}
|
||||
|
||||
type CurrentSlotter interface {
|
||||
CurrentSlot() types.Slot
|
||||
}
|
||||
|
||||
type FinalizedCheckpointer interface {
|
||||
FinalizedCheckpoint(ctx context.Context) (*ethpb.Checkpoint, error)
|
||||
}
|
||||
|
||||
type finalizedCurrentSlotter struct {
|
||||
fc FinalizedCheckpointer
|
||||
ctx context.Context
|
||||
}
|
||||
|
||||
func (fc *finalizedCurrentSlotter) CurrentSlot() types.Slot {
|
||||
cp, err := fc.fc.FinalizedCheckpoint(fc.ctx)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
s, err := slots.EpochStart(cp.Epoch)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
func FinalizedCurrentSlotter(fc FinalizedCheckpointer, ctx context.Context) CurrentSlotter {
|
||||
return &finalizedCurrentSlotter{fc: fc, ctx: ctx}
|
||||
}
|
||||
@@ -93,12 +93,36 @@ func KVStoreDatafilePath(dirPath string) string {
|
||||
return path.Join(dirPath, DatabaseFileName)
|
||||
}
|
||||
|
||||
type StoreOption func(*Store) error
|
||||
|
||||
func NewKVStoreWithDB(ctx context.Context, bdb *bolt.DB, opts ...StoreOption) (*Store, error) {
|
||||
bdb.AllocSize = boltAllocSize
|
||||
start := time.Now()
|
||||
log.Infof("Creating block cache...")
|
||||
// NewKVStore initializes a new boltDB key-value store at the directory
|
||||
// path specified, creates the kv-buckets based on the schema, and stores
|
||||
// an open connection db object as a property of the Store struct.
|
||||
func NewKVStore(ctx context.Context, dirPath string, config *Config) (*Store, error) {
|
||||
hasDir, err := file.HasDir(dirPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !hasDir {
|
||||
if err := file.MkdirAll(dirPath); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
datafile := KVStoreDatafilePath(dirPath)
|
||||
log.Infof("Opening Bolt DB at %s", datafile)
|
||||
boltDB, err := bolt.Open(
|
||||
datafile,
|
||||
params.BeaconIoConfig().ReadWritePermissions,
|
||||
&bolt.Options{
|
||||
Timeout: 1 * time.Second,
|
||||
InitialMmapSize: config.InitialMMapSize,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
if errors.Is(err, bolt.ErrTimeout) {
|
||||
return nil, errors.New("cannot obtain database lock, database may be in use by another process")
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
boltDB.AllocSize = boltAllocSize
|
||||
blockCache, err := ristretto.NewCache(&ristretto.Config{
|
||||
NumCounters: 1000, // number of keys to track frequency of (1000).
|
||||
MaxCost: BlockCacheSize, // maximum cost of cache (1000 Blocks).
|
||||
@@ -118,8 +142,8 @@ func NewKVStoreWithDB(ctx context.Context, bdb *bolt.DB, opts ...StoreOption) (*
|
||||
}
|
||||
|
||||
kv := &Store{
|
||||
db: bdb,
|
||||
databasePath: path.Dir(bdb.Path()),
|
||||
db: boltDB,
|
||||
databasePath: dirPath,
|
||||
blockCache: blockCache,
|
||||
validatorEntryCache: validatorCache,
|
||||
stateSummaryCache: newStateSummaryCache(),
|
||||
@@ -150,7 +174,6 @@ func NewKVStoreWithDB(ctx context.Context, bdb *bolt.DB, opts ...StoreOption) (*
|
||||
blockParentRootIndicesBucket,
|
||||
finalizedBlockRootsIndexBucket,
|
||||
blockRootValidatorHashesBucket,
|
||||
finalizedBlockRootBySlot,
|
||||
// State management service bucket.
|
||||
newStateServiceCompatibleBucket,
|
||||
// Migrations
|
||||
@@ -162,59 +185,13 @@ func NewKVStoreWithDB(ctx context.Context, bdb *bolt.DB, opts ...StoreOption) (*
|
||||
}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err = prometheus.Register(createBoltCollector(kv.db)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err = kv.checkNeedsResync(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
log.WithField("elapsed", time.Since(start)).Info("Updated db and created buckets")
|
||||
for _, o := range opts {
|
||||
err := o(kv)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "error while applying StoreOptions")
|
||||
}
|
||||
}
|
||||
|
||||
return kv, err
|
||||
}
|
||||
|
||||
func WithPrometheusCollection() StoreOption {
|
||||
return func(kv *Store) error {
|
||||
return prometheus.Register(createBoltCollector(kv.db))
|
||||
}
|
||||
}
|
||||
|
||||
// NewKVStore initializes a new boltDB key-value store at the directory
|
||||
// path specified, creates the kv-buckets based on the schema, and stores
|
||||
// an open connection db object as a property of the Store struct.
|
||||
func NewKVStore(ctx context.Context, dirPath string, config *Config) (*Store, error) {
|
||||
hasDir, err := file.HasDir(dirPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !hasDir {
|
||||
if err := file.MkdirAll(dirPath); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
datafile := KVStoreDatafilePath(dirPath)
|
||||
start := time.Now()
|
||||
log.Infof("Opening Bolt DB at %s", datafile)
|
||||
bdb, err := bolt.Open(
|
||||
datafile,
|
||||
params.BeaconIoConfig().ReadWritePermissions,
|
||||
&bolt.Options{
|
||||
Timeout: 1 * time.Second,
|
||||
InitialMmapSize: config.InitialMMapSize,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
log.WithField("elapsed", time.Since(start)).Error("Failed to open Bolt DB")
|
||||
if errors.Is(err, bolt.ErrTimeout) {
|
||||
return nil, errors.New("cannot obtain database lock, database may be in use by another process")
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
log.WithField("elapsed", time.Since(start)).Info("Opened Bolt DB")
|
||||
return NewKVStoreWithDB(ctx, bdb, WithPrometheusCollection())
|
||||
return kv, nil
|
||||
}
|
||||
|
||||
// ClearDB removes the previously stored database in the data directory.
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -580,13 +580,20 @@ func (s *Service) initPOWService() {
|
||||
|
||||
if err := s.processPastLogs(ctx); err != nil {
|
||||
s.retryExecutionClientConnection(ctx, err)
|
||||
errorLogger(err, "Unable to process past deposit contract logs")
|
||||
errorLogger(
|
||||
err,
|
||||
"Unable to process past deposit contract logs, perhaps your execution client is not fully synced",
|
||||
)
|
||||
continue
|
||||
}
|
||||
// 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
|
||||
|
||||
@@ -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\"}")
|
||||
@@ -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\"}")
|
||||
@@ -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\"}")
|
||||
@@ -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":
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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 ðpb.SyncingResponse{
|
||||
Data: ðpb.SyncInfo{
|
||||
HeadSlot: headSlot,
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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, ðpb.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
|
||||
|
||||
@@ -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 := ðpb.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)
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ func (vs *Server) ValidatorIndex(ctx context.Context, req *ethpb.ValidatorIndexR
|
||||
}
|
||||
index, ok := st.ValidatorIndexByPubkey(bytesutil.ToBytes48(req.PublicKey))
|
||||
if !ok {
|
||||
return nil, status.Errorf(codes.Internal, "Could not find validator index for public key %#x not found", req.PublicKey)
|
||||
return nil, status.Errorf(codes.NotFound, "Could not find validator index for public key %#x not found", req.PublicKey)
|
||||
}
|
||||
|
||||
return ðpb.ValidatorIndexResponse{Index: index}, nil
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}()
|
||||
|
||||
@@ -31,6 +31,7 @@ go_library(
|
||||
"//monitoring/journald:go_default_library",
|
||||
"//runtime/debug:go_default_library",
|
||||
"//runtime/fdlimits:go_default_library",
|
||||
"//runtime/logging/logrus-prefixed-formatter:go_default_library",
|
||||
"//runtime/maxprocs:go_default_library",
|
||||
"//runtime/tos:go_default_library",
|
||||
"//runtime/version:go_default_library",
|
||||
@@ -39,7 +40,6 @@ go_library(
|
||||
"@com_github_joonix_log//:go_default_library",
|
||||
"@com_github_sirupsen_logrus//:go_default_library",
|
||||
"@com_github_urfave_cli_v2//:go_default_library",
|
||||
"@com_github_x_cray_logrus_prefixed_formatter//:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -27,12 +27,12 @@ import (
|
||||
"github.com/prysmaticlabs/prysm/monitoring/journald"
|
||||
"github.com/prysmaticlabs/prysm/runtime/debug"
|
||||
"github.com/prysmaticlabs/prysm/runtime/fdlimits"
|
||||
prefixed "github.com/prysmaticlabs/prysm/runtime/logging/logrus-prefixed-formatter"
|
||||
_ "github.com/prysmaticlabs/prysm/runtime/maxprocs"
|
||||
"github.com/prysmaticlabs/prysm/runtime/tos"
|
||||
"github.com/prysmaticlabs/prysm/runtime/version"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli/v2"
|
||||
prefixed "github.com/x-cray/logrus-prefixed-formatter"
|
||||
)
|
||||
|
||||
var appFlags = []cli.Flag{
|
||||
|
||||
@@ -16,11 +16,11 @@ go_library(
|
||||
"//io/logs:go_default_library",
|
||||
"//monitoring/clientstats:go_default_library",
|
||||
"//monitoring/journald:go_default_library",
|
||||
"//runtime/logging/logrus-prefixed-formatter:go_default_library",
|
||||
"//runtime/version:go_default_library",
|
||||
"@com_github_joonix_log//:go_default_library",
|
||||
"@com_github_sirupsen_logrus//:go_default_library",
|
||||
"@com_github_urfave_cli_v2//:go_default_library",
|
||||
"@com_github_x_cray_logrus_prefixed_formatter//:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -12,10 +12,10 @@ import (
|
||||
"github.com/prysmaticlabs/prysm/io/logs"
|
||||
"github.com/prysmaticlabs/prysm/monitoring/clientstats"
|
||||
"github.com/prysmaticlabs/prysm/monitoring/journald"
|
||||
prefixed "github.com/prysmaticlabs/prysm/runtime/logging/logrus-prefixed-formatter"
|
||||
"github.com/prysmaticlabs/prysm/runtime/version"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli/v2"
|
||||
prefixed "github.com/x-cray/logrus-prefixed-formatter"
|
||||
)
|
||||
|
||||
var appFlags = []cli.Flag{
|
||||
|
||||
@@ -27,6 +27,7 @@ go_library(
|
||||
"//io/logs:go_default_library",
|
||||
"//monitoring/journald:go_default_library",
|
||||
"//runtime/debug:go_default_library",
|
||||
"//runtime/logging/logrus-prefixed-formatter:go_default_library",
|
||||
"//runtime/maxprocs:go_default_library",
|
||||
"//runtime/tos:go_default_library",
|
||||
"//runtime/version:go_default_library",
|
||||
@@ -34,7 +35,6 @@ go_library(
|
||||
"@com_github_joonix_log//:go_default_library",
|
||||
"@com_github_sirupsen_logrus//:go_default_library",
|
||||
"@com_github_urfave_cli_v2//:go_default_library",
|
||||
"@com_github_x_cray_logrus_prefixed_formatter//:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -23,13 +23,13 @@ import (
|
||||
"github.com/prysmaticlabs/prysm/io/logs"
|
||||
"github.com/prysmaticlabs/prysm/monitoring/journald"
|
||||
"github.com/prysmaticlabs/prysm/runtime/debug"
|
||||
prefixed "github.com/prysmaticlabs/prysm/runtime/logging/logrus-prefixed-formatter"
|
||||
_ "github.com/prysmaticlabs/prysm/runtime/maxprocs"
|
||||
"github.com/prysmaticlabs/prysm/runtime/tos"
|
||||
"github.com/prysmaticlabs/prysm/runtime/version"
|
||||
"github.com/prysmaticlabs/prysm/validator/node"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli/v2"
|
||||
prefixed "github.com/x-cray/logrus-prefixed-formatter"
|
||||
)
|
||||
|
||||
func startNode(ctx *cli.Context) error {
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
@@ -185,9 +208,10 @@ func ConfigureBeaconChain(ctx *cli.Context) error {
|
||||
logDisabled(disableGRPCConnectionLogging)
|
||||
cfg.DisableGRPCConnectionLogs = true
|
||||
}
|
||||
if ctx.Bool(enablePeerScorer.Name) {
|
||||
logEnabled(enablePeerScorer)
|
||||
cfg.EnablePeerScorer = true
|
||||
cfg.EnablePeerScorer = true
|
||||
if ctx.Bool(disablePeerScorer.Name) {
|
||||
logDisabled(disablePeerScorer)
|
||||
cfg.EnablePeerScorer = false
|
||||
}
|
||||
if ctx.Bool(checkPtInfoCache.Name) {
|
||||
log.Warn("Advance check point info cache is no longer supported and will soon be deleted")
|
||||
|
||||
@@ -12,11 +12,11 @@ import (
|
||||
func TestInitFeatureConfig(t *testing.T) {
|
||||
defer Init(&Flags{})
|
||||
cfg := &Flags{
|
||||
EnablePeerScorer: true,
|
||||
EnableSlasher: true,
|
||||
}
|
||||
Init(cfg)
|
||||
c := Get()
|
||||
assert.Equal(t, true, c.EnablePeerScorer)
|
||||
assert.Equal(t, true, c.EnableSlasher)
|
||||
|
||||
// Reset back to false for the follow up tests.
|
||||
cfg = &Flags{RemoteSlasherProtection: false}
|
||||
@@ -26,27 +26,27 @@ func TestInitFeatureConfig(t *testing.T) {
|
||||
func TestInitWithReset(t *testing.T) {
|
||||
defer Init(&Flags{})
|
||||
Init(&Flags{
|
||||
EnablePeerScorer: true,
|
||||
EnableSlasher: true,
|
||||
})
|
||||
assert.Equal(t, true, Get().EnablePeerScorer)
|
||||
assert.Equal(t, true, Get().EnableSlasher)
|
||||
|
||||
// Overwrite previously set value (value that didn't come by default).
|
||||
resetCfg := InitWithReset(&Flags{
|
||||
EnablePeerScorer: false,
|
||||
EnableSlasher: false,
|
||||
})
|
||||
assert.Equal(t, false, Get().EnablePeerScorer)
|
||||
assert.Equal(t, false, Get().EnableSlasher)
|
||||
|
||||
// Reset must get to previously set configuration (not to default config values).
|
||||
resetCfg()
|
||||
assert.Equal(t, true, Get().EnablePeerScorer)
|
||||
assert.Equal(t, true, Get().EnableSlasher)
|
||||
}
|
||||
|
||||
func TestConfigureBeaconConfig(t *testing.T) {
|
||||
app := cli.App{}
|
||||
set := flag.NewFlagSet("test", 0)
|
||||
set.Bool(enablePeerScorer.Name, true, "test")
|
||||
set.Bool(enableSlasherFlag.Name, true, "test")
|
||||
context := cli.NewContext(&app, set, nil)
|
||||
require.NoError(t, ConfigureBeaconChain(context))
|
||||
c := Get()
|
||||
assert.Equal(t, true, c.EnablePeerScorer)
|
||||
assert.Equal(t, true, c.EnableSlasher)
|
||||
}
|
||||
|
||||
@@ -120,6 +120,11 @@ var (
|
||||
Usage: deprecatedUsage,
|
||||
Hidden: true,
|
||||
}
|
||||
deprecatedEnablePeerScorer = &cli.BoolFlag{
|
||||
Name: "enable-peer-scorer",
|
||||
Usage: deprecatedUsage,
|
||||
Hidden: true,
|
||||
}
|
||||
)
|
||||
|
||||
var deprecatedFlags = []cli.Flag{
|
||||
@@ -144,4 +149,5 @@ var deprecatedFlags = []cli.Flag{
|
||||
deprecatedDisableCorrectlyInsertOrphanedAtts,
|
||||
deprecatedDisableCorrectlyPruneCanonicalAtts,
|
||||
deprecatedEnableNativeState,
|
||||
deprecatedEnablePeerScorer,
|
||||
}
|
||||
|
||||
@@ -46,9 +46,9 @@ var (
|
||||
Name: "disable-grpc-connection-logging",
|
||||
Usage: "Disables displaying logs for newly connected grpc clients",
|
||||
}
|
||||
enablePeerScorer = &cli.BoolFlag{
|
||||
Name: "enable-peer-scorer",
|
||||
Usage: "Enable experimental P2P peer scorer",
|
||||
disablePeerScorer = &cli.BoolFlag{
|
||||
Name: "disable-peer-scorer",
|
||||
Usage: "Disables experimental P2P peer scorer",
|
||||
}
|
||||
checkPtInfoCache = &cli.BoolFlag{
|
||||
Name: "use-check-point-cache",
|
||||
@@ -130,7 +130,6 @@ var (
|
||||
|
||||
// devModeFlags holds list of flags that are set when development mode is on.
|
||||
var devModeFlags = []cli.Flag{
|
||||
enablePeerScorer,
|
||||
enableVecHTR,
|
||||
enableForkChoiceDoublyLinkedTree,
|
||||
enableGossipBatchAggregation,
|
||||
@@ -165,7 +164,7 @@ var BeaconChainFlags = append(deprecatedFlags, []cli.Flag{
|
||||
RopstenTestnet,
|
||||
SepoliaTestnet,
|
||||
Mainnet,
|
||||
enablePeerScorer,
|
||||
disablePeerScorer,
|
||||
enableLargerGossipHistory,
|
||||
checkPtInfoCache,
|
||||
disableBroadcastSlashingFlag,
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -29,6 +29,7 @@ func MinimalSpecConfig() *BeaconChainConfig {
|
||||
|
||||
// Initial values
|
||||
minimalConfig.BLSWithdrawalPrefixByte = byte(0)
|
||||
minimalConfig.ETH1AddressWithdrawalPrefixByte = byte(1)
|
||||
|
||||
// Time parameters
|
||||
minimalConfig.SecondsPerSlot = 6
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
6
go.mod
6
go.mod
@@ -47,10 +47,13 @@ require (
|
||||
github.com/libp2p/go-libp2p-pubsub v0.7.1-0.20220701163738-60cf38003244
|
||||
github.com/logrusorgru/aurora v2.0.3+incompatible
|
||||
github.com/manifoldco/promptui v0.7.0
|
||||
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b
|
||||
github.com/minio/highwayhash v1.0.1
|
||||
github.com/minio/sha256-simd v1.0.0
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
|
||||
github.com/multiformats/go-multiaddr v0.6.0
|
||||
github.com/onsi/ginkgo v1.16.5
|
||||
github.com/onsi/gomega v1.13.0
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible
|
||||
github.com/paulbellamy/ratecounter v0.2.0
|
||||
github.com/pborman/uuid v1.2.1
|
||||
@@ -78,7 +81,6 @@ require (
|
||||
github.com/wealdtech/go-eth2-util v1.6.3
|
||||
github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4 v1.1.3
|
||||
github.com/wercker/journalhook v0.0.0-20180428041537-5d0a5ae867b3
|
||||
github.com/x-cray/logrus-prefixed-formatter v0.5.2
|
||||
go.etcd.io/bbolt v1.3.5
|
||||
go.opencensus.io v0.23.0
|
||||
go.uber.org/automaxprocs v1.3.0
|
||||
@@ -175,7 +177,6 @@ require (
|
||||
github.com/mattn/go-isatty v0.0.14 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.9 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
|
||||
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
|
||||
github.com/miekg/dns v1.1.50 // indirect
|
||||
github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect
|
||||
github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect
|
||||
@@ -196,7 +197,6 @@ require (
|
||||
github.com/multiformats/go-varint v0.0.6 // indirect
|
||||
github.com/nxadm/tail v1.4.8 // indirect
|
||||
github.com/olekukonko/tablewriter v0.0.5 // indirect
|
||||
github.com/onsi/ginkgo v1.16.5 // indirect
|
||||
github.com/opencontainers/runtime-spec v1.0.2 // indirect
|
||||
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
||||
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
|
||||
|
||||
1
go.sum
1
go.sum
@@ -1361,7 +1361,6 @@ github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee h1:lYbXeSv
|
||||
github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee/go.mod h1:m2aV4LZI4Aez7dP5PMyVKEHhUyEJ/RjmPEDOpDvudHg=
|
||||
github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
|
||||
github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees=
|
||||
github.com/x-cray/logrus-prefixed-formatter v0.5.2 h1:00txxvfBM9muc0jiLIEAkAcIMJzfthRT6usrui8uGmg=
|
||||
github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE=
|
||||
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I=
|
||||
github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
|
||||
|
||||
609
proto/engine/v1/execution_engine.pb.go
generated
609
proto/engine/v1/execution_engine.pb.go
generated
@@ -77,7 +77,7 @@ func (x PayloadStatus_Status) Number() protoreflect.EnumNumber {
|
||||
|
||||
// Deprecated: Use PayloadStatus_Status.Descriptor instead.
|
||||
func (PayloadStatus_Status) EnumDescriptor() ([]byte, []int) {
|
||||
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{5, 0}
|
||||
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{6, 0}
|
||||
}
|
||||
|
||||
type ExecutionPayload struct {
|
||||
@@ -104,7 +104,7 @@ type ExecutionPayload struct {
|
||||
func (x *ExecutionPayload) Reset() {
|
||||
*x = ExecutionPayload{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[1]
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -117,7 +117,7 @@ func (x *ExecutionPayload) String() string {
|
||||
func (*ExecutionPayload) ProtoMessage() {}
|
||||
|
||||
func (x *ExecutionPayload) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[1]
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -130,7 +130,7 @@ func (x *ExecutionPayload) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use ExecutionPayload.ProtoReflect.Descriptor instead.
|
||||
func (*ExecutionPayload) Descriptor() ([]byte, []int) {
|
||||
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{1}
|
||||
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *ExecutionPayload) GetParentHash() []byte {
|
||||
@@ -231,6 +231,165 @@ func (x *ExecutionPayload) GetTransactions() [][]byte {
|
||||
return nil
|
||||
}
|
||||
|
||||
type ExecutionPayloadCapella struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ParentHash []byte `protobuf:"bytes,1,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty" ssz-size:"32"`
|
||||
FeeRecipient []byte `protobuf:"bytes,2,opt,name=fee_recipient,json=feeRecipient,proto3" json:"fee_recipient,omitempty" ssz-size:"20"`
|
||||
StateRoot []byte `protobuf:"bytes,3,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty" ssz-size:"32"`
|
||||
ReceiptsRoot []byte `protobuf:"bytes,4,opt,name=receipts_root,json=receiptsRoot,proto3" json:"receipts_root,omitempty" ssz-size:"32"`
|
||||
LogsBloom []byte `protobuf:"bytes,5,opt,name=logs_bloom,json=logsBloom,proto3" json:"logs_bloom,omitempty" ssz-size:"256"`
|
||||
PrevRandao []byte `protobuf:"bytes,6,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty" ssz-size:"32"`
|
||||
BlockNumber uint64 `protobuf:"varint,7,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"`
|
||||
GasLimit uint64 `protobuf:"varint,8,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"`
|
||||
GasUsed uint64 `protobuf:"varint,9,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"`
|
||||
Timestamp uint64 `protobuf:"varint,10,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
|
||||
ExtraData []byte `protobuf:"bytes,11,opt,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty" ssz-max:"32"`
|
||||
BaseFeePerGas []byte `protobuf:"bytes,12,opt,name=base_fee_per_gas,json=baseFeePerGas,proto3" json:"base_fee_per_gas,omitempty" ssz-size:"32"`
|
||||
BlockHash []byte `protobuf:"bytes,13,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty" ssz-size:"32"`
|
||||
Transactions [][]byte `protobuf:"bytes,14,rep,name=transactions,proto3" json:"transactions,omitempty" ssz-max:"1048576,1073741824" ssz-size:"?,?"`
|
||||
Withdrawals []uint64 `protobuf:"varint,15,rep,packed,name=withdrawals,proto3" json:"withdrawals,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadCapella) Reset() {
|
||||
*x = ExecutionPayloadCapella{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadCapella) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ExecutionPayloadCapella) ProtoMessage() {}
|
||||
|
||||
func (x *ExecutionPayloadCapella) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_engine_v1_execution_engine_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 ExecutionPayloadCapella.ProtoReflect.Descriptor instead.
|
||||
func (*ExecutionPayloadCapella) Descriptor() ([]byte, []int) {
|
||||
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadCapella) GetParentHash() []byte {
|
||||
if x != nil {
|
||||
return x.ParentHash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadCapella) GetFeeRecipient() []byte {
|
||||
if x != nil {
|
||||
return x.FeeRecipient
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadCapella) GetStateRoot() []byte {
|
||||
if x != nil {
|
||||
return x.StateRoot
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadCapella) GetReceiptsRoot() []byte {
|
||||
if x != nil {
|
||||
return x.ReceiptsRoot
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadCapella) GetLogsBloom() []byte {
|
||||
if x != nil {
|
||||
return x.LogsBloom
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadCapella) GetPrevRandao() []byte {
|
||||
if x != nil {
|
||||
return x.PrevRandao
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadCapella) GetBlockNumber() uint64 {
|
||||
if x != nil {
|
||||
return x.BlockNumber
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadCapella) GetGasLimit() uint64 {
|
||||
if x != nil {
|
||||
return x.GasLimit
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadCapella) GetGasUsed() uint64 {
|
||||
if x != nil {
|
||||
return x.GasUsed
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadCapella) GetTimestamp() uint64 {
|
||||
if x != nil {
|
||||
return x.Timestamp
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadCapella) GetExtraData() []byte {
|
||||
if x != nil {
|
||||
return x.ExtraData
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadCapella) GetBaseFeePerGas() []byte {
|
||||
if x != nil {
|
||||
return x.BaseFeePerGas
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadCapella) GetBlockHash() []byte {
|
||||
if x != nil {
|
||||
return x.BlockHash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadCapella) GetTransactions() [][]byte {
|
||||
if x != nil {
|
||||
return x.Transactions
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadCapella) GetWithdrawals() []uint64 {
|
||||
if x != nil {
|
||||
return x.Withdrawals
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ExecutionPayloadHeader struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
@@ -382,6 +541,165 @@ func (x *ExecutionPayloadHeader) GetTransactionsRoot() []byte {
|
||||
return nil
|
||||
}
|
||||
|
||||
type ExecutionPayloadHeaderCapella struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ParentHash []byte `protobuf:"bytes,1,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty" ssz-size:"32"`
|
||||
FeeRecipient []byte `protobuf:"bytes,2,opt,name=fee_recipient,json=feeRecipient,proto3" json:"fee_recipient,omitempty" ssz-size:"20"`
|
||||
StateRoot []byte `protobuf:"bytes,3,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty" ssz-size:"32"`
|
||||
ReceiptsRoot []byte `protobuf:"bytes,4,opt,name=receipts_root,json=receiptsRoot,proto3" json:"receipts_root,omitempty" ssz-size:"32"`
|
||||
LogsBloom []byte `protobuf:"bytes,5,opt,name=logs_bloom,json=logsBloom,proto3" json:"logs_bloom,omitempty" ssz-size:"256"`
|
||||
PrevRandao []byte `protobuf:"bytes,6,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty" ssz-size:"32"`
|
||||
BlockNumber uint64 `protobuf:"varint,7,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"`
|
||||
GasLimit uint64 `protobuf:"varint,8,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"`
|
||||
GasUsed uint64 `protobuf:"varint,9,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"`
|
||||
Timestamp uint64 `protobuf:"varint,10,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
|
||||
ExtraData []byte `protobuf:"bytes,11,opt,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty" ssz-max:"32"`
|
||||
BaseFeePerGas []byte `protobuf:"bytes,12,opt,name=base_fee_per_gas,json=baseFeePerGas,proto3" json:"base_fee_per_gas,omitempty" ssz-size:"32"`
|
||||
BlockHash []byte `protobuf:"bytes,13,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty" ssz-size:"32"`
|
||||
TransactionsRoot []byte `protobuf:"bytes,14,opt,name=transactions_root,json=transactionsRoot,proto3" json:"transactions_root,omitempty" ssz-size:"32"`
|
||||
WithdrawalsRoot []byte `protobuf:"bytes,15,opt,name=withdrawals_root,json=withdrawalsRoot,proto3" json:"withdrawals_root,omitempty" ssz-size:"32"`
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadHeaderCapella) Reset() {
|
||||
*x = ExecutionPayloadHeaderCapella{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadHeaderCapella) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ExecutionPayloadHeaderCapella) ProtoMessage() {}
|
||||
|
||||
func (x *ExecutionPayloadHeaderCapella) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ExecutionPayloadHeaderCapella.ProtoReflect.Descriptor instead.
|
||||
func (*ExecutionPayloadHeaderCapella) Descriptor() ([]byte, []int) {
|
||||
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadHeaderCapella) GetParentHash() []byte {
|
||||
if x != nil {
|
||||
return x.ParentHash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadHeaderCapella) GetFeeRecipient() []byte {
|
||||
if x != nil {
|
||||
return x.FeeRecipient
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadHeaderCapella) GetStateRoot() []byte {
|
||||
if x != nil {
|
||||
return x.StateRoot
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadHeaderCapella) GetReceiptsRoot() []byte {
|
||||
if x != nil {
|
||||
return x.ReceiptsRoot
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadHeaderCapella) GetLogsBloom() []byte {
|
||||
if x != nil {
|
||||
return x.LogsBloom
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadHeaderCapella) GetPrevRandao() []byte {
|
||||
if x != nil {
|
||||
return x.PrevRandao
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadHeaderCapella) GetBlockNumber() uint64 {
|
||||
if x != nil {
|
||||
return x.BlockNumber
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadHeaderCapella) GetGasLimit() uint64 {
|
||||
if x != nil {
|
||||
return x.GasLimit
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadHeaderCapella) GetGasUsed() uint64 {
|
||||
if x != nil {
|
||||
return x.GasUsed
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadHeaderCapella) GetTimestamp() uint64 {
|
||||
if x != nil {
|
||||
return x.Timestamp
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadHeaderCapella) GetExtraData() []byte {
|
||||
if x != nil {
|
||||
return x.ExtraData
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadHeaderCapella) GetBaseFeePerGas() []byte {
|
||||
if x != nil {
|
||||
return x.BaseFeePerGas
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadHeaderCapella) GetBlockHash() []byte {
|
||||
if x != nil {
|
||||
return x.BlockHash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadHeaderCapella) GetTransactionsRoot() []byte {
|
||||
if x != nil {
|
||||
return x.TransactionsRoot
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadHeaderCapella) GetWithdrawalsRoot() []byte {
|
||||
if x != nil {
|
||||
return x.WithdrawalsRoot
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type TransitionConfiguration struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
@@ -395,7 +713,7 @@ type TransitionConfiguration struct {
|
||||
func (x *TransitionConfiguration) Reset() {
|
||||
*x = TransitionConfiguration{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[3]
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -408,7 +726,7 @@ func (x *TransitionConfiguration) String() string {
|
||||
func (*TransitionConfiguration) ProtoMessage() {}
|
||||
|
||||
func (x *TransitionConfiguration) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[3]
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -421,7 +739,7 @@ func (x *TransitionConfiguration) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use TransitionConfiguration.ProtoReflect.Descriptor instead.
|
||||
func (*TransitionConfiguration) Descriptor() ([]byte, []int) {
|
||||
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{3}
|
||||
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *TransitionConfiguration) GetTerminalTotalDifficulty() string {
|
||||
@@ -458,7 +776,7 @@ type PayloadAttributes struct {
|
||||
func (x *PayloadAttributes) Reset() {
|
||||
*x = PayloadAttributes{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[4]
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -471,7 +789,7 @@ func (x *PayloadAttributes) String() string {
|
||||
func (*PayloadAttributes) ProtoMessage() {}
|
||||
|
||||
func (x *PayloadAttributes) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[4]
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -484,7 +802,7 @@ func (x *PayloadAttributes) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use PayloadAttributes.ProtoReflect.Descriptor instead.
|
||||
func (*PayloadAttributes) Descriptor() ([]byte, []int) {
|
||||
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{4}
|
||||
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *PayloadAttributes) GetTimestamp() uint64 {
|
||||
@@ -521,7 +839,7 @@ type PayloadStatus struct {
|
||||
func (x *PayloadStatus) Reset() {
|
||||
*x = PayloadStatus{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5]
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -534,7 +852,7 @@ func (x *PayloadStatus) String() string {
|
||||
func (*PayloadStatus) ProtoMessage() {}
|
||||
|
||||
func (x *PayloadStatus) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[5]
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -547,7 +865,7 @@ func (x *PayloadStatus) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use PayloadStatus.ProtoReflect.Descriptor instead.
|
||||
func (*PayloadStatus) Descriptor() ([]byte, []int) {
|
||||
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{5}
|
||||
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *PayloadStatus) GetStatus() PayloadStatus_Status {
|
||||
@@ -584,7 +902,7 @@ type ForkchoiceState struct {
|
||||
func (x *ForkchoiceState) Reset() {
|
||||
*x = ForkchoiceState{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6]
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -597,7 +915,7 @@ func (x *ForkchoiceState) String() string {
|
||||
func (*ForkchoiceState) ProtoMessage() {}
|
||||
|
||||
func (x *ForkchoiceState) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[6]
|
||||
mi := &file_proto_engine_v1_execution_engine_proto_msgTypes[7]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -610,7 +928,7 @@ func (x *ForkchoiceState) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use ForkchoiceState.ProtoReflect.Descriptor instead.
|
||||
func (*ForkchoiceState) Descriptor() ([]byte, []int) {
|
||||
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{6}
|
||||
return file_proto_engine_v1_execution_engine_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (x *ForkchoiceState) GetHeadBlockHash() []byte {
|
||||
@@ -642,86 +960,45 @@ var file_proto_engine_v1_execution_engine_proto_rawDesc = []byte{
|
||||
0x6e, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65,
|
||||
0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 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, 0x8e, 0x05, 0x0a, 0x0e, 0x45, 0x78,
|
||||
0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x16, 0x0a, 0x06,
|
||||
0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6e, 0x75,
|
||||
0x6d, 0x62, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65,
|
||||
0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x70,
|
||||
0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x68, 0x61,
|
||||
0x33, 0x5f, 0x75, 0x6e, 0x63, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a,
|
||||
0x73, 0x68, 0x61, 0x33, 0x55, 0x6e, 0x63, 0x6c, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x69,
|
||||
0x6e, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x65, 0x72,
|
||||
0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x06,
|
||||
0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12,
|
||||
0x2b, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f,
|
||||
0x72, 0x6f, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e,
|
||||
0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x23, 0x0a, 0x0d,
|
||||
0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x08, 0x20,
|
||||
0x01, 0x28, 0x0c, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f,
|
||||
0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18,
|
||||
0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d,
|
||||
0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x0a,
|
||||
0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79,
|
||||
0x12, 0x29, 0x0a, 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63,
|
||||
0x75, 0x6c, 0x74, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x74, 0x6f, 0x74, 0x61,
|
||||
0x6c, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x67,
|
||||
0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08,
|
||||
0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f,
|
||||
0x75, 0x73, 0x65, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55,
|
||||
0x73, 0x65, 0x64, 0x12, 0x27, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f,
|
||||
0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x62,
|
||||
0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x12, 0x0a, 0x04,
|
||||
0x73, 0x69, 0x7a, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65,
|
||||
0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x10, 0x20,
|
||||
0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1d,
|
||||
0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x11, 0x20, 0x01,
|
||||
0x28, 0x0c, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x19, 0x0a,
|
||||
0x08, 0x6d, 0x69, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0c, 0x52,
|
||||
0x07, 0x6d, 0x69, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63,
|
||||
0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x22,
|
||||
0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x14,
|
||||
0x20, 0x03, 0x28, 0x0c, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x6e, 0x63, 0x6c, 0x65, 0x73, 0x18, 0x15, 0x20, 0x03,
|
||||
0x28, 0x0c, 0x52, 0x06, 0x75, 0x6e, 0x63, 0x6c, 0x65, 0x73, 0x22, 0xc8, 0x04, 0x0a, 0x10, 0x45,
|
||||
0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12,
|
||||
0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61,
|
||||
0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f,
|
||||
0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42,
|
||||
0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69,
|
||||
0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72,
|
||||
0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33,
|
||||
0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d,
|
||||
0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20,
|
||||
0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63,
|
||||
0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67,
|
||||
0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a,
|
||||
0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f,
|
||||
0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f,
|
||||
0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a,
|
||||
0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c,
|
||||
0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04,
|
||||
0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a,
|
||||
0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04,
|
||||
0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61,
|
||||
0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61,
|
||||
0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
|
||||
0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74,
|
||||
0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74,
|
||||
0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52,
|
||||
0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61,
|
||||
0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c,
|
||||
0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61,
|
||||
0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62,
|
||||
0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42,
|
||||
0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61,
|
||||
0x73, 0x68, 0x12, 0x41, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x1d, 0x8a, 0xb5, 0x18, 0x03, 0x3f, 0x2c,
|
||||
0x3f, 0x92, 0xb5, 0x18, 0x12, 0x31, 0x30, 0x34, 0x38, 0x35, 0x37, 0x36, 0x2c, 0x31, 0x30, 0x37,
|
||||
0x33, 0x37, 0x34, 0x31, 0x38, 0x32, 0x34, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xc0, 0x04, 0x0a, 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
|
||||
0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc8, 0x04, 0x0a, 0x10, 0x45, 0x78,
|
||||
0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x27,
|
||||
0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72,
|
||||
0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72,
|
||||
0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06,
|
||||
0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70,
|
||||
0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f,
|
||||
0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32,
|
||||
0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72,
|
||||
0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01,
|
||||
0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65,
|
||||
0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73,
|
||||
0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5,
|
||||
0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d,
|
||||
0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18,
|
||||
0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70,
|
||||
0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f,
|
||||
0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52,
|
||||
0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09,
|
||||
0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52,
|
||||
0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73,
|
||||
0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73,
|
||||
0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
|
||||
0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
|
||||
0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61,
|
||||
0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09,
|
||||
0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73,
|
||||
0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20,
|
||||
0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73,
|
||||
0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c,
|
||||
0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06,
|
||||
0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73,
|
||||
0x68, 0x12, 0x41, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x1d, 0x8a, 0xb5, 0x18, 0x03, 0x3f, 0x2c, 0x3f,
|
||||
0x92, 0xb5, 0x18, 0x12, 0x31, 0x30, 0x34, 0x38, 0x35, 0x37, 0x36, 0x2c, 0x31, 0x30, 0x37, 0x33,
|
||||
0x37, 0x34, 0x31, 0x38, 0x32, 0x34, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x73, 0x22, 0xf1, 0x04, 0x0a, 0x17, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61,
|
||||
0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70,
|
||||
0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65,
|
||||
@@ -753,10 +1030,89 @@ var file_proto_engine_v1_execution_engine_proto_rawDesc = []byte{
|
||||
0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a,
|
||||
0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c,
|
||||
0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48,
|
||||
0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06,
|
||||
0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xb9, 0x01, 0x0a, 0x17, 0x54, 0x72, 0x61,
|
||||
0x61, 0x73, 0x68, 0x12, 0x41, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x1d, 0x8a, 0xb5, 0x18, 0x03, 0x3f,
|
||||
0x2c, 0x3f, 0x92, 0xb5, 0x18, 0x12, 0x31, 0x30, 0x34, 0x38, 0x35, 0x37, 0x36, 0x2c, 0x31, 0x30,
|
||||
0x37, 0x33, 0x37, 0x34, 0x31, 0x38, 0x32, 0x34, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61,
|
||||
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72,
|
||||
0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x04, 0x52, 0x0b, 0x77, 0x69, 0x74,
|
||||
0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x22, 0xc0, 0x04, 0x0a, 0x16, 0x45, 0x78, 0x65,
|
||||
0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61,
|
||||
0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61,
|
||||
0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32,
|
||||
0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d,
|
||||
0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65,
|
||||
0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61,
|
||||
0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a,
|
||||
0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74,
|
||||
0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f,
|
||||
0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52,
|
||||
0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a,
|
||||
0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28,
|
||||
0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73,
|
||||
0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61,
|
||||
0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02,
|
||||
0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21,
|
||||
0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07,
|
||||
0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65,
|
||||
0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08,
|
||||
0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19,
|
||||
0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04,
|
||||
0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d,
|
||||
0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69,
|
||||
0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61,
|
||||
0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18,
|
||||
0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f,
|
||||
0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67,
|
||||
0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32,
|
||||
0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12,
|
||||
0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20,
|
||||
0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f,
|
||||
0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61,
|
||||
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28,
|
||||
0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73,
|
||||
0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xfa, 0x04, 0x0a, 0x1d,
|
||||
0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64,
|
||||
0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x12, 0x27, 0x0a,
|
||||
0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65,
|
||||
0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65,
|
||||
0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a,
|
||||
0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69,
|
||||
0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f,
|
||||
0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52,
|
||||
0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65,
|
||||
0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28,
|
||||
0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69,
|
||||
0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f,
|
||||
0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18,
|
||||
0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12,
|
||||
0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06,
|
||||
0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72,
|
||||
0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63,
|
||||
0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b,
|
||||
0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67,
|
||||
0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08,
|
||||
0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f,
|
||||
0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55,
|
||||
0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
|
||||
0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
|
||||
0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18,
|
||||
0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65,
|
||||
0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65,
|
||||
0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01,
|
||||
0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65,
|
||||
0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f,
|
||||
0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a,
|
||||
0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68,
|
||||
0x12, 0x33, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73,
|
||||
0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18,
|
||||
0x02, 0x33, 0x32, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61,
|
||||
0x77, 0x61, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x42,
|
||||
0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61,
|
||||
0x77, 0x61, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xb9, 0x01, 0x0a, 0x17, 0x54, 0x72, 0x61,
|
||||
0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3a, 0x0a, 0x19, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c,
|
||||
0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74,
|
||||
@@ -832,16 +1188,17 @@ func file_proto_engine_v1_execution_engine_proto_rawDescGZIP() []byte {
|
||||
}
|
||||
|
||||
var file_proto_engine_v1_execution_engine_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_proto_engine_v1_execution_engine_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_proto_engine_v1_execution_engine_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
|
||||
var file_proto_engine_v1_execution_engine_proto_goTypes = []interface{}{
|
||||
(PayloadStatus_Status)(0), // 0: ethereum.engine.v1.PayloadStatus.Status
|
||||
(*ExecutionBlock)(nil), // 1: ethereum.engine.v1.ExecutionBlock
|
||||
(*ExecutionPayload)(nil), // 2: ethereum.engine.v1.ExecutionPayload
|
||||
(*ExecutionPayloadHeader)(nil), // 3: ethereum.engine.v1.ExecutionPayloadHeader
|
||||
(*TransitionConfiguration)(nil), // 4: ethereum.engine.v1.TransitionConfiguration
|
||||
(*PayloadAttributes)(nil), // 5: ethereum.engine.v1.PayloadAttributes
|
||||
(*PayloadStatus)(nil), // 6: ethereum.engine.v1.PayloadStatus
|
||||
(*ForkchoiceState)(nil), // 7: ethereum.engine.v1.ForkchoiceState
|
||||
(PayloadStatus_Status)(0), // 0: ethereum.engine.v1.PayloadStatus.Status
|
||||
(*ExecutionPayload)(nil), // 1: ethereum.engine.v1.ExecutionPayload
|
||||
(*ExecutionPayloadCapella)(nil), // 2: ethereum.engine.v1.ExecutionPayloadCapella
|
||||
(*ExecutionPayloadHeader)(nil), // 3: ethereum.engine.v1.ExecutionPayloadHeader
|
||||
(*ExecutionPayloadHeaderCapella)(nil), // 4: ethereum.engine.v1.ExecutionPayloadHeaderCapella
|
||||
(*TransitionConfiguration)(nil), // 5: ethereum.engine.v1.TransitionConfiguration
|
||||
(*PayloadAttributes)(nil), // 6: ethereum.engine.v1.PayloadAttributes
|
||||
(*PayloadStatus)(nil), // 7: ethereum.engine.v1.PayloadStatus
|
||||
(*ForkchoiceState)(nil), // 8: ethereum.engine.v1.ForkchoiceState
|
||||
}
|
||||
var file_proto_engine_v1_execution_engine_proto_depIdxs = []int32{
|
||||
0, // 0: ethereum.engine.v1.PayloadStatus.status:type_name -> ethereum.engine.v1.PayloadStatus.Status
|
||||
@@ -871,7 +1228,7 @@ func file_proto_engine_v1_execution_engine_proto_init() {
|
||||
}
|
||||
}
|
||||
file_proto_engine_v1_execution_engine_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ExecutionPayloadHeader); i {
|
||||
switch v := v.(*ExecutionPayloadCapella); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
@@ -883,7 +1240,7 @@ func file_proto_engine_v1_execution_engine_proto_init() {
|
||||
}
|
||||
}
|
||||
file_proto_engine_v1_execution_engine_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*TransitionConfiguration); i {
|
||||
switch v := v.(*ExecutionPayloadHeader); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
@@ -895,7 +1252,7 @@ func file_proto_engine_v1_execution_engine_proto_init() {
|
||||
}
|
||||
}
|
||||
file_proto_engine_v1_execution_engine_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PayloadAttributes); i {
|
||||
switch v := v.(*ExecutionPayloadHeaderCapella); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
@@ -907,7 +1264,7 @@ func file_proto_engine_v1_execution_engine_proto_init() {
|
||||
}
|
||||
}
|
||||
file_proto_engine_v1_execution_engine_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PayloadStatus); i {
|
||||
switch v := v.(*TransitionConfiguration); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
@@ -919,6 +1276,30 @@ func file_proto_engine_v1_execution_engine_proto_init() {
|
||||
}
|
||||
}
|
||||
file_proto_engine_v1_execution_engine_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PayloadAttributes); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_engine_v1_execution_engine_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PayloadStatus); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_engine_v1_execution_engine_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ForkchoiceState); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -937,7 +1318,7 @@ func file_proto_engine_v1_execution_engine_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_proto_engine_v1_execution_engine_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 7,
|
||||
NumMessages: 8,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
||||
@@ -41,6 +41,24 @@ message ExecutionPayload {
|
||||
repeated bytes transactions = 14 [(ethereum.eth.ext.ssz_size) = "?,?", (ethereum.eth.ext.ssz_max) = "1048576,1073741824"];
|
||||
}
|
||||
|
||||
message ExecutionPayloadCapella {
|
||||
bytes parent_hash = 1 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
bytes fee_recipient = 2 [(ethereum.eth.ext.ssz_size) = "20"];
|
||||
bytes state_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
bytes receipts_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
bytes logs_bloom = 5 [(ethereum.eth.ext.ssz_size) = "256"];
|
||||
bytes prev_randao = 6 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
uint64 block_number = 7;
|
||||
uint64 gas_limit = 8;
|
||||
uint64 gas_used = 9;
|
||||
uint64 timestamp = 10;
|
||||
bytes extra_data = 11 [(ethereum.eth.ext.ssz_max) = "32"];
|
||||
bytes base_fee_per_gas = 12 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
bytes block_hash = 13 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
repeated bytes transactions = 14 [(ethereum.eth.ext.ssz_size) = "?,?", (ethereum.eth.ext.ssz_max) = "1048576,1073741824"];
|
||||
repeated uint64 withdrawals = 15; // New in Capella.
|
||||
}
|
||||
|
||||
message ExecutionPayloadHeader {
|
||||
bytes parent_hash = 1 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
bytes fee_recipient = 2 [(ethereum.eth.ext.ssz_size) = "20"];
|
||||
@@ -58,6 +76,24 @@ message ExecutionPayloadHeader {
|
||||
bytes transactions_root = 14 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
}
|
||||
|
||||
message ExecutionPayloadHeaderCapella {
|
||||
bytes parent_hash = 1 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
bytes fee_recipient = 2 [(ethereum.eth.ext.ssz_size) = "20"];
|
||||
bytes state_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
bytes receipts_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
bytes logs_bloom = 5 [(ethereum.eth.ext.ssz_size) = "256"];
|
||||
bytes prev_randao = 6 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
uint64 block_number = 7;
|
||||
uint64 gas_limit = 8;
|
||||
uint64 gas_used = 9;
|
||||
uint64 timestamp = 10;
|
||||
bytes extra_data = 11 [(ethereum.eth.ext.ssz_max) = "32"];
|
||||
bytes base_fee_per_gas = 12 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
bytes block_hash = 13 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
bytes transactions_root = 14 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
bytes withdrawals_root = 15 [(ethereum.eth.ext.ssz_size) = "32"]; // New in Capella.
|
||||
}
|
||||
|
||||
message TransitionConfiguration {
|
||||
string terminal_total_difficulty = 1;
|
||||
bytes terminal_block_hash = 2;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Code generated by fastssz. DO NOT EDIT.
|
||||
// Hash: 1ff7027b5ff36aabafba387be30535ceee20e61226f5d23ec138769493c9e0be
|
||||
// Hash: 193ee08fc7deef9db16221d5f9c3bbcc73091e7bfcac407a822546a5207c383e
|
||||
package enginev1
|
||||
|
||||
import (
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
14
proto/eth/ext/options.pb.go
generated
14
proto/eth/ext/options.pb.go
generated
@@ -9,9 +9,9 @@ package ext
|
||||
import (
|
||||
reflect "reflect"
|
||||
|
||||
descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
descriptorpb "google.golang.org/protobuf/types/descriptorpb"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -23,7 +23,7 @@ const (
|
||||
|
||||
var file_proto_eth_ext_options_proto_extTypes = []protoimpl.ExtensionInfo{
|
||||
{
|
||||
ExtendedType: (*descriptor.FieldOptions)(nil),
|
||||
ExtendedType: (*descriptorpb.FieldOptions)(nil),
|
||||
ExtensionType: (*string)(nil),
|
||||
Field: 50000,
|
||||
Name: "ethereum.eth.ext.cast_type",
|
||||
@@ -31,7 +31,7 @@ var file_proto_eth_ext_options_proto_extTypes = []protoimpl.ExtensionInfo{
|
||||
Filename: "proto/eth/ext/options.proto",
|
||||
},
|
||||
{
|
||||
ExtendedType: (*descriptor.FieldOptions)(nil),
|
||||
ExtendedType: (*descriptorpb.FieldOptions)(nil),
|
||||
ExtensionType: (*string)(nil),
|
||||
Field: 50001,
|
||||
Name: "ethereum.eth.ext.ssz_size",
|
||||
@@ -39,7 +39,7 @@ var file_proto_eth_ext_options_proto_extTypes = []protoimpl.ExtensionInfo{
|
||||
Filename: "proto/eth/ext/options.proto",
|
||||
},
|
||||
{
|
||||
ExtendedType: (*descriptor.FieldOptions)(nil),
|
||||
ExtendedType: (*descriptorpb.FieldOptions)(nil),
|
||||
ExtensionType: (*string)(nil),
|
||||
Field: 50002,
|
||||
Name: "ethereum.eth.ext.ssz_max",
|
||||
@@ -47,7 +47,7 @@ var file_proto_eth_ext_options_proto_extTypes = []protoimpl.ExtensionInfo{
|
||||
Filename: "proto/eth/ext/options.proto",
|
||||
},
|
||||
{
|
||||
ExtendedType: (*descriptor.FieldOptions)(nil),
|
||||
ExtendedType: (*descriptorpb.FieldOptions)(nil),
|
||||
ExtensionType: (*string)(nil),
|
||||
Field: 50003,
|
||||
Name: "ethereum.eth.ext.spec_name",
|
||||
@@ -56,7 +56,7 @@ var file_proto_eth_ext_options_proto_extTypes = []protoimpl.ExtensionInfo{
|
||||
},
|
||||
}
|
||||
|
||||
// Extension fields to descriptor.FieldOptions.
|
||||
// Extension fields to descriptorpb.FieldOptions.
|
||||
var (
|
||||
// optional string cast_type = 50000;
|
||||
E_CastType = &file_proto_eth_ext_options_proto_extTypes[0]
|
||||
@@ -103,7 +103,7 @@ var file_proto_eth_ext_options_proto_rawDesc = []byte{
|
||||
}
|
||||
|
||||
var file_proto_eth_ext_options_proto_goTypes = []interface{}{
|
||||
(*descriptor.FieldOptions)(nil), // 0: google.protobuf.FieldOptions
|
||||
(*descriptorpb.FieldOptions)(nil), // 0: google.protobuf.FieldOptions
|
||||
}
|
||||
var file_proto_eth_ext_options_proto_depIdxs = []int32{
|
||||
0, // 0: ethereum.eth.ext.cast_type:extendee -> google.protobuf.FieldOptions
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package ignore
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package ignore
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package ignore
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package ignore
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package ignore
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Code generated by fastssz. DO NOT EDIT.
|
||||
// Hash: 25cabd4ee6b2013aa3ecc4e5560b0db4c755c5c84d208d13861d23731b1ca838
|
||||
// Hash: 13e1dcc0e4f90172e1c70a3acac7b73b1a2dc02350d950f3222f4626fe8aa20a
|
||||
package v1
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package ignore
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package ignore
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package ignore
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package ignore
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Code generated by fastssz. DO NOT EDIT.
|
||||
// Hash: 041d5d528e07bf99188c39100dc83a4e6ba1f1d4cd190c46fcf27af4ca367fda
|
||||
// Hash: 16637c49444f2c3a90bcc4587dfbc26b39f45c26129de7d43fea32a2bcf8441e
|
||||
package eth
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package ignore
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package ignore
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package ignore
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package ignore
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package ignore
|
||||
|
||||
2051
proto/prysm/v1alpha1/beacon_block.pb.go
generated
2051
proto/prysm/v1alpha1/beacon_block.pb.go
generated
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package ignore
|
||||
|
||||
@@ -17,6 +17,7 @@ package ethereum.eth.v1alpha1;
|
||||
|
||||
import "proto/eth/ext/options.proto";
|
||||
import "proto/prysm/v1alpha1/attestation.proto";
|
||||
import "proto/prysm/v1alpha1/withdrawals.proto";
|
||||
import "proto/engine/v1/execution_engine.proto";
|
||||
|
||||
option csharp_namespace = "Ethereum.Eth.v1alpha1";
|
||||
@@ -39,6 +40,12 @@ message GenericSignedBeaconBlock {
|
||||
|
||||
// Representing a signed, post-Bellatrix fork blinded beacon block.
|
||||
SignedBlindedBeaconBlockBellatrix blinded_bellatrix = 4;
|
||||
|
||||
// Representing a signed, post-Capella fork beacon block.
|
||||
SignedBeaconBlockCapella capella = 5;
|
||||
|
||||
// Representing a signed, post-Capella fork blinded beacon block.
|
||||
SignedBlindedBeaconBlockCapella blinded_capella = 6;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +62,12 @@ message GenericBeaconBlock {
|
||||
|
||||
// Representing a post-Bellatrix fork blinded beacon block.
|
||||
BlindedBeaconBlockBellatrix blinded_bellatrix = 4;
|
||||
|
||||
// Representing a post-Capella fork beacon block.
|
||||
BeaconBlockCapella capella = 5;
|
||||
|
||||
// Representing a post-Capella fork blinded beacon block.
|
||||
BlindedBeaconBlockCapella blinded_capella = 6;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -423,6 +436,131 @@ message BlindedBeaconBlockBodyBellatrix {
|
||||
ethereum.engine.v1.ExecutionPayloadHeader execution_payload_header = 10;
|
||||
}
|
||||
|
||||
message SignedBeaconBlockCapella {
|
||||
// The unsigned beacon block itself.
|
||||
BeaconBlockCapella block = 1;
|
||||
|
||||
// 96 byte BLS signature from the validator that produced this block.
|
||||
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
|
||||
}
|
||||
|
||||
message BeaconBlockCapella {
|
||||
// Beacon chain slot that this block represents.
|
||||
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/consensus-types/primitives.Slot"];
|
||||
|
||||
// Validator index of the validator that proposed the block header.
|
||||
uint64 proposer_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/consensus-types/primitives.ValidatorIndex"];
|
||||
|
||||
// 32 byte root of the parent block.
|
||||
bytes parent_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
|
||||
// 32 byte root of the resulting state after processing this block.
|
||||
bytes state_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
|
||||
// The beacon block body.
|
||||
BeaconBlockBodyCapella body = 5;
|
||||
}
|
||||
|
||||
message BeaconBlockBodyCapella {
|
||||
// The validators RANDAO reveal 96 byte value.
|
||||
bytes randao_reveal = 1 [(ethereum.eth.ext.ssz_size) = "96"];
|
||||
|
||||
// A reference to the Ethereum 1.x chain.
|
||||
Eth1Data eth1_data = 2;
|
||||
|
||||
// 32 byte field of arbitrary data. This field may contain any data and
|
||||
// is not used for anything other than a fun message.
|
||||
bytes graffiti = 3 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
|
||||
// Block operations
|
||||
// Refer to spec constants at https://github.com/ethereum/consensus-specs/blob/dev/specs/core/0_beacon-chain.md#max-operations-per-block
|
||||
|
||||
// At most MAX_PROPOSER_SLASHINGS.
|
||||
repeated ProposerSlashing proposer_slashings = 4 [(ethereum.eth.ext.ssz_max) = "16"];
|
||||
|
||||
// At most MAX_ATTESTER_SLASHINGS.
|
||||
repeated AttesterSlashing attester_slashings = 5 [(ethereum.eth.ext.ssz_max) = "2"];
|
||||
|
||||
// At most MAX_ATTESTATIONS.
|
||||
repeated Attestation attestations = 6 [(ethereum.eth.ext.ssz_max) = "128"];
|
||||
|
||||
// At most MAX_DEPOSITS.
|
||||
repeated Deposit deposits = 7 [(ethereum.eth.ext.ssz_max) = "16"];
|
||||
|
||||
// At most MAX_VOLUNTARY_EXITS.
|
||||
repeated SignedVoluntaryExit voluntary_exits = 8 [(ethereum.eth.ext.ssz_max) = "16"];
|
||||
|
||||
// Sync aggregate object for the beacon chain to track sync committee votes. New in Altair network upgrade.
|
||||
SyncAggregate sync_aggregate = 9;
|
||||
|
||||
// Execution payload from the execution chain. New in Bellatrix network upgrade.
|
||||
ethereum.engine.v1.ExecutionPayloadCapella execution_payload = 10;
|
||||
|
||||
// At most MAX_BLS_TO_EXECUTION_CHANGES. New in Capella network upgrade.
|
||||
repeated SignedBLSToExecutionChange bls_to_execution_changes = 11 [(ethereum.eth.ext.ssz_max) = "16"];
|
||||
}
|
||||
|
||||
message SignedBlindedBeaconBlockCapella {
|
||||
// The unsigned blinded beacon block itself.
|
||||
BlindedBeaconBlockCapella block = 1;
|
||||
|
||||
// 96 byte BLS signature from the validator that produced this blinded block.
|
||||
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
|
||||
}
|
||||
|
||||
message BlindedBeaconBlockCapella {
|
||||
// Beacon chain slot that this blinded block represents.
|
||||
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/consensus-types/primitives.Slot"];
|
||||
|
||||
// Validator index of the validator that proposed the block header.
|
||||
uint64 proposer_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/consensus-types/primitives.ValidatorIndex"];
|
||||
|
||||
// 32 byte root of the parent block.
|
||||
bytes parent_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
|
||||
// 32 byte root of the resulting state after processing this blinded block.
|
||||
bytes state_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
|
||||
// The blinded beacon block body.
|
||||
BlindedBeaconBlockBodyCapella body = 5;
|
||||
}
|
||||
|
||||
message BlindedBeaconBlockBodyCapella {
|
||||
// The validators RANDAO reveal 96 byte value.
|
||||
bytes randao_reveal = 1 [(ethereum.eth.ext.ssz_size) = "96"];
|
||||
|
||||
// A reference to the Ethereum 1.x chain.
|
||||
Eth1Data eth1_data = 2;
|
||||
|
||||
// 32 byte field of arbitrary data. This field may contain any data and
|
||||
// is not used for anything other than a fun message.
|
||||
bytes graffiti = 3 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
|
||||
// At most MAX_PROPOSER_SLASHINGS.
|
||||
repeated ProposerSlashing proposer_slashings = 4 [(ethereum.eth.ext.ssz_max) = "16"];
|
||||
|
||||
// At most MAX_ATTESTER_SLASHINGS.
|
||||
repeated AttesterSlashing attester_slashings = 5 [(ethereum.eth.ext.ssz_max) = "2"];
|
||||
|
||||
// At most MAX_ATTESTATIONS.
|
||||
repeated Attestation attestations = 6 [(ethereum.eth.ext.ssz_max) = "128"];
|
||||
|
||||
// At most MAX_DEPOSITS.
|
||||
repeated Deposit deposits = 7 [(ethereum.eth.ext.ssz_max) = "16"];
|
||||
|
||||
// At most MAX_VOLUNTARY_EXITS.
|
||||
repeated SignedVoluntaryExit voluntary_exits = 8 [(ethereum.eth.ext.ssz_max) = "16"];
|
||||
|
||||
// Sync aggregate object for the beacon chain to track sync committee votes. New in Altair network upgrade.
|
||||
SyncAggregate sync_aggregate = 9;
|
||||
|
||||
// Execution payload header from the execution chain. New in Bellatrix network upgrade to accommodate MEV interaction.
|
||||
ethereum.engine.v1.ExecutionPayloadHeaderCapella execution_payload_header = 10;
|
||||
|
||||
// At most MAX_BLS_TO_EXECUTION_CHANGES. New in Capella network upgrade.
|
||||
repeated SignedBLSToExecutionChange bls_to_execution_changes = 11 [(ethereum.eth.ext.ssz_max) = "16"];
|
||||
}
|
||||
|
||||
message ValidatorRegistrationV1 {
|
||||
bytes fee_recipient = 1 [(ethereum.eth.ext.ssz_size) = "20"];
|
||||
uint64 gas_limit = 2;
|
||||
|
||||
1395
proto/prysm/v1alpha1/beacon_state.pb.go
generated
1395
proto/prysm/v1alpha1/beacon_state.pb.go
generated
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package ignore
|
||||
|
||||
@@ -5,6 +5,7 @@ package ethereum.eth.v1alpha1;
|
||||
import "proto/prysm/v1alpha1/attestation.proto";
|
||||
import "proto/prysm/v1alpha1/beacon_block.proto";
|
||||
import "proto/prysm/v1alpha1/validator.proto";
|
||||
import "proto/prysm/v1alpha1/withdrawals.proto";
|
||||
import "proto/engine/v1/execution_engine.proto";
|
||||
import "proto/eth/ext/options.proto";
|
||||
|
||||
@@ -236,6 +237,58 @@ message BeaconStateBellatrix {
|
||||
ethereum.engine.v1.ExecutionPayloadHeader latest_execution_payload_header = 10001; // [New in Bellatrix]
|
||||
}
|
||||
|
||||
message BeaconStateCapella {
|
||||
// Versioning [1001-2000]
|
||||
uint64 genesis_time = 1001;
|
||||
bytes genesis_validators_root = 1002 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
uint64 slot = 1003 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/consensus-types/primitives.Slot"];
|
||||
Fork fork = 1004;
|
||||
|
||||
// History [2001-3000]
|
||||
BeaconBlockHeader latest_block_header = 2001;
|
||||
repeated bytes block_roots = 2002 [(ethereum.eth.ext.ssz_size) = "block_roots.size"];
|
||||
repeated bytes state_roots = 2003 [(ethereum.eth.ext.ssz_size) = "state_roots.size"];
|
||||
repeated bytes historical_roots = 2004 [(ethereum.eth.ext.ssz_size) = "?,32", (ethereum.eth.ext.ssz_max) = "16777216"];
|
||||
|
||||
// Eth1 [3001-4000]
|
||||
Eth1Data eth1_data = 3001;
|
||||
repeated Eth1Data eth1_data_votes = 3002 [(ethereum.eth.ext.ssz_max) = "eth1_data_votes.size"];
|
||||
uint64 eth1_deposit_index = 3003;
|
||||
|
||||
// Registry [4001-5000]
|
||||
repeated Validator validators = 4001 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
|
||||
repeated uint64 balances = 4002 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
|
||||
|
||||
// Randomness [5001-6000]
|
||||
repeated bytes randao_mixes = 5001 [(ethereum.eth.ext.ssz_size) = "randao_mixes.size"];
|
||||
|
||||
// Slashings [6001-7000]
|
||||
repeated uint64 slashings = 6001 [(ethereum.eth.ext.ssz_size) = "slashings.size"];
|
||||
|
||||
// Participation [7001-8000]
|
||||
bytes previous_epoch_participation = 7001 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
|
||||
bytes current_epoch_participation = 7002 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
|
||||
|
||||
// Finality [8001-9000]
|
||||
// Spec type [4]Bitvector which means this would be a fixed size of 4 bits.
|
||||
bytes justification_bits = 8001 [(ethereum.eth.ext.ssz_size) = "1", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitvector4"];
|
||||
Checkpoint previous_justified_checkpoint = 8002;
|
||||
Checkpoint current_justified_checkpoint = 8003;
|
||||
Checkpoint finalized_checkpoint = 8004;
|
||||
|
||||
// Altair fields [9001-10000]
|
||||
repeated uint64 inactivity_scores = 9001 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
|
||||
SyncCommittee current_sync_committee = 9002; // [New in Altair]
|
||||
SyncCommittee next_sync_committee = 9003; // [New in Altair]
|
||||
|
||||
// Bellatrix fields [10001-11000]
|
||||
ethereum.engine.v1.ExecutionPayloadHeader latest_execution_payload_header = 10001; // [New in Bellatrix]
|
||||
|
||||
// Capella fields [11001-12000]
|
||||
repeated Withdrawal withdrawal_queue = 11001 [(ethereum.eth.ext.ssz_max) = "1099511627776"]; // [New in Capella]
|
||||
uint64 next_withdrawal_index = 11002; // [New in Capella]
|
||||
uint64 next_partial_withdrawal_validator_index = 11003 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/consensus-types/primitives.ValidatorIndex"]; // [New in Capella]
|
||||
}
|
||||
|
||||
// PowBlock is a definition from Bellatrix fork choice spec to represent a block with total difficulty in the PoW chain.
|
||||
// Spec:
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package ignore
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package ignore
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package ignore
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package ignore
|
||||
|
||||
1272
proto/prysm/v1alpha1/validator.pb.go
generated
1272
proto/prysm/v1alpha1/validator.pb.go
generated
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
)
|
||||
|
||||
@@ -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: "*"
|
||||
@@ -644,6 +649,51 @@ message Validator {
|
||||
uint64 withdrawable_epoch = 8 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/consensus-types/primitives.Epoch"];
|
||||
}
|
||||
|
||||
// An Ethereum validator after Capella fork.
|
||||
message ValidatorCapella {
|
||||
// 48 byte BLS public key used for the validator's activities.
|
||||
bytes public_key = 1 [(ethereum.eth.ext.ssz_size) = "48", (ethereum.eth.ext.spec_name) = "pubkey"];
|
||||
|
||||
// 32 byte hash of the withdrawal destination public key.
|
||||
bytes withdrawal_credentials = 2 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||
|
||||
// The validators current effective balance in gwei.
|
||||
uint64 effective_balance = 3;
|
||||
|
||||
// Whether or not the validator has been slashed.
|
||||
bool slashed = 4;
|
||||
|
||||
// Epoch when the validator became eligible for activation. This field may
|
||||
// be zero if the validator was present in the Ethereum proof of stake genesis. This
|
||||
// field is FAR_FUTURE_EPOCH if the validator has not been activated.
|
||||
uint64 activation_eligibility_epoch = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/consensus-types/primitives.Epoch"];
|
||||
|
||||
// Epoch when the validator was activated. This field may be zero if the
|
||||
// validator was present in the Ethereum proof of stake genesis. This field is
|
||||
// FAR_FUTURE_EPOCH if the validator has not been activated.
|
||||
uint64 activation_epoch = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/consensus-types/primitives.Epoch"];
|
||||
|
||||
// Epoch when the validator was exited. This field is FAR_FUTURE_EPOCH if
|
||||
// the validator has not exited.
|
||||
// FAR_FUTURE_EPOCH is a constant defined by the official Ethereum Beacon Chain specification:
|
||||
// https://github.com/ethereum/consensus-specs/blob/v0.9.2/specs/core/0_beacon-chain.md#constants
|
||||
uint64 exit_epoch = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/consensus-types/primitives.Epoch"];
|
||||
|
||||
// Epoch when the validator is eligible to withdraw their funds. This field
|
||||
// is FAR_FUTURE_EPOCH if the validator has not exited.
|
||||
// FAR_FUTURE_EPOCH is a constant defined by the official Ethereum Beacon Chain specification:
|
||||
// https://github.com/ethereum/consensus-specs/blob/v0.9.2/specs/core/0_beacon-chain.md#constants
|
||||
uint64 withdrawable_epoch = 8 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/consensus-types/primitives.Epoch"];
|
||||
|
||||
// New in Capella.
|
||||
//
|
||||
// Epoch when the validator's funds were withdrawn.
|
||||
// This field is FAR_FUTURE_EPOCH if the validator's withdrawal has not been processed.
|
||||
// FAR_FUTURE_EPOCH is a constant defined by the official Ethereum Beacon Chain specification:
|
||||
// https://github.com/ethereum/consensus-specs/blob/v0.9.2/specs/core/0_beacon-chain.md#constants
|
||||
uint64 fully_withdrawn_epoch = 9 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/consensus-types/primitives.Epoch"];
|
||||
}
|
||||
|
||||
// ValidatorParticipation stores participation metrics during a given epoch.
|
||||
message ValidatorParticipation {
|
||||
// Percentage of validator participation in the given epoch. This field
|
||||
|
||||
349
proto/prysm/v1alpha1/withdrawals.pb.go
generated
Executable file
349
proto/prysm/v1alpha1/withdrawals.pb.go
generated
Executable 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
|
||||
}
|
||||
4
proto/prysm/v1alpha1/withdrawals.pb.gw.go
Executable file
4
proto/prysm/v1alpha1/withdrawals.pb.gw.go
Executable file
@@ -0,0 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package ignore
|
||||
60
proto/prysm/v1alpha1/withdrawals.proto
Normal file
60
proto/prysm/v1alpha1/withdrawals.proto
Normal 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"];
|
||||
}
|
||||
|
||||
|
||||
29
runtime/logging/logrus-prefixed-formatter/BUILD.bazel
Normal file
29
runtime/logging/logrus-prefixed-formatter/BUILD.bazel
Normal file
@@ -0,0 +1,29 @@
|
||||
load("@prysm//tools/go:def.bzl", "go_library", "go_test")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["formatter.go"],
|
||||
importpath = "github.com/prysmaticlabs/prysm/runtime/logging/logrus-prefixed-formatter",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"@com_github_mgutz_ansi//:go_default_library",
|
||||
"@com_github_sirupsen_logrus//:go_default_library",
|
||||
"@org_golang_x_crypto//ssh/terminal:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
srcs = [
|
||||
"formatter_test.go",
|
||||
"logrus_prefixed_formatter_suite_test.go",
|
||||
],
|
||||
deps = [
|
||||
":go_default_library",
|
||||
"//testing/require:go_default_library",
|
||||
"@com_github_onsi_ginkgo//:go_default_library",
|
||||
"@com_github_onsi_gomega//:go_default_library",
|
||||
"@com_github_pkg_errors//:go_default_library",
|
||||
"@com_github_sirupsen_logrus//:go_default_library",
|
||||
],
|
||||
)
|
||||
21
runtime/logging/logrus-prefixed-formatter/LICENSE
Normal file
21
runtime/logging/logrus-prefixed-formatter/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Denis Parchenko
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
117
runtime/logging/logrus-prefixed-formatter/README.md
Normal file
117
runtime/logging/logrus-prefixed-formatter/README.md
Normal file
@@ -0,0 +1,117 @@
|
||||
# Logrus Prefixed Log Formatter
|
||||
|
||||
Originally from [github.com/x-cray/logrus-prefixed-formatter(https://github.com/x-cray/logrus-prefixed-formatter)
|
||||
|
||||
[Logrus](https://github.com/sirupsen/logrus) formatter mainly based on original `logrus.TextFormatter` but with slightly
|
||||
modified colored output and support for log entry prefixes, e.g. message source followed by a colon. In addition, custom
|
||||
color themes are supported.
|
||||
|
||||

|
||||
|
||||
Just like with the original `logrus.TextFormatter` when a TTY is not attached, the output is compatible with the
|
||||
[logfmt](http://godoc.org/github.com/kr/logfmt) format:
|
||||
|
||||
```text
|
||||
time="Oct 27 00:44:26" level=debug msg="Started observing beach" animal=walrus number=8
|
||||
time="Oct 27 00:44:26" level=info msg="A group of walrus emerges from the ocean" animal=walrus size=10
|
||||
time="Oct 27 00:44:26" level=warning msg="The group's number increased tremendously!" number=122 omg=true
|
||||
time="Oct 27 00:44:26" level=debug msg="Temperature changes" temperature=-4
|
||||
time="Oct 27 00:44:26" level=panic msg="It's over 9000!" animal=orca size=9009
|
||||
time="Oct 27 00:44:26" level=fatal msg="The ice breaks!" number=100 omg=true
|
||||
exit status 1
|
||||
```
|
||||
|
||||
## Installation
|
||||
To install formatter, use `go get`:
|
||||
|
||||
```sh
|
||||
$ go get github.com/prysmaticlabs/prysm/runtime/logging/logrus-prefixed-formatter
|
||||
```
|
||||
|
||||
## Usage
|
||||
Here is how it should be used:
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/sirupsen/logrus"
|
||||
prefixed "github.com/prysmaticlabs/prysm/runtime/logging/logrus-prefixed-formatter"
|
||||
)
|
||||
|
||||
var log = logrus.New()
|
||||
|
||||
func init() {
|
||||
log.Formatter = new(prefixed.TextFormatter)
|
||||
log.Level = logrus.DebugLevel
|
||||
}
|
||||
|
||||
func main() {
|
||||
log.WithFields(logrus.Fields{
|
||||
"prefix": "main",
|
||||
"animal": "walrus",
|
||||
"number": 8,
|
||||
}).Debug("Started observing beach")
|
||||
|
||||
log.WithFields(logrus.Fields{
|
||||
"prefix": "sensor",
|
||||
"temperature": -4,
|
||||
}).Info("Temperature changes")
|
||||
}
|
||||
```
|
||||
|
||||
## API
|
||||
`prefixed.TextFormatter` exposes the following fields and methods.
|
||||
|
||||
### Fields
|
||||
|
||||
* `ForceColors bool` — set to true to bypass checking for a TTY before outputting colors.
|
||||
* `DisableColors bool` — force disabling colors. For a TTY colors are enabled by default.
|
||||
* `DisableUppercase bool` — set to true to turn off the conversion of the log level names to uppercase.
|
||||
* `ForceFormatting bool` — force formatted layout, even for non-TTY output.
|
||||
* `DisableTimestamp bool` — disable timestamp logging. Useful when output is redirected to logging system that already adds timestamps.
|
||||
* `FullTimestamp bool` — enable logging the full timestamp when a TTY is attached instead of just the time passed since beginning of execution.
|
||||
* `TimestampFormat string` — timestamp format to use for display when a full timestamp is printed.
|
||||
* `DisableSorting bool` — the fields are sorted by default for a consistent output. For applications that log extremely frequently and don't use the JSON formatter this may not be desired.
|
||||
* `QuoteEmptyFields bool` — wrap empty fields in quotes if true.
|
||||
* `QuoteCharacter string` — can be set to the override the default quoting character `"` with something else. For example: `'`, or `` ` ``.
|
||||
* `SpacePadding int` — pad msg field with spaces on the right for display. The value for this parameter will be the size of padding. Its default value is zero, which means no padding will be applied.
|
||||
|
||||
### Methods
|
||||
|
||||
#### `SetColorScheme(colorScheme *prefixed.ColorScheme)`
|
||||
|
||||
Sets an alternative color scheme for colored output. `prefixed.ColorScheme` struct supports the following fields:
|
||||
* `InfoLevelStyle string` — info level style.
|
||||
* `WarnLevelStyle string` — warn level style.
|
||||
* `ErrorLevelStyle string` — error style.
|
||||
* `FatalLevelStyle string` — fatal level style.
|
||||
* `PanicLevelStyle string` — panic level style.
|
||||
* `DebugLevelStyle string` — debug level style.
|
||||
* `PrefixStyle string` — prefix style.
|
||||
* `TimestampStyle string` — timestamp style.
|
||||
|
||||
Color styles should be specified using [mgutz/ansi](https://github.com/mgutz/ansi#style-format) style syntax. For example, here is the default theme:
|
||||
|
||||
```go
|
||||
InfoLevelStyle: "green",
|
||||
WarnLevelStyle: "yellow",
|
||||
ErrorLevelStyle: "red",
|
||||
FatalLevelStyle: "red",
|
||||
PanicLevelStyle: "red",
|
||||
DebugLevelStyle: "blue",
|
||||
PrefixStyle: "cyan",
|
||||
TimestampStyle: "black+h"
|
||||
```
|
||||
|
||||
It's not necessary to specify all colors when changing color scheme if you want to change just specific ones:
|
||||
|
||||
```go
|
||||
formatter.SetColorScheme(&prefixed.ColorScheme{
|
||||
PrefixStyle: "blue+b",
|
||||
TimestampStyle: "white+h",
|
||||
})
|
||||
```
|
||||
|
||||
# License
|
||||
MIT
|
||||
387
runtime/logging/logrus-prefixed-formatter/formatter.go
Normal file
387
runtime/logging/logrus-prefixed-formatter/formatter.go
Normal file
@@ -0,0 +1,387 @@
|
||||
package prefixed
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/mgutz/ansi"
|
||||
"github.com/sirupsen/logrus"
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
)
|
||||
|
||||
const defaultTimestampFormat = time.RFC3339
|
||||
|
||||
var (
|
||||
baseTimestamp time.Time = time.Now()
|
||||
defaultColorScheme *ColorScheme = &ColorScheme{
|
||||
InfoLevelStyle: "green",
|
||||
WarnLevelStyle: "yellow",
|
||||
ErrorLevelStyle: "red",
|
||||
FatalLevelStyle: "red",
|
||||
PanicLevelStyle: "red",
|
||||
DebugLevelStyle: "blue",
|
||||
PrefixStyle: "cyan",
|
||||
TimestampStyle: "black+h",
|
||||
}
|
||||
noColorsColorScheme *compiledColorScheme = &compiledColorScheme{
|
||||
InfoLevelColor: ansi.ColorFunc(""),
|
||||
WarnLevelColor: ansi.ColorFunc(""),
|
||||
ErrorLevelColor: ansi.ColorFunc(""),
|
||||
FatalLevelColor: ansi.ColorFunc(""),
|
||||
PanicLevelColor: ansi.ColorFunc(""),
|
||||
DebugLevelColor: ansi.ColorFunc(""),
|
||||
PrefixColor: ansi.ColorFunc(""),
|
||||
TimestampColor: ansi.ColorFunc(""),
|
||||
}
|
||||
defaultCompiledColorScheme *compiledColorScheme = compileColorScheme(defaultColorScheme)
|
||||
)
|
||||
|
||||
func miniTS() int {
|
||||
return int(time.Since(baseTimestamp) / time.Second)
|
||||
}
|
||||
|
||||
type ColorScheme struct {
|
||||
InfoLevelStyle string
|
||||
WarnLevelStyle string
|
||||
ErrorLevelStyle string
|
||||
FatalLevelStyle string
|
||||
PanicLevelStyle string
|
||||
DebugLevelStyle string
|
||||
PrefixStyle string
|
||||
TimestampStyle string
|
||||
}
|
||||
|
||||
type compiledColorScheme struct {
|
||||
InfoLevelColor func(string) string
|
||||
WarnLevelColor func(string) string
|
||||
ErrorLevelColor func(string) string
|
||||
FatalLevelColor func(string) string
|
||||
PanicLevelColor func(string) string
|
||||
DebugLevelColor func(string) string
|
||||
PrefixColor func(string) string
|
||||
TimestampColor func(string) string
|
||||
}
|
||||
|
||||
type TextFormatter struct {
|
||||
// Set to true to bypass checking for a TTY before outputting colors.
|
||||
ForceColors bool
|
||||
|
||||
// Whether the logger's out is to a terminal.
|
||||
isTerminal bool
|
||||
|
||||
// Force disabling colors. For a TTY colors are enabled by default.
|
||||
DisableColors bool
|
||||
|
||||
// Force formatted layout, even for non-TTY output.
|
||||
ForceFormatting bool
|
||||
|
||||
// Disable timestamp logging. useful when output is redirected to logging
|
||||
// system that already adds timestamps.
|
||||
DisableTimestamp bool
|
||||
|
||||
// Disable the conversion of the log levels to uppercase
|
||||
DisableUppercase bool
|
||||
|
||||
// Enable logging the full timestamp when a TTY is attached instead of just
|
||||
// the time passed since beginning of execution.
|
||||
FullTimestamp bool
|
||||
|
||||
// The fields are sorted by default for a consistent output. For applications
|
||||
// that log extremely frequently and don't use the JSON formatter this may not
|
||||
// be desired.
|
||||
DisableSorting bool
|
||||
|
||||
// Wrap empty fields in quotes if true.
|
||||
QuoteEmptyFields bool
|
||||
|
||||
sync.Once
|
||||
|
||||
// Pad msg field with spaces on the right for display.
|
||||
// The value for this parameter will be the size of padding.
|
||||
// Its default value is zero, which means no padding will be applied for msg.
|
||||
SpacePadding int
|
||||
|
||||
// Color scheme to use.
|
||||
colorScheme *compiledColorScheme
|
||||
|
||||
// Can be set to the override the default quoting character "
|
||||
// with something else. For example: ', or `.
|
||||
QuoteCharacter string
|
||||
|
||||
// Timestamp format to use for display when a full timestamp is printed.
|
||||
TimestampFormat string
|
||||
}
|
||||
|
||||
func getCompiledColor(main string, fallback string) func(string) string {
|
||||
var style string
|
||||
if main != "" {
|
||||
style = main
|
||||
} else {
|
||||
style = fallback
|
||||
}
|
||||
return ansi.ColorFunc(style)
|
||||
}
|
||||
|
||||
func compileColorScheme(s *ColorScheme) *compiledColorScheme {
|
||||
return &compiledColorScheme{
|
||||
InfoLevelColor: getCompiledColor(s.InfoLevelStyle, defaultColorScheme.InfoLevelStyle),
|
||||
WarnLevelColor: getCompiledColor(s.WarnLevelStyle, defaultColorScheme.WarnLevelStyle),
|
||||
ErrorLevelColor: getCompiledColor(s.ErrorLevelStyle, defaultColorScheme.ErrorLevelStyle),
|
||||
FatalLevelColor: getCompiledColor(s.FatalLevelStyle, defaultColorScheme.FatalLevelStyle),
|
||||
PanicLevelColor: getCompiledColor(s.PanicLevelStyle, defaultColorScheme.PanicLevelStyle),
|
||||
DebugLevelColor: getCompiledColor(s.DebugLevelStyle, defaultColorScheme.DebugLevelStyle),
|
||||
PrefixColor: getCompiledColor(s.PrefixStyle, defaultColorScheme.PrefixStyle),
|
||||
TimestampColor: getCompiledColor(s.TimestampStyle, defaultColorScheme.TimestampStyle),
|
||||
}
|
||||
}
|
||||
|
||||
func (f *TextFormatter) init(entry *logrus.Entry) {
|
||||
if len(f.QuoteCharacter) == 0 {
|
||||
f.QuoteCharacter = "\""
|
||||
}
|
||||
if entry.Logger != nil {
|
||||
f.isTerminal = f.checkIfTerminal(entry.Logger.Out)
|
||||
}
|
||||
}
|
||||
|
||||
func (f *TextFormatter) checkIfTerminal(w io.Writer) bool {
|
||||
switch v := w.(type) {
|
||||
case *os.File:
|
||||
return terminal.IsTerminal(int(v.Fd()))
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func (f *TextFormatter) SetColorScheme(colorScheme *ColorScheme) {
|
||||
f.colorScheme = compileColorScheme(colorScheme)
|
||||
}
|
||||
|
||||
func (f *TextFormatter) Format(entry *logrus.Entry) ([]byte, error) {
|
||||
var b *bytes.Buffer
|
||||
var keys []string = make([]string, 0, len(entry.Data))
|
||||
for k := range entry.Data {
|
||||
keys = append(keys, k)
|
||||
}
|
||||
lastKeyIdx := len(keys) - 1
|
||||
|
||||
if !f.DisableSorting {
|
||||
sort.Strings(keys)
|
||||
}
|
||||
if entry.Buffer != nil {
|
||||
b = entry.Buffer
|
||||
} else {
|
||||
b = &bytes.Buffer{}
|
||||
}
|
||||
|
||||
prefixFieldClashes(entry.Data)
|
||||
|
||||
f.Do(func() { f.init(entry) })
|
||||
|
||||
isFormatted := f.ForceFormatting || f.isTerminal
|
||||
|
||||
timestampFormat := f.TimestampFormat
|
||||
if timestampFormat == "" {
|
||||
timestampFormat = defaultTimestampFormat
|
||||
}
|
||||
if isFormatted {
|
||||
isColored := (f.ForceColors || f.isTerminal) && !f.DisableColors
|
||||
var colorScheme *compiledColorScheme
|
||||
if isColored {
|
||||
if f.colorScheme == nil {
|
||||
colorScheme = defaultCompiledColorScheme
|
||||
} else {
|
||||
colorScheme = f.colorScheme
|
||||
}
|
||||
} else {
|
||||
colorScheme = noColorsColorScheme
|
||||
}
|
||||
if err := f.printColored(b, entry, keys, timestampFormat, colorScheme); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
if !f.DisableTimestamp {
|
||||
if err := f.appendKeyValue(b, "time", entry.Time.Format(timestampFormat), true); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if err := f.appendKeyValue(b, "level", entry.Level.String(), true); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if entry.Message != "" {
|
||||
if err := f.appendKeyValue(b, "msg", entry.Message, lastKeyIdx >= 0); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
for i, key := range keys {
|
||||
if err := f.appendKeyValue(b, key, entry.Data[key], lastKeyIdx != i); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if err := b.WriteByte('\n'); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b.Bytes(), nil
|
||||
}
|
||||
|
||||
func (f *TextFormatter) printColored(b *bytes.Buffer, entry *logrus.Entry, keys []string, timestampFormat string, colorScheme *compiledColorScheme) (err error) {
|
||||
var levelColor func(string) string
|
||||
var levelText string
|
||||
switch entry.Level {
|
||||
case logrus.InfoLevel:
|
||||
levelColor = colorScheme.InfoLevelColor
|
||||
case logrus.WarnLevel:
|
||||
levelColor = colorScheme.WarnLevelColor
|
||||
case logrus.ErrorLevel:
|
||||
levelColor = colorScheme.ErrorLevelColor
|
||||
case logrus.FatalLevel:
|
||||
levelColor = colorScheme.FatalLevelColor
|
||||
case logrus.PanicLevel:
|
||||
levelColor = colorScheme.PanicLevelColor
|
||||
default:
|
||||
levelColor = colorScheme.DebugLevelColor
|
||||
}
|
||||
|
||||
if entry.Level != logrus.WarnLevel {
|
||||
levelText = entry.Level.String()
|
||||
} else {
|
||||
levelText = "warn"
|
||||
}
|
||||
|
||||
if !f.DisableUppercase {
|
||||
levelText = strings.ToUpper(levelText)
|
||||
}
|
||||
|
||||
level := levelColor(fmt.Sprintf("%5s", levelText))
|
||||
prefix := ""
|
||||
message := entry.Message
|
||||
|
||||
if prefixValue, ok := entry.Data["prefix"]; ok {
|
||||
prefix = colorScheme.PrefixColor(" " + prefixValue.(string) + ":")
|
||||
} else {
|
||||
prefixValue, trimmedMsg := extractPrefix(entry.Message)
|
||||
if len(prefixValue) > 0 {
|
||||
prefix = colorScheme.PrefixColor(" " + prefixValue + ":")
|
||||
message = trimmedMsg
|
||||
}
|
||||
}
|
||||
|
||||
messageFormat := "%s"
|
||||
if f.SpacePadding != 0 {
|
||||
messageFormat = fmt.Sprintf("%%-%ds", f.SpacePadding)
|
||||
}
|
||||
|
||||
if f.DisableTimestamp {
|
||||
_, err = fmt.Fprintf(b, "%s%s "+messageFormat, level, prefix, message)
|
||||
} else {
|
||||
var timestamp string
|
||||
if !f.FullTimestamp {
|
||||
timestamp = fmt.Sprintf("[%04d]", miniTS())
|
||||
} else {
|
||||
timestamp = fmt.Sprintf("[%s]", entry.Time.Format(timestampFormat))
|
||||
}
|
||||
_, err = fmt.Fprintf(b, "%s %s%s "+messageFormat, colorScheme.TimestampColor(timestamp), level, prefix, message)
|
||||
}
|
||||
for _, k := range keys {
|
||||
if k != "prefix" {
|
||||
v := entry.Data[k]
|
||||
format := " %s=%+v"
|
||||
if k == logrus.ErrorKey {
|
||||
format = " %s=%v" // To avoid printing stack traces for errors
|
||||
}
|
||||
_, err = fmt.Fprintf(b, format, levelColor(k), v)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (f *TextFormatter) needsQuoting(text string) bool {
|
||||
if f.QuoteEmptyFields && len(text) == 0 {
|
||||
return true
|
||||
}
|
||||
for _, ch := range text {
|
||||
if !((ch >= 'a' && ch <= 'z') ||
|
||||
(ch >= 'A' && ch <= 'Z') ||
|
||||
(ch >= '0' && ch <= '9') ||
|
||||
ch == '-' || ch == '.') {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func extractPrefix(msg string) (string, string) {
|
||||
prefix := ""
|
||||
regex := regexp.MustCompile("^\\[(.*?)\\]")
|
||||
if regex.MatchString(msg) {
|
||||
match := regex.FindString(msg)
|
||||
prefix, msg = match[1:len(match)-1], strings.TrimSpace(msg[len(match):])
|
||||
}
|
||||
return prefix, msg
|
||||
}
|
||||
|
||||
func (f *TextFormatter) appendKeyValue(b *bytes.Buffer, key string, value interface{}, appendSpace bool) error {
|
||||
b.WriteString(key)
|
||||
b.WriteByte('=')
|
||||
if err := f.appendValue(b, value); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if appendSpace {
|
||||
return b.WriteByte(' ')
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (f *TextFormatter) appendValue(b *bytes.Buffer, value interface{}) (err error) {
|
||||
switch value := value.(type) {
|
||||
case string:
|
||||
if !f.needsQuoting(value) {
|
||||
_, err = b.WriteString(value)
|
||||
} else {
|
||||
_, err = fmt.Fprintf(b, "%s%v%s", f.QuoteCharacter, value, f.QuoteCharacter)
|
||||
}
|
||||
case error:
|
||||
errmsg := value.Error()
|
||||
if !f.needsQuoting(errmsg) {
|
||||
_, err = b.WriteString(errmsg)
|
||||
} else {
|
||||
_, err = fmt.Fprintf(b, "%s%v%s", f.QuoteCharacter, errmsg, f.QuoteCharacter)
|
||||
}
|
||||
default:
|
||||
_, err = fmt.Fprint(b, value)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// This is to not silently overwrite `time`, `msg` and `level` fields when
|
||||
// dumping it. If this code wasn't there doing:
|
||||
//
|
||||
// logrus.WithField("level", 1).Info("hello")
|
||||
//
|
||||
// would just silently drop the user provided level. Instead with this code
|
||||
// it'll be logged as:
|
||||
//
|
||||
// {"level": "info", "fields.level": 1, "msg": "hello", "time": "..."}
|
||||
func prefixFieldClashes(data logrus.Fields) {
|
||||
if t, ok := data["time"]; ok {
|
||||
data["fields.time"] = t
|
||||
}
|
||||
|
||||
if m, ok := data["msg"]; ok {
|
||||
data["fields.msg"] = m
|
||||
}
|
||||
|
||||
if l, ok := data["level"]; ok {
|
||||
data["fields.level"] = l
|
||||
}
|
||||
}
|
||||
73
runtime/logging/logrus-prefixed-formatter/formatter_test.go
Normal file
73
runtime/logging/logrus-prefixed-formatter/formatter_test.go
Normal file
@@ -0,0 +1,73 @@
|
||||
package prefixed_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
"testing"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
. "github.com/prysmaticlabs/prysm/runtime/logging/logrus-prefixed-formatter"
|
||||
"github.com/prysmaticlabs/prysm/testing/require"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
var _ = Describe("Formatter", func() {
|
||||
var formatter *TextFormatter
|
||||
var log *logrus.Logger
|
||||
var output *LogOutput
|
||||
|
||||
BeforeEach(func() {
|
||||
output = new(LogOutput)
|
||||
formatter = new(TextFormatter)
|
||||
log = logrus.New()
|
||||
log.Out = output
|
||||
log.Formatter = formatter
|
||||
log.Level = logrus.DebugLevel
|
||||
})
|
||||
|
||||
Describe("logfmt output", func() {
|
||||
It("should output simple message", func() {
|
||||
formatter.DisableTimestamp = true
|
||||
log.Debug("test")
|
||||
Ω(output.GetValue()).Should(Equal("level=debug msg=test\n"))
|
||||
})
|
||||
|
||||
It("should output message with additional field", func() {
|
||||
formatter.DisableTimestamp = true
|
||||
log.WithFields(logrus.Fields{"animal": "walrus"}).Debug("test")
|
||||
Ω(output.GetValue()).Should(Equal("level=debug msg=test animal=walrus\n"))
|
||||
})
|
||||
})
|
||||
|
||||
Describe("Formatted output", func() {
|
||||
It("should output formatted message", func() {
|
||||
formatter.DisableTimestamp = true
|
||||
formatter.ForceFormatting = true
|
||||
log.Debug("test")
|
||||
Ω(output.GetValue()).Should(Equal("DEBUG test\n"))
|
||||
})
|
||||
})
|
||||
|
||||
Describe("Theming support", func() {
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
func TestFormatter_SuppressErrorStackTraces(t *testing.T) {
|
||||
formatter := new(TextFormatter)
|
||||
formatter.ForceFormatting = true
|
||||
log := logrus.New()
|
||||
log.Formatter = formatter
|
||||
output := new(LogOutput)
|
||||
log.Out = output
|
||||
|
||||
errFn := func() error {
|
||||
return errors.New("inner")
|
||||
}
|
||||
|
||||
log.WithError(errors.Wrap(errFn(), "outer")).Error("test")
|
||||
require.Equal(t, true, regexp.MustCompile(`test error=outer: inner\n\s*$`).MatchString(output.GetValue()), fmt.Sprintf("wrong log output: %s", output.GetValue()))
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package prefixed_test
|
||||
|
||||
import (
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
"testing"
|
||||
)
|
||||
|
||||
type LogOutput struct {
|
||||
buffer string
|
||||
}
|
||||
|
||||
func (o *LogOutput) Write(p []byte) (int, error) {
|
||||
o.buffer += string(p)
|
||||
return len(p), nil
|
||||
}
|
||||
|
||||
func (o *LogOutput) GetValue() string {
|
||||
return o.buffer
|
||||
}
|
||||
|
||||
func TestLogrusPrefixedFormatter(t *testing.T) {
|
||||
RegisterFailHandler(Fail)
|
||||
RunSpecs(t, "LogrusPrefixedFormatter Suite")
|
||||
}
|
||||
@@ -42,6 +42,7 @@ test_suite(
|
||||
)
|
||||
|
||||
common_deps = [
|
||||
"//crypto/rand:go_default_library",
|
||||
"//api/client/beacon:go_default_library",
|
||||
"//beacon-chain/blockchain/testing:go_default_library",
|
||||
"//beacon-chain/core/transition:go_default_library",
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -15,6 +15,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/api/client/beacon"
|
||||
"github.com/prysmaticlabs/prysm/crypto/rand"
|
||||
"github.com/prysmaticlabs/prysm/encoding/bytesutil"
|
||||
"github.com/prysmaticlabs/prysm/io/file"
|
||||
enginev1 "github.com/prysmaticlabs/prysm/proto/engine/v1"
|
||||
@@ -665,6 +666,9 @@ func (r *testRunner) eeOffline(epoch uint64, _ []*grpc.ClientConn) bool {
|
||||
// After the proxy has been sending `SYNCING` responses to the beacon node, we
|
||||
// will test this with our optimistic sync evaluator to ensure everything works
|
||||
// as expected.
|
||||
// 4) We then start testing late blocks being proposed in the network. This is done via
|
||||
// our engine proxy, which would sleep for a random amount of time for our get payload
|
||||
// requests.
|
||||
func (r *testRunner) multiScenario(epoch uint64, conns []*grpc.ClientConn) bool {
|
||||
switch epoch {
|
||||
case 9:
|
||||
@@ -708,7 +712,33 @@ func (r *testRunner) multiScenario(epoch uint64, conns []*grpc.ClientConn) bool
|
||||
engineProxy.ReleaseBackedUpRequests("engine_newPayloadV1")
|
||||
|
||||
return true
|
||||
case 11, 12, 16, 17, 21, 22:
|
||||
case 24:
|
||||
component, err := r.comHandler.eth1Proxy.ComponentAtIndex(0)
|
||||
require.NoError(r.t, err)
|
||||
component.(e2etypes.EngineProxy).AddRequestInterceptor("engine_getPayloadV1", func() interface{} {
|
||||
return nil
|
||||
}, func() bool {
|
||||
// Have a random delay which is triggered here.
|
||||
gen := rand.NewDeterministicGenerator()
|
||||
genNum := gen.Int63()
|
||||
randFactor := ((time.Duration(params.BeaconConfig().SecondsPerSlot) * time.Second) * 1) / 12
|
||||
randomDelay := time.Duration(genNum) % randFactor
|
||||
fixedDelay := ((time.Duration(params.BeaconConfig().SecondsPerSlot) * time.Second) * 11) / 12
|
||||
timeToSleep := fixedDelay + randomDelay
|
||||
time.Sleep(timeToSleep)
|
||||
return false
|
||||
})
|
||||
return true
|
||||
case 26:
|
||||
// Disable Interceptor
|
||||
component, err := r.comHandler.eth1Proxy.ComponentAtIndex(0)
|
||||
require.NoError(r.t, err)
|
||||
engineProxy, ok := component.(e2etypes.EngineProxy)
|
||||
require.Equal(r.t, true, ok)
|
||||
engineProxy.RemoveRequestInterceptor("engine_getPayloadV1")
|
||||
|
||||
return true
|
||||
case 11, 12, 16, 17, 21, 22, 25, 27, 28:
|
||||
// Allow 2 epochs for the network to finalize again.
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func TestEndToEnd_MultiScenarioRun(t *testing.T) {
|
||||
runner := e2eMinimal(t, types.WithEpochs(22))
|
||||
runner := e2eMinimal(t, types.WithEpochs(29))
|
||||
|
||||
runner.config.Evaluators = scenarioEvals()
|
||||
runner.config.EvalInterceptor = runner.multiScenario
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user