Compare commits

...

26 Commits

Author SHA1 Message Date
Preston Van Loon
23d278b7c5 bazel run //:gazelle 2024-06-03 09:57:06 -05:00
jsvisa
a9c1911912 config/params: update build.bazel
Signed-off-by: jsvisa <delweng@gmail.com>
2024-06-02 00:54:51 +00:00
jsvisa
7fefa151be config/params: split testutils into normal,prod,dev
Signed-off-by: jsvisa <delweng@gmail.com>
2024-06-02 00:54:32 +00:00
Delweng
6c2508472e Merge branch 'develop' into beacon-p2p-datarace 2024-06-02 08:23:14 +08:00
Radosław Kapka
b08e691127 Organize validator flags (#14028)
* Organize validator flags

* whitespace

* fix comment in test

* remove unneeded flags
2024-05-31 18:36:18 +00:00
Radosław Kapka
968e82b02d EIP-7549 gRPC (part 1) (#14055)
* interfaces move

* build fix

* remove annoying warning

* more build fixes

* review

* core code

* tests part 1

* tests part 2

* TranslateParticipation doesn't need Electra

* remove unused function

* pending atts don't need Electra

* tests part 3

* build fixes

* review

* EIP-7549 gRPC part 1
2024-05-31 17:24:06 +00:00
james-prysm
de04ce8329 EIP-7002:Execution layer triggerable withdrawals (#14031)
* wip fixing 7002 branch

* fixing tests and functions

* fixing linting

* temp fix for transition

* adding unit tests for method

* fixing linting

* partial review from terence

* Update withdrawals.go

Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>

* Update withdrawals.go

Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>

* Update withdrawals.go

Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>

* Update beacon-chain/core/electra/withdrawals.go

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* addressing feedback

---------

Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
2024-05-31 16:55:49 +00:00
terence
5efecff631 Fix mockgen sh (#14068)
* Fix mockgen sh

* Radek's suggestion

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* Generate prysm chain client

---------

Co-authored-by: Radosław Kapka <rkapka@wp.pl>
2024-05-31 16:24:17 +00:00
Radosław Kapka
3ab759e163 One more validator client cleanup (#14048)
* interface names

* interface method names

* inspection

* regenerate pb and mock

* Revert beacon node changes

* build fix

* review

* more functions

* combine parameters
2024-05-31 15:53:58 +00:00
james-prysm
836d369c6c api fix for panic on unsynced unfound block (#14063)
* api fix for panic

* adding test

* fixing how we handle the error
2024-05-31 14:46:38 +00:00
Nishant Das
568273453b Update Libp2p Dependencies (#14060)
* Update to v0.35.0 and v0.11.0

* Update Protobuf

* Update bazel deps
2024-05-30 08:56:55 +00:00
jsvisa
d9afce3861 config/params: move SetActiveTestCleanup to develop only
Signed-off-by: jsvisa <delweng@gmail.com>
2024-05-08 03:18:42 +00:00
Delweng
9fd889e48f Merge branch 'develop' into beacon-p2p-datarace 2024-05-08 08:42:16 +08:00
Preston Van Loon
39b81ea555 remove go:test constraints, gocheckcompilerdirectives 2024-05-07 16:52:46 -05:00
Preston Van Loon
f3eeab7d80 Merge branch 'develop' of github.com:prysmaticlabs/prysm into beacon-p2p-datarace 2024-05-07 15:51:35 -05:00
jsvisa
33d3f078e8 cofig/params: bazel build
Signed-off-by: jsvisa <delweng@gmail.com>
2023-12-14 05:10:13 +00:00
jsvisa
2e5b3c59fa config/params: add network_config_{develop,prod} to bazel build
Signed-off-by: jsvisa <delweng@gmail.com>
2023-12-14 02:44:16 +00:00
Delweng
bcc02ee913 Merge branch 'develop' into beacon-p2p-datarace 2023-12-13 21:15:59 +08:00
Delweng
b9064d704f Merge branch 'develop' into beacon-p2p-datarace 2023-12-13 20:29:09 +08:00
Delweng
17402180f8 Merge branch 'develop' into beacon-p2p-datarace 2023-12-05 21:26:06 +08:00
jsvisa
4f00c0b487 beacon-chainn/p2p: avoid datarate
Signed-off-by: jsvisa <delweng@gmail.com>
2023-12-02 12:11:14 +00:00
jsvisa
f29f76cbf2 beacon-chain/p2p: don't modify pollingPeriod
Signed-off-by: jsvisa <delweng@gmail.com>
2023-12-02 12:11:14 +00:00
jsvisa
aab101a4bc config/params: rw network config lock or not
Signed-off-by: jsvisa <delweng@gmail.com>
2023-12-02 12:11:12 +00:00
jsvisa
82c3c11335 config/params: setActive with lock
Signed-off-by: jsvisa <delweng@gmail.com>
2023-12-02 12:10:23 +00:00
jsvisa
859b9d8a7e config/params: apply develop tag for go:test
Signed-off-by: jsvisa <delweng@gmail.com>
2023-12-02 12:10:22 +00:00
jsvisa
6c76232203 beacon-chain/p2p: use atomic.Bool instead of bool for concurrent rw
Signed-off-by: jsvisa <delweng@gmail.com>
2023-12-02 12:10:22 +00:00
154 changed files with 4713 additions and 2701 deletions

View File

@@ -22,6 +22,7 @@ go_library(
"//beacon-chain/core/helpers:go_default_library",
"//beacon-chain/core/signing:go_default_library",
"//beacon-chain/core/time:go_default_library",
"//beacon-chain/core/validators:go_default_library",
"//beacon-chain/state:go_default_library",
"//beacon-chain/state/state-native:go_default_library",
"//config/params:go_default_library",
@@ -32,7 +33,9 @@ go_library(
"//proto/engine/v1:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",
"//time/slots:go_default_library",
"@com_github_ethereum_go_ethereum//common/hexutil:go_default_library",
"@com_github_pkg_errors//:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@io_opencensus_go//trace:go_default_library",
],
)
@@ -46,6 +49,7 @@ go_test(
"effective_balance_updates_test.go",
"upgrade_test.go",
"validator_test.go",
"withdrawals_test.go",
],
deps = [
":go_default_library",
@@ -63,8 +67,12 @@ go_test(
"//proto/engine/v1:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",
"//runtime/interop:go_default_library",
"//testing/assert:go_default_library",
"//testing/require:go_default_library",
"//testing/util:go_default_library",
"//time/slots:go_default_library",
"@com_github_ethereum_go_ethereum//common/hexutil:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@com_github_sirupsen_logrus//hooks/test:go_default_library",
],
)

View File

@@ -73,10 +73,12 @@ func ProcessEpoch(ctx context.Context, state state.BeaconState) (state.BeaconSta
if err != nil {
return nil, errors.Wrap(err, "could not process rewards and penalties")
}
state, err = ProcessRegistryUpdates(ctx, state)
if err != nil {
return nil, errors.Wrap(err, "could not process registry updates")
}
proportionalSlashingMultiplier, err := state.ProportionalSlashingMultiplier()
if err != nil {
return nil, err
@@ -89,6 +91,7 @@ func ProcessEpoch(ctx context.Context, state state.BeaconState) (state.BeaconSta
if err != nil {
return nil, err
}
if err = ProcessPendingBalanceDeposits(ctx, state, primitives.Gwei(bp.ActiveCurrentEpoch)); err != nil {
return nil, err
}
@@ -98,6 +101,7 @@ func ProcessEpoch(ctx context.Context, state state.BeaconState) (state.BeaconSta
if err := ProcessEffectiveBalanceUpdates(state); err != nil {
return nil, err
}
state, err = ProcessSlashingsReset(state)
if err != nil {
return nil, err

View File

@@ -1,13 +1,25 @@
package electra
import (
"bytes"
"context"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/pkg/errors"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/validators"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/state"
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v5/encoding/bytesutil"
enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/time/slots"
log "github.com/sirupsen/logrus"
"go.opencensus.io/trace"
)
// ProcessExecutionLayerWithdrawRequests processes the validator withdrawals from the provided execution payload
// ProcessExecutionLayerWithdrawalRequests processes the validator withdrawals from the provided execution payload
// into the beacon state triggered by the execution layer.
//
// Spec pseudocode definition:
@@ -74,7 +86,109 @@ import (
// amount=to_withdraw,
// withdrawable_epoch=withdrawable_epoch,
// ))
func ProcessExecutionLayerWithdrawRequests(ctx context.Context, st state.BeaconState, wrs []*enginev1.ExecutionLayerWithdrawalRequest) (state.BeaconState, error) {
//TODO: replace with real implementation
func ProcessExecutionLayerWithdrawalRequests(ctx context.Context, st state.BeaconState, wrs []*enginev1.ExecutionLayerWithdrawalRequest) (state.BeaconState, error) {
ctx, span := trace.StartSpan(ctx, "electra.ProcessExecutionLayerWithdrawalRequests")
defer span.End()
currentEpoch := slots.ToEpoch(st.Slot())
for _, wr := range wrs {
if wr == nil {
return nil, errors.New("nil execution layer withdrawal request")
}
amount := wr.Amount
isFullExitRequest := amount == params.BeaconConfig().FullExitRequestAmount
// If partial withdrawal queue is full, only full exits are processed
if n, err := st.NumPendingPartialWithdrawals(); err != nil {
return nil, err
} else if n == params.BeaconConfig().PendingPartialWithdrawalsLimit && !isFullExitRequest {
// if the PendingPartialWithdrawalsLimit is met, the user would have paid for a partial withdrawal that's not included
log.Debugln("Skipping execution layer withdrawal request, PendingPartialWithdrawalsLimit reached")
continue
}
vIdx, exists := st.ValidatorIndexByPubkey(bytesutil.ToBytes48(wr.ValidatorPubkey))
if !exists {
log.Debugf("Skipping execution layer withdrawal request, validator index for %s not found\n", hexutil.Encode(wr.ValidatorPubkey))
continue
}
validator, err := st.ValidatorAtIndex(vIdx)
if err != nil {
return nil, err
}
// Verify withdrawal credentials
hasCorrectCredential := helpers.HasExecutionWithdrawalCredentials(validator)
isCorrectSourceAddress := bytes.Equal(validator.WithdrawalCredentials[12:], wr.SourceAddress)
if !hasCorrectCredential || !isCorrectSourceAddress {
log.Debugln("Skipping execution layer withdrawal request, wrong withdrawal credentials")
continue
}
// Verify the validator is active.
if !helpers.IsActiveValidator(validator, currentEpoch) {
log.Debugln("Skipping execution layer withdrawal request, validator not active")
continue
}
// Verify the validator has not yet submitted an exit.
if validator.ExitEpoch != params.BeaconConfig().FarFutureEpoch {
log.Debugln("Skipping execution layer withdrawal request, validator has submitted an exit already")
continue
}
// Verify the validator has been active long enough.
if currentEpoch < validator.ActivationEpoch.AddEpoch(params.BeaconConfig().ShardCommitteePeriod) {
log.Debugln("Skipping execution layer withdrawal request, validator has not been active long enough")
continue
}
pendingBalanceToWithdraw, err := st.PendingBalanceToWithdraw(vIdx)
if err != nil {
return nil, err
}
if isFullExitRequest {
// Only exit validator if it has no pending withdrawals in the queue
if pendingBalanceToWithdraw == 0 {
maxExitEpoch, churn := validators.MaxExitEpochAndChurn(st)
var err error
st, _, err = validators.InitiateValidatorExit(ctx, st, vIdx, maxExitEpoch, churn)
if err != nil {
return nil, err
}
}
continue
}
hasSufficientEffectiveBalance := validator.EffectiveBalance >= params.BeaconConfig().MinActivationBalance
vBal, err := st.BalanceAtIndex(vIdx)
if err != nil {
return nil, err
}
hasExcessBalance := vBal > params.BeaconConfig().MinActivationBalance+pendingBalanceToWithdraw
// Only allow partial withdrawals with compounding withdrawal credentials
if helpers.HasCompoundingWithdrawalCredential(validator) && hasSufficientEffectiveBalance && hasExcessBalance {
// Spec definition:
// to_withdraw = min(
// state.balances[index] - MIN_ACTIVATION_BALANCE - pending_balance_to_withdraw,
// amount
// )
// note: you can safely subtract these values because haxExcessBalance is checked
toWithdraw := min(vBal-params.BeaconConfig().MinActivationBalance-pendingBalanceToWithdraw, amount)
exitQueueEpoch, err := st.ExitEpochAndUpdateChurn(primitives.Gwei(toWithdraw))
if err != nil {
return nil, err
}
// safe add the uint64 to avoid overflow
withdrawableEpoch, err := exitQueueEpoch.SafeAddEpoch(params.BeaconConfig().MinValidatorWithdrawabilityDelay)
if err != nil {
return nil, errors.Wrap(err, "failed to add withdrawability delay to exit queue epoch")
}
if err := st.AppendPendingPartialWithdrawal(&ethpb.PendingPartialWithdrawal{
Index: vIdx,
Amount: toWithdraw,
WithdrawableEpoch: withdrawableEpoch,
}); err != nil {
return nil, err
}
}
}
return st, nil
}

View File

@@ -0,0 +1,295 @@
package electra_test
import (
"context"
"testing"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/state"
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v5/encoding/bytesutil"
enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1"
eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/testing/assert"
"github.com/prysmaticlabs/prysm/v5/testing/require"
"github.com/prysmaticlabs/prysm/v5/testing/util"
"github.com/sirupsen/logrus"
"github.com/sirupsen/logrus/hooks/test"
)
func TestProcessExecutionLayerWithdrawRequests(t *testing.T) {
logHook := test.NewGlobal()
source, err := hexutil.Decode("0xb20a608c624Ca5003905aA834De7156C68b2E1d0")
require.NoError(t, err)
st, _ := util.DeterministicGenesisStateElectra(t, 1)
currentSlot := primitives.Slot(uint64(params.BeaconConfig().SlotsPerEpoch)*uint64(params.BeaconConfig().ShardCommitteePeriod) + 1)
require.NoError(t, st.SetSlot(currentSlot))
val, err := st.ValidatorAtIndex(0)
require.NoError(t, err)
type args struct {
st state.BeaconState
wrs []*enginev1.ExecutionLayerWithdrawalRequest
}
tests := []struct {
name string
args args
wantFn func(t *testing.T, got state.BeaconState)
wantErr bool
}{
{
name: "happy path exit and withdrawal only",
args: args{
st: func() state.BeaconState {
preSt := st.Copy()
require.NoError(t, preSt.AppendPendingPartialWithdrawal(&eth.PendingPartialWithdrawal{
Index: 0,
Amount: params.BeaconConfig().FullExitRequestAmount,
WithdrawableEpoch: 0,
}))
v, err := preSt.ValidatorAtIndex(0)
require.NoError(t, err)
prefix := make([]byte, 12)
prefix[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte
v.WithdrawalCredentials = append(prefix, source...)
require.NoError(t, preSt.SetValidators([]*eth.Validator{v}))
return preSt
}(),
wrs: []*enginev1.ExecutionLayerWithdrawalRequest{
{
SourceAddress: source,
ValidatorPubkey: bytesutil.SafeCopyBytes(val.PublicKey),
Amount: params.BeaconConfig().FullExitRequestAmount,
},
},
},
wantFn: func(t *testing.T, got state.BeaconState) {
wantPostSt := st.Copy()
v, err := wantPostSt.ValidatorAtIndex(0)
require.NoError(t, err)
prefix := make([]byte, 12)
prefix[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte
v.WithdrawalCredentials = append(prefix, source...)
v.ExitEpoch = 261
v.WithdrawableEpoch = 517
require.NoError(t, wantPostSt.SetValidators([]*eth.Validator{v}))
require.NoError(t, wantPostSt.AppendPendingPartialWithdrawal(&eth.PendingPartialWithdrawal{
Index: 0,
Amount: params.BeaconConfig().FullExitRequestAmount,
WithdrawableEpoch: 0,
}))
_, err = wantPostSt.ExitEpochAndUpdateChurn(primitives.Gwei(v.EffectiveBalance))
require.NoError(t, err)
require.DeepEqual(t, wantPostSt.Validators(), got.Validators())
webc, err := wantPostSt.ExitBalanceToConsume()
require.NoError(t, err)
gebc, err := got.ExitBalanceToConsume()
require.NoError(t, err)
require.DeepEqual(t, webc, gebc)
weee, err := wantPostSt.EarliestExitEpoch()
require.NoError(t, err)
geee, err := got.EarliestExitEpoch()
require.NoError(t, err)
require.DeepEqual(t, weee, geee)
},
},
{
name: "happy path has compounding",
args: args{
st: func() state.BeaconState {
preSt := st.Copy()
require.NoError(t, preSt.AppendPendingPartialWithdrawal(&eth.PendingPartialWithdrawal{
Index: 0,
Amount: params.BeaconConfig().FullExitRequestAmount,
WithdrawableEpoch: 0,
}))
v, err := preSt.ValidatorAtIndex(0)
require.NoError(t, err)
prefix := make([]byte, 12)
prefix[0] = params.BeaconConfig().CompoundingWithdrawalPrefixByte
v.WithdrawalCredentials = append(prefix, source...)
require.NoError(t, preSt.SetValidators([]*eth.Validator{v}))
bal, err := preSt.BalanceAtIndex(0)
require.NoError(t, err)
bal += 200
require.NoError(t, preSt.SetBalances([]uint64{bal}))
require.NoError(t, preSt.AppendPendingPartialWithdrawal(&eth.PendingPartialWithdrawal{
Index: 0,
Amount: 100,
WithdrawableEpoch: 0,
}))
return preSt
}(),
wrs: []*enginev1.ExecutionLayerWithdrawalRequest{
{
SourceAddress: source,
ValidatorPubkey: bytesutil.SafeCopyBytes(val.PublicKey),
Amount: 100,
},
},
},
wantFn: func(t *testing.T, got state.BeaconState) {
wantPostSt := st.Copy()
v, err := wantPostSt.ValidatorAtIndex(0)
require.NoError(t, err)
prefix := make([]byte, 12)
prefix[0] = params.BeaconConfig().CompoundingWithdrawalPrefixByte
v.WithdrawalCredentials = append(prefix, source...)
require.NoError(t, wantPostSt.SetValidators([]*eth.Validator{v}))
bal, err := wantPostSt.BalanceAtIndex(0)
require.NoError(t, err)
bal += 200
require.NoError(t, wantPostSt.SetBalances([]uint64{bal}))
require.NoError(t, wantPostSt.AppendPendingPartialWithdrawal(&eth.PendingPartialWithdrawal{
Index: 0,
Amount: 0,
WithdrawableEpoch: 0,
}))
require.NoError(t, wantPostSt.AppendPendingPartialWithdrawal(&eth.PendingPartialWithdrawal{
Index: 0,
Amount: 100,
WithdrawableEpoch: 0,
}))
require.NoError(t, wantPostSt.AppendPendingPartialWithdrawal(&eth.PendingPartialWithdrawal{
Index: 0,
Amount: 100,
WithdrawableEpoch: 517,
}))
wnppw, err := wantPostSt.NumPendingPartialWithdrawals()
require.NoError(t, err)
gnppw, err := got.NumPendingPartialWithdrawals()
require.NoError(t, err)
require.Equal(t, wnppw, gnppw)
wece, err := wantPostSt.EarliestConsolidationEpoch()
require.NoError(t, err)
gece, err := got.EarliestConsolidationEpoch()
require.NoError(t, err)
require.Equal(t, wece, gece)
_, err = wantPostSt.ExitEpochAndUpdateChurn(primitives.Gwei(100))
require.NoError(t, err)
require.DeepEqual(t, wantPostSt.Validators(), got.Validators())
webc, err := wantPostSt.ExitBalanceToConsume()
require.NoError(t, err)
gebc, err := got.ExitBalanceToConsume()
require.NoError(t, err)
require.DeepEqual(t, webc, gebc)
},
},
{
name: "validator already submitted exit",
args: args{
st: func() state.BeaconState {
preSt := st.Copy()
v, err := preSt.ValidatorAtIndex(0)
require.NoError(t, err)
prefix := make([]byte, 12)
prefix[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte
v.WithdrawalCredentials = append(prefix, source...)
v.ExitEpoch = 1000
require.NoError(t, preSt.SetValidators([]*eth.Validator{v}))
return preSt
}(),
wrs: []*enginev1.ExecutionLayerWithdrawalRequest{
{
SourceAddress: source,
ValidatorPubkey: bytesutil.SafeCopyBytes(val.PublicKey),
Amount: params.BeaconConfig().FullExitRequestAmount,
},
},
},
wantFn: func(t *testing.T, got state.BeaconState) {
wantPostSt := st.Copy()
v, err := wantPostSt.ValidatorAtIndex(0)
require.NoError(t, err)
prefix := make([]byte, 12)
prefix[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte
v.WithdrawalCredentials = append(prefix, source...)
v.ExitEpoch = 1000
require.NoError(t, wantPostSt.SetValidators([]*eth.Validator{v}))
eee, err := got.EarliestExitEpoch()
require.NoError(t, err)
require.Equal(t, eee, primitives.Epoch(0))
require.DeepEqual(t, wantPostSt.Validators(), got.Validators())
},
},
{
name: "validator too new",
args: args{
st: func() state.BeaconState {
preSt := st.Copy()
require.NoError(t, preSt.SetSlot(0))
v, err := preSt.ValidatorAtIndex(0)
require.NoError(t, err)
prefix := make([]byte, 12)
prefix[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte
v.WithdrawalCredentials = append(prefix, source...)
require.NoError(t, preSt.SetValidators([]*eth.Validator{v}))
return preSt
}(),
wrs: []*enginev1.ExecutionLayerWithdrawalRequest{
{
SourceAddress: source,
ValidatorPubkey: bytesutil.SafeCopyBytes(val.PublicKey),
Amount: params.BeaconConfig().FullExitRequestAmount,
},
},
},
wantFn: func(t *testing.T, got state.BeaconState) {
wantPostSt := st.Copy()
require.NoError(t, wantPostSt.SetSlot(0))
v, err := wantPostSt.ValidatorAtIndex(0)
require.NoError(t, err)
prefix := make([]byte, 12)
prefix[0] = params.BeaconConfig().ETH1AddressWithdrawalPrefixByte
v.WithdrawalCredentials = append(prefix, source...)
require.NoError(t, wantPostSt.SetValidators([]*eth.Validator{v}))
eee, err := got.EarliestExitEpoch()
require.NoError(t, err)
require.Equal(t, eee, primitives.Epoch(0))
require.DeepEqual(t, wantPostSt.Validators(), got.Validators())
},
},
{
name: "PendingPartialWithdrawalsLimit reached with partial withdrawal results in a skip",
args: args{
st: func() state.BeaconState {
cfg := params.BeaconConfig().Copy()
cfg.PendingPartialWithdrawalsLimit = 1
params.OverrideBeaconConfig(cfg)
logrus.SetLevel(logrus.DebugLevel)
preSt := st.Copy()
require.NoError(t, preSt.AppendPendingPartialWithdrawal(&eth.PendingPartialWithdrawal{
Index: 0,
Amount: params.BeaconConfig().FullExitRequestAmount,
WithdrawableEpoch: 0,
}))
return preSt
}(),
wrs: []*enginev1.ExecutionLayerWithdrawalRequest{
{
SourceAddress: source,
ValidatorPubkey: bytesutil.SafeCopyBytes(val.PublicKey),
Amount: 100,
},
},
},
wantFn: func(t *testing.T, got state.BeaconState) {
assert.LogsContain(t, logHook, "Skipping execution layer withdrawal request, PendingPartialWithdrawalsLimit reached")
params.SetupTestConfigCleanup(t)
logrus.SetLevel(logrus.InfoLevel) // reset
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := electra.ProcessExecutionLayerWithdrawalRequests(context.Background(), tt.args.st, tt.args.wrs)
if (err != nil) != tt.wantErr {
t.Errorf("ProcessExecutionLayerWithdrawalRequests() error = %v, wantErr %v", err, tt.wantErr)
return
}
tt.wantFn(t, got)
})
}
}

View File

@@ -500,11 +500,11 @@ func LastActivatedValidatorIndex(ctx context.Context, st state.ReadOnlyBeaconSta
// hasETH1WithdrawalCredential returns whether the validator has an ETH1
// Withdrawal prefix. It assumes that the caller has a lock on the state
func HasETH1WithdrawalCredential(val *ethpb.Validator) bool {
func HasETH1WithdrawalCredential(val interfaces.WithWithdrawalCredentials) bool {
if val == nil {
return false
}
return isETH1WithdrawalCredential(val.WithdrawalCredentials)
return isETH1WithdrawalCredential(val.GetWithdrawalCredentials())
}
func isETH1WithdrawalCredential(creds []byte) bool {

View File

@@ -445,11 +445,12 @@ func electraOperations(
if !ok {
return nil, errors.New("could not cast execution data to electra execution data")
}
st, err = electra.ProcessExecutionLayerWithdrawRequests(ctx, st, exe.WithdrawalRequests())
st, err = electra.ProcessExecutionLayerWithdrawalRequests(ctx, st, exe.WithdrawalRequests())
if err != nil {
return nil, errors.Wrap(err, "could not process execution layer withdrawal requests")
}
st, err = electra.ProcessDepositReceipts(ctx, st, exe.DepositReceipts())
st, err = electra.ProcessDepositReceipts(ctx, st, exe.DepositReceipts()) // TODO: EIP-6110 deposit changes.
if err != nil {
return nil, errors.Wrap(err, "could not process deposit receipts")
}

View File

@@ -226,13 +226,6 @@ func TestService_BroadcastAttestationWithDiscoveryAttempts(t *testing.T) {
require.NoError(t, err)
defer bootListener.Close()
// Use shorter period for testing.
currentPeriod := pollingPeriod
pollingPeriod = 1 * time.Second
defer func() {
pollingPeriod = currentPeriod
}()
bootNode := bootListener.Self()
subnet := uint64(5)

View File

@@ -42,7 +42,7 @@ func (s *Service) InterceptAddrDial(pid peer.ID, m multiaddr.Multiaddr) (allow b
// InterceptAccept checks whether the incidental inbound connection is allowed.
func (s *Service) InterceptAccept(n network.ConnMultiaddrs) (allow bool) {
// Deny all incoming connections before we are ready
if !s.started {
if !s.Started() {
return false
}
if !s.validateDial(n.RemoteMultiaddr()) {

View File

@@ -40,7 +40,7 @@ func TestPeer_AtMaxLimit(t *testing.T) {
s.cfg = &Config{MaxPeers: 0}
s.addrFilter, err = configureFilter(&Config{})
require.NoError(t, err)
s.started = true
s.started.Store(true)
h1, err := libp2p.New([]libp2p.Option{privKeyOption(pkey), libp2p.ListenAddrs(listen), libp2p.ConnectionGater(s)}...)
require.NoError(t, err)
s.host = h1
@@ -84,7 +84,7 @@ func TestService_InterceptBannedIP(t *testing.T) {
ip := "212.67.10.122"
multiAddress, err := ma.NewMultiaddr(fmt.Sprintf("/ip4/%s/tcp/%d", ip, 3000))
require.NoError(t, err)
s.started = true
s.started.Store(true)
for i := 0; i < ipBurst; i++ {
valid := s.validateDial(multiAddress)
@@ -122,7 +122,7 @@ func TestService_RejectInboundConnectionBeforeStarted(t *testing.T) {
t.Errorf("Expected multiaddress with ip %s to be rejected as p2p service is not ready", ip)
}
s.started = true
s.started.Store(true)
valid = s.InterceptAccept(&maEndpoints{raddr: multiAddress})
if !valid {
t.Errorf("Expected multiaddress with ip %s to be accepted after service is started", ip)
@@ -146,7 +146,7 @@ func TestService_RejectInboundPeersBeyondLimit(t *testing.T) {
ip := "212.67.10.122"
multiAddress, err := ma.NewMultiaddr(fmt.Sprintf("/ip4/%s/tcp/%d", ip, 3000))
require.NoError(t, err)
s.started = true
s.started.Store(true)
valid := s.InterceptAccept(&maEndpoints{raddr: multiAddress})
if !valid {
@@ -191,7 +191,7 @@ func TestPeer_BelowMaxLimit(t *testing.T) {
h1, err := libp2p.New([]libp2p.Option{privKeyOption(pkey), libp2p.ListenAddrs(listen), libp2p.ConnectionGater(s)}...)
require.NoError(t, err)
s.host = h1
s.started = true
s.started.Store(true)
defer func() {
err := h1.Close()
require.NoError(t, err)
@@ -237,7 +237,7 @@ func TestPeerAllowList(t *testing.T) {
h1, err := libp2p.New([]libp2p.Option{privKeyOption(pkey), libp2p.ListenAddrs(listen), libp2p.ConnectionGater(s)}...)
require.NoError(t, err)
s.host = h1
s.started = true
s.started.Store(true)
defer func() {
err := h1.Close()
require.NoError(t, err)
@@ -284,7 +284,7 @@ func TestPeerDenyList(t *testing.T) {
h1, err := libp2p.New([]libp2p.Option{privKeyOption(pkey), libp2p.ListenAddrs(listen), libp2p.ConnectionGater(s)}...)
require.NoError(t, err)
s.host = h1
s.started = true
s.started.Store(true)
defer func() {
err := h1.Close()
require.NoError(t, err)

View File

@@ -7,6 +7,7 @@ import (
"context"
"crypto/ecdsa"
"sync"
"sync/atomic"
"time"
"github.com/ethereum/go-ethereum/p2p/enode"
@@ -54,7 +55,7 @@ var maxDialTimeout = params.BeaconConfig().RespTimeoutDuration()
// Service for managing peer to peer (p2p) networking.
type Service struct {
started bool
started atomic.Bool
isPreGenesis bool
pingMethod func(ctx context.Context, id peer.ID) error
pingMethodLock sync.RWMutex
@@ -173,7 +174,7 @@ func NewService(ctx context.Context, cfg *Config) (*Service, error) {
// Start the p2p service.
func (s *Service) Start() {
if s.started {
if s.Started() {
log.Error("Attempted to start p2p service when it was already started")
return
}
@@ -212,7 +213,7 @@ func (s *Service) Start() {
go s.listenForNewNodes()
}
s.started = true
s.started.Store(true)
if len(s.cfg.StaticPeers) > 0 {
addrs, err := PeersFromStringAddrs(s.cfg.StaticPeers)
@@ -278,7 +279,7 @@ func (s *Service) Start() {
// Stop the p2p service and terminate all peer connections.
func (s *Service) Stop() error {
defer s.cancel()
s.started = false
s.started.Store(false)
if s.dv5Listener != nil {
s.dv5Listener.Close()
}
@@ -291,7 +292,7 @@ func (s *Service) Status() error {
if s.isPreGenesis {
return nil
}
if !s.started {
if !s.started.Load() {
return errors.New("not running")
}
if s.startupErr != nil {
@@ -305,7 +306,7 @@ func (s *Service) Status() error {
// Started returns true if the p2p service has successfully started.
func (s *Service) Started() bool {
return s.started
return s.started.Load()
}
// Encoding returns the configured networking encoding.

View File

@@ -83,10 +83,10 @@ func TestService_Stop_SetsStartedToFalse(t *testing.T) {
params.SetupTestConfigCleanup(t)
s, err := NewService(context.Background(), &Config{StateNotifier: &mock.MockStateNotifier{}})
require.NoError(t, err)
s.started = true
s.started.Store(true)
s.dv5Listener = &mockListener{}
assert.NoError(t, s.Stop())
assert.Equal(t, false, s.started)
assert.Equal(t, false, s.Started())
}
func TestService_Stop_DontPanicIfDv5ListenerIsNotInited(t *testing.T) {
@@ -118,7 +118,7 @@ func TestService_Start_OnlyStartsOnce(t *testing.T) {
var vr [32]byte
require.NoError(t, cs.SetClock(startup.NewClock(time.Now(), vr)))
time.Sleep(time.Second * 2)
assert.Equal(t, true, s.started, "Expected service to be started")
assert.Equal(t, true, s.Started(), "Expected service to be started")
s.Start()
require.LogsContain(t, hook, "Attempted to start p2p service when it was already started")
require.NoError(t, s.Stop())
@@ -127,14 +127,15 @@ func TestService_Start_OnlyStartsOnce(t *testing.T) {
func TestService_Status_NotRunning(t *testing.T) {
params.SetupTestConfigCleanup(t)
s := &Service{started: false}
s := &Service{}
s.dv5Listener = &mockListener{}
assert.ErrorContains(t, "not running", s.Status(), "Status returned wrong error")
}
func TestService_Status_NoGenesisTimeSet(t *testing.T) {
params.SetupTestConfigCleanup(t)
s := &Service{started: true}
s := &Service{}
s.started.Store(true)
s.dv5Listener = &mockListener{}
assert.ErrorContains(t, "no genesis time set", s.Status(), "Status returned wrong error")
@@ -201,13 +202,6 @@ func TestListenForNewNodes(t *testing.T) {
require.NoError(t, err)
defer bootListener.Close()
// Use shorter period for testing.
currentPeriod := pollingPeriod
pollingPeriod = 1 * time.Second
defer func() {
pollingPeriod = currentPeriod
}()
bootNode := bootListener.Self()
var listeners []*discover.UDPv5
@@ -308,11 +302,16 @@ func TestService_JoinLeaveTopic(t *testing.T) {
s, err := NewService(ctx, &Config{StateNotifier: &mock.MockStateNotifier{}, ClockWaiter: gs})
require.NoError(t, err)
go s.awaitStateInitialized()
wait := make(chan struct{})
go func() {
s.awaitStateInitialized()
wait <- struct{}{}
}()
fd := initializeStateWithForkDigest(ctx, t, gs)
assert.Equal(t, 0, len(s.joinedTopics))
<-wait
topic := fmt.Sprintf(AttestationSubnetTopicFormat, fd, 42) + "/" + encoder.ProtocolSuffixSSZSnappy
topicHandle, err := s.JoinTopic(topic)
assert.NoError(t, err)

View File

@@ -60,8 +60,7 @@ func (s *Server) GetBlockV2(w http.ResponseWriter, r *http.Request) {
return
}
blk, err := s.Blocker.Block(ctx, []byte(blockId))
if err != nil {
shared.WriteBlockFetchError(w, blk, err)
if !shared.WriteBlockFetchError(w, blk, err) {
return
}
@@ -69,7 +68,7 @@ func (s *Server) GetBlockV2(w http.ResponseWriter, r *http.Request) {
if blk.Version() >= version.Bellatrix && blk.IsBlinded() {
blk, err = s.ExecutionPayloadReconstructor.ReconstructFullBlock(ctx, blk)
if err != nil {
shared.WriteBlockFetchError(w, blk, errors.Wrapf(err, "could not reconstruct full execution payload to create signed beacon block"))
httputil.HandleError(w, errors.Wrapf(err, "could not reconstruct full execution payload to create signed beacon block").Error(), http.StatusBadRequest)
return
}
}
@@ -892,6 +891,11 @@ func (s *Server) validateConsensus(ctx context.Context, blk interfaces.ReadOnlyS
if err != nil {
return errors.Wrap(err, "could not get parent block")
}
if err := blocks.BeaconBlockIsNil(blk); err != nil {
return errors.Wrap(err, "could not validate block")
}
parentStateRoot := parentBlock.Block().StateRoot()
parentState, err := s.Stater.State(ctx, parentStateRoot[:])
if err != nil {

View File

@@ -86,6 +86,24 @@ func fillDBTestBlocks(ctx context.Context, t *testing.T, beaconDB db.Database) (
}
func TestGetBlockV2(t *testing.T) {
t.Run("Unsycned Block", func(t *testing.T) {
mockBlockFetcher := &testutil.MockBlocker{BlockToReturn: nil}
mockChainService := &chainMock.ChainService{
FinalizedRoots: map[[32]byte]bool{},
}
s := &Server{
FinalizationFetcher: mockChainService,
Blocker: mockBlockFetcher,
}
request := httptest.NewRequest(http.MethodGet, "http://foo.example/eth/v2/beacon/blocks/{block_id}", nil)
request = mux.SetURLVars(request, map[string]string{"block_id": "123552314"})
writer := httptest.NewRecorder()
writer.Body = &bytes.Buffer{}
s.GetBlockV2(writer, request)
require.Equal(t, http.StatusNotFound, writer.Code)
})
t.Run("phase0", func(t *testing.T) {
b := util.NewBeaconBlock()
b.Block.Slot = 123

View File

@@ -14,6 +14,7 @@ import (
"github.com/prysmaticlabs/prysm/v5/beacon-chain/state"
fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams"
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/blocks"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v5/network/httputil"
"github.com/prysmaticlabs/prysm/v5/runtime/version"
@@ -33,6 +34,12 @@ func (s *Server) BlockRewards(w http.ResponseWriter, r *http.Request) {
if !shared.WriteBlockFetchError(w, blk, err) {
return
}
if err := blocks.BeaconBlockIsNil(blk); err != nil {
httputil.HandleError(w, fmt.Sprintf("block id %s was not found", blockId), http.StatusNotFound)
return
}
if blk.Version() == version.Phase0 {
httputil.HandleError(w, "Block rewards are not supported for Phase 0 blocks", http.StatusBadRequest)
return

View File

@@ -9,6 +9,8 @@ import (
"github.com/prysmaticlabs/prysm/v5/api/pagination"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filters"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/attestations"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/state/stategen"
"github.com/prysmaticlabs/prysm/v5/cmd"
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces"
@@ -67,6 +69,13 @@ func (bs *Server) ListAttestations(
return nil, status.Errorf(codes.Internal, "Could not fetch attestations: %v", err)
}
case *ethpb.ListAttestationsRequest_Epoch:
if q.Epoch >= params.BeaconConfig().ElectraForkEpoch {
return &ethpb.ListAttestationsResponse{
Attestations: make([]*ethpb.Attestation, 0),
TotalSize: int32(0),
NextPageToken: strconv.Itoa(0),
}, nil
}
blocks, _, err = bs.BeaconDB.Blocks(ctx, filters.NewFilter().SetStartEpoch(q.Epoch).SetEndEpoch(q.Epoch))
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not fetch attestations: %v", err)
@@ -74,17 +83,15 @@ func (bs *Server) ListAttestations(
default:
return nil, status.Error(codes.InvalidArgument, "Must specify a filter criteria for fetching attestations")
}
atts := make([]ethpb.Att, 0, params.BeaconConfig().MaxAttestations*uint64(len(blocks)))
for _, blk := range blocks {
atts = append(atts, blk.Block().Body().Attestations()...)
atts, err := blockAttestations[*ethpb.Attestation](blocks)
if err != nil {
return nil, err
}
// We sort attestations according to the Sortable interface.
sort.Sort(sortableAttestations(atts))
numAttestations := len(atts)
// If there are no attestations, we simply return a response specifying this.
// Otherwise, attempting to paginate 0 attestations below would result in an error.
if numAttestations == 0 {
if len(atts) == 0 {
return &ethpb.ListAttestationsResponse{
Attestations: make([]*ethpb.Attestation, 0),
TotalSize: int32(0),
@@ -92,20 +99,77 @@ func (bs *Server) ListAttestations(
}, nil
}
start, end, nextPageToken, err := pagination.StartAndEndPage(req.PageToken, int(req.PageSize), numAttestations)
start, end, nextPageToken, err := pagination.StartAndEndPage(req.PageToken, int(req.PageSize), len(atts))
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not paginate attestations: %v", err)
}
attestations := make([]*ethpb.Attestation, 0, len(atts))
for _, att := range atts {
a, ok := att.(*ethpb.Attestation)
if ok {
attestations = append(attestations, a)
}
}
return &ethpb.ListAttestationsResponse{
Attestations: attestations[start:end],
TotalSize: int32(numAttestations),
Attestations: atts[start:end],
TotalSize: int32(len(atts)),
NextPageToken: nextPageToken,
}, nil
}
// ListAttestationsElectra retrieves attestations by block root, slot, or epoch.
// Attestations are sorted by data slot by default.
//
// The server may return an empty list when no attestations match the given
// filter criteria. This RPC should not return NOT_FOUND. Only one filter
// criteria should be used.
func (bs *Server) ListAttestationsElectra(ctx context.Context, req *ethpb.ListAttestationsRequest) (*ethpb.ListAttestationsElectraResponse, error) {
if int(req.PageSize) > cmd.Get().MaxRPCPageSize {
return nil, status.Errorf(codes.InvalidArgument, "Requested page size %d can not be greater than max size %d",
req.PageSize, cmd.Get().MaxRPCPageSize)
}
var blocks []interfaces.ReadOnlySignedBeaconBlock
var err error
switch q := req.QueryFilter.(type) {
case *ethpb.ListAttestationsRequest_GenesisEpoch:
return &ethpb.ListAttestationsElectraResponse{
Attestations: make([]*ethpb.AttestationElectra, 0),
TotalSize: int32(0),
NextPageToken: strconv.Itoa(0),
}, nil
case *ethpb.ListAttestationsRequest_Epoch:
if q.Epoch < params.BeaconConfig().ElectraForkEpoch {
return &ethpb.ListAttestationsElectraResponse{
Attestations: make([]*ethpb.AttestationElectra, 0),
TotalSize: int32(0),
NextPageToken: strconv.Itoa(0),
}, nil
}
blocks, _, err = bs.BeaconDB.Blocks(ctx, filters.NewFilter().SetStartEpoch(q.Epoch).SetEndEpoch(q.Epoch))
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not fetch attestations: %v", err)
}
default:
return nil, status.Error(codes.InvalidArgument, "Must specify a filter criteria for fetching attestations")
}
atts, err := blockAttestations[*ethpb.AttestationElectra](blocks)
if err != nil {
return nil, err
}
// If there are no attestations, we simply return a response specifying this.
// Otherwise, attempting to paginate 0 attestations below would result in an error.
if len(atts) == 0 {
return &ethpb.ListAttestationsElectraResponse{
Attestations: make([]*ethpb.AttestationElectra, 0),
TotalSize: int32(0),
NextPageToken: strconv.Itoa(0),
}, nil
}
start, end, nextPageToken, err := pagination.StartAndEndPage(req.PageToken, int(req.PageSize), len(atts))
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not paginate attestations: %v", err)
}
return &ethpb.ListAttestationsElectraResponse{
Attestations: atts[start:end],
TotalSize: int32(len(atts)),
NextPageToken: nextPageToken,
}, nil
}
@@ -128,6 +192,13 @@ func (bs *Server) ListIndexedAttestations(
return nil, status.Errorf(codes.Internal, "Could not fetch attestations: %v", err)
}
case *ethpb.ListIndexedAttestationsRequest_Epoch:
if q.Epoch >= params.BeaconConfig().ElectraForkEpoch {
return &ethpb.ListIndexedAttestationsResponse{
IndexedAttestations: make([]*ethpb.IndexedAttestation, 0),
TotalSize: int32(0),
NextPageToken: strconv.Itoa(0),
}, nil
}
blocks, _, err = bs.BeaconDB.Blocks(ctx, filters.NewFilter().SetStartEpoch(q.Epoch).SetEndEpoch(q.Epoch))
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not fetch attestations: %v", err)
@@ -136,29 +207,205 @@ func (bs *Server) ListIndexedAttestations(
return nil, status.Error(codes.InvalidArgument, "Must specify a filter criteria for fetching attestations")
}
attsArray := make([]ethpb.Att, 0, params.BeaconConfig().MaxAttestations*uint64(len(blocks)))
for _, b := range blocks {
attsArray = append(attsArray, b.Block().Body().Attestations()...)
indexedAtts, err := blockIndexedAttestations[*ethpb.IndexedAttestation](ctx, blocks, bs.StateGen)
if err != nil {
return nil, err
}
// We sort attestations according to the Sortable interface.
sort.Sort(sortableAttestations(attsArray))
numAttestations := len(attsArray)
// If there are no attestations, we simply return a response specifying this.
// Otherwise, attempting to paginate 0 attestations below would result in an error.
if numAttestations == 0 {
if len(indexedAtts) == 0 {
return &ethpb.ListIndexedAttestationsResponse{
IndexedAttestations: make([]*ethpb.IndexedAttestation, 0),
TotalSize: int32(0),
NextPageToken: strconv.Itoa(0),
}, nil
}
start, end, nextPageToken, err := pagination.StartAndEndPage(req.PageToken, int(req.PageSize), len(indexedAtts))
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not paginate attestations: %v", err)
}
return &ethpb.ListIndexedAttestationsResponse{
IndexedAttestations: indexedAtts[start:end],
TotalSize: int32(len(indexedAtts)),
NextPageToken: nextPageToken,
}, nil
}
// ListIndexedAttestationsElectra retrieves indexed attestations by block root.
// IndexedAttestationsForEpoch are sorted by data slot by default. Start-end epoch
// filter is used to retrieve blocks with.
//
// The server may return an empty list when no attestations match the given
// filter criteria. This RPC should not return NOT_FOUND.
func (bs *Server) ListIndexedAttestationsElectra(
ctx context.Context,
req *ethpb.ListIndexedAttestationsRequest,
) (*ethpb.ListIndexedAttestationsElectraResponse, error) {
var blocks []interfaces.ReadOnlySignedBeaconBlock
var err error
switch q := req.QueryFilter.(type) {
case *ethpb.ListIndexedAttestationsRequest_GenesisEpoch:
return &ethpb.ListIndexedAttestationsElectraResponse{
IndexedAttestations: make([]*ethpb.IndexedAttestationElectra, 0),
TotalSize: int32(0),
NextPageToken: strconv.Itoa(0),
}, nil
case *ethpb.ListIndexedAttestationsRequest_Epoch:
if q.Epoch < params.BeaconConfig().ElectraForkEpoch {
return &ethpb.ListIndexedAttestationsElectraResponse{
IndexedAttestations: make([]*ethpb.IndexedAttestationElectra, 0),
TotalSize: int32(0),
NextPageToken: strconv.Itoa(0),
}, nil
}
blocks, _, err = bs.BeaconDB.Blocks(ctx, filters.NewFilter().SetStartEpoch(q.Epoch).SetEndEpoch(q.Epoch))
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not fetch attestations: %v", err)
}
default:
return nil, status.Error(codes.InvalidArgument, "Must specify a filter criteria for fetching attestations")
}
indexedAtts, err := blockIndexedAttestations[*ethpb.IndexedAttestationElectra](ctx, blocks, bs.StateGen)
if err != nil {
return nil, err
}
// If there are no attestations, we simply return a response specifying this.
// Otherwise, attempting to paginate 0 attestations below would result in an error.
if len(indexedAtts) == 0 {
return &ethpb.ListIndexedAttestationsElectraResponse{
IndexedAttestations: make([]*ethpb.IndexedAttestationElectra, 0),
TotalSize: int32(0),
NextPageToken: strconv.Itoa(0),
}, nil
}
start, end, nextPageToken, err := pagination.StartAndEndPage(req.PageToken, int(req.PageSize), len(indexedAtts))
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not paginate attestations: %v", err)
}
return &ethpb.ListIndexedAttestationsElectraResponse{
IndexedAttestations: indexedAtts[start:end],
TotalSize: int32(len(indexedAtts)),
NextPageToken: nextPageToken,
}, nil
}
// AttestationPool retrieves pending attestations.
//
// The server returns a list of attestations that have been seen but not
// yet processed. Pool attestations eventually expire as the slot
// advances, so an attestation missing from this request does not imply
// that it was included in a block. The attestation may have expired.
// Refer to the ethereum consensus specification for more details on how
// attestations are processed and when they are no longer valid.
// https://github.com/ethereum/consensus-specs/blob/dev/specs/core/0_beacon-chain.md#attestations
func (bs *Server) AttestationPool(_ context.Context, req *ethpb.AttestationPoolRequest) (*ethpb.AttestationPoolResponse, error) {
atts, err := attestationsFromPool[*ethpb.Attestation](req.PageSize, bs.AttestationsPool)
if err != nil {
return nil, err
}
// If there are no attestations, we simply return a response specifying this.
// Otherwise, attempting to paginate 0 attestations below would result in an error.
if len(atts) == 0 {
return &ethpb.AttestationPoolResponse{
Attestations: make([]*ethpb.Attestation, 0),
TotalSize: int32(0),
NextPageToken: strconv.Itoa(0),
}, nil
}
start, end, nextPageToken, err := pagination.StartAndEndPage(req.PageToken, int(req.PageSize), len(atts))
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not paginate attestations: %v", err)
}
return &ethpb.AttestationPoolResponse{
Attestations: atts[start:end],
TotalSize: int32(len(atts)),
NextPageToken: nextPageToken,
}, nil
}
func (bs *Server) AttestationPoolElectra(_ context.Context, req *ethpb.AttestationPoolRequest) (*ethpb.AttestationPoolElectraResponse, error) {
atts, err := attestationsFromPool[*ethpb.AttestationElectra](req.PageSize, bs.AttestationsPool)
if err != nil {
return nil, err
}
// If there are no attestations, we simply return a response specifying this.
// Otherwise, attempting to paginate 0 attestations below would result in an error.
if len(atts) == 0 {
return &ethpb.AttestationPoolElectraResponse{
Attestations: make([]*ethpb.AttestationElectra, 0),
TotalSize: int32(0),
NextPageToken: strconv.Itoa(0),
}, nil
}
start, end, nextPageToken, err := pagination.StartAndEndPage(req.PageToken, int(req.PageSize), len(atts))
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not paginate attestations: %v", err)
}
return &ethpb.AttestationPoolElectraResponse{
Attestations: atts[start:end],
TotalSize: int32(len(atts)),
NextPageToken: nextPageToken,
}, nil
}
func blockAttestations[T ethpb.Att](blocks []interfaces.ReadOnlySignedBeaconBlock) ([]T, error) {
blockAtts := make([]ethpb.Att, 0, params.BeaconConfig().MaxAttestations*uint64(len(blocks)))
for _, blk := range blocks {
blockAtts = append(blockAtts, blk.Block().Body().Attestations()...)
}
// We sort attestations according to the Sortable interface.
sort.Sort(sortableAttestations(blockAtts))
numAttestations := len(blockAtts)
if numAttestations == 0 {
return []T{}, nil
}
atts := make([]T, 0, len(blockAtts))
for _, att := range blockAtts {
a, ok := att.(T)
if !ok {
var expected T
return nil, status.Errorf(codes.Internal, "Attestation is of the wrong type (expected %T, got %T)", expected, att)
}
atts = append(atts, a)
}
return atts, nil
}
func blockIndexedAttestations[T ethpb.IndexedAtt](
ctx context.Context,
blocks []interfaces.ReadOnlySignedBeaconBlock,
stateGen stategen.StateManager,
) ([]T, error) {
attsArray := make([]ethpb.Att, 0, params.BeaconConfig().MaxAttestations*uint64(len(blocks)))
for _, b := range blocks {
attsArray = append(attsArray, b.Block().Body().Attestations()...)
}
// We sort attestations according to the Sortable interface.
sort.Sort(sortableAttestations(attsArray))
numAttestations := len(attsArray)
if numAttestations == 0 {
return []T{}, nil
}
// We use the retrieved committees for the b root to convert all attestations
// into indexed form effectively.
mappedAttestations := mapAttestationsByTargetRoot(attsArray)
indexedAtts := make([]*ethpb.IndexedAttestation, 0, numAttestations)
indexed := make([]T, 0, numAttestations)
for targetRoot, atts := range mappedAttestations {
attState, err := bs.StateGen.StateByRoot(ctx, targetRoot)
attState, err := stateGen.StateByRoot(ctx, targetRoot)
if err != nil && strings.Contains(err.Error(), "unknown state summary") {
// We shouldn't stop the request if we encounter an attestation we don't have the state for.
log.Debugf("Could not get state for attestation target root %#x", targetRoot)
@@ -185,67 +432,36 @@ func (bs *Server) ListIndexedAttestations(
if err != nil {
return nil, err
}
a, ok := idxAtt.(*ethpb.IndexedAttestation)
if ok {
indexedAtts = append(indexedAtts, a)
a, ok := idxAtt.(T)
if !ok {
var expected T
return nil, status.Errorf(codes.Internal, "Indexed attestation is of the wrong type (expected %T, got %T)", expected, idxAtt)
}
indexed = append(indexed, a)
}
}
start, end, nextPageToken, err := pagination.StartAndEndPage(req.PageToken, int(req.PageSize), len(indexedAtts))
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not paginate attestations: %v", err)
}
return &ethpb.ListIndexedAttestationsResponse{
IndexedAttestations: indexedAtts[start:end],
TotalSize: int32(len(indexedAtts)),
NextPageToken: nextPageToken,
}, nil
return indexed, nil
}
// AttestationPool retrieves pending attestations.
//
// The server returns a list of attestations that have been seen but not
// yet processed. Pool attestations eventually expire as the slot
// advances, so an attestation missing from this request does not imply
// that it was included in a block. The attestation may have expired.
// Refer to the ethereum consensus specification for more details on how
// attestations are processed and when they are no longer valid.
// https://github.com/ethereum/consensus-specs/blob/dev/specs/core/0_beacon-chain.md#attestations
func (bs *Server) AttestationPool(
_ context.Context, req *ethpb.AttestationPoolRequest,
) (*ethpb.AttestationPoolResponse, error) {
if int(req.PageSize) > cmd.Get().MaxRPCPageSize {
func attestationsFromPool[T ethpb.Att](pageSize int32, pool attestations.Pool) ([]T, error) {
if int(pageSize) > cmd.Get().MaxRPCPageSize {
return nil, status.Errorf(
codes.InvalidArgument,
"Requested page size %d can not be greater than max size %d",
req.PageSize,
pageSize,
cmd.Get().MaxRPCPageSize,
)
}
atts := bs.AttestationsPool.AggregatedAttestations()
numAtts := len(atts)
if numAtts == 0 {
return &ethpb.AttestationPoolResponse{
Attestations: make([]*ethpb.Attestation, 0),
TotalSize: int32(0),
NextPageToken: strconv.Itoa(0),
}, nil
}
start, end, nextPageToken, err := pagination.StartAndEndPage(req.PageToken, int(req.PageSize), numAtts)
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not paginate attestations: %v", err)
}
attestations := make([]*ethpb.Attestation, 0, len(atts))
for _, att := range atts {
a, ok := att.(*ethpb.Attestation)
if ok {
attestations = append(attestations, a)
poolAtts := pool.AggregatedAttestations()
atts := make([]T, 0, len(poolAtts))
for _, att := range poolAtts {
a, ok := att.(T)
if !ok {
var expected T
return nil, status.Errorf(codes.Internal, "Attestation is of the wrong type (expected %T, got %T)", expected, att)
}
atts = append(atts, a)
}
return &ethpb.AttestationPoolResponse{
Attestations: attestations[start:end],
TotalSize: int32(numAtts),
NextPageToken: nextPageToken,
}, nil
return atts, nil
}

View File

@@ -462,6 +462,59 @@ func TestServer_ListAttestations_Pagination_DefaultPageSize(t *testing.T) {
assert.DeepEqual(t, atts[i:j], res.Attestations, "Incorrect attestations response")
}
func TestServer_ListAttestationsElectra(t *testing.T) {
params.SetupTestConfigCleanup(t)
cfg := params.BeaconConfig()
cfg.ElectraForkEpoch = 0
params.OverrideBeaconConfig(cfg)
db := dbTest.SetupDB(t)
ctx := context.Background()
st, err := state_native.InitializeFromProtoElectra(&ethpb.BeaconStateElectra{
Slot: 0,
})
require.NoError(t, err)
bs := &Server{
BeaconDB: db,
HeadFetcher: &chainMock.ChainService{
State: st,
},
}
cb := primitives.NewAttestationCommitteeBits()
cb.SetBitAt(2, true)
att := util.HydrateAttestationElectra(&ethpb.AttestationElectra{
AggregationBits: bitfield.NewBitlist(0),
Data: &ethpb.AttestationData{
Slot: 2,
},
CommitteeBits: cb,
})
parentRoot := [32]byte{1, 2, 3}
signedBlock := util.NewBeaconBlockElectra()
signedBlock.Block.ParentRoot = bytesutil.PadTo(parentRoot[:], 32)
signedBlock.Block.Body.Attestations = []*ethpb.AttestationElectra{att}
root, err := signedBlock.Block.HashTreeRoot()
require.NoError(t, err)
util.SaveBlock(t, ctx, db, signedBlock)
require.NoError(t, db.SaveGenesisBlockRoot(ctx, root))
wanted := &ethpb.ListAttestationsElectraResponse{
Attestations: []*ethpb.AttestationElectra{att},
NextPageToken: "",
TotalSize: 1,
}
res, err := bs.ListAttestationsElectra(ctx, &ethpb.ListAttestationsRequest{
QueryFilter: &ethpb.ListAttestationsRequest_Epoch{
Epoch: params.BeaconConfig().ElectraForkEpoch,
},
})
require.NoError(t, err)
require.DeepSSZEqual(t, wanted, res)
}
func TestServer_mapAttestationToTargetRoot(t *testing.T) {
count := primitives.Slot(100)
atts := make([]ethpb.Att, count)
@@ -494,8 +547,6 @@ func TestServer_mapAttestationToTargetRoot(t *testing.T) {
}
func TestServer_ListIndexedAttestations_GenesisEpoch(t *testing.T) {
params.SetupTestConfigCleanup(t)
params.OverrideBeaconConfig(params.BeaconConfig())
db := dbTest.SetupDB(t)
helpers.ClearCache()
ctx := context.Background()
@@ -606,8 +657,6 @@ func TestServer_ListIndexedAttestations_GenesisEpoch(t *testing.T) {
}
func TestServer_ListIndexedAttestations_OldEpoch(t *testing.T) {
params.SetupTestConfigCleanup(t)
params.OverrideBeaconConfig(params.BeaconConfig())
db := dbTest.SetupDB(t)
helpers.ClearCache()
ctx := context.Background()
@@ -690,6 +739,123 @@ func TestServer_ListIndexedAttestations_OldEpoch(t *testing.T) {
require.DeepEqual(t, indexedAtts, res.IndexedAttestations, "Incorrect list indexed attestations response")
}
func TestServer_ListIndexedAttestationsElectra(t *testing.T) {
params.SetupTestConfigCleanup(t)
cfg := params.BeaconConfig()
cfg.ElectraForkEpoch = 0
params.OverrideBeaconConfig(cfg)
db := dbTest.SetupDB(t)
helpers.ClearCache()
ctx := context.Background()
targetRoot1 := bytesutil.ToBytes32([]byte("root"))
targetRoot2 := bytesutil.ToBytes32([]byte("root2"))
count := params.BeaconConfig().SlotsPerEpoch
atts := make([]*ethpb.AttestationElectra, 0, count)
atts2 := make([]*ethpb.AttestationElectra, 0, count)
for i := primitives.Slot(0); i < count; i++ {
var targetRoot [32]byte
if i%2 == 0 {
targetRoot = targetRoot1
} else {
targetRoot = targetRoot2
}
cb := primitives.NewAttestationCommitteeBits()
cb.SetBitAt(0, true)
blockExample := util.NewBeaconBlockElectra()
blockExample.Block.Body.Attestations = []*ethpb.AttestationElectra{
{
Signature: make([]byte, fieldparams.BLSSignatureLength),
Data: &ethpb.AttestationData{
BeaconBlockRoot: make([]byte, fieldparams.RootLength),
Target: &ethpb.Checkpoint{
Root: targetRoot[:],
},
Source: &ethpb.Checkpoint{
Root: make([]byte, fieldparams.RootLength),
},
Slot: i,
},
AggregationBits: bitfield.NewBitlist(128 / uint64(params.BeaconConfig().SlotsPerEpoch)),
CommitteeBits: cb,
},
}
util.SaveBlock(t, ctx, db, blockExample)
if i%2 == 0 {
atts = append(atts, blockExample.Block.Body.Attestations...)
} else {
atts2 = append(atts2, blockExample.Block.Body.Attestations...)
}
}
// We setup 512 validators so that committee size matches the length of attestations' aggregation bits.
numValidators := uint64(512)
state, _ := util.DeterministicGenesisStateElectra(t, numValidators)
// Next up we convert the test attestations to indexed form:
indexedAtts := make([]*ethpb.IndexedAttestationElectra, len(atts)+len(atts2))
for i := 0; i < len(atts); i++ {
att := atts[i]
committee, err := helpers.BeaconCommitteeFromState(context.Background(), state, att.Data.Slot, 0)
require.NoError(t, err)
idxAtt, err := attestation.ConvertToIndexed(ctx, atts[i], committee)
require.NoError(t, err, "Could not convert attestation to indexed")
a, ok := idxAtt.(*ethpb.IndexedAttestationElectra)
require.Equal(t, true, ok, "unexpected type of indexed attestation")
indexedAtts[i] = a
}
for i := 0; i < len(atts2); i++ {
att := atts2[i]
committee, err := helpers.BeaconCommitteeFromState(context.Background(), state, att.Data.Slot, 0)
require.NoError(t, err)
idxAtt, err := attestation.ConvertToIndexed(ctx, atts2[i], committee)
require.NoError(t, err, "Could not convert attestation to indexed")
a, ok := idxAtt.(*ethpb.IndexedAttestationElectra)
require.Equal(t, true, ok, "unexpected type of indexed attestation")
indexedAtts[i+len(atts)] = a
}
bs := &Server{
BeaconDB: db,
GenesisTimeFetcher: &chainMock.ChainService{State: state},
HeadFetcher: &chainMock.ChainService{State: state},
StateGen: stategen.New(db, doublylinkedtree.New()),
}
err := db.SaveStateSummary(ctx, &ethpb.StateSummary{
Root: targetRoot1[:],
Slot: 1,
})
require.NoError(t, err)
err = db.SaveStateSummary(ctx, &ethpb.StateSummary{
Root: targetRoot2[:],
Slot: 2,
})
require.NoError(t, err)
require.NoError(t, db.SaveState(ctx, state, bytesutil.ToBytes32(targetRoot1[:])))
require.NoError(t, state.SetSlot(state.Slot()+1))
require.NoError(t, db.SaveState(ctx, state, bytesutil.ToBytes32(targetRoot2[:])))
res, err := bs.ListIndexedAttestationsElectra(ctx, &ethpb.ListIndexedAttestationsRequest{
QueryFilter: &ethpb.ListIndexedAttestationsRequest_Epoch{
Epoch: 0,
},
})
require.NoError(t, err)
assert.Equal(t, len(indexedAtts), len(res.IndexedAttestations), "Incorrect indexted attestations length")
sort.Slice(indexedAtts, func(i, j int) bool {
return indexedAtts[i].GetData().Slot < indexedAtts[j].GetData().Slot
})
sort.Slice(res.IndexedAttestations, func(i, j int) bool {
return res.IndexedAttestations[i].Data.Slot < res.IndexedAttestations[j].Data.Slot
})
assert.DeepEqual(t, indexedAtts, res.IndexedAttestations, "Incorrect list indexed attestations response")
}
func TestServer_AttestationPool_Pagination_ExceedsMaxPageSize(t *testing.T) {
ctx := context.Background()
bs := &Server{}
@@ -827,3 +993,24 @@ func TestServer_AttestationPool_Pagination_CustomPageSize(t *testing.T) {
assert.Equal(t, tt.res.NextPageToken, res.NextPageToken, "Unexpected next page token")
}
}
func TestServer_AttestationPoolElectra(t *testing.T) {
ctx := context.Background()
bs := &Server{
AttestationsPool: attestations.NewPool(),
}
atts := make([]ethpb.Att, params.BeaconConfig().DefaultPageSize+1)
for i := 0; i < len(atts); i++ {
att := util.NewAttestationElectra()
att.Data.Slot = primitives.Slot(i)
atts[i] = att
}
require.NoError(t, bs.AttestationsPool.SaveAggregatedAttestations(atts))
req := &ethpb.AttestationPoolRequest{}
res, err := bs.AttestationPoolElectra(ctx, req)
require.NoError(t, err)
assert.Equal(t, params.BeaconConfig().DefaultPageSize, len(res.Attestations), "Unexpected number of attestations")
assert.Equal(t, params.BeaconConfig().DefaultPageSize+1, int(res.TotalSize), "Unexpected total size")
}

View File

@@ -36,26 +36,31 @@ func (bs *Server) SubmitProposerSlashing(
}, nil
}
// SubmitAttesterSlashing receives an attester slashing object via
func (bs *Server) SubmitAttesterSlashing(ctx context.Context, req *ethpb.AttesterSlashing) (*ethpb.SubmitSlashingResponse, error) {
return bs.submitAttesterSlashing(ctx, req)
}
// SubmitAttesterSlashingElectra receives an attester slashing object via
// RPC and injects it into the beacon node's operations pool.
// Submission into this pool does not guarantee inclusion into a beacon block.
func (bs *Server) SubmitAttesterSlashing(
ctx context.Context,
req *ethpb.AttesterSlashing,
) (*ethpb.SubmitSlashingResponse, error) {
func (bs *Server) SubmitAttesterSlashingElectra(ctx context.Context, req *ethpb.AttesterSlashingElectra) (*ethpb.SubmitSlashingResponse, error) {
return bs.submitAttesterSlashing(ctx, req)
}
func (bs *Server) submitAttesterSlashing(ctx context.Context, slashing ethpb.AttSlashing) (*ethpb.SubmitSlashingResponse, error) {
beaconState, err := bs.HeadFetcher.HeadStateReadOnly(ctx)
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not retrieve head state: %v", err)
}
if err := bs.SlashingsPool.InsertAttesterSlashing(ctx, beaconState, req); err != nil {
if err := bs.SlashingsPool.InsertAttesterSlashing(ctx, beaconState, slashing); err != nil {
return nil, status.Errorf(codes.Internal, "Could not insert attester slashing into pool: %v", err)
}
if !features.Get().DisableBroadcastSlashings {
if err := bs.Broadcaster.Broadcast(ctx, req); err != nil {
if err := bs.Broadcaster.Broadcast(ctx, slashing); err != nil {
return nil, status.Errorf(codes.Internal, "Could not broadcast slashing object: %v", err)
}
}
indices := slice.IntersectionUint64(req.Attestation_1.AttestingIndices, req.Attestation_2.AttestingIndices)
indices := slice.IntersectionUint64(slashing.FirstAttestation().GetAttestingIndices(), slashing.SecondAttestation().GetAttestingIndices())
slashedIndices := make([]primitives.ValidatorIndex, len(indices))
for i, index := range indices {
slashedIndices[i] = primitives.ValidatorIndex(index)

View File

@@ -167,3 +167,28 @@ func TestServer_SubmitAttesterSlashing_DontBroadcast(t *testing.T) {
_, err = bs.SubmitAttesterSlashing(ctx, generatedSlashing.(*ethpb.AttesterSlashing))
assert.NotNil(t, err, "Expected including a attester slashing for an already slashed validator to fail")
}
func TestServer_SubmitAttesterSlashingElectra(t *testing.T) {
ctx := context.Background()
st, privs := util.DeterministicGenesisStateElectra(t, 64)
slashedVal, err := st.ValidatorAtIndex(5)
require.NoError(t, err)
slashedVal.Slashed = true
require.NoError(t, st.UpdateValidatorAtIndex(5, slashedVal))
mb := &mockp2p.MockBroadcaster{}
bs := &Server{
HeadFetcher: &mock.ChainService{
State: st,
},
SlashingsPool: slashings.NewPool(),
Broadcaster: mb,
}
generatedSlashing, err := util.GenerateAttesterSlashingForValidator(st, privs[2], primitives.ValidatorIndex(2))
require.NoError(t, err)
_, err = bs.SubmitAttesterSlashingElectra(ctx, generatedSlashing.(*ethpb.AttesterSlashingElectra))
require.NoError(t, err)
assert.Equal(t, true, mb.BroadcastCalled.Load(), "Expected broadcast to be called when flag is set")
}

View File

@@ -158,7 +158,7 @@ func (b *BeaconState) ExpectedWithdrawals() ([]*enginev1.Withdrawal, uint64, err
withdrawals = append(withdrawals, &enginev1.Withdrawal{
Index: withdrawalIndex,
ValidatorIndex: validatorIndex,
Address: bytesutil.SafeCopyBytes(val.WithdrawalCredentials[ETH1AddressOffset:]),
Address: bytesutil.SafeCopyBytes(val.GetWithdrawalCredentials()[ETH1AddressOffset:]),
Amount: balance,
})
withdrawalIndex++
@@ -166,7 +166,7 @@ func (b *BeaconState) ExpectedWithdrawals() ([]*enginev1.Withdrawal, uint64, err
withdrawals = append(withdrawals, &enginev1.Withdrawal{
Index: withdrawalIndex,
ValidatorIndex: validatorIndex,
Address: bytesutil.SafeCopyBytes(val.WithdrawalCredentials[ETH1AddressOffset:]),
Address: bytesutil.SafeCopyBytes(val.GetWithdrawalCredentials()[ETH1AddressOffset:]),
Amount: balance - helpers.ValidatorMaxEffectiveBalance(val),
})
withdrawalIndex++

View File

@@ -160,12 +160,12 @@ var Commands = []*cli.Command{
flags.InteropStartIndex,
cmd.GrpcMaxCallRecvMsgSizeFlag,
flags.CertFlag,
flags.GrpcHeadersFlag,
flags.GrpcRetriesFlag,
flags.GrpcRetryDelayFlag,
flags.GRPCHeadersFlag,
flags.GRPCRetriesFlag,
flags.GRPCRetryDelayFlag,
flags.ExitAllFlag,
flags.ForceExitFlag,
flags.VoluntaryExitJSONOutputPath,
flags.VoluntaryExitJSONOutputPathFlag,
features.Mainnet,
features.SepoliaTestnet,
features.HoleskyTestnet,

View File

@@ -58,9 +58,9 @@ var Commands = &cli.Command{
flags.BeaconRPCProviderFlag,
cmd.GrpcMaxCallRecvMsgSizeFlag,
flags.CertFlag,
flags.GrpcHeadersFlag,
flags.GrpcRetriesFlag,
flags.GrpcRetryDelayFlag,
flags.GRPCHeadersFlag,
flags.GRPCRetriesFlag,
flags.GRPCRetryDelayFlag,
features.Mainnet,
features.SepoliaTestnet,
features.HoleskyTestnet,
@@ -93,7 +93,7 @@ var Commands = &cli.Command{
flags.WalletPasswordFileFlag,
flags.BackupDirFlag,
flags.BackupPublicKeysFlag,
flags.BackupPasswordFile,
flags.BackupPasswordFileFlag,
features.Mainnet,
features.SepoliaTestnet,
features.HoleskyTestnet,
@@ -160,12 +160,12 @@ var Commands = &cli.Command{
flags.InteropStartIndex,
cmd.GrpcMaxCallRecvMsgSizeFlag,
flags.CertFlag,
flags.GrpcHeadersFlag,
flags.GrpcRetriesFlag,
flags.GrpcRetryDelayFlag,
flags.GRPCHeadersFlag,
flags.GRPCRetriesFlag,
flags.GRPCRetryDelayFlag,
flags.ExitAllFlag,
flags.ForceExitFlag,
flags.VoluntaryExitJSONOutputPath,
flags.VoluntaryExitJSONOutputPathFlag,
features.Mainnet,
features.SepoliaTestnet,
features.HoleskyTestnet,

View File

@@ -23,10 +23,10 @@ func accountsBackup(c *cli.Context) error {
dialOpts := client.ConstructDialOptions(
c.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name),
c.String(flags.CertFlag.Name),
c.Uint(flags.GrpcRetriesFlag.Name),
c.Duration(flags.GrpcRetryDelayFlag.Name),
c.Uint(flags.GRPCRetriesFlag.Name),
c.Duration(flags.GRPCRetryDelayFlag.Name),
)
grpcHeaders := strings.Split(c.String(flags.GrpcHeadersFlag.Name), ",")
grpcHeaders := strings.Split(c.String(flags.GRPCHeadersFlag.Name), ",")
opts := []accounts.Option{
accounts.WithWallet(w),
@@ -62,7 +62,7 @@ func accountsBackup(c *cli.Context) error {
// Ask the user for their desired password for their backed up accounts.
backupsPassword, err := prompt.InputPassword(
c,
flags.BackupPasswordFile,
flags.BackupPasswordFileFlag,
"Enter a new password for your backed up accounts",
"Confirm new password",
true,

View File

@@ -20,10 +20,10 @@ func accountsDelete(c *cli.Context) error {
dialOpts := client.ConstructDialOptions(
c.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name),
c.String(flags.CertFlag.Name),
c.Uint(flags.GrpcRetriesFlag.Name),
c.Duration(flags.GrpcRetryDelayFlag.Name),
c.Uint(flags.GRPCRetriesFlag.Name),
c.Duration(flags.GRPCRetryDelayFlag.Name),
)
grpcHeaders := strings.Split(c.String(flags.GrpcHeadersFlag.Name), ",")
grpcHeaders := strings.Split(c.String(flags.GRPCHeadersFlag.Name), ",")
opts := []accounts.Option{
accounts.WithWallet(w),

View File

@@ -98,7 +98,7 @@ func setupWalletCtx(
set.String(flags.DeletePublicKeysFlag.Name, cfg.deletePublicKeys, "")
set.String(flags.VoluntaryExitPublicKeysFlag.Name, cfg.voluntaryExitPublicKeys, "")
set.String(flags.BackupDirFlag.Name, cfg.backupDir, "")
set.String(flags.BackupPasswordFile.Name, cfg.backupPasswordFile, "")
set.String(flags.BackupPasswordFileFlag.Name, cfg.backupPasswordFile, "")
set.String(flags.BackupPublicKeysFlag.Name, cfg.backupPublicKeys, "")
set.String(flags.WalletPasswordFileFlag.Name, cfg.walletPasswordFile, "")
set.String(flags.AccountPasswordFileFlag.Name, cfg.accountPasswordFile, "")
@@ -106,7 +106,7 @@ func setupWalletCtx(
set.Bool(flags.SkipDepositConfirmationFlag.Name, cfg.skipDepositConfirm, "")
set.Bool(flags.SkipMnemonic25thWordCheckFlag.Name, true, "")
set.Bool(flags.ExitAllFlag.Name, cfg.exitAll, "")
set.String(flags.GrpcHeadersFlag.Name, cfg.grpcHeaders, "")
set.String(flags.GRPCHeadersFlag.Name, cfg.grpcHeaders, "")
if cfg.privateKeyFile != "" {
set.String(flags.ImportPrivateKeyFileFlag.Name, cfg.privateKeyFile, "")
@@ -120,13 +120,13 @@ func setupWalletCtx(
assert.NoError(tb, set.Set(flags.VoluntaryExitPublicKeysFlag.Name, cfg.voluntaryExitPublicKeys))
assert.NoError(tb, set.Set(flags.BackupDirFlag.Name, cfg.backupDir))
assert.NoError(tb, set.Set(flags.BackupPublicKeysFlag.Name, cfg.backupPublicKeys))
assert.NoError(tb, set.Set(flags.BackupPasswordFile.Name, cfg.backupPasswordFile))
assert.NoError(tb, set.Set(flags.BackupPasswordFileFlag.Name, cfg.backupPasswordFile))
assert.NoError(tb, set.Set(flags.WalletPasswordFileFlag.Name, cfg.walletPasswordFile))
assert.NoError(tb, set.Set(flags.AccountPasswordFileFlag.Name, cfg.accountPasswordFile))
assert.NoError(tb, set.Set(flags.NumAccountsFlag.Name, strconv.Itoa(int(cfg.numAccounts))))
assert.NoError(tb, set.Set(flags.SkipDepositConfirmationFlag.Name, strconv.FormatBool(cfg.skipDepositConfirm)))
assert.NoError(tb, set.Set(flags.ExitAllFlag.Name, strconv.FormatBool(cfg.exitAll)))
assert.NoError(tb, set.Set(flags.GrpcHeadersFlag.Name, cfg.grpcHeaders))
assert.NoError(tb, set.Set(flags.GRPCHeadersFlag.Name, cfg.grpcHeaders))
return cli.NewContext(&app, set, nil)
}

View File

@@ -27,10 +27,10 @@ func Exit(c *cli.Context, r io.Reader) error {
dialOpts := client.ConstructDialOptions(
c.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name),
c.String(flags.CertFlag.Name),
c.Uint(flags.GrpcRetriesFlag.Name),
c.Duration(flags.GrpcRetryDelayFlag.Name),
c.Uint(flags.GRPCRetriesFlag.Name),
c.Duration(flags.GRPCRetryDelayFlag.Name),
)
grpcHeaders := strings.Split(c.String(flags.GrpcHeadersFlag.Name), ",")
grpcHeaders := strings.Split(c.String(flags.GRPCHeadersFlag.Name), ",")
beaconRPCProvider := c.String(flags.BeaconRPCProviderFlag.Name)
if !c.IsSet(flags.Web3SignerURLFlag.Name) && !c.IsSet(flags.WalletDirFlag.Name) && !c.IsSet(flags.InteropNumValidators.Name) {
return errors.Errorf("No validators found, please provide a prysm wallet directory via flag --%s "+
@@ -83,7 +83,7 @@ func Exit(c *cli.Context, r io.Reader) error {
accounts.WithBeaconRPCProvider(beaconRPCProvider),
accounts.WithBeaconRESTApiProvider(c.String(flags.BeaconRESTApiProviderFlag.Name)),
accounts.WithGRPCHeaders(grpcHeaders),
accounts.WithExitJSONOutputPath(c.String(flags.VoluntaryExitJSONOutputPath.Name)),
accounts.WithExitJSONOutputPath(c.String(flags.VoluntaryExitJSONOutputPathFlag.Name)),
}
// Get full set of public keys from the keymanager.
validatingPublicKeys, err := km.FetchValidatingPublicKeys(c.Context)

View File

@@ -37,7 +37,7 @@ func TestExitAccountsCli_OK(t *testing.T) {
}
mockNodeClient.EXPECT().
GetGenesis(gomock.Any(), gomock.Any()).
Genesis(gomock.Any(), gomock.Any()).
Return(&ethpb.Genesis{GenesisTime: genesisTime}, nil)
mockValidatorClient.EXPECT().
@@ -133,7 +133,7 @@ func TestExitAccountsCli_OK_AllPublicKeys(t *testing.T) {
}
mockNodeClient.EXPECT().
GetGenesis(gomock.Any(), gomock.Any()).
Genesis(gomock.Any(), gomock.Any()).
Return(&ethpb.Genesis{GenesisTime: genesisTime}, nil)
mockValidatorClient.EXPECT().
@@ -235,7 +235,7 @@ func TestExitAccountsCli_OK_ForceExit(t *testing.T) {
}
mockNodeClient.EXPECT().
GetGenesis(gomock.Any(), gomock.Any()).
Genesis(gomock.Any(), gomock.Any()).
Return(&ethpb.Genesis{GenesisTime: genesisTime}, nil)
mockValidatorClient.EXPECT().
@@ -324,7 +324,7 @@ func TestExitAccountsCli_WriteJSON_NoBroadcast(t *testing.T) {
}
mockNodeClient.EXPECT().
GetGenesis(gomock.Any(), gomock.Any()).
Genesis(gomock.Any(), gomock.Any()).
Return(&ethpb.Genesis{GenesisTime: genesisTime}, nil)
mockValidatorClient.EXPECT().

View File

@@ -27,10 +27,10 @@ func accountsImport(c *cli.Context) error {
dialOpts := client.ConstructDialOptions(
c.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name),
c.String(flags.CertFlag.Name),
c.Uint(flags.GrpcRetriesFlag.Name),
c.Duration(flags.GrpcRetryDelayFlag.Name),
c.Uint(flags.GRPCRetriesFlag.Name),
c.Duration(flags.GRPCRetryDelayFlag.Name),
)
grpcHeaders := strings.Split(c.String(flags.GrpcHeadersFlag.Name), ",")
grpcHeaders := strings.Split(c.String(flags.GRPCHeadersFlag.Name), ",")
opts := []accounts.Option{
accounts.WithWallet(w),

View File

@@ -18,10 +18,10 @@ func accountsList(c *cli.Context) error {
dialOpts := client.ConstructDialOptions(
c.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name),
c.String(flags.CertFlag.Name),
c.Uint(flags.GrpcRetriesFlag.Name),
c.Duration(flags.GrpcRetryDelayFlag.Name),
c.Uint(flags.GRPCRetriesFlag.Name),
c.Duration(flags.GRPCRetryDelayFlag.Name),
)
grpcHeaders := strings.Split(c.String(flags.GrpcHeadersFlag.Name), ",")
grpcHeaders := strings.Split(c.String(flags.GRPCHeadersFlag.Name), ",")
opts := []accounts.Option{
accounts.WithWallet(w),

View File

@@ -91,20 +91,20 @@ var (
Name: "graffiti",
Usage: "String to include in proposed blocks.",
}
// GrpcRetriesFlag defines the number of times to retry a failed gRPC request.
GrpcRetriesFlag = &cli.UintFlag{
// GRPCRetriesFlag defines the number of times to retry a failed gRPC request.
GRPCRetriesFlag = &cli.UintFlag{
Name: "grpc-retries",
Usage: "Number of attempts to retry gRPC requests.",
Value: 5,
}
// GrpcRetryDelayFlag defines the interval to retry a failed gRPC request.
GrpcRetryDelayFlag = &cli.DurationFlag{
// GRPCRetryDelayFlag defines the interval to retry a failed gRPC request.
GRPCRetryDelayFlag = &cli.DurationFlag{
Name: "grpc-retry-delay",
Usage: "Amount of time between gRPC retry requests.",
Value: 1 * time.Second,
}
// GrpcHeadersFlag defines a list of headers to send with all gRPC requests.
GrpcHeadersFlag = &cli.StringFlag{
// GRPCHeadersFlag defines a list of headers to send with all gRPC requests.
GRPCHeadersFlag = &cli.StringFlag{
Name: "grpc-headers",
Usage: `Comma separated list of key value pairs to pass as gRPC headers for all gRPC calls.
Example: --grpc-headers=key=value`,
@@ -121,8 +121,8 @@ var (
Usage: "Enables gRPC gateway for JSON requests.",
Value: 7500,
}
// GPRCGatewayCorsDomain serves preflight requests when serving gRPC JSON gateway.
GPRCGatewayCorsDomain = &cli.StringFlag{
// GRPCGatewayCorsDomain serves preflight requests when serving gRPC JSON gateway.
GRPCGatewayCorsDomain = &cli.StringFlag{
Name: "grpc-gateway-corsdomain",
Usage: `Comma separated list of domains from which to accept cross origin requests (browser enforced).
This flag has no effect if not used with --grpc-gateway-port.
@@ -142,7 +142,6 @@ var (
Value: filepath.Join(filepath.Join(DefaultValidatorDir(), WalletDefaultDirName), api.AuthTokenFileName),
Aliases: []string{"validator-api-bearer-file"},
}
// WalletDirFlag defines the path to a wallet directory for Prysm accounts.
WalletDirFlag = &cli.StringFlag{
Name: "wallet-dir",
@@ -184,7 +183,6 @@ var (
Name: "mnemonic-language",
Usage: "Allows specifying mnemonic language. Supported languages are: english|chinese_traditional|chinese_simplified|czech|french|japanese|korean|italian|spanish.",
}
// ShowPrivateKeysFlag for accounts.
ShowPrivateKeysFlag = &cli.BoolFlag{
Name: "show-private-keys",
@@ -236,14 +234,15 @@ var (
Name: "force-exit",
Usage: "Exits without displaying the confirmation prompt.",
}
VoluntaryExitJSONOutputPath = &cli.StringFlag{
// VoluntaryExitJSONOutputPathFlag to write voluntary exits as JSON files instead of broadcasting them.
VoluntaryExitJSONOutputPathFlag = &cli.StringFlag{
Name: "exit-json-output-dir",
Usage: "Output directory to write voluntary exits as individual unencrypted JSON " +
"files. If this flag is provided, voluntary exits will be written to the provided " +
"directory and will not be broadcasted.",
}
// BackupPasswordFile for encrypting accounts a user wishes to back up.
BackupPasswordFile = &cli.StringFlag{
// BackupPasswordFileFlag for encrypting accounts a user wishes to back up.
BackupPasswordFileFlag = &cli.StringFlag{
Name: "backup-password-file",
Usage: "Path to a plain-text, .txt file containing the desired password for your backed up accounts.",
Value: "",
@@ -264,7 +263,6 @@ var (
Name: "keys-dir",
Usage: "Path to a directory where keystores to be imported are stored.",
}
// RemoteSignerCertPathFlag defines the path to a client.crt file for a wallet to connect to
// a secure signer via TLS and gRPC.
RemoteSignerCertPathFlag = &cli.StringFlag{
@@ -294,7 +292,6 @@ var (
Usage: "URL for consensys' web3signer software to use with the Prysm validator client.",
Value: "",
}
// Web3SignerPublicValidatorKeysFlag defines a comma-separated list of hex string public keys or external url for web3signer to use for validator signing.
// example with external url: --validators-external-signer-public-keys= https://web3signer.com/api/v1/eth2/publicKeys
// example with public key: --validators-external-signer-public-keys=0xa99a...e44c,0xb89b...4a0b
@@ -303,7 +300,6 @@ var (
Name: "validators-external-signer-public-keys",
Usage: "Comma separated list of public keys OR an external url endpoint for the validator to retrieve public keys from for usage with web3signer.",
}
// KeymanagerKindFlag defines the kind of keymanager desired by a user during wallet creation.
KeymanagerKindFlag = &cli.StringFlag{
Name: "keymanager-kind",
@@ -348,7 +344,6 @@ var (
fee recipient and gas limit. File format found in docs`,
Value: "",
}
// SuggestedFeeRecipientFlag defines the address of the fee recipient.
SuggestedFeeRecipientFlag = &cli.StringFlag{
Name: "suggested-fee-recipient",
@@ -358,7 +353,6 @@ var (
--` + ProposerSettingsFlag.Name + " or --" + ProposerSettingsURLFlag.Name + " flags.",
Value: params.BeaconConfig().EthBurnAddressHex,
}
// EnableBuilderFlag enables the periodic validator registration API calls that will update the custom builder with validator settings.
EnableBuilderFlag = &cli.BoolFlag{
Name: "enable-builder",
@@ -368,21 +362,18 @@ var (
Value: false,
Aliases: []string{"enable-validator-registration"},
}
// BuilderGasLimitFlag defines the gas limit for the builder to use for constructing a payload.
BuilderGasLimitFlag = &cli.StringFlag{
Name: "suggested-gas-limit",
Usage: "Sets gas limit for the builder to use for constructing a payload for all the validators.",
Value: fmt.Sprint(params.BeaconConfig().DefaultBuilderGasLimit),
}
// ValidatorsRegistrationBatchSizeFlag sets the maximum size for one batch of validator registrations. Use a non-positive value to disable batching.
ValidatorsRegistrationBatchSizeFlag = &cli.IntFlag{
Name: "validators-registration-batch-size",
Usage: "Sets the maximum size for one batch of validator registrations. Use a non-positive value to disable batching.",
Value: 0,
}
// EnableDistributed enables the usage of prysm validator client in a Distributed Validator Cluster.
EnableDistributed = &cli.BoolFlag{
Name: "distributed",

View File

@@ -62,10 +62,10 @@ var appFlags = []cli.Flag{
flags.RPCPort,
flags.GRPCGatewayPort,
flags.GRPCGatewayHost,
flags.GrpcRetriesFlag,
flags.GrpcRetryDelayFlag,
flags.GrpcHeadersFlag,
flags.GPRCGatewayCorsDomain,
flags.GRPCRetriesFlag,
flags.GRPCRetryDelayFlag,
flags.GRPCHeadersFlag,
flags.GRPCGatewayCorsDomain,
flags.DisableAccountMetricsFlag,
flags.MonitoringPortFlag,
flags.SlasherRPCProviderFlag,

View File

@@ -56,6 +56,8 @@ var appHelpFlagGroups = []flagGroup{
cmd.E2EConfigFlag,
cmd.VerbosityFlag,
cmd.DataDirFlag,
flags.WalletDirFlag,
flags.WalletPasswordFileFlag,
cmd.ClearDB,
cmd.ForceClearDB,
cmd.EnableBackupWebhookFlag,
@@ -90,38 +92,56 @@ var appHelpFlagGroups = []flagGroup{
},
},
{
Name: "validator",
Name: "rpc",
Flags: []cli.Flag{
flags.CertFlag,
flags.BeaconRPCProviderFlag,
flags.BeaconRPCGatewayProviderFlag,
flags.BeaconRESTApiProviderFlag,
flags.CertFlag,
flags.EnableWebFlag,
flags.DisablePenaltyRewardLogFlag,
flags.GraffitiFlag,
flags.EnableRPCFlag,
flags.RPCHost,
flags.RPCPort,
flags.GRPCGatewayPort,
flags.GRPCGatewayHost,
flags.GrpcRetriesFlag,
flags.GrpcRetryDelayFlag,
flags.GPRCGatewayCorsDomain,
flags.GrpcHeadersFlag,
flags.SlasherRPCProviderFlag,
flags.SlasherCertFlag,
flags.DisableAccountMetricsFlag,
flags.WalletDirFlag,
flags.WalletPasswordFileFlag,
flags.GraffitiFileFlag,
flags.Web3SignerURLFlag,
flags.Web3SignerPublicValidatorKeysFlag,
flags.GRPCRetriesFlag,
flags.GRPCRetryDelayFlag,
flags.GRPCGatewayCorsDomain,
flags.GRPCHeadersFlag,
flags.BeaconRESTApiProviderFlag,
},
},
{
Name: "proposer",
Flags: []cli.Flag{
flags.ProposerSettingsFlag,
flags.ProposerSettingsURLFlag,
flags.SuggestedFeeRecipientFlag,
flags.EnableBuilderFlag,
flags.BuilderGasLimitFlag,
flags.ValidatorsRegistrationBatchSizeFlag,
flags.GraffitiFlag,
flags.GraffitiFileFlag,
},
},
{
Name: "remote signer",
Flags: []cli.Flag{
flags.Web3SignerURLFlag,
flags.Web3SignerPublicValidatorKeysFlag,
},
},
{
Name: "slasher",
Flags: []cli.Flag{
flags.SlasherRPCProviderFlag,
flags.SlasherCertFlag,
},
},
{
Name: "misc",
Flags: []cli.Flag{
flags.EnableWebFlag,
flags.DisablePenaltyRewardLogFlag,
flags.DisableAccountMetricsFlag,
flags.EnableDistributed,
flags.AuthTokenPathFlag,
},

View File

@@ -10,7 +10,7 @@ import (
func TestAllFlagsExistInHelp(t *testing.T) {
// If this test is failing, it is because you've recently added/removed a
// flag in beacon chain main.go, but did not add/remove it to the usage.go
// flag in main.go, but did not add/remove it to the usage.go
// flag grouping (appHelpFlagGroups).
var helpFlags []cli.Flag

View File

@@ -68,7 +68,7 @@ func SetupWalletCtx(
set.String(flags.DeletePublicKeysFlag.Name, cfg.deletePublicKeys, "")
set.String(flags.VoluntaryExitPublicKeysFlag.Name, cfg.voluntaryExitPublicKeys, "")
set.String(flags.BackupDirFlag.Name, cfg.backupDir, "")
set.String(flags.BackupPasswordFile.Name, cfg.backupPasswordFile, "")
set.String(flags.BackupPasswordFileFlag.Name, cfg.backupPasswordFile, "")
set.String(flags.BackupPublicKeysFlag.Name, cfg.backupPublicKeys, "")
set.String(flags.WalletPasswordFileFlag.Name, cfg.walletPasswordFile, "")
set.String(flags.AccountPasswordFileFlag.Name, cfg.accountPasswordFile, "")
@@ -76,7 +76,7 @@ func SetupWalletCtx(
set.Bool(flags.SkipDepositConfirmationFlag.Name, cfg.skipDepositConfirm, "")
set.Bool(flags.SkipMnemonic25thWordCheckFlag.Name, true, "")
set.Bool(flags.ExitAllFlag.Name, cfg.exitAll, "")
set.String(flags.GrpcHeadersFlag.Name, cfg.grpcHeaders, "")
set.String(flags.GRPCHeadersFlag.Name, cfg.grpcHeaders, "")
if cfg.privateKeyFile != "" {
set.String(flags.ImportPrivateKeyFileFlag.Name, cfg.privateKeyFile, "")
@@ -90,13 +90,13 @@ func SetupWalletCtx(
assert.NoError(tb, set.Set(flags.VoluntaryExitPublicKeysFlag.Name, cfg.voluntaryExitPublicKeys))
assert.NoError(tb, set.Set(flags.BackupDirFlag.Name, cfg.backupDir))
assert.NoError(tb, set.Set(flags.BackupPublicKeysFlag.Name, cfg.backupPublicKeys))
assert.NoError(tb, set.Set(flags.BackupPasswordFile.Name, cfg.backupPasswordFile))
assert.NoError(tb, set.Set(flags.BackupPasswordFileFlag.Name, cfg.backupPasswordFile))
assert.NoError(tb, set.Set(flags.WalletPasswordFileFlag.Name, cfg.walletPasswordFile))
assert.NoError(tb, set.Set(flags.AccountPasswordFileFlag.Name, cfg.accountPasswordFile))
assert.NoError(tb, set.Set(flags.NumAccountsFlag.Name, strconv.Itoa(int(cfg.numAccounts))))
assert.NoError(tb, set.Set(flags.SkipDepositConfirmationFlag.Name, strconv.FormatBool(cfg.skipDepositConfirm)))
assert.NoError(tb, set.Set(flags.ExitAllFlag.Name, strconv.FormatBool(cfg.exitAll)))
assert.NoError(tb, set.Set(flags.GrpcHeadersFlag.Name, cfg.grpcHeaders))
assert.NoError(tb, set.Set(flags.GRPCHeadersFlag.Name, cfg.grpcHeaders))
return cli.NewContext(&app, set, nil)
}

View File

@@ -14,11 +14,14 @@ go_library(
"mainnet_config.go",
"minimal_config.go",
"network_config.go",
"network_config_develop.go", # keep
"network_config_prod.go",
"testnet_e2e_config.go",
"testnet_holesky_config.go",
"testnet_sepolia_config.go",
"testutils.go",
"testutils_develop.go", # keep
"testutils_prod.go",
"values.go",
],
importpath = "github.com/prysmaticlabs/prysm/v5/config/params",

View File

@@ -1,7 +1,6 @@
package params
import (
"github.com/mohae/deepcopy"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
)
@@ -20,27 +19,6 @@ type NetworkConfig struct {
var networkConfig = mainnetNetworkConfig
// BeaconNetworkConfig returns the current network config for
// the beacon chain.
func BeaconNetworkConfig() *NetworkConfig {
return networkConfig
}
// OverrideBeaconNetworkConfig will override the network
// config with the added argument.
func OverrideBeaconNetworkConfig(cfg *NetworkConfig) {
networkConfig = cfg.Copy()
}
// Copy returns Copy of the config object.
func (c *NetworkConfig) Copy() *NetworkConfig {
config, ok := deepcopy.Copy(*c).(NetworkConfig)
if !ok {
config = *networkConfig
}
return &config
}
// MaxRequestBlock determines the maximum number of blocks that can be requested in a single
// request for a given epoch. If the epoch is at or beyond config's `DenebForkEpoch`,
// a special limit defined for Deneb is used.

View File

@@ -0,0 +1,38 @@
//go:build develop
package params
import (
"sync"
"github.com/mohae/deepcopy"
)
var networkConfigLock sync.Mutex
// BeaconNetworkConfig returns the current network config for
// the beacon chain.
func BeaconNetworkConfig() *NetworkConfig {
networkConfigLock.Lock()
defer networkConfigLock.Unlock()
return networkConfig
}
// OverrideBeaconNetworkConfig will override the network
// config with the added argument.
func OverrideBeaconNetworkConfig(cfg *NetworkConfig) {
networkConfigLock.Lock()
defer networkConfigLock.Unlock()
networkConfig = cfg.Copy()
}
// Copy returns Copy of the config object.
func (c *NetworkConfig) Copy() *NetworkConfig {
config, ok := deepcopy.Copy(*c).(NetworkConfig)
if !ok {
networkConfigLock.Lock()
config = *networkConfig
networkConfigLock.Unlock()
}
return &config
}

View File

@@ -0,0 +1,26 @@
//go:build !develop
package params
import "github.com/mohae/deepcopy"
// BeaconNetworkConfig returns the current network config for
// the beacon chain.
func BeaconNetworkConfig() *NetworkConfig {
return networkConfig
}
// OverrideBeaconNetworkConfig will override the network
// config with the added argument.
func OverrideBeaconNetworkConfig(cfg *NetworkConfig) {
networkConfig = cfg.Copy()
}
// Copy returns Copy of the config object.
func (c *NetworkConfig) Copy() *NetworkConfig {
config, ok := deepcopy.Copy(*c).(NetworkConfig)
if !ok {
config = *networkConfig
}
return &config
}

View File

@@ -1,28 +1,6 @@
package params
import (
"testing"
)
// SetupTestConfigCleanup preserves configurations allowing to modify them within tests without any
// restrictions, everything is restored after the test.
func SetupTestConfigCleanup(t testing.TB) {
prevDefaultBeaconConfig := mainnetBeaconConfig.Copy()
temp := configs.getActive().Copy()
undo, err := SetActiveWithUndo(temp)
if err != nil {
t.Fatal(err)
}
prevNetworkCfg := networkConfig.Copy()
t.Cleanup(func() {
mainnetBeaconConfig = prevDefaultBeaconConfig
err = undo()
if err != nil {
t.Fatal(err)
}
networkConfig = prevNetworkCfg
})
}
import "testing"
// SetActiveTestCleanup sets an active config,
// and adds a test cleanup hook to revert to the default config after the test completes.

View File

@@ -4,13 +4,15 @@ package params
import "testing"
// SetupTestConfigCleanupWithLock preserves configurations allowing to modify them within tests without any
// SetupTestConfigCleanup preserves configurations allowing to modify them within tests without any
// restrictions, everything is restored after the test. This locks our config when undoing our config
// change in order to satisfy the race detector.
func SetupTestConfigCleanupWithLock(t testing.TB) {
func SetupTestConfigCleanup(t testing.TB) {
prevDefaultBeaconConfig := mainnetBeaconConfig.Copy()
temp := configs.getActive().Copy()
cfgrw.Lock()
undo, err := SetActiveWithUndo(temp)
cfgrw.Unlock()
if err != nil {
t.Error(err)
}
@@ -23,6 +25,8 @@ func SetupTestConfigCleanupWithLock(t testing.TB) {
if err != nil {
t.Error(err)
}
networkConfigLock.Lock()
networkConfig = prevNetworkCfg
networkConfigLock.Unlock()
})
}

View File

@@ -0,0 +1,25 @@
//go:build !develop
package params
import "testing"
// SetupTestConfigCleanup preserves configurations allowing to modify them within tests without any
// restrictions, everything is restored after the test.
func SetupTestConfigCleanup(t testing.TB) {
prevDefaultBeaconConfig := mainnetBeaconConfig.Copy()
temp := configs.getActive().Copy()
undo, err := SetActiveWithUndo(temp)
if err != nil {
t.Fatal(err)
}
prevNetworkCfg := networkConfig.Copy()
t.Cleanup(func() {
mainnetBeaconConfig = prevDefaultBeaconConfig
err = undo()
if err != nil {
t.Fatal(err)
}
networkConfig = prevNetworkCfg
})
}

185
deps.bzl
View File

@@ -705,8 +705,8 @@ def prysm_deps():
go_repository(
name = "com_github_decred_dcrd_dcrec_secp256k1_v4",
importpath = "github.com/decred/dcrd/dcrec/secp256k1/v4",
sum = "h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs=",
version = "v4.2.0",
sum = "h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg=",
version = "v4.3.0",
)
go_repository(
name = "com_github_deepmap_oapi_codegen",
@@ -1295,8 +1295,8 @@ def prysm_deps():
importpath = "github.com/golang/protobuf",
patch_args = ["-p1"],
patches = ["@io_bazel_rules_go//third_party:com_github_golang_protobuf-extras.patch"],
sum = "h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=",
version = "v1.5.3",
sum = "h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=",
version = "v1.5.4",
)
go_repository(
name = "com_github_golang_snappy",
@@ -1607,14 +1607,14 @@ def prysm_deps():
go_repository(
name = "com_github_hashicorp_golang_lru_arc_v2",
importpath = "github.com/hashicorp/golang-lru/arc/v2",
sum = "h1:l2zaLDubNhW4XO3LnliVj0GXO3+/CGNJAg1dcN2Fpfw=",
version = "v2.0.5",
sum = "h1:QxkVTxwColcduO+LP7eJO56r2hFiG8zEbfAAzRv52KQ=",
version = "v2.0.7",
)
go_repository(
name = "com_github_hashicorp_golang_lru_v2",
importpath = "github.com/hashicorp/golang-lru/v2",
sum = "h1:wW7h1TG88eUIJ2i69gaE3uNVtEPIagzhGvHgwfx2Vm4=",
version = "v2.0.5",
sum = "h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=",
version = "v2.0.7",
)
go_repository(
name = "com_github_hashicorp_hcl",
@@ -1975,8 +1975,8 @@ def prysm_deps():
go_repository(
name = "com_github_klauspost_compress",
importpath = "github.com/klauspost/compress",
sum = "h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI=",
version = "v1.17.6",
sum = "h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU=",
version = "v1.17.8",
)
go_repository(
name = "com_github_klauspost_cpuid",
@@ -2105,8 +2105,8 @@ def prysm_deps():
],
build_file_proto_mode = "disable_global",
importpath = "github.com/libp2p/go-libp2p",
sum = "h1:tvJl9b9M6nSLBtZSXSguq+/lRhRj2oLRkyhBmQNMFLA=",
version = "v0.33.1",
sum = "h1:1xS1Bkr9X7GtdvV6ntLnDV9xB1kNjHK1lZ0eaO6gnhc=",
version = "v0.35.0",
)
go_repository(
name = "com_github_libp2p_go_libp2p_asn_util",
@@ -2124,8 +2124,8 @@ def prysm_deps():
name = "com_github_libp2p_go_libp2p_pubsub",
build_file_proto_mode = "disable_global",
importpath = "github.com/libp2p/go-libp2p-pubsub",
sum = "h1:/RqOZpEtAolsr8/9CC8KqROJSOZeu7lK7fPftn4MwNg=",
version = "v0.10.1",
sum = "h1:+JvS8Kty0OiyUiN0i8H5JbaCgjnJTRnTHe4rU88dLFc=",
version = "v0.11.0",
)
go_repository(
name = "com_github_libp2p_go_libp2p_testing",
@@ -2448,8 +2448,8 @@ def prysm_deps():
go_repository(
name = "com_github_multiformats_go_multiaddr",
importpath = "github.com/multiformats/go-multiaddr",
sum = "h1:9G9sTY/wCYajKa9lyfWPmpZAwe6oV+Wb1zcmMS1HG24=",
version = "v0.12.2",
sum = "h1:rrKqpY9h+n80EwhhC/kkcunCZZ7URIF8yN1WEUt2Hvc=",
version = "v0.12.4",
)
go_repository(
name = "com_github_multiformats_go_multiaddr_dns",
@@ -2577,8 +2577,8 @@ def prysm_deps():
go_repository(
name = "com_github_nxadm_tail",
importpath = "github.com/nxadm/tail",
sum = "h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=",
version = "v1.4.8",
sum = "h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY=",
version = "v1.4.11",
)
go_repository(
name = "com_github_nytimes_gziphandler",
@@ -2787,26 +2787,26 @@ def prysm_deps():
go_repository(
name = "com_github_pion_datachannel",
importpath = "github.com/pion/datachannel",
sum = "h1:10ef4kwdjije+M9d7Xm9im2Y3O6A6ccQb0zcqZcJew8=",
version = "v1.5.5",
sum = "h1:1IxKJntfSlYkpUj8LlYRSWpYiTTC02nUrOE8T3DqGeg=",
version = "v1.5.6",
)
go_repository(
name = "com_github_pion_dtls_v2",
importpath = "github.com/pion/dtls/v2",
sum = "h1:BUroldfiIbV9jSnC6cKOMnyiORRWrWWpV11JUyEu5OA=",
version = "v2.2.8",
sum = "h1:9U/dpCYl1ySttROPWJgqWKEylUdT0fXp/xst6JwY5Ks=",
version = "v2.2.11",
)
go_repository(
name = "com_github_pion_ice_v2",
importpath = "github.com/pion/ice/v2",
sum = "h1:rZjVmUwyT55cmN8ySMpL7rsS8KYsJERsrxJLLxpKhdw=",
version = "v2.3.11",
sum = "h1:RYgzhH/u5lH0XO+ABatVKCtRd+4U1GEaCXSMjNr13tI=",
version = "v2.3.24",
)
go_repository(
name = "com_github_pion_interceptor",
importpath = "github.com/pion/interceptor",
sum = "h1:pwY9r7P6ToQ3+IF0bajN0xmk/fNw/suTgaTdlwTDmhc=",
version = "v0.1.25",
sum = "h1:39fsnlP1U8gw2JzOFWdfCU82vHvhW9o0rZnZF56wF+M=",
version = "v0.1.29",
)
go_repository(
name = "com_github_pion_logging",
@@ -2817,8 +2817,8 @@ def prysm_deps():
go_repository(
name = "com_github_pion_mdns",
importpath = "github.com/pion/mdns",
sum = "h1:7Ue5KZsqq8EuqStnpPWV33vYYEH0+skdDN5L7EiEsI4=",
version = "v0.0.9",
sum = "h1:CiMYlY+O0azojWDmxdNr7ADGrnZ+V6Ilfner+6mSVK8=",
version = "v0.0.12",
)
go_repository(
name = "com_github_pion_randutil",
@@ -2829,26 +2829,26 @@ def prysm_deps():
go_repository(
name = "com_github_pion_rtcp",
importpath = "github.com/pion/rtcp",
sum = "h1:+EQijuisKwm/8VBs8nWllr0bIndR7Lf7cZG200mpbNo=",
version = "v1.2.13",
sum = "h1:KCkGV3vJ+4DAJmvP0vaQShsb0xkRfWkO540Gy102KyE=",
version = "v1.2.14",
)
go_repository(
name = "com_github_pion_rtp",
importpath = "github.com/pion/rtp",
sum = "h1:VEHxqzSVQxCkKDSHro5/4IUUG1ea+MFdqR2R3xSpNU8=",
version = "v1.8.3",
sum = "h1:MTmn/b0aWWsAzux2AmP8WGllusBVw4NPYPVFFd7jUPw=",
version = "v1.8.6",
)
go_repository(
name = "com_github_pion_sctp",
importpath = "github.com/pion/sctp",
sum = "h1:TP5ZVxV5J7rz7uZmbyvnUvsn7EJ2x/5q9uhsTtXbI3g=",
version = "v1.8.9",
sum = "h1:PKrMs+o9EMLRvFfXq59WFsC+V8mN1wnKzqrv+3D/gYY=",
version = "v1.8.16",
)
go_repository(
name = "com_github_pion_sdp_v3",
importpath = "github.com/pion/sdp/v3",
sum = "h1:WuDLhtuFUUVpTfus9ILC4HRyHsW6TdugjEX/QY9OiUw=",
version = "v3.0.6",
sum = "h1:pX++dCHoHUwq43kuwf3PyJfHlwIj4hXA7Vrifiq0IJY=",
version = "v3.0.9",
)
go_repository(
name = "com_github_pion_srtp_v2",
@@ -2865,20 +2865,26 @@ def prysm_deps():
go_repository(
name = "com_github_pion_transport_v2",
importpath = "github.com/pion/transport/v2",
sum = "h1:41JJK6DZQYSeVLxILA2+F4ZkKb4Xd/tFJZRFZQ9QAlo=",
version = "v2.2.4",
sum = "h1:iyi25i/21gQck4hfRhomF6SktmUQjRsRW4WJdhfc3Kc=",
version = "v2.2.5",
)
go_repository(
name = "com_github_pion_transport_v3",
importpath = "github.com/pion/transport/v3",
sum = "h1:r+40RJR25S9w3jbA6/5uEPTzcdn7ncyU44RWCbHkLg4=",
version = "v3.0.2",
)
go_repository(
name = "com_github_pion_turn_v2",
importpath = "github.com/pion/turn/v2",
sum = "h1:2xn8rduI5W6sCZQkEnIUDAkrBQNl2eYIBCHMZ3QMmP8=",
version = "v2.1.4",
sum = "h1:Xr2niVsiPTB0FPtt+yAWKFUkU1eotQbGgpTIld4x1Gc=",
version = "v2.1.6",
)
go_repository(
name = "com_github_pion_webrtc_v3",
importpath = "github.com/pion/webrtc/v3",
sum = "h1:GbqEuxBbVLFhXk0GwxKAoaIJYiEa9TyoZPEZC+2HZxM=",
version = "v3.2.23",
sum = "h1:Wtfi6AZMQg+624cvCXUuSmrKWepSB7zfgYDOYqsSOVU=",
version = "v3.2.40",
)
go_repository(
name = "com_github_pkg_diff",
@@ -2925,20 +2931,20 @@ def prysm_deps():
go_repository(
name = "com_github_prometheus_client_golang",
importpath = "github.com/prometheus/client_golang",
sum = "h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=",
version = "v1.18.0",
sum = "h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE=",
version = "v1.19.1",
)
go_repository(
name = "com_github_prometheus_client_model",
importpath = "github.com/prometheus/client_model",
sum = "h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=",
version = "v0.6.0",
sum = "h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=",
version = "v0.6.1",
)
go_repository(
name = "com_github_prometheus_common",
importpath = "github.com/prometheus/common",
sum = "h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k=",
version = "v0.47.0",
sum = "h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=",
version = "v0.48.0",
)
go_repository(
name = "com_github_prometheus_procfs",
@@ -3015,15 +3021,6 @@ def prysm_deps():
sum = "h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo=",
version = "v0.4.0",
)
go_repository(
name = "com_github_quic_go_qtls_go1_20",
build_directives = [
"gazelle:exclude generate_cert.go",
],
importpath = "github.com/quic-go/qtls-go1-20",
sum = "h1:MfFAPULvst4yoMgY9QmtpYmfij/em7O8UUi+bNVm7Cg=",
version = "v0.3.4",
)
go_repository(
name = "com_github_quic_go_quic_go",
build_directives = [
@@ -3031,14 +3028,14 @@ def prysm_deps():
"gazelle:exclude tools.go",
],
importpath = "github.com/quic-go/quic-go",
sum = "h1:uSfdap0eveIl8KXnipv9K7nlwZ5IqLlYOpJ58u5utpM=",
version = "v0.42.0",
sum = "h1:So5wOr7jyO4vzL2sd8/pD9Kesciv91zSk8BoFngItQ0=",
version = "v0.44.0",
)
go_repository(
name = "com_github_quic_go_webtransport_go",
importpath = "github.com/quic-go/webtransport-go",
sum = "h1:CvNsKqc4W2HljHJnoT+rMmbRJybShZ0YPFDD3NxaZLY=",
version = "v0.6.0",
sum = "h1:HxSrwun11U+LlmwpgM1kEqIqH90IT4N8auv/cD7QFJg=",
version = "v0.8.0",
)
go_repository(
name = "com_github_raulk_go_watchdog",
@@ -3128,6 +3125,12 @@ def prysm_deps():
sum = "h1:nMinx+JaEm/zJz4cEyClQeAw5rsYSB5th3xv+5lV6Vg=",
version = "v3.3.4",
)
go_repository(
name = "com_github_sclevine_agouti",
importpath = "github.com/sclevine/agouti",
sum = "h1:8IBJS6PWz3uTlMP3YBIR5f+KAldcGuOeFkFbUWfBgK4=",
version = "v3.0.0+incompatible",
)
go_repository(
name = "com_github_sean_seed",
importpath = "github.com/sean-/seed",
@@ -3407,14 +3410,14 @@ def prysm_deps():
go_repository(
name = "com_github_stretchr_objx",
importpath = "github.com/stretchr/objx",
sum = "h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=",
version = "v0.5.0",
sum = "h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=",
version = "v0.5.2",
)
go_repository(
name = "com_github_stretchr_testify",
importpath = "github.com/stretchr/testify",
sum = "h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=",
version = "v1.8.4",
sum = "h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=",
version = "v1.9.0",
)
go_repository(
name = "com_github_subosito_gotenv",
@@ -4783,8 +4786,8 @@ def prysm_deps():
go_repository(
name = "org_golang_google_protobuf",
importpath = "google.golang.org/protobuf",
sum = "h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=",
version = "v1.32.0",
sum = "h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=",
version = "v1.34.1",
)
go_repository(
name = "org_golang_x_build",
@@ -4795,14 +4798,14 @@ def prysm_deps():
go_repository(
name = "org_golang_x_crypto",
importpath = "golang.org/x/crypto",
sum = "h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo=",
version = "v0.19.0",
sum = "h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=",
version = "v0.23.0",
)
go_repository(
name = "org_golang_x_exp",
importpath = "golang.org/x/exp",
sum = "h1:HinSgX1tJRX3KsL//Gxynpw5CTOAIPhgL4W8PNiIpVE=",
version = "v0.0.0-20240213143201-ec583247a57a",
sum = "h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM=",
version = "v0.0.0-20240506185415-9bf2ced13842",
)
go_repository(
name = "org_golang_x_exp_typeparams",
@@ -4831,14 +4834,14 @@ def prysm_deps():
go_repository(
name = "org_golang_x_mod",
importpath = "golang.org/x/mod",
sum = "h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8=",
version = "v0.15.0",
sum = "h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=",
version = "v0.17.0",
)
go_repository(
name = "org_golang_x_net",
importpath = "golang.org/x/net",
sum = "h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=",
version = "v0.21.0",
sum = "h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=",
version = "v0.25.0",
)
go_repository(
name = "org_golang_x_oauth2",
@@ -4855,32 +4858,32 @@ def prysm_deps():
go_repository(
name = "org_golang_x_sync",
importpath = "golang.org/x/sync",
sum = "h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=",
version = "v0.6.0",
sum = "h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=",
version = "v0.7.0",
)
go_repository(
name = "org_golang_x_sys",
importpath = "golang.org/x/sys",
sum = "h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=",
version = "v0.17.0",
sum = "h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=",
version = "v0.20.0",
)
go_repository(
name = "org_golang_x_telemetry",
importpath = "golang.org/x/telemetry",
sum = "h1:+Kc94D8UVEVxJnLXp/+FMfqQARZtWHfVrcRtcG8aT3g=",
version = "v0.0.0-20240208230135-b75ee8823808",
sum = "h1:IRJeR9r1pYWsHKTRe/IInb7lYvbBVIqOgsX/u0mbOWY=",
version = "v0.0.0-20240228155512-f48c80bd79b2",
)
go_repository(
name = "org_golang_x_term",
importpath = "golang.org/x/term",
sum = "h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U=",
version = "v0.17.0",
sum = "h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw=",
version = "v0.20.0",
)
go_repository(
name = "org_golang_x_text",
importpath = "golang.org/x/text",
sum = "h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=",
version = "v0.14.0",
sum = "h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=",
version = "v0.15.0",
)
go_repository(
name = "org_golang_x_time",
@@ -4891,8 +4894,8 @@ def prysm_deps():
go_repository(
name = "org_golang_x_tools",
importpath = "golang.org/x/tools",
sum = "h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ=",
version = "v0.18.0",
sum = "h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw=",
version = "v0.21.0",
)
go_repository(
name = "org_golang_x_xerrors",
@@ -4903,8 +4906,8 @@ def prysm_deps():
go_repository(
name = "org_uber_go_atomic",
importpath = "go.uber.org/atomic",
sum = "h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=",
version = "v1.11.0",
sum = "h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=",
version = "v1.7.0",
)
go_repository(
name = "org_uber_go_automaxprocs",
@@ -4926,8 +4929,8 @@ def prysm_deps():
go_repository(
name = "org_uber_go_fx",
importpath = "go.uber.org/fx",
sum = "h1:zVwVQGS8zYvhh9Xxcu4w1M6ESyeMzebzj2NbSayZ4Mk=",
version = "v1.20.1",
sum = "h1:RqBh3cYdzZS0uqwVeEjOX2p73dddLpym315myy/Bpb0=",
version = "v1.21.1",
)
go_repository(
name = "org_uber_go_goleak",

68
go.mod
View File

@@ -25,7 +25,7 @@ require (
github.com/gogo/protobuf v1.3.2
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/golang/gddo v0.0.0-20200528160355-8d077c1d8f4c
github.com/golang/protobuf v1.5.3
github.com/golang/protobuf v1.5.4
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb
github.com/google/go-cmp v0.6.0
github.com/google/gofuzz v1.2.0
@@ -45,9 +45,9 @@ require (
github.com/json-iterator/go v1.1.12
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213
github.com/kr/pretty v0.3.1
github.com/libp2p/go-libp2p v0.33.1
github.com/libp2p/go-libp2p v0.35.0
github.com/libp2p/go-libp2p-mplex v0.9.0
github.com/libp2p/go-libp2p-pubsub v0.10.1
github.com/libp2p/go-libp2p-pubsub v0.11.0
github.com/libp2p/go-mplex v0.7.0
github.com/logrusorgru/aurora v2.0.3+incompatible
github.com/manifoldco/promptui v0.7.0
@@ -55,15 +55,15 @@ require (
github.com/minio/highwayhash v1.0.2
github.com/minio/sha256-simd v1.0.1
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
github.com/multiformats/go-multiaddr v0.12.2
github.com/multiformats/go-multiaddr v0.12.4
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.30.0
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/paulbellamy/ratecounter v0.2.0
github.com/pborman/uuid v1.2.1
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.18.0
github.com/prometheus/client_model v0.6.0
github.com/prometheus/client_golang v1.19.1
github.com/prometheus/client_model v0.6.1
github.com/prometheus/prom2json v1.3.0
github.com/prysmaticlabs/fastssz v0.0.0-20221107182844-78142813af44
github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7
@@ -74,7 +74,7 @@ require (
github.com/sirupsen/logrus v1.9.0
github.com/spf13/afero v1.10.0
github.com/status-im/keycard-go v0.2.0
github.com/stretchr/testify v1.8.4
github.com/stretchr/testify v1.9.0
github.com/supranational/blst v0.3.11
github.com/thomaso-mirodin/intmath v0.0.0-20160323211736-5dc6d854e46e
github.com/trailofbits/go-mutexasserts v0.0.0-20230328101604-8cdbc5f3d279
@@ -88,14 +88,14 @@ require (
go.opencensus.io v0.24.0
go.uber.org/automaxprocs v1.5.2
go.uber.org/mock v0.4.0
golang.org/x/crypto v0.21.0
golang.org/x/exp v0.0.0-20240213143201-ec583247a57a
golang.org/x/mod v0.15.0
golang.org/x/sync v0.6.0
golang.org/x/tools v0.18.0
golang.org/x/crypto v0.23.0
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842
golang.org/x/mod v0.17.0
golang.org/x/sync v0.7.0
golang.org/x/tools v0.21.0
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1
google.golang.org/grpc v1.56.3
google.golang.org/protobuf v1.32.0
google.golang.org/protobuf v1.34.1
gopkg.in/d4l3k/messagediff.v1 v1.2.1
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
@@ -128,7 +128,7 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect
github.com/deckarep/golang-set/v2 v2.5.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/deepmap/oapi-codegen v1.8.2 // indirect
github.com/dlclark/regexp2 v1.7.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
@@ -152,7 +152,7 @@ require (
github.com/gorilla/websocket v1.5.1 // indirect
github.com/graph-gophers/graphql-go v1.3.0 // indirect
github.com/hashicorp/go-bexpr v0.1.10 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.5 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/goevmlab v0.0.0-20231201084119-c73b3c97929c // indirect
@@ -165,7 +165,7 @@ require (
github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect
github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a // indirect
github.com/karalabe/usb v0.0.3-0.20230711191512-61db3e06439c // indirect
github.com/klauspost/compress v1.17.6 // indirect
github.com/klauspost/compress v1.17.8 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/koron/go-ssdp v0.0.4 // indirect
github.com/kr/text v0.2.0 // indirect
@@ -203,25 +203,41 @@ require (
github.com/multiformats/go-multihash v0.2.3 // indirect
github.com/multiformats/go-multistream v0.5.0 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/nxadm/tail v1.4.11 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/onsi/ginkgo/v2 v2.15.0 // indirect
github.com/opencontainers/runtime-spec v1.2.0 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
github.com/pion/datachannel v1.5.6 // indirect
github.com/pion/dtls/v2 v2.2.11 // indirect
github.com/pion/ice/v2 v2.3.24 // indirect
github.com/pion/interceptor v0.1.29 // indirect
github.com/pion/logging v0.2.2 // indirect
github.com/pion/mdns v0.0.12 // indirect
github.com/pion/randutil v0.1.0 // indirect
github.com/pion/rtcp v1.2.14 // indirect
github.com/pion/rtp v1.8.6 // indirect
github.com/pion/sctp v1.8.16 // indirect
github.com/pion/sdp/v3 v3.0.9 // indirect
github.com/pion/srtp/v2 v2.0.18 // indirect
github.com/pion/stun v0.6.1 // indirect
github.com/pion/transport/v2 v2.2.5 // indirect
github.com/pion/turn/v2 v2.1.6 // indirect
github.com/pion/webrtc/v3 v3.2.40 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/common v0.47.0 // indirect
github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/quic-go/qpack v0.4.0 // indirect
github.com/quic-go/quic-go v0.42.0 // indirect
github.com/quic-go/webtransport-go v0.6.0 // indirect
github.com/quic-go/quic-go v0.44.0 // indirect
github.com/quic-go/webtransport-go v0.8.0 // indirect
github.com/raulk/go-watchdog v1.3.0 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tklauser/go-sysconf v0.3.13 // indirect
github.com/tklauser/numcpus v0.7.0 // indirect
@@ -230,14 +246,14 @@ require (
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.uber.org/dig v1.17.1 // indirect
go.uber.org/fx v1.20.1 // indirect
go.uber.org/fx v1.21.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/oauth2 v0.16.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/term v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/time v0.5.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
@@ -257,7 +273,7 @@ require (
github.com/go-playground/validator/v10 v10.13.0
github.com/peterh/liner v1.2.0 // indirect
github.com/prysmaticlabs/gohashtree v0.0.4-beta
golang.org/x/sys v0.18.0 // indirect
golang.org/x/sys v0.20.0 // indirect
google.golang.org/api v0.44.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
k8s.io/klog/v2 v2.80.0 // indirect

179
go.sum
View File

@@ -215,8 +215,8 @@ github.com/deckarep/golang-set/v2 v2.5.0 h1:hn6cEZtQ0h3J8kFrHR/NrzyOoTnjgW1+FmNJ
github.com/deckarep/golang-set/v2 v2.5.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4=
github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y=
github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M=
github.com/deepmap/oapi-codegen v1.8.2 h1:SegyeYGcdi0jLLrpbCMoJxnUUn8GBXHsvr4rbzjuhfU=
github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw=
@@ -405,8 +405,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
@@ -462,6 +462,7 @@ github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=
github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
@@ -521,8 +522,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs=
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/golang-lru/v2 v2.0.5 h1:wW7h1TG88eUIJ2i69gaE3uNVtEPIagzhGvHgwfx2Vm4=
github.com/hashicorp/golang-lru/v2 v2.0.5/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
github.com/hashicorp/hcl v0.0.0-20170914154624-68e816d1c783/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
@@ -597,8 +598,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o
github.com/klauspost/compress v1.9.8/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.10.1/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI=
github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU=
github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM=
github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
@@ -635,14 +636,14 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6
github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg=
github.com/libp2p/go-flow-metrics v0.1.0 h1:0iPhMI8PskQwzh57jB9WxIuIOQ0r+15PChFGkx3Q3WM=
github.com/libp2p/go-flow-metrics v0.1.0/go.mod h1:4Xi8MX8wj5aWNDAZttg6UPmc0ZrnFNsMtpsYUClFtro=
github.com/libp2p/go-libp2p v0.33.1 h1:tvJl9b9M6nSLBtZSXSguq+/lRhRj2oLRkyhBmQNMFLA=
github.com/libp2p/go-libp2p v0.33.1/go.mod h1:zOUTMjG4I7TXwMndNyOBn/CNtVBLlvBlnxfi+8xzx+E=
github.com/libp2p/go-libp2p v0.35.0 h1:1xS1Bkr9X7GtdvV6ntLnDV9xB1kNjHK1lZ0eaO6gnhc=
github.com/libp2p/go-libp2p v0.35.0/go.mod h1:snyJQix4ET6Tj+LeI0VPjjxTtdWpeOhYt5lEY0KirkQ=
github.com/libp2p/go-libp2p-asn-util v0.4.1 h1:xqL7++IKD9TBFMgnLPZR6/6iYhawHKHl950SO9L6n94=
github.com/libp2p/go-libp2p-asn-util v0.4.1/go.mod h1:d/NI6XZ9qxw67b4e+NgpQexCIiFYJjErASrYW4PFDN8=
github.com/libp2p/go-libp2p-mplex v0.9.0 h1:R58pDRAmuBXkYugbSSXR9wrTX3+1pFM1xP2bLuodIq8=
github.com/libp2p/go-libp2p-mplex v0.9.0/go.mod h1:ro1i4kuwiFT+uMPbIDIFkcLs1KRbNp0QwnUXM+P64Og=
github.com/libp2p/go-libp2p-pubsub v0.10.1 h1:/RqOZpEtAolsr8/9CC8KqROJSOZeu7lK7fPftn4MwNg=
github.com/libp2p/go-libp2p-pubsub v0.10.1/go.mod h1:1OxbaT/pFRO5h+Dpze8hdHQ63R0ke55XTs6b6NwLLkw=
github.com/libp2p/go-libp2p-pubsub v0.11.0 h1:+JvS8Kty0OiyUiN0i8H5JbaCgjnJTRnTHe4rU88dLFc=
github.com/libp2p/go-libp2p-pubsub v0.11.0/go.mod h1:QEb+hEV9WL9wCiUAnpY29FZR6W3zK8qYlaml8R4q6gQ=
github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA=
github.com/libp2p/go-libp2p-testing v0.12.0/go.mod h1:KcGDRXyN7sQCllucn1cOOS+Dmm7ujhfEyXQL5lvkcPg=
github.com/libp2p/go-mplex v0.7.0 h1:BDhFZdlk5tbr0oyFq/xv/NPGfjbnrsDam1EvutpBDbY=
@@ -758,8 +759,8 @@ github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9
github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4=
github.com/multiformats/go-multiaddr v0.1.1/go.mod h1:aMKBKNEYmzmDmxfX88/vz+J5IU55txyt0p4aiWVohjo=
github.com/multiformats/go-multiaddr v0.2.0/go.mod h1:0nO36NvPpyV4QzvTLi/lafl2y95ncPj0vFwVF6k6wJ4=
github.com/multiformats/go-multiaddr v0.12.2 h1:9G9sTY/wCYajKa9lyfWPmpZAwe6oV+Wb1zcmMS1HG24=
github.com/multiformats/go-multiaddr v0.12.2/go.mod h1:GKyaTYjZRdcUhyOetrxTk9z0cW+jA/YrnqTOvKgi44M=
github.com/multiformats/go-multiaddr v0.12.4 h1:rrKqpY9h+n80EwhhC/kkcunCZZ7URIF8yN1WEUt2Hvc=
github.com/multiformats/go-multiaddr v0.12.4/go.mod h1:sBXrNzucqkFJhvKOiwwLyqamGa/P5EIXNPLovyhQCII=
github.com/multiformats/go-multiaddr-dns v0.3.1 h1:QgQgR+LQVt3NPTjbrLLpsaT2ufAA2y0Mkk+QRVJbW3A=
github.com/multiformats/go-multiaddr-dns v0.3.1/go.mod h1:G/245BRQ6FJGmryJCrOuTdB37AMA5AMOVuO6NY3JwTk=
github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E=
@@ -791,8 +792,9 @@ github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJE
github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM=
github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY=
github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc=
github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
@@ -861,6 +863,50 @@ github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi
github.com/pierrec/lz4 v2.4.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
github.com/pion/datachannel v1.5.6 h1:1IxKJntfSlYkpUj8LlYRSWpYiTTC02nUrOE8T3DqGeg=
github.com/pion/datachannel v1.5.6/go.mod h1:1eKT6Q85pRnr2mHiWHxJwO50SfZRtWHTsNIVb/NfGW4=
github.com/pion/dtls/v2 v2.2.7/go.mod h1:8WiMkebSHFD0T+dIU+UeBaoV7kDhOW5oDCzZ7WZ/F9s=
github.com/pion/dtls/v2 v2.2.11 h1:9U/dpCYl1ySttROPWJgqWKEylUdT0fXp/xst6JwY5Ks=
github.com/pion/dtls/v2 v2.2.11/go.mod h1:d9SYc9fch0CqK90mRk1dC7AkzzpwJj6u2GU3u+9pqFE=
github.com/pion/ice/v2 v2.3.24 h1:RYgzhH/u5lH0XO+ABatVKCtRd+4U1GEaCXSMjNr13tI=
github.com/pion/ice/v2 v2.3.24/go.mod h1:KXJJcZK7E8WzrBEYnV4UtqEZsGeWfHxsNqhVcVvgjxw=
github.com/pion/interceptor v0.1.29 h1:39fsnlP1U8gw2JzOFWdfCU82vHvhW9o0rZnZF56wF+M=
github.com/pion/interceptor v0.1.29/go.mod h1:ri+LGNjRUc5xUNtDEPzfdkmSqISixVTBF/z/Zms/6T4=
github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY=
github.com/pion/logging v0.2.2/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms=
github.com/pion/mdns v0.0.12 h1:CiMYlY+O0azojWDmxdNr7ADGrnZ+V6Ilfner+6mSVK8=
github.com/pion/mdns v0.0.12/go.mod h1:VExJjv8to/6Wqm1FXK+Ii/Z9tsVk/F5sD/N70cnYFbk=
github.com/pion/randutil v0.1.0 h1:CFG1UdESneORglEsnimhUjf33Rwjubwj6xfiOXBa3mA=
github.com/pion/randutil v0.1.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8=
github.com/pion/rtcp v1.2.12/go.mod h1:sn6qjxvnwyAkkPzPULIbVqSKI5Dv54Rv7VG0kNxh9L4=
github.com/pion/rtcp v1.2.14 h1:KCkGV3vJ+4DAJmvP0vaQShsb0xkRfWkO540Gy102KyE=
github.com/pion/rtcp v1.2.14/go.mod h1:sn6qjxvnwyAkkPzPULIbVqSKI5Dv54Rv7VG0kNxh9L4=
github.com/pion/rtp v1.8.3/go.mod h1:pBGHaFt/yW7bf1jjWAoUjpSNoDnw98KTMg+jWWvziqU=
github.com/pion/rtp v1.8.6 h1:MTmn/b0aWWsAzux2AmP8WGllusBVw4NPYPVFFd7jUPw=
github.com/pion/rtp v1.8.6/go.mod h1:pBGHaFt/yW7bf1jjWAoUjpSNoDnw98KTMg+jWWvziqU=
github.com/pion/sctp v1.8.13/go.mod h1:YKSgO/bO/6aOMP9LCie1DuD7m+GamiK2yIiPM6vH+GA=
github.com/pion/sctp v1.8.16 h1:PKrMs+o9EMLRvFfXq59WFsC+V8mN1wnKzqrv+3D/gYY=
github.com/pion/sctp v1.8.16/go.mod h1:P6PbDVA++OJMrVNg2AL3XtYHV4uD6dvfyOovCgMs0PE=
github.com/pion/sdp/v3 v3.0.9 h1:pX++dCHoHUwq43kuwf3PyJfHlwIj4hXA7Vrifiq0IJY=
github.com/pion/sdp/v3 v3.0.9/go.mod h1:B5xmvENq5IXJimIO4zfp6LAe1fD9N+kFv+V/1lOdz8M=
github.com/pion/srtp/v2 v2.0.18 h1:vKpAXfawO9RtTRKZJbG4y0v1b11NZxQnxRl85kGuUlo=
github.com/pion/srtp/v2 v2.0.18/go.mod h1:0KJQjA99A6/a0DOVTu1PhDSw0CXF2jTkqOoMg3ODqdA=
github.com/pion/stun v0.6.1 h1:8lp6YejULeHBF8NmV8e2787BogQhduZugh5PdhDyyN4=
github.com/pion/stun v0.6.1/go.mod h1:/hO7APkX4hZKu/D0f2lHzNyvdkTGtIy3NDmLR7kSz/8=
github.com/pion/transport/v2 v2.2.1/go.mod h1:cXXWavvCnFF6McHTft3DWS9iic2Mftcz1Aq29pGcU5g=
github.com/pion/transport/v2 v2.2.2/go.mod h1:OJg3ojoBJopjEeECq2yJdXH9YVrUJ1uQ++NjXLOUorc=
github.com/pion/transport/v2 v2.2.3/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0=
github.com/pion/transport/v2 v2.2.4/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0=
github.com/pion/transport/v2 v2.2.5 h1:iyi25i/21gQck4hfRhomF6SktmUQjRsRW4WJdhfc3Kc=
github.com/pion/transport/v2 v2.2.5/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0=
github.com/pion/transport/v3 v3.0.1/go.mod h1:UY7kiITrlMv7/IKgd5eTUcaahZx5oUN3l9SzK5f5xE0=
github.com/pion/transport/v3 v3.0.2 h1:r+40RJR25S9w3jbA6/5uEPTzcdn7ncyU44RWCbHkLg4=
github.com/pion/transport/v3 v3.0.2/go.mod h1:nIToODoOlb5If2jF9y2Igfx3PFYWfuXi37m0IlWa/D0=
github.com/pion/turn/v2 v2.1.3/go.mod h1:huEpByKKHix2/b9kmTAM3YoX6MKP+/D//0ClgUYR2fY=
github.com/pion/turn/v2 v2.1.6 h1:Xr2niVsiPTB0FPtt+yAWKFUkU1eotQbGgpTIld4x1Gc=
github.com/pion/turn/v2 v2.1.6/go.mod h1:huEpByKKHix2/b9kmTAM3YoX6MKP+/D//0ClgUYR2fY=
github.com/pion/webrtc/v3 v3.2.40 h1:Wtfi6AZMQg+624cvCXUuSmrKWepSB7zfgYDOYqsSOVU=
github.com/pion/webrtc/v3 v3.2.40/go.mod h1:M1RAe3TNTD1tzyvqHrbVODfwdPGSXOUo/OgpoGGJqFY=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -885,16 +931,16 @@ github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeD
github.com/prometheus/client_golang v1.4.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU=
github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE=
github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
@@ -904,8 +950,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2
github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s=
github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k=
github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
@@ -935,10 +981,10 @@ github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20230228205207-28762a7b9294 h
github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20230228205207-28762a7b9294/go.mod h1:ZVEbRdnMkGhp/pu35zq4SXxtvUwWK0J1MATtekZpH2Y=
github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo=
github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A=
github.com/quic-go/quic-go v0.42.0 h1:uSfdap0eveIl8KXnipv9K7nlwZ5IqLlYOpJ58u5utpM=
github.com/quic-go/quic-go v0.42.0/go.mod h1:132kz4kL3F9vxhW3CtQJLDVwcFe5wdWeJXXijhsO57M=
github.com/quic-go/webtransport-go v0.6.0 h1:CvNsKqc4W2HljHJnoT+rMmbRJybShZ0YPFDD3NxaZLY=
github.com/quic-go/webtransport-go v0.6.0/go.mod h1:9KjU4AEBqEQidGHNDkZrb8CAa1abRaosM2yGOyiikEc=
github.com/quic-go/quic-go v0.44.0 h1:So5wOr7jyO4vzL2sd8/pD9Kesciv91zSk8BoFngItQ0=
github.com/quic-go/quic-go v0.44.0/go.mod h1:z4cx/9Ny9UtGITIPzmPTXh1ULfOyWh4qGQlpnPcWmek=
github.com/quic-go/webtransport-go v0.8.0 h1:HxSrwun11U+LlmwpgM1kEqIqH90IT4N8auv/cD7QFJg=
github.com/quic-go/webtransport-go v0.8.0/go.mod h1:N99tjprW432Ut5ONql/aUhSLT0YVSlwHohQsuac9WaM=
github.com/raulk/go-watchdog v1.3.0 h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtBsk=
github.com/raulk/go-watchdog v1.3.0/go.mod h1:fIvOnLbF0b0ZwkB9YU4mOW9Did//4vPZtDqv66NfsMU=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
@@ -1034,8 +1080,9 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
@@ -1046,8 +1093,10 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4=
github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw=
@@ -1135,14 +1184,12 @@ go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/automaxprocs v1.5.2 h1:2LxUOGiR3O6tw8ui5sZa2LAaHnsviZdVOUZw4fvbnME=
go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0=
go.uber.org/dig v1.17.1 h1:Tga8Lz8PcYNsWsyHMZ1Vm0OQOUaJNDyvPImgbAu9YSc=
go.uber.org/dig v1.17.1/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE=
go.uber.org/fx v1.20.1 h1:zVwVQGS8zYvhh9Xxcu4w1M6ESyeMzebzj2NbSayZ4Mk=
go.uber.org/fx v1.20.1/go.mod h1:iSYNbHf2y55acNCwCXKx7LbWb5WG1Bnue5RDXz1OREg=
go.uber.org/fx v1.21.1 h1:RqBh3cYdzZS0uqwVeEjOX2p73dddLpym315myy/Bpb0=
go.uber.org/fx v1.21.1/go.mod h1:HT2M7d7RHo+ebKGh9NRcrsrHHfpZ60nW3QRubMRfv48=
go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
@@ -1185,8 +1232,14 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE=
golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio=
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -1198,8 +1251,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw=
golang.org/x/exp v0.0.0-20240213143201-ec583247a57a h1:HinSgX1tJRX3KsL//Gxynpw5CTOAIPhgL4W8PNiIpVE=
golang.org/x/exp v0.0.0-20240213143201-ec583247a57a/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc=
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM=
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc=
golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 h1:1P7xPZEwZMoBoz0Yze5Nx2/4pxj6nw9ZqHWXqP0iRgQ=
golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
@@ -1228,8 +1281,9 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8=
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -1282,8 +1336,16 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/oauth2 v0.0.0-20170912212905-13449ad91cb2/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
@@ -1316,8 +1378,9 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -1409,14 +1472,30 @@ golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o=
golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw=
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -1427,8 +1506,13 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20170424234030-8be79e1e0910/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -1506,8 +1590,9 @@ golang.org/x/tools v0.1.1-0.20210205202024-ef80cdb6ec6d/go.mod h1:9bzcO0MWcOuT0t
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ=
golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw=
golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -1649,8 +1734,8 @@ google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX7
google.golang.org/protobuf v1.25.1-0.20201208041424-160c7477e0e8/go.mod h1:hFxJC2f0epmp1elRCiEGJTKAWbwxZ2nvqZdHl3FQXCY=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a/go.mod h1:KF9sEfUPAXdG8Oev9e99iLGnl2uJMjc5B+4y3O7x610=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

View File

@@ -27,8 +27,8 @@ done
# github.com/prysmaticlabs/prysm/v5/validator/client/iface
# --------------------------------------------------------
iface_mocks=(
"$iface_mock_path/beacon_chain_client_mock.go BeaconChainClient"
"$iface_mock_path/prysm_beacon_chain_client_mock.go PrysmBeaconChainClient"
"$iface_mock_path/chain_client_mock.go ChainClient"
"$iface_mock_path/prysm_chain_client_mock.go PrysmChainClient"
"$iface_mock_path/node_client_mock.go NodeClient"
"$iface_mock_path/validator_client_mock.go ValidatorClient"
)

View File

@@ -48,12 +48,19 @@ func ConvertToIndexed(ctx context.Context, attestation ethpb.Att, committees ...
sort.Slice(attIndices, func(i, j int) bool {
return attIndices[i] < attIndices[j]
})
inAtt := &ethpb.IndexedAttestation{
if attestation.Version() >= version.Electra {
return &ethpb.IndexedAttestationElectra{
Data: attestation.GetData(),
Signature: attestation.GetSignature(),
AttestingIndices: attIndices,
}, nil
}
return &ethpb.IndexedAttestation{
Data: attestation.GetData(),
Signature: attestation.GetSignature(),
AttestingIndices: attIndices,
}
return inAtt, err
}, nil
}
// AttestingIndices returns the attesting participants indices from the attestation data.

File diff suppressed because it is too large Load Diff

View File

@@ -71,6 +71,42 @@ func local_request_BeaconChain_ListAttestations_0(ctx context.Context, marshaler
}
var (
filter_BeaconChain_ListAttestationsElectra_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_BeaconChain_ListAttestationsElectra_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListAttestationsRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListAttestationsElectra_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ListAttestationsElectra(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_BeaconChain_ListAttestationsElectra_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListAttestationsRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListAttestationsElectra_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.ListAttestationsElectra(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_BeaconChain_ListIndexedAttestations_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
@@ -107,6 +143,42 @@ func local_request_BeaconChain_ListIndexedAttestations_0(ctx context.Context, ma
}
var (
filter_BeaconChain_ListIndexedAttestationsElectra_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_BeaconChain_ListIndexedAttestationsElectra_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListIndexedAttestationsRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListIndexedAttestationsElectra_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ListIndexedAttestationsElectra(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_BeaconChain_ListIndexedAttestationsElectra_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListIndexedAttestationsRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListIndexedAttestationsElectra_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.ListIndexedAttestationsElectra(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_BeaconChain_AttestationPool_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
@@ -143,6 +215,42 @@ func local_request_BeaconChain_AttestationPool_0(ctx context.Context, marshaler
}
var (
filter_BeaconChain_AttestationPoolElectra_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_BeaconChain_AttestationPoolElectra_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq AttestationPoolRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_AttestationPoolElectra_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.AttestationPoolElectra(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_BeaconChain_AttestationPoolElectra_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq AttestationPoolRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_AttestationPoolElectra_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.AttestationPoolElectra(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_BeaconChain_ListBeaconBlocks_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
@@ -557,6 +665,42 @@ func local_request_BeaconChain_SubmitAttesterSlashing_0(ctx context.Context, mar
}
var (
filter_BeaconChain_SubmitAttesterSlashingElectra_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_BeaconChain_SubmitAttesterSlashingElectra_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq AttesterSlashingElectra
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_SubmitAttesterSlashingElectra_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.SubmitAttesterSlashingElectra(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_BeaconChain_SubmitAttesterSlashingElectra_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq AttesterSlashingElectra
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_SubmitAttesterSlashingElectra_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.SubmitAttesterSlashingElectra(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_BeaconChain_SubmitProposerSlashing_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
@@ -658,6 +802,29 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux
})
mux.Handle("GET", pattern_BeaconChain_ListAttestationsElectra_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.BeaconChain/ListAttestationsElectra")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_BeaconChain_ListAttestationsElectra_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 {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconChain_ListAttestationsElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconChain_ListIndexedAttestations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -681,6 +848,29 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux
})
mux.Handle("GET", pattern_BeaconChain_ListIndexedAttestationsElectra_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.BeaconChain/ListIndexedAttestationsElectra")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_BeaconChain_ListIndexedAttestationsElectra_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 {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconChain_ListIndexedAttestationsElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconChain_AttestationPool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -704,6 +894,29 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux
})
mux.Handle("GET", pattern_BeaconChain_AttestationPoolElectra_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.BeaconChain/AttestationPoolElectra")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_BeaconChain_AttestationPoolElectra_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 {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconChain_AttestationPoolElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconChain_ListBeaconBlocks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1003,6 +1216,29 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux
})
mux.Handle("GET", pattern_BeaconChain_SubmitAttesterSlashingElectra_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.BeaconChain/SubmitAttesterSlashingElectra")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_BeaconChain_SubmitAttesterSlashingElectra_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 {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconChain_SubmitAttesterSlashingElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconChain_SubmitProposerSlashing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1110,6 +1346,26 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux
})
mux.Handle("GET", pattern_BeaconChain_ListAttestationsElectra_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.BeaconChain/ListAttestationsElectra")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_BeaconChain_ListAttestationsElectra_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconChain_ListAttestationsElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconChain_ListIndexedAttestations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1130,6 +1386,26 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux
})
mux.Handle("GET", pattern_BeaconChain_ListIndexedAttestationsElectra_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.BeaconChain/ListIndexedAttestationsElectra")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_BeaconChain_ListIndexedAttestationsElectra_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconChain_ListIndexedAttestationsElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconChain_AttestationPool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1150,6 +1426,26 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux
})
mux.Handle("GET", pattern_BeaconChain_AttestationPoolElectra_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.BeaconChain/AttestationPoolElectra")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_BeaconChain_AttestationPoolElectra_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconChain_AttestationPoolElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconChain_ListBeaconBlocks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1410,6 +1706,26 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux
})
mux.Handle("GET", pattern_BeaconChain_SubmitAttesterSlashingElectra_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.BeaconChain/SubmitAttesterSlashingElectra")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_BeaconChain_SubmitAttesterSlashingElectra_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconChain_SubmitAttesterSlashingElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconChain_SubmitProposerSlashing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1456,10 +1772,16 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux
var (
pattern_BeaconChain_ListAttestations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "attestations"}, ""))
pattern_BeaconChain_ListAttestationsElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "attestations_electra"}, ""))
pattern_BeaconChain_ListIndexedAttestations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "attestations", "indexed"}, ""))
pattern_BeaconChain_ListIndexedAttestationsElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "attestations", "indexed_electra"}, ""))
pattern_BeaconChain_AttestationPool_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "attestations", "pool"}, ""))
pattern_BeaconChain_AttestationPoolElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "attestations", "pool_electra"}, ""))
pattern_BeaconChain_ListBeaconBlocks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha2", "beacon", "blocks"}, ""))
pattern_BeaconChain_GetChainHead_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "chainhead"}, ""))
@@ -1486,6 +1808,8 @@ var (
pattern_BeaconChain_SubmitAttesterSlashing_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"eth", "v1alpha1", "beacon", "slashings", "attester", "submit"}, ""))
pattern_BeaconChain_SubmitAttesterSlashingElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"eth", "v1alpha1", "beacon", "slashings", "attester", "submit_electra"}, ""))
pattern_BeaconChain_SubmitProposerSlashing_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"eth", "v1alpha1", "beacon", "slashings", "proposer", "submit"}, ""))
pattern_BeaconChain_GetIndividualVotes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "individual_votes"}, ""))
@@ -1494,10 +1818,16 @@ var (
var (
forward_BeaconChain_ListAttestations_0 = runtime.ForwardResponseMessage
forward_BeaconChain_ListAttestationsElectra_0 = runtime.ForwardResponseMessage
forward_BeaconChain_ListIndexedAttestations_0 = runtime.ForwardResponseMessage
forward_BeaconChain_ListIndexedAttestationsElectra_0 = runtime.ForwardResponseMessage
forward_BeaconChain_AttestationPool_0 = runtime.ForwardResponseMessage
forward_BeaconChain_AttestationPoolElectra_0 = runtime.ForwardResponseMessage
forward_BeaconChain_ListBeaconBlocks_0 = runtime.ForwardResponseMessage
forward_BeaconChain_GetChainHead_0 = runtime.ForwardResponseMessage
@@ -1524,6 +1854,8 @@ var (
forward_BeaconChain_SubmitAttesterSlashing_0 = runtime.ForwardResponseMessage
forward_BeaconChain_SubmitAttesterSlashingElectra_0 = runtime.ForwardResponseMessage
forward_BeaconChain_SubmitProposerSlashing_0 = runtime.ForwardResponseMessage
forward_BeaconChain_GetIndividualVotes_0 = runtime.ForwardResponseMessage

View File

@@ -47,6 +47,18 @@ service BeaconChain {
};
}
// Retrieve attestations by block root, slot, or epoch.
//
// The server may return an empty list when no attestations match the given
// filter criteria. This RPC should not return NOT_FOUND. Only one filter
// criteria should be used. This endpoint allows for retrieval of genesis
// information via a boolean query filter.
rpc ListAttestationsElectra(ListAttestationsRequest) returns (ListAttestationsElectraResponse) {
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/attestations_electra"
};
}
// Retrieve indexed attestations by block root, slot, or epoch.
//
// The server may return an empty list when no indexed attestations match the given
@@ -59,6 +71,18 @@ service BeaconChain {
};
}
// Retrieve indexed attestations by block root, slot, or epoch.
//
// The server may return an empty list when no indexed attestations match the given
// filter criteria. This RPC should not return NOT_FOUND. Only one filter
// criteria should be used. This endpoint allows for retrieval of genesis
// information via a boolean query filter.
rpc ListIndexedAttestationsElectra(ListIndexedAttestationsRequest) returns (ListIndexedAttestationsElectraResponse) {
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/attestations/indexed_electra"
};
}
// Retrieve attestations from pool.
//
// The server returns a list of attestations that have been seen but not
@@ -74,6 +98,21 @@ service BeaconChain {
};
}
// Retrieve attestations from pool.
//
// The server returns a list of attestations that have been seen but not
// yet processed. Pool attestations eventually expire as the slot
// advances, so an attestation missing from this request does not imply
// that it was included in a block. The attestation may have expired.
// Refer to the Ethereum Beacon Chain specification for more details on how
// attestations are processed and when they are no longer valid.
// https://github.com/ethereum/consensus-specs/blob/dev/specs/core/0_beacon-chain.md#attestations
rpc AttestationPoolElectra(AttestationPoolRequest) returns (AttestationPoolElectraResponse) {
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/attestations/pool_electra"
};
}
// Retrieve blocks by root, slot, or epoch.
//
// The server may return multiple blocks in the case that a slot or epoch is
@@ -205,6 +244,13 @@ service BeaconChain {
};
}
// Submit an attester slashing object to the beacon node.
rpc SubmitAttesterSlashingElectra(AttesterSlashingElectra) returns (SubmitSlashingResponse) {
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/slashings/attester/submit_electra"
};
}
// Submit a proposer slashing object to the beacon node.
rpc SubmitProposerSlashing(ProposerSlashing) returns (SubmitSlashingResponse) {
option (google.api.http) = {
@@ -274,6 +320,18 @@ message ListAttestationsResponse {
int32 total_size = 3;
}
message ListAttestationsElectraResponse {
repeated AttestationElectra attestations = 1;
// A pagination token returned from a previous call to `ListAttestations`
// that indicates from where listing should continue.
// This field is optional.
string next_page_token = 2;
// Total count of Attestations matching the request filter.
int32 total_size = 3;
}
message ListIndexedAttestationsResponse {
repeated IndexedAttestation indexed_attestations = 1;
@@ -286,6 +344,18 @@ message ListIndexedAttestationsResponse {
int32 total_size = 3;
}
message ListIndexedAttestationsElectraResponse {
repeated IndexedAttestationElectra indexed_attestations = 1;
// A pagination token returned from a previous call to `ListIndexedAttestations`
// that indicates from where listing should continue.
// This field is optional.
string next_page_token = 2;
// Total count of Attestations matching the request filter.
int32 total_size = 3;
}
message ListBlocksRequest {
oneof query_filter {
// Block root filter to return a single block.
@@ -780,6 +850,19 @@ message AttestationPoolResponse {
int32 total_size = 3;
}
message AttestationPoolElectraResponse {
// List of attestations currently in the pool of the beacon chain.
repeated AttestationElectra attestations = 1;
// A pagination token returned from a previous call
// that indicates where this listing should continue from.
// This field is optional.
string next_page_token = 2;
// Total count of objects matching the request filter.
int32 total_size = 3;
}
// Information about the configuration parameters of the beacon node, such
// as the slots per epoch, slots per eth1 voting period, and more.
message BeaconConfig {

View File

@@ -229,7 +229,7 @@ func (v *ValidatorNode) Start(ctx context.Context) error {
fmt.Sprintf("--%s=%d", flags.GRPCGatewayPort.Name, e2e.TestParams.Ports.ValidatorGatewayPort+index),
fmt.Sprintf("--%s=localhost:%d", flags.BeaconRPCProviderFlag.Name, beaconRPCPort),
fmt.Sprintf("--%s=%s", flags.GrpcHeadersFlag.Name, "dummy=value,foo=bar"), // Sending random headers shouldn't break anything.
fmt.Sprintf("--%s=%s", flags.GRPCHeadersFlag.Name, "dummy=value,foo=bar"), // Sending random headers shouldn't break anything.
fmt.Sprintf("--%s=%s", cmdshared.VerbosityFlag.Name, "debug"),
fmt.Sprintf("--%s=%s", flags.ProposerSettingsFlag.Name, proposerSettingsPathPath),
fmt.Sprintf("--%s=%s", cmdshared.ChainConfigFileFlag.Name, cfgPath),

View File

@@ -7,6 +7,7 @@ go_test(
"block_header_test.go",
"bls_to_execution_change_test.go",
"consolidation_test.go",
"execution_layer_withdrawals_test.go",
"execution_payload_test.go",
"proposer_slashing_test.go",
"sync_committee_test.go",

View File

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

View File

@@ -7,6 +7,7 @@ go_test(
"block_header_test.go",
"bls_to_execution_change_test.go",
"consolidation_test.go",
"execution_layer_withdrawals_test.go",
"execution_payload_test.go",
"proposer_slashing_test.go",
"sync_committee_test.go",

View File

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

View File

@@ -1,3 +1,50 @@
package operations
// TODO: Add tests.
import (
"context"
"path"
"testing"
"github.com/golang/snappy"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/state"
"github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces"
enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/testing/require"
"github.com/prysmaticlabs/prysm/v5/testing/spectest/utils"
"github.com/prysmaticlabs/prysm/v5/testing/util"
)
func RunExecutionLayerWithdrawalRequestTest(t *testing.T, config string) {
require.NoError(t, utils.SetConfig(t, config))
testFolders, testsFolderPath := utils.TestFolders(t, config, "electra", "operations/execution_layer_withdrawal_request/pyspec_tests")
if len(testFolders) == 0 {
t.Fatalf("No test folders found for %s/%s/%s", config, "electra", "operations/execution_layer_withdrawal_request/pyspec_tests")
}
for _, folder := range testFolders {
t.Run(folder.Name(), func(t *testing.T) {
folderPath := path.Join(testsFolderPath, folder.Name())
executionLayerWithdrawalRequestFile, err := util.BazelFileBytes(folderPath, "execution_layer_withdrawal_request.ssz_snappy")
require.NoError(t, err)
executionLayerWithdrawalRequestSSZ, err := snappy.Decode(nil /* dst */, executionLayerWithdrawalRequestFile)
require.NoError(t, err, "Failed to decompress")
withdrawalRequest := &enginev1.ExecutionLayerWithdrawalRequest{}
require.NoError(t, withdrawalRequest.UnmarshalSSZ(executionLayerWithdrawalRequestSSZ), "Failed to unmarshal")
body := &ethpb.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadElectra{
WithdrawalRequests: []*enginev1.ExecutionLayerWithdrawalRequest{
withdrawalRequest,
},
}}
RunBlockOperationTest(t, folderPath, body, func(ctx context.Context, s state.BeaconState, b interfaces.SignedBeaconBlock) (state.BeaconState, error) {
bod, ok := b.Block().Body().(interfaces.ROBlockBodyElectra)
require.Equal(t, true, ok)
e, err := bod.Execution()
require.NoError(t, err)
exe, ok := e.(interfaces.ExecutionDataElectra)
require.Equal(t, true, ok)
return electra.ProcessExecutionLayerWithdrawalRequests(ctx, s, exe.WithdrawalRequests())
})
})
}
}

View File

@@ -23,7 +23,7 @@ import (
log "github.com/sirupsen/logrus"
)
// NewAttestation creates an attestation block with minimum marshalable fields.
// NewAttestation creates a block attestation with minimum marshalable fields.
func NewAttestation() *ethpb.Attestation {
return &ethpb.Attestation{
AggregationBits: bitfield.Bitlist{0b1101},
@@ -40,6 +40,26 @@ func NewAttestation() *ethpb.Attestation {
}
}
// NewAttestationElectra creates a block attestation with minimum marshalable fields.
func NewAttestationElectra() *ethpb.AttestationElectra {
cb := primitives.NewAttestationCommitteeBits()
cb.SetBitAt(0, true)
return &ethpb.AttestationElectra{
AggregationBits: bitfield.Bitlist{0b1101},
CommitteeBits: cb,
Data: &ethpb.AttestationData{
BeaconBlockRoot: make([]byte, fieldparams.RootLength),
Source: &ethpb.Checkpoint{
Root: make([]byte, fieldparams.RootLength),
},
Target: &ethpb.Checkpoint{
Root: make([]byte, fieldparams.RootLength),
},
},
Signature: make([]byte, 96),
}
}
// GenerateAttestations creates attestations that are entirely valid, for all
// the committees of the current state slot. This function expects attestations
// requested to be cleanly divisible by committees per slot. If there is 1 committee

View File

@@ -1,9 +1,9 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/prysmaticlabs/prysm/v5/validator/client/iface (interfaces: BeaconChainClient)
// Source: github.com/prysmaticlabs/prysm/v5/validator/client/iface (interfaces: ChainClient)
//
// Generated by this command:
//
// mockgen -package=validator_mock -destination=testing/validator-mock/beacon_chain_client_mock.go github.com/prysmaticlabs/prysm/v5/validator/client/iface BeaconChainClient
// mockgen -package=validator_mock -destination=testing/validator-mock/chain_client_mock.go github.com/prysmaticlabs/prysm/v5/validator/client/iface ChainClient
//
// Package validator_mock is a generated GoMock package.
@@ -42,9 +42,9 @@ func (m *MockChainClient) EXPECT() *MockChainClientMockRecorder {
}
// GetChainHead mocks base method.
func (m *MockChainClient) GetChainHead(arg0 context.Context, arg1 *emptypb.Empty) (*eth.ChainHead, error) {
func (m *MockChainClient) ChainHead(arg0 context.Context, arg1 *emptypb.Empty) (*eth.ChainHead, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetChainHead", arg0, arg1)
ret := m.ctrl.Call(m, "ChainHead", arg0, arg1)
ret0, _ := ret[0].(*eth.ChainHead)
ret1, _ := ret[1].(error)
return ret0, ret1
@@ -53,13 +53,13 @@ func (m *MockChainClient) GetChainHead(arg0 context.Context, arg1 *emptypb.Empty
// GetChainHead indicates an expected call of GetChainHead.
func (mr *MockChainClientMockRecorder) GetChainHead(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChainHead", reflect.TypeOf((*MockChainClient)(nil).GetChainHead), arg0, arg1)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainHead", reflect.TypeOf((*MockChainClient)(nil).ChainHead), arg0, arg1)
}
// GetValidatorParticipation mocks base method.
func (m *MockChainClient) GetValidatorParticipation(arg0 context.Context, arg1 *eth.GetValidatorParticipationRequest) (*eth.ValidatorParticipationResponse, error) {
func (m *MockChainClient) ValidatorParticipation(arg0 context.Context, arg1 *eth.GetValidatorParticipationRequest) (*eth.ValidatorParticipationResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetValidatorParticipation", arg0, arg1)
ret := m.ctrl.Call(m, "ValidatorParticipation", arg0, arg1)
ret0, _ := ret[0].(*eth.ValidatorParticipationResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
@@ -68,13 +68,13 @@ func (m *MockChainClient) GetValidatorParticipation(arg0 context.Context, arg1 *
// GetValidatorParticipation indicates an expected call of GetValidatorParticipation.
func (mr *MockChainClientMockRecorder) GetValidatorParticipation(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorParticipation", reflect.TypeOf((*MockChainClient)(nil).GetValidatorParticipation), arg0, arg1)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorParticipation", reflect.TypeOf((*MockChainClient)(nil).ValidatorParticipation), arg0, arg1)
}
// GetValidatorPerformance mocks base method.
func (m *MockChainClient) GetValidatorPerformance(arg0 context.Context, arg1 *eth.ValidatorPerformanceRequest) (*eth.ValidatorPerformanceResponse, error) {
func (m *MockChainClient) ValidatorPerformance(arg0 context.Context, arg1 *eth.ValidatorPerformanceRequest) (*eth.ValidatorPerformanceResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetValidatorPerformance", arg0, arg1)
ret := m.ctrl.Call(m, "ValidatorPerformance", arg0, arg1)
ret0, _ := ret[0].(*eth.ValidatorPerformanceResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
@@ -83,13 +83,13 @@ func (m *MockChainClient) GetValidatorPerformance(arg0 context.Context, arg1 *et
// GetValidatorPerformance indicates an expected call of GetValidatorPerformance.
func (mr *MockChainClientMockRecorder) GetValidatorPerformance(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorPerformance", reflect.TypeOf((*MockChainClient)(nil).GetValidatorPerformance), arg0, arg1)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorPerformance", reflect.TypeOf((*MockChainClient)(nil).ValidatorPerformance), arg0, arg1)
}
// GetValidatorQueue mocks base method.
func (m *MockChainClient) GetValidatorQueue(arg0 context.Context, arg1 *emptypb.Empty) (*eth.ValidatorQueue, error) {
func (m *MockChainClient) ValidatorQueue(arg0 context.Context, arg1 *emptypb.Empty) (*eth.ValidatorQueue, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetValidatorQueue", arg0, arg1)
ret := m.ctrl.Call(m, "ValidatorQueue", arg0, arg1)
ret0, _ := ret[0].(*eth.ValidatorQueue)
ret1, _ := ret[1].(error)
return ret0, ret1
@@ -98,13 +98,13 @@ func (m *MockChainClient) GetValidatorQueue(arg0 context.Context, arg1 *emptypb.
// GetValidatorQueue indicates an expected call of GetValidatorQueue.
func (mr *MockChainClientMockRecorder) GetValidatorQueue(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorQueue", reflect.TypeOf((*MockChainClient)(nil).GetValidatorQueue), arg0, arg1)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorQueue", reflect.TypeOf((*MockChainClient)(nil).ValidatorQueue), arg0, arg1)
}
// ListValidatorBalances mocks base method.
func (m *MockChainClient) ListValidatorBalances(arg0 context.Context, arg1 *eth.ListValidatorBalancesRequest) (*eth.ValidatorBalances, error) {
func (m *MockChainClient) ValidatorBalances(arg0 context.Context, arg1 *eth.ListValidatorBalancesRequest) (*eth.ValidatorBalances, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListValidatorBalances", arg0, arg1)
ret := m.ctrl.Call(m, "ValidatorBalances", arg0, arg1)
ret0, _ := ret[0].(*eth.ValidatorBalances)
ret1, _ := ret[1].(error)
return ret0, ret1
@@ -113,13 +113,13 @@ func (m *MockChainClient) ListValidatorBalances(arg0 context.Context, arg1 *eth.
// ListValidatorBalances indicates an expected call of ListValidatorBalances.
func (mr *MockChainClientMockRecorder) ListValidatorBalances(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListValidatorBalances", reflect.TypeOf((*MockChainClient)(nil).ListValidatorBalances), arg0, arg1)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorBalances", reflect.TypeOf((*MockChainClient)(nil).ValidatorBalances), arg0, arg1)
}
// ListValidators mocks base method.
func (m *MockChainClient) ListValidators(arg0 context.Context, arg1 *eth.ListValidatorsRequest) (*eth.Validators, error) {
func (m *MockChainClient) Validators(arg0 context.Context, arg1 *eth.ListValidatorsRequest) (*eth.Validators, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListValidators", arg0, arg1)
ret := m.ctrl.Call(m, "Validators", arg0, arg1)
ret0, _ := ret[0].(*eth.Validators)
ret1, _ := ret[1].(error)
return ret0, ret1
@@ -128,5 +128,5 @@ func (m *MockChainClient) ListValidators(arg0 context.Context, arg1 *eth.ListVal
// ListValidators indicates an expected call of ListValidators.
func (mr *MockChainClientMockRecorder) ListValidators(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListValidators", reflect.TypeOf((*MockChainClient)(nil).ListValidators), arg0, arg1)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Validators", reflect.TypeOf((*MockChainClient)(nil).Validators), arg0, arg1)
}

View File

@@ -42,49 +42,19 @@ func (m *MockNodeClient) EXPECT() *MockNodeClientMockRecorder {
return m.recorder
}
// GetGenesis mocks base method.
func (m *MockNodeClient) GetGenesis(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Genesis, error) {
// Genesis mocks base method.
func (m *MockNodeClient) Genesis(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Genesis, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetGenesis", arg0, arg1)
ret := m.ctrl.Call(m, "Genesis", arg0, arg1)
ret0, _ := ret[0].(*eth.Genesis)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetGenesis indicates an expected call of GetGenesis.
func (mr *MockNodeClientMockRecorder) GetGenesis(arg0, arg1 any) *gomock.Call {
// Genesis indicates an expected call of Genesis.
func (mr *MockNodeClientMockRecorder) Genesis(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGenesis", reflect.TypeOf((*MockNodeClient)(nil).GetGenesis), arg0, arg1)
}
// GetSyncStatus mocks base method.
func (m *MockNodeClient) GetSyncStatus(arg0 context.Context, arg1 *emptypb.Empty) (*eth.SyncStatus, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetSyncStatus", arg0, arg1)
ret0, _ := ret[0].(*eth.SyncStatus)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetSyncStatus indicates an expected call of GetSyncStatus.
func (mr *MockNodeClientMockRecorder) GetSyncStatus(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncStatus", reflect.TypeOf((*MockNodeClient)(nil).GetSyncStatus), arg0, arg1)
}
// GetVersion mocks base method.
func (m *MockNodeClient) GetVersion(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Version, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetVersion", arg0, arg1)
ret0, _ := ret[0].(*eth.Version)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetVersion indicates an expected call of GetVersion.
func (mr *MockNodeClientMockRecorder) GetVersion(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVersion", reflect.TypeOf((*MockNodeClient)(nil).GetVersion), arg0, arg1)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Genesis", reflect.TypeOf((*MockNodeClient)(nil).Genesis), arg0, arg1)
}
// HealthTracker mocks base method.
@@ -101,17 +71,47 @@ func (mr *MockNodeClientMockRecorder) HealthTracker() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HealthTracker", reflect.TypeOf((*MockNodeClient)(nil).HealthTracker))
}
// ListPeers mocks base method.
func (m *MockNodeClient) ListPeers(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Peers, error) {
// Peers mocks base method.
func (m *MockNodeClient) Peers(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Peers, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListPeers", arg0, arg1)
ret := m.ctrl.Call(m, "Peers", arg0, arg1)
ret0, _ := ret[0].(*eth.Peers)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListPeers indicates an expected call of ListPeers.
func (mr *MockNodeClientMockRecorder) ListPeers(arg0, arg1 any) *gomock.Call {
// Peers indicates an expected call of Peers.
func (mr *MockNodeClientMockRecorder) Peers(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListPeers", reflect.TypeOf((*MockNodeClient)(nil).ListPeers), arg0, arg1)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Peers", reflect.TypeOf((*MockNodeClient)(nil).Peers), arg0, arg1)
}
// SyncStatus mocks base method.
func (m *MockNodeClient) SyncStatus(arg0 context.Context, arg1 *emptypb.Empty) (*eth.SyncStatus, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SyncStatus", arg0, arg1)
ret0, _ := ret[0].(*eth.SyncStatus)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// SyncStatus indicates an expected call of SyncStatus.
func (mr *MockNodeClientMockRecorder) SyncStatus(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncStatus", reflect.TypeOf((*MockNodeClient)(nil).SyncStatus), arg0, arg1)
}
// Version mocks base method.
func (m *MockNodeClient) Version(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Version, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Version", arg0, arg1)
ret0, _ := ret[0].(*eth.Version)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Version indicates an expected call of Version.
func (mr *MockNodeClientMockRecorder) Version(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Version", reflect.TypeOf((*MockNodeClient)(nil).Version), arg0, arg1)
}

View File

@@ -1,5 +1,10 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/prysmaticlabs/prysm/v4/validator/client/iface (interfaces: PrysmChainClient)
// Source: github.com/prysmaticlabs/prysm/v5/validator/client/iface (interfaces: PrysmChainClient)
//
// Generated by this command:
//
// mockgen -package=validator_mock -destination=testing/validator-mock/prysm_chain_client_mock.go github.com/prysmaticlabs/prysm/v5/validator/client/iface PrysmChainClient
//
// Package validator_mock is a generated GoMock package.
package validator_mock
@@ -37,16 +42,16 @@ func (m *MockPrysmChainClient) EXPECT() *MockPrysmChainClientMockRecorder {
}
// GetValidatorCount mocks base method.
func (m *MockPrysmChainClient) GetValidatorCount(arg0 context.Context, arg1 string, arg2 []validator.Status) ([]iface.ValidatorCount, error) {
func (m *MockPrysmChainClient) ValidatorCount(arg0 context.Context, arg1 string, arg2 []validator.Status) ([]iface.ValidatorCount, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetValidatorCount", arg0, arg1, arg2)
ret := m.ctrl.Call(m, "ValidatorCount", arg0, arg1, arg2)
ret0, _ := ret[0].([]iface.ValidatorCount)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetValidatorCount indicates an expected call of GetValidatorCount.
func (mr *MockPrysmChainClientMockRecorder) GetValidatorCount(arg0, arg1, arg2 interface{}) *gomock.Call {
func (mr *MockPrysmChainClientMockRecorder) GetValidatorCount(arg0, arg1, arg2 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorCount", reflect.TypeOf((*MockPrysmChainClient)(nil).GetValidatorCount), arg0, arg1, arg2)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorCount", reflect.TypeOf((*MockPrysmChainClient)(nil).ValidatorCount), arg0, arg1, arg2)
}

View File

@@ -44,6 +44,66 @@ func (m *MockValidatorClient) EXPECT() *MockValidatorClientMockRecorder {
return m.recorder
}
// AggregatedSelections mocks base method.
func (m *MockValidatorClient) AggregatedSelections(arg0 context.Context, arg1 []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AggregatedSelections", arg0, arg1)
ret0, _ := ret[0].([]iface.BeaconCommitteeSelection)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// AggregatedSelections indicates an expected call of AggregatedSelections.
func (mr *MockValidatorClientMockRecorder) AggregatedSelections(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AggregatedSelections", reflect.TypeOf((*MockValidatorClient)(nil).AggregatedSelections), arg0, arg1)
}
// AggregatedSyncSelections mocks base method.
func (m *MockValidatorClient) AggregatedSyncSelections(arg0 context.Context, arg1 []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AggregatedSyncSelections", arg0, arg1)
ret0, _ := ret[0].([]iface.SyncCommitteeSelection)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// AggregatedSyncSelections indicates an expected call of AggregatedSyncSelections.
func (mr *MockValidatorClientMockRecorder) AggregatedSyncSelections(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AggregatedSyncSelections", reflect.TypeOf((*MockValidatorClient)(nil).AggregatedSyncSelections), arg0, arg1)
}
// AttestationData mocks base method.
func (m *MockValidatorClient) AttestationData(arg0 context.Context, arg1 *eth.AttestationDataRequest) (*eth.AttestationData, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AttestationData", arg0, arg1)
ret0, _ := ret[0].(*eth.AttestationData)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// AttestationData indicates an expected call of AttestationData.
func (mr *MockValidatorClientMockRecorder) AttestationData(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AttestationData", reflect.TypeOf((*MockValidatorClient)(nil).AttestationData), arg0, arg1)
}
// BeaconBlock mocks base method.
func (m *MockValidatorClient) BeaconBlock(arg0 context.Context, arg1 *eth.BlockRequest) (*eth.GenericBeaconBlock, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "BeaconBlock", arg0, arg1)
ret0, _ := ret[0].(*eth.GenericBeaconBlock)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// BeaconBlock indicates an expected call of BeaconBlock.
func (mr *MockValidatorClientMockRecorder) BeaconBlock(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeaconBlock", reflect.TypeOf((*MockValidatorClient)(nil).BeaconBlock), arg0, arg1)
}
// CheckDoppelGanger mocks base method.
func (m *MockValidatorClient) CheckDoppelGanger(arg0 context.Context, arg1 *eth.DoppelGangerRequest) (*eth.DoppelGangerResponse, error) {
m.ctrl.T.Helper()
@@ -74,6 +134,21 @@ func (mr *MockValidatorClientMockRecorder) DomainData(arg0, arg1 any) *gomock.Ca
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DomainData", reflect.TypeOf((*MockValidatorClient)(nil).DomainData), arg0, arg1)
}
// Duties mocks base method.
func (m *MockValidatorClient) Duties(arg0 context.Context, arg1 *eth.DutiesRequest) (*eth.DutiesResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Duties", arg0, arg1)
ret0, _ := ret[0].(*eth.DutiesResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Duties indicates an expected call of Duties.
func (mr *MockValidatorClientMockRecorder) Duties(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Duties", reflect.TypeOf((*MockValidatorClient)(nil).Duties), arg0, arg1)
}
// EventStreamIsRunning mocks base method.
func (m *MockValidatorClient) EventStreamIsRunning() bool {
m.ctrl.T.Helper()
@@ -88,139 +163,19 @@ func (mr *MockValidatorClientMockRecorder) EventStreamIsRunning() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EventStreamIsRunning", reflect.TypeOf((*MockValidatorClient)(nil).EventStreamIsRunning))
}
// GetAggregatedSelections mocks base method.
func (m *MockValidatorClient) GetAggregatedSelections(arg0 context.Context, arg1 []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) {
// FeeRecipientByPubKey mocks base method.
func (m *MockValidatorClient) FeeRecipientByPubKey(arg0 context.Context, arg1 *eth.FeeRecipientByPubKeyRequest) (*eth.FeeRecipientByPubKeyResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetAggregatedSelections", arg0, arg1)
ret0, _ := ret[0].([]iface.BeaconCommitteeSelection)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetAggregatedSelections indicates an expected call of GetAggregatedSelections.
func (mr *MockValidatorClientMockRecorder) GetAggregatedSelections(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAggregatedSelections", reflect.TypeOf((*MockValidatorClient)(nil).GetAggregatedSelections), arg0, arg1)
}
// GetAggregatedSyncSelections mocks base method.
func (m *MockValidatorClient) GetAggregatedSyncSelections(arg0 context.Context, arg1 []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetAggregatedSyncSelections", arg0, arg1)
ret0, _ := ret[0].([]iface.SyncCommitteeSelection)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetAggregatedSyncSelections indicates an expected call of GetAggregatedSyncSelections.
func (mr *MockValidatorClientMockRecorder) GetAggregatedSyncSelections(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAggregatedSyncSelections", reflect.TypeOf((*MockValidatorClient)(nil).GetAggregatedSyncSelections), arg0, arg1)
}
// GetAttestationData mocks base method.
func (m *MockValidatorClient) GetAttestationData(arg0 context.Context, arg1 *eth.AttestationDataRequest) (*eth.AttestationData, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetAttestationData", arg0, arg1)
ret0, _ := ret[0].(*eth.AttestationData)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetAttestationData indicates an expected call of GetAttestationData.
func (mr *MockValidatorClientMockRecorder) GetAttestationData(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAttestationData", reflect.TypeOf((*MockValidatorClient)(nil).GetAttestationData), arg0, arg1)
}
// GetBeaconBlock mocks base method.
func (m *MockValidatorClient) GetBeaconBlock(arg0 context.Context, arg1 *eth.BlockRequest) (*eth.GenericBeaconBlock, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetBeaconBlock", arg0, arg1)
ret0, _ := ret[0].(*eth.GenericBeaconBlock)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetBeaconBlock indicates an expected call of GetBeaconBlock.
func (mr *MockValidatorClientMockRecorder) GetBeaconBlock(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBeaconBlock", reflect.TypeOf((*MockValidatorClient)(nil).GetBeaconBlock), arg0, arg1)
}
// GetDuties mocks base method.
func (m *MockValidatorClient) GetDuties(arg0 context.Context, arg1 *eth.DutiesRequest) (*eth.DutiesResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetDuties", arg0, arg1)
ret0, _ := ret[0].(*eth.DutiesResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetDuties indicates an expected call of GetDuties.
func (mr *MockValidatorClientMockRecorder) GetDuties(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDuties", reflect.TypeOf((*MockValidatorClient)(nil).GetDuties), arg0, arg1)
}
// GetFeeRecipientByPubKey mocks base method.
func (m *MockValidatorClient) GetFeeRecipientByPubKey(arg0 context.Context, arg1 *eth.FeeRecipientByPubKeyRequest) (*eth.FeeRecipientByPubKeyResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetFeeRecipientByPubKey", arg0, arg1)
ret := m.ctrl.Call(m, "FeeRecipientByPubKey", arg0, arg1)
ret0, _ := ret[0].(*eth.FeeRecipientByPubKeyResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetFeeRecipientByPubKey indicates an expected call of GetFeeRecipientByPubKey.
func (mr *MockValidatorClientMockRecorder) GetFeeRecipientByPubKey(arg0, arg1 any) *gomock.Call {
// FeeRecipientByPubKey indicates an expected call of FeeRecipientByPubKey.
func (mr *MockValidatorClientMockRecorder) FeeRecipientByPubKey(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFeeRecipientByPubKey", reflect.TypeOf((*MockValidatorClient)(nil).GetFeeRecipientByPubKey), arg0, arg1)
}
// GetSyncCommitteeContribution mocks base method.
func (m *MockValidatorClient) GetSyncCommitteeContribution(arg0 context.Context, arg1 *eth.SyncCommitteeContributionRequest) (*eth.SyncCommitteeContribution, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetSyncCommitteeContribution", arg0, arg1)
ret0, _ := ret[0].(*eth.SyncCommitteeContribution)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetSyncCommitteeContribution indicates an expected call of GetSyncCommitteeContribution.
func (mr *MockValidatorClientMockRecorder) GetSyncCommitteeContribution(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncCommitteeContribution", reflect.TypeOf((*MockValidatorClient)(nil).GetSyncCommitteeContribution), arg0, arg1)
}
// GetSyncMessageBlockRoot mocks base method.
func (m *MockValidatorClient) GetSyncMessageBlockRoot(arg0 context.Context, arg1 *emptypb.Empty) (*eth.SyncMessageBlockRootResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetSyncMessageBlockRoot", arg0, arg1)
ret0, _ := ret[0].(*eth.SyncMessageBlockRootResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetSyncMessageBlockRoot indicates an expected call of GetSyncMessageBlockRoot.
func (mr *MockValidatorClientMockRecorder) GetSyncMessageBlockRoot(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncMessageBlockRoot", reflect.TypeOf((*MockValidatorClient)(nil).GetSyncMessageBlockRoot), arg0, arg1)
}
// GetSyncSubcommitteeIndex mocks base method.
func (m *MockValidatorClient) GetSyncSubcommitteeIndex(arg0 context.Context, arg1 *eth.SyncSubcommitteeIndexRequest) (*eth.SyncSubcommitteeIndexResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetSyncSubcommitteeIndex", arg0, arg1)
ret0, _ := ret[0].(*eth.SyncSubcommitteeIndexResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetSyncSubcommitteeIndex indicates an expected call of GetSyncSubcommitteeIndex.
func (mr *MockValidatorClientMockRecorder) GetSyncSubcommitteeIndex(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncSubcommitteeIndex", reflect.TypeOf((*MockValidatorClient)(nil).GetSyncSubcommitteeIndex), arg0, arg1)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FeeRecipientByPubKey", reflect.TypeOf((*MockValidatorClient)(nil).FeeRecipientByPubKey), arg0, arg1)
}
// Host mocks base method.
@@ -426,6 +381,51 @@ func (mr *MockValidatorClientMockRecorder) SubscribeCommitteeSubnets(arg0, arg1,
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscribeCommitteeSubnets", reflect.TypeOf((*MockValidatorClient)(nil).SubscribeCommitteeSubnets), arg0, arg1, arg2)
}
// SyncCommitteeContribution mocks base method.
func (m *MockValidatorClient) SyncCommitteeContribution(arg0 context.Context, arg1 *eth.SyncCommitteeContributionRequest) (*eth.SyncCommitteeContribution, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SyncCommitteeContribution", arg0, arg1)
ret0, _ := ret[0].(*eth.SyncCommitteeContribution)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// SyncCommitteeContribution indicates an expected call of SyncCommitteeContribution.
func (mr *MockValidatorClientMockRecorder) SyncCommitteeContribution(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncCommitteeContribution", reflect.TypeOf((*MockValidatorClient)(nil).SyncCommitteeContribution), arg0, arg1)
}
// SyncMessageBlockRoot mocks base method.
func (m *MockValidatorClient) SyncMessageBlockRoot(arg0 context.Context, arg1 *emptypb.Empty) (*eth.SyncMessageBlockRootResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SyncMessageBlockRoot", arg0, arg1)
ret0, _ := ret[0].(*eth.SyncMessageBlockRootResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// SyncMessageBlockRoot indicates an expected call of SyncMessageBlockRoot.
func (mr *MockValidatorClientMockRecorder) SyncMessageBlockRoot(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncMessageBlockRoot", reflect.TypeOf((*MockValidatorClient)(nil).SyncMessageBlockRoot), arg0, arg1)
}
// SyncSubcommitteeIndex mocks base method.
func (m *MockValidatorClient) SyncSubcommitteeIndex(arg0 context.Context, arg1 *eth.SyncSubcommitteeIndexRequest) (*eth.SyncSubcommitteeIndexResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SyncSubcommitteeIndex", arg0, arg1)
ret0, _ := ret[0].(*eth.SyncSubcommitteeIndexResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// SyncSubcommitteeIndex indicates an expected call of SyncSubcommitteeIndex.
func (mr *MockValidatorClientMockRecorder) SyncSubcommitteeIndex(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncSubcommitteeIndex", reflect.TypeOf((*MockValidatorClient)(nil).SyncSubcommitteeIndex), arg0, arg1)
}
// ValidatorIndex mocks base method.
func (m *MockValidatorClient) ValidatorIndex(arg0 context.Context, arg1 *eth.ValidatorIndexRequest) (*eth.ValidatorIndexResponse, error) {
m.ctrl.T.Helper()

View File

@@ -47,7 +47,7 @@ func (acm *CLIManager) Exit(ctx context.Context) error {
if nodeClient == nil {
return errors.New("could not prepare beacon node client")
}
syncStatus, err := (*nodeClient).GetSyncStatus(ctx, &emptypb.Empty{})
syncStatus, err := (*nodeClient).SyncStatus(ctx, &emptypb.Empty{})
if err != nil {
return err
}
@@ -81,7 +81,7 @@ func PerformVoluntaryExit(
ctx context.Context, cfg PerformExitCfg,
) (rawExitedKeys [][]byte, formattedExitedKeys []string, err error) {
var rawNotExitedKeys [][]byte
genesisResponse, err := cfg.NodeClient.GetGenesis(ctx, &emptypb.Empty{})
genesisResponse, err := cfg.NodeClient.Genesis(ctx, &emptypb.Empty{})
if err != nil {
log.WithError(err).Errorf("voluntary exit failed: %v", err)
}

View File

@@ -65,7 +65,7 @@ func setupWalletCtx(
set.String(flags.DeletePublicKeysFlag.Name, cfg.deletePublicKeys, "")
set.String(flags.VoluntaryExitPublicKeysFlag.Name, cfg.voluntaryExitPublicKeys, "")
set.String(flags.BackupDirFlag.Name, cfg.backupDir, "")
set.String(flags.BackupPasswordFile.Name, cfg.backupPasswordFile, "")
set.String(flags.BackupPasswordFileFlag.Name, cfg.backupPasswordFile, "")
set.String(flags.BackupPublicKeysFlag.Name, cfg.backupPublicKeys, "")
set.String(flags.WalletPasswordFileFlag.Name, cfg.walletPasswordFile, "")
set.String(flags.AccountPasswordFileFlag.Name, cfg.accountPasswordFile, "")
@@ -73,7 +73,7 @@ func setupWalletCtx(
set.Bool(flags.SkipDepositConfirmationFlag.Name, cfg.skipDepositConfirm, "")
set.Bool(flags.SkipMnemonic25thWordCheckFlag.Name, true, "")
set.Bool(flags.ExitAllFlag.Name, cfg.exitAll, "")
set.String(flags.GrpcHeadersFlag.Name, cfg.grpcHeaders, "")
set.String(flags.GRPCHeadersFlag.Name, cfg.grpcHeaders, "")
if cfg.privateKeyFile != "" {
set.String(flags.ImportPrivateKeyFileFlag.Name, cfg.privateKeyFile, "")
@@ -87,13 +87,13 @@ func setupWalletCtx(
assert.NoError(tb, set.Set(flags.VoluntaryExitPublicKeysFlag.Name, cfg.voluntaryExitPublicKeys))
assert.NoError(tb, set.Set(flags.BackupDirFlag.Name, cfg.backupDir))
assert.NoError(tb, set.Set(flags.BackupPublicKeysFlag.Name, cfg.backupPublicKeys))
assert.NoError(tb, set.Set(flags.BackupPasswordFile.Name, cfg.backupPasswordFile))
assert.NoError(tb, set.Set(flags.BackupPasswordFileFlag.Name, cfg.backupPasswordFile))
assert.NoError(tb, set.Set(flags.WalletPasswordFileFlag.Name, cfg.walletPasswordFile))
assert.NoError(tb, set.Set(flags.AccountPasswordFileFlag.Name, cfg.accountPasswordFile))
assert.NoError(tb, set.Set(flags.NumAccountsFlag.Name, strconv.Itoa(int(cfg.numAccounts))))
assert.NoError(tb, set.Set(flags.SkipDepositConfirmationFlag.Name, strconv.FormatBool(cfg.skipDepositConfirm)))
assert.NoError(tb, set.Set(flags.ExitAllFlag.Name, strconv.FormatBool(cfg.exitAll)))
assert.NoError(tb, set.Set(flags.GrpcHeadersFlag.Name, cfg.grpcHeaders))
assert.NoError(tb, set.Set(flags.GRPCHeadersFlag.Name, cfg.grpcHeaders))
return cli.NewContext(&app, set, nil)
}

View File

@@ -217,8 +217,8 @@ func (m *Validator) SetProposerSettings(_ context.Context, settings *proposer.Se
return nil
}
// GetGraffiti for mocking
func (m *Validator) GetGraffiti(_ context.Context, _ [fieldparams.BLSPubkeyLength]byte) ([]byte, error) {
// Graffiti for mocking
func (m *Validator) Graffiti(_ context.Context, _ [fieldparams.BLSPubkeyLength]byte) ([]byte, error) {
return []byte(m.graffiti), nil
}

View File

@@ -55,7 +55,7 @@ func (v *validator) SubmitAggregateAndProof(ctx context.Context, slot primitives
var slotSig []byte
if v.distributed {
slotSig, err = v.getAttSelection(attSelectionKey{slot: slot, index: duty.ValidatorIndex})
slotSig, err = v.attSelection(attSelectionKey{slot: slot, index: duty.ValidatorIndex})
if err != nil {
log.WithError(err).Error("Could not find aggregated selection proof")
if v.emitAccountMetrics {

View File

@@ -75,7 +75,7 @@ func (v *validator) SubmitAttestation(ctx context.Context, slot primitives.Slot,
Slot: slot,
CommitteeIndex: duty.CommitteeIndex,
}
data, err := v.validatorClient.GetAttestationData(ctx, req)
data, err := v.validatorClient.AttestationData(ctx, req)
if err != nil {
log.WithError(err).Error("Could not request attestation to sign at slot")
if v.emitAccountMetrics {
@@ -90,7 +90,7 @@ func (v *validator) SubmitAttestation(ctx context.Context, slot primitives.Slot,
Data: data,
}
_, signingRoot, err := v.getDomainAndSigningRoot(ctx, indexedAtt.Data)
_, signingRoot, err := v.domainAndSigningRoot(ctx, indexedAtt.Data)
if err != nil {
log.WithError(err).Error("Could not get domain and signing root from attestation")
if v.emitAccountMetrics {
@@ -199,7 +199,7 @@ func (v *validator) duty(pubKey [fieldparams.BLSPubkeyLength]byte) (*ethpb.Dutie
// Given validator's public key, this function returns the signature of an attestation data and its signing root.
func (v *validator) signAtt(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, data *ethpb.AttestationData, slot primitives.Slot) ([]byte, [32]byte, error) {
domain, root, err := v.getDomainAndSigningRoot(ctx, data)
domain, root, err := v.domainAndSigningRoot(ctx, data)
if err != nil {
return nil, [32]byte{}, err
}
@@ -217,7 +217,7 @@ func (v *validator) signAtt(ctx context.Context, pubKey [fieldparams.BLSPubkeyLe
return sig.Marshal(), root, nil
}
func (v *validator) getDomainAndSigningRoot(ctx context.Context, data *ethpb.AttestationData) (*ethpb.DomainResponse, [32]byte, error) {
func (v *validator) domainAndSigningRoot(ctx context.Context, data *ethpb.AttestationData) (*ethpb.DomainResponse, [32]byte, error) {
domain, err := v.domainData(ctx, data.Target.Epoch, params.BeaconConfig().DomainBeaconAttester[:])
if err != nil {
return nil, [32]byte{}, err

View File

@@ -81,7 +81,7 @@ func TestAttestToBlockHead_SubmitAttestation_RequestFailure(t *testing.T) {
Committee: make([]primitives.ValidatorIndex, 111),
ValidatorIndex: 0,
}}}
m.validatorClient.EXPECT().GetAttestationData(
m.validatorClient.EXPECT().AttestationData(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.AttestationDataRequest{}),
).Return(&ethpb.AttestationData{
@@ -128,7 +128,7 @@ func TestAttestToBlockHead_AttestsCorrectly(t *testing.T) {
beaconBlockRoot := bytesutil.ToBytes32([]byte("A"))
targetRoot := bytesutil.ToBytes32([]byte("B"))
sourceRoot := bytesutil.ToBytes32([]byte("C"))
m.validatorClient.EXPECT().GetAttestationData(
m.validatorClient.EXPECT().AttestationData(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.AttestationDataRequest{}),
).Return(&ethpb.AttestationData{
@@ -206,7 +206,7 @@ func TestAttestToBlockHead_BlocksDoubleAtt(t *testing.T) {
sourceRoot := bytesutil.ToBytes32([]byte("C"))
beaconBlockRoot2 := bytesutil.ToBytes32([]byte("D"))
m.validatorClient.EXPECT().GetAttestationData(
m.validatorClient.EXPECT().AttestationData(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.AttestationDataRequest{}),
).Return(&ethpb.AttestationData{
@@ -214,7 +214,7 @@ func TestAttestToBlockHead_BlocksDoubleAtt(t *testing.T) {
Target: &ethpb.Checkpoint{Root: targetRoot[:], Epoch: 4},
Source: &ethpb.Checkpoint{Root: sourceRoot[:], Epoch: 3},
}, nil)
m.validatorClient.EXPECT().GetAttestationData(
m.validatorClient.EXPECT().AttestationData(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.AttestationDataRequest{}),
).Return(&ethpb.AttestationData{
@@ -261,7 +261,7 @@ func TestAttestToBlockHead_BlocksSurroundAtt(t *testing.T) {
targetRoot := bytesutil.ToBytes32([]byte("B"))
sourceRoot := bytesutil.ToBytes32([]byte("C"))
m.validatorClient.EXPECT().GetAttestationData(
m.validatorClient.EXPECT().AttestationData(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.AttestationDataRequest{}),
).Return(&ethpb.AttestationData{
@@ -269,7 +269,7 @@ func TestAttestToBlockHead_BlocksSurroundAtt(t *testing.T) {
Target: &ethpb.Checkpoint{Root: targetRoot[:], Epoch: 2},
Source: &ethpb.Checkpoint{Root: sourceRoot[:], Epoch: 1},
}, nil)
m.validatorClient.EXPECT().GetAttestationData(
m.validatorClient.EXPECT().AttestationData(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.AttestationDataRequest{}),
).Return(&ethpb.AttestationData{
@@ -317,7 +317,7 @@ func TestAttestToBlockHead_BlocksSurroundedAtt(t *testing.T) {
targetRoot := bytesutil.ToBytes32([]byte("B"))
sourceRoot := bytesutil.ToBytes32([]byte("C"))
m.validatorClient.EXPECT().GetAttestationData(
m.validatorClient.EXPECT().AttestationData(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.AttestationDataRequest{}),
).Return(&ethpb.AttestationData{
@@ -339,7 +339,7 @@ func TestAttestToBlockHead_BlocksSurroundedAtt(t *testing.T) {
validator.SubmitAttestation(context.Background(), 30, pubKey)
require.LogsDoNotContain(t, hook, failedAttLocalProtectionErr)
m.validatorClient.EXPECT().GetAttestationData(
m.validatorClient.EXPECT().AttestationData(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.AttestationDataRequest{}),
).Return(&ethpb.AttestationData{
@@ -363,12 +363,12 @@ func TestAttestToBlockHead_DoesNotAttestBeforeDelay(t *testing.T) {
var pubKey [fieldparams.BLSPubkeyLength]byte
copy(pubKey[:], validatorKey.PublicKey().Marshal())
validator.genesisTime = uint64(prysmTime.Now().Unix())
m.validatorClient.EXPECT().GetDuties(
m.validatorClient.EXPECT().Duties(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.DutiesRequest{}),
).Times(0)
m.validatorClient.EXPECT().GetAttestationData(
m.validatorClient.EXPECT().AttestationData(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.AttestationDataRequest{}),
).Times(0)
@@ -408,7 +408,7 @@ func TestAttestToBlockHead_DoesAttestAfterDelay(t *testing.T) {
ValidatorIndex: validatorIndex,
}}}
m.validatorClient.EXPECT().GetAttestationData(
m.validatorClient.EXPECT().AttestationData(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.AttestationDataRequest{}),
).Return(&ethpb.AttestationData{
@@ -450,7 +450,7 @@ func TestAttestToBlockHead_CorrectBitfieldLength(t *testing.T) {
Committee: committee,
ValidatorIndex: validatorIndex,
}}}
m.validatorClient.EXPECT().GetAttestationData(
m.validatorClient.EXPECT().AttestationData(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.AttestationDataRequest{}),
).Return(&ethpb.AttestationData{
@@ -643,7 +643,7 @@ func Test_slashableAttestationCheck_UpdatesLowestSignedEpochs(t *testing.T) {
gomock.Any(), // ctx
&ethpb.DomainRequest{Epoch: 10, Domain: []byte{1, 0, 0, 0}},
).Return(&ethpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/)
_, sr, err := validator.getDomainAndSigningRoot(ctx, att.Data)
_, sr, err := validator.domainAndSigningRoot(ctx, att.Data)
require.NoError(t, err)
err = validator.db.SlashableAttestationCheck(context.Background(), att, pubKey, sr, false, nil)

View File

@@ -13,7 +13,7 @@ import (
"google.golang.org/grpc"
)
func (c beaconApiValidatorClient) waitForActivation(ctx context.Context, in *ethpb.ValidatorActivationRequest) (ethpb.BeaconNodeValidator_WaitForActivationClient, error) {
func (c *beaconApiValidatorClient) waitForActivation(ctx context.Context, in *ethpb.ValidatorActivationRequest) (ethpb.BeaconNodeValidator_WaitForActivationClient, error) {
return &waitForActivationClient{
ctx: ctx,
beaconApiValidatorClient: c,
@@ -24,12 +24,12 @@ func (c beaconApiValidatorClient) waitForActivation(ctx context.Context, in *eth
type waitForActivationClient struct {
grpc.ClientStream
ctx context.Context
beaconApiValidatorClient
*beaconApiValidatorClient
*ethpb.ValidatorActivationRequest
lastRecvTime time.Time
}
func computeWaitElements(now time.Time, lastRecvTime time.Time) (time.Duration, time.Time) {
func computeWaitElements(now, lastRecvTime time.Time) (time.Duration, time.Time) {
nextRecvTime := lastRecvTime.Add(time.Duration(params.BeaconConfig().SecondsPerSlot) * time.Second)
if lastRecvTime.IsZero() {
@@ -68,7 +68,7 @@ func (c *waitForActivationClient) Recv() (*ethpb.ValidatorActivationResponse, er
stringTargetPubKeys[index] = stringPubKey
}
stateValidators, err := c.stateValidatorsProvider.GetStateValidators(c.ctx, stringTargetPubKeys, nil, nil)
stateValidators, err := c.stateValidatorsProvider.StateValidators(c.ctx, stringTargetPubKeys, nil, nil)
if err != nil {
return nil, errors.Wrap(err, "failed to get state validators")
}

View File

@@ -12,7 +12,7 @@ import (
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
)
func (c beaconApiValidatorClient) getAttestationData(
func (c *beaconApiValidatorClient) attestationData(
ctx context.Context,
reqSlot primitives.Slot,
reqCommitteeIndex primitives.CommitteeIndex,

View File

@@ -58,7 +58,7 @@ func TestGetAttestationData_ValidAttestation(t *testing.T) {
).Times(1)
validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler}
resp, err := validatorClient.getAttestationData(ctx, primitives.Slot(expectedSlot), primitives.CommitteeIndex(expectedCommitteeIndex))
resp, err := validatorClient.attestationData(ctx, primitives.Slot(expectedSlot), primitives.CommitteeIndex(expectedCommitteeIndex))
assert.NoError(t, err)
require.NotNil(t, resp)
@@ -194,7 +194,7 @@ func TestGetAttestationData_InvalidData(t *testing.T) {
).Times(1)
validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler}
_, err := validatorClient.getAttestationData(ctx, 1, 2)
_, err := validatorClient.attestationData(ctx, 1, 2)
assert.ErrorContains(t, testCase.expectedErrorMessage, err)
})
}
@@ -220,11 +220,11 @@ func TestGetAttestationData_JsonResponseError(t *testing.T) {
).Times(1)
validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler}
_, err := validatorClient.getAttestationData(ctx, slot, committeeIndex)
_, err := validatorClient.attestationData(ctx, slot, committeeIndex)
assert.ErrorContains(t, "some specific json response error", err)
}
func generateValidAttestation(slot uint64, committeeIndex uint64) structs.GetAttestationDataResponse {
func generateValidAttestation(slot, committeeIndex uint64) structs.GetAttestationDataResponse {
return structs.GetAttestationDataResponse{
Data: &structs.AttestationData{
Slot: strconv.FormatUint(slot, 10),

View File

@@ -25,7 +25,7 @@ type beaconApiChainClient struct {
const getValidatorPerformanceEndpoint = "/prysm/validators/performance"
func (c beaconApiChainClient) getHeadBlockHeaders(ctx context.Context) (*structs.GetBlockHeaderResponse, error) {
func (c beaconApiChainClient) headBlockHeaders(ctx context.Context) (*structs.GetBlockHeaderResponse, error) {
blockHeader := structs.GetBlockHeaderResponse{}
err := c.jsonRestHandler.Get(ctx, "/eth/v1/beacon/headers/head", &blockHeader)
if err != nil {
@@ -43,7 +43,7 @@ func (c beaconApiChainClient) getHeadBlockHeaders(ctx context.Context) (*structs
return &blockHeader, nil
}
func (c beaconApiChainClient) GetChainHead(ctx context.Context, _ *empty.Empty) (*ethpb.ChainHead, error) {
func (c beaconApiChainClient) ChainHead(ctx context.Context, _ *empty.Empty) (*ethpb.ChainHead, error) {
const endpoint = "/eth/v1/beacon/states/head/finality_checkpoints"
finalityCheckpoints := structs.GetFinalityCheckpointsResponse{}
@@ -112,7 +112,7 @@ func (c beaconApiChainClient) GetChainHead(ctx context.Context, _ *empty.Empty)
return nil, errors.Wrapf(err, "failed to decode previous justified checkpoint root `%s`", finalityCheckpoints.Data.PreviousJustified.Root)
}
blockHeader, err := c.getHeadBlockHeaders(ctx)
blockHeader, err := c.headBlockHeaders(ctx)
if err != nil {
return nil, errors.Wrap(err, "failed to get head block headers")
}
@@ -146,16 +146,16 @@ func (c beaconApiChainClient) GetChainHead(ctx context.Context, _ *empty.Empty)
}, nil
}
func (c beaconApiChainClient) ListValidatorBalances(ctx context.Context, in *ethpb.ListValidatorBalancesRequest) (*ethpb.ValidatorBalances, error) {
func (c beaconApiChainClient) ValidatorBalances(ctx context.Context, in *ethpb.ListValidatorBalancesRequest) (*ethpb.ValidatorBalances, error) {
if c.fallbackClient != nil {
return c.fallbackClient.ListValidatorBalances(ctx, in)
return c.fallbackClient.ValidatorBalances(ctx, in)
}
// TODO: Implement me
panic("beaconApiChainClient.ListValidatorBalances is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiChainClientWithFallback.")
panic("beaconApiChainClient.ValidatorBalances is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiChainClientWithFallback.")
}
func (c beaconApiChainClient) ListValidators(ctx context.Context, in *ethpb.ListValidatorsRequest) (*ethpb.Validators, error) {
func (c beaconApiChainClient) Validators(ctx context.Context, in *ethpb.ListValidatorsRequest) (*ethpb.Validators, error) {
pageSize := in.PageSize
// We follow the gRPC behavior here, which returns a maximum of 250 results when pageSize == 0
@@ -191,21 +191,21 @@ func (c beaconApiChainClient) ListValidators(ctx context.Context, in *ethpb.List
if err != nil {
return nil, errors.Wrapf(err, "failed to get first slot for epoch `%d`", queryFilter.Epoch)
}
if stateValidators, err = c.stateValidatorsProvider.GetStateValidatorsForSlot(ctx, slot, pubkeys, in.Indices, statuses); err != nil {
if stateValidators, err = c.stateValidatorsProvider.StateValidatorsForSlot(ctx, slot, pubkeys, in.Indices, statuses); err != nil {
return nil, errors.Wrapf(err, "failed to get state validators for slot `%d`", slot)
}
epoch = slots.ToEpoch(slot)
case *ethpb.ListValidatorsRequest_Genesis:
if stateValidators, err = c.stateValidatorsProvider.GetStateValidatorsForSlot(ctx, 0, pubkeys, in.Indices, statuses); err != nil {
if stateValidators, err = c.stateValidatorsProvider.StateValidatorsForSlot(ctx, 0, pubkeys, in.Indices, statuses); err != nil {
return nil, errors.Wrapf(err, "failed to get genesis state validators")
}
epoch = 0
case nil:
if stateValidators, err = c.stateValidatorsProvider.GetStateValidatorsForHead(ctx, pubkeys, in.Indices, statuses); err != nil {
if stateValidators, err = c.stateValidatorsProvider.StateValidatorsForHead(ctx, pubkeys, in.Indices, statuses); err != nil {
return nil, errors.Wrap(err, "failed to get head state validators")
}
blockHeader, err := c.getHeadBlockHeaders(ctx)
blockHeader, err := c.headBlockHeaders(ctx)
if err != nil {
return nil, errors.Wrap(err, "failed to get head block headers")
}
@@ -310,16 +310,16 @@ func (c beaconApiChainClient) ListValidators(ctx context.Context, in *ethpb.List
}, nil
}
func (c beaconApiChainClient) GetValidatorQueue(ctx context.Context, in *empty.Empty) (*ethpb.ValidatorQueue, error) {
func (c beaconApiChainClient) ValidatorQueue(ctx context.Context, in *empty.Empty) (*ethpb.ValidatorQueue, error) {
if c.fallbackClient != nil {
return c.fallbackClient.GetValidatorQueue(ctx, in)
return c.fallbackClient.ValidatorQueue(ctx, in)
}
// TODO: Implement me
panic("beaconApiChainClient.GetValidatorQueue is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiChainClientWithFallback.")
panic("beaconApiChainClient.ValidatorQueue is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiChainClientWithFallback.")
}
func (c beaconApiChainClient) GetValidatorPerformance(ctx context.Context, in *ethpb.ValidatorPerformanceRequest) (*ethpb.ValidatorPerformanceResponse, error) {
func (c beaconApiChainClient) ValidatorPerformance(ctx context.Context, in *ethpb.ValidatorPerformanceRequest) (*ethpb.ValidatorPerformanceResponse, error) {
request, err := json.Marshal(structs.GetValidatorPerformanceRequest{
PublicKeys: in.PublicKeys,
Indices: in.Indices,
@@ -345,13 +345,13 @@ func (c beaconApiChainClient) GetValidatorPerformance(ctx context.Context, in *e
}, nil
}
func (c beaconApiChainClient) GetValidatorParticipation(ctx context.Context, in *ethpb.GetValidatorParticipationRequest) (*ethpb.ValidatorParticipationResponse, error) {
func (c beaconApiChainClient) ValidatorParticipation(ctx context.Context, in *ethpb.GetValidatorParticipationRequest) (*ethpb.ValidatorParticipationResponse, error) {
if c.fallbackClient != nil {
return c.fallbackClient.GetValidatorParticipation(ctx, in)
return c.fallbackClient.ValidatorParticipation(ctx, in)
}
// TODO: Implement me
panic("beaconApiChainClient.GetValidatorParticipation is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiChainClientWithFallback.")
panic("beaconApiChainClient.ValidatorParticipation is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiChainClientWithFallback.")
}
func NewBeaconApiChainClientWithFallback(jsonRestHandler JsonRestHandler, fallbackClient iface.ChainClient) iface.ChainClient {

View File

@@ -32,7 +32,7 @@ func TestListValidators(t *testing.T) {
ctx := context.Background()
beaconChainClient := beaconApiChainClient{}
_, err := beaconChainClient.ListValidators(ctx, &ethpb.ListValidatorsRequest{
_, err := beaconChainClient.Validators(ctx, &ethpb.ListValidatorsRequest{
PageToken: "foo",
})
assert.ErrorContains(t, "failed to parse page token `foo`", err)
@@ -44,7 +44,7 @@ func TestListValidators(t *testing.T) {
ctx := context.Background()
beaconChainClient := beaconApiChainClient{}
_, err := beaconChainClient.ListValidators(ctx, &ethpb.ListValidatorsRequest{
_, err := beaconChainClient.Validators(ctx, &ethpb.ListValidatorsRequest{
QueryFilter: &ethpb.ListValidatorsRequest_Epoch{
Epoch: math.MaxUint64,
},
@@ -58,13 +58,13 @@ func TestListValidators(t *testing.T) {
ctx := context.Background()
stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl)
stateValidatorsProvider.EXPECT().GetStateValidatorsForSlot(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(
stateValidatorsProvider.EXPECT().StateValidatorsForSlot(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(
nil,
errors.New("foo error"),
)
beaconChainClient := beaconApiChainClient{stateValidatorsProvider: stateValidatorsProvider}
_, err := beaconChainClient.ListValidators(ctx, &ethpb.ListValidatorsRequest{
_, err := beaconChainClient.Validators(ctx, &ethpb.ListValidatorsRequest{
QueryFilter: &ethpb.ListValidatorsRequest_Epoch{
Epoch: 0,
},
@@ -78,13 +78,13 @@ func TestListValidators(t *testing.T) {
ctx := context.Background()
stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl)
stateValidatorsProvider.EXPECT().GetStateValidatorsForSlot(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(
stateValidatorsProvider.EXPECT().StateValidatorsForSlot(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(
nil,
errors.New("bar error"),
)
beaconChainClient := beaconApiChainClient{stateValidatorsProvider: stateValidatorsProvider}
_, err := beaconChainClient.ListValidators(ctx, &ethpb.ListValidatorsRequest{
_, err := beaconChainClient.Validators(ctx, &ethpb.ListValidatorsRequest{
QueryFilter: &ethpb.ListValidatorsRequest_Genesis{},
})
assert.ErrorContains(t, "failed to get genesis state validators: bar error", err)
@@ -96,13 +96,13 @@ func TestListValidators(t *testing.T) {
ctx := context.Background()
stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl)
stateValidatorsProvider.EXPECT().GetStateValidatorsForHead(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Return(
stateValidatorsProvider.EXPECT().StateValidatorsForHead(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Return(
nil,
errors.New("foo error"),
)
beaconChainClient := beaconApiChainClient{stateValidatorsProvider: stateValidatorsProvider}
_, err := beaconChainClient.ListValidators(ctx, &ethpb.ListValidatorsRequest{
_, err := beaconChainClient.Validators(ctx, &ethpb.ListValidatorsRequest{
QueryFilter: nil,
})
assert.ErrorContains(t, "failed to get head state validators: foo error", err)
@@ -114,7 +114,7 @@ func TestListValidators(t *testing.T) {
ctx := context.Background()
stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl)
stateValidatorsProvider.EXPECT().GetStateValidatorsForHead(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Return(
stateValidatorsProvider.EXPECT().StateValidatorsForHead(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Return(
nil,
nil,
)
@@ -126,7 +126,7 @@ func TestListValidators(t *testing.T) {
stateValidatorsProvider: stateValidatorsProvider,
jsonRestHandler: jsonRestHandler,
}
_, err := beaconChainClient.ListValidators(ctx, &ethpb.ListValidatorsRequest{
_, err := beaconChainClient.Validators(ctx, &ethpb.ListValidatorsRequest{
QueryFilter: nil,
})
assert.ErrorContains(t, "bar error", err)
@@ -187,7 +187,7 @@ func TestListValidators(t *testing.T) {
ctx := context.Background()
stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl)
stateValidatorsProvider.EXPECT().GetStateValidatorsForHead(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Return(
stateValidatorsProvider.EXPECT().StateValidatorsForHead(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Return(
nil,
nil,
)
@@ -204,7 +204,7 @@ func TestListValidators(t *testing.T) {
stateValidatorsProvider: stateValidatorsProvider,
jsonRestHandler: jsonRestHandler,
}
_, err := beaconChainClient.ListValidators(ctx, &ethpb.ListValidatorsRequest{
_, err := beaconChainClient.Validators(ctx, &ethpb.ListValidatorsRequest{
QueryFilter: nil,
})
assert.ErrorContains(t, testCase.expectedError, err)
@@ -328,13 +328,13 @@ func TestListValidators(t *testing.T) {
ctx := context.Background()
stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl)
stateValidatorsProvider.EXPECT().GetStateValidatorsForSlot(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(
stateValidatorsProvider.EXPECT().StateValidatorsForSlot(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(
testCase.generateStateValidatorsResponse(),
nil,
)
beaconChainClient := beaconApiChainClient{stateValidatorsProvider: stateValidatorsProvider}
_, err := beaconChainClient.ListValidators(ctx, &ethpb.ListValidatorsRequest{
_, err := beaconChainClient.Validators(ctx, &ethpb.ListValidatorsRequest{
QueryFilter: &ethpb.ListValidatorsRequest_Genesis{},
})
assert.ErrorContains(t, testCase.expectedError, err)
@@ -556,13 +556,13 @@ func TestListValidators(t *testing.T) {
ctx := context.Background()
stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl)
stateValidatorsProvider.EXPECT().GetStateValidatorsForSlot(ctx, primitives.Slot(0), make([]string, 0), []primitives.ValidatorIndex{}, nil).Return(
stateValidatorsProvider.EXPECT().StateValidatorsForSlot(ctx, primitives.Slot(0), make([]string, 0), []primitives.ValidatorIndex{}, nil).Return(
testCase.generateJsonStateValidatorsResponse(),
nil,
)
beaconChainClient := beaconApiChainClient{stateValidatorsProvider: stateValidatorsProvider}
validators, err := beaconChainClient.ListValidators(ctx, &ethpb.ListValidatorsRequest{
validators, err := beaconChainClient.Validators(ctx, &ethpb.ListValidatorsRequest{
QueryFilter: &ethpb.ListValidatorsRequest_Genesis{},
PublicKeys: [][]byte{},
Indices: []primitives.ValidatorIndex{},
@@ -753,7 +753,7 @@ func TestGetChainHead(t *testing.T) {
)
beaconChainClient := beaconApiChainClient{jsonRestHandler: jsonRestHandler}
_, err := beaconChainClient.GetChainHead(ctx, &emptypb.Empty{})
_, err := beaconChainClient.ChainHead(ctx, &emptypb.Empty{})
assert.ErrorContains(t, testCase.expectedError, err)
})
}
@@ -860,7 +860,7 @@ func TestGetChainHead(t *testing.T) {
)
beaconChainClient := beaconApiChainClient{jsonRestHandler: jsonRestHandler}
_, err := beaconChainClient.GetChainHead(ctx, &emptypb.Empty{})
_, err := beaconChainClient.ChainHead(ctx, &emptypb.Empty{})
assert.ErrorContains(t, testCase.expectedError, err)
})
}
@@ -914,7 +914,7 @@ func TestGetChainHead(t *testing.T) {
}
beaconChainClient := beaconApiChainClient{jsonRestHandler: jsonRestHandler}
chainHead, err := beaconChainClient.GetChainHead(ctx, &emptypb.Empty{})
chainHead, err := beaconChainClient.ChainHead(ctx, &emptypb.Empty{})
require.NoError(t, err)
assert.DeepEqual(t, expectedChainHead, chainHead)
})
@@ -953,7 +953,7 @@ func Test_beaconApiBeaconChainClient_GetValidatorPerformance(t *testing.T) {
jsonRestHandler: jsonRestHandler,
}
got, err := c.GetValidatorPerformance(ctx, &ethpb.ValidatorPerformanceRequest{
got, err := c.ValidatorPerformance(ctx, &ethpb.ValidatorPerformanceRequest{
PublicKeys: [][]byte{publicKeys[0][:], publicKeys[2][:], publicKeys[1][:]},
})
require.NoError(t, err)

View File

@@ -48,7 +48,7 @@ func buildURL(path string, queryParams ...neturl.Values) string {
return fmt.Sprintf("%s?%s", path, queryParams[0].Encode())
}
func (c *beaconApiValidatorClient) getFork(ctx context.Context) (*structs.GetStateForkResponse, error) {
func (c *beaconApiValidatorClient) fork(ctx context.Context) (*structs.GetStateForkResponse, error) {
const endpoint = "/eth/v1/beacon/states/head/fork"
stateForkResponseJson := &structs.GetStateForkResponse{}
@@ -60,7 +60,7 @@ func (c *beaconApiValidatorClient) getFork(ctx context.Context) (*structs.GetSta
return stateForkResponseJson, nil
}
func (c *beaconApiValidatorClient) getHeaders(ctx context.Context) (*structs.GetBlockHeadersResponse, error) {
func (c *beaconApiValidatorClient) headers(ctx context.Context) (*structs.GetBlockHeadersResponse, error) {
const endpoint = "/eth/v1/beacon/headers"
blockHeadersResponseJson := &structs.GetBlockHeadersResponse{}
@@ -72,7 +72,7 @@ func (c *beaconApiValidatorClient) getHeaders(ctx context.Context) (*structs.Get
return blockHeadersResponseJson, nil
}
func (c *beaconApiValidatorClient) getLiveness(ctx context.Context, epoch primitives.Epoch, validatorIndexes []string) (*structs.GetLivenessResponse, error) {
func (c *beaconApiValidatorClient) liveness(ctx context.Context, epoch primitives.Epoch, validatorIndexes []string) (*structs.GetLivenessResponse, error) {
const endpoint = "/eth/v1/validator/liveness/"
url := endpoint + strconv.FormatUint(uint64(epoch), 10)
@@ -90,7 +90,7 @@ func (c *beaconApiValidatorClient) getLiveness(ctx context.Context, epoch primit
return livenessResponseJson, nil
}
func (c *beaconApiValidatorClient) getSyncing(ctx context.Context) (*structs.SyncStatusResponse, error) {
func (c *beaconApiValidatorClient) syncing(ctx context.Context) (*structs.SyncStatusResponse, error) {
const endpoint = "/eth/v1/node/syncing"
syncingResponseJson := &structs.SyncStatusResponse{}
@@ -103,7 +103,7 @@ func (c *beaconApiValidatorClient) getSyncing(ctx context.Context) (*structs.Syn
}
func (c *beaconApiValidatorClient) isSyncing(ctx context.Context) (bool, error) {
response, err := c.getSyncing(ctx)
response, err := c.syncing(ctx)
if err != nil || response == nil || response.Data == nil {
return true, errors.Wrapf(err, "failed to get syncing status")
}
@@ -112,7 +112,7 @@ func (c *beaconApiValidatorClient) isSyncing(ctx context.Context) (bool, error)
}
func (c *beaconApiValidatorClient) isOptimistic(ctx context.Context) (bool, error) {
response, err := c.getSyncing(ctx)
response, err := c.syncing(ctx)
if err != nil || response == nil || response.Data == nil {
return true, errors.Wrapf(err, "failed to get syncing status")
}

View File

@@ -123,7 +123,7 @@ func TestGetFork_Nominal(t *testing.T) {
jsonRestHandler: jsonRestHandler,
}
fork, err := validatorClient.getFork(ctx)
fork, err := validatorClient.fork(ctx)
require.NoError(t, err)
assert.DeepEqual(t, &expected, fork)
}
@@ -148,7 +148,7 @@ func TestGetFork_Invalid(t *testing.T) {
jsonRestHandler: jsonRestHandler,
}
_, err := validatorClient.getFork(ctx)
_, err := validatorClient.fork(ctx)
require.ErrorContains(t, "custom error", err)
}
@@ -190,7 +190,7 @@ func TestGetHeaders_Nominal(t *testing.T) {
jsonRestHandler: jsonRestHandler,
}
headers, err := validatorClient.getHeaders(ctx)
headers, err := validatorClient.headers(ctx)
require.NoError(t, err)
assert.DeepEqual(t, &expected, headers)
}
@@ -215,7 +215,7 @@ func TestGetHeaders_Invalid(t *testing.T) {
jsonRestHandler: jsonRestHandler,
}
_, err := validatorClient.getHeaders(ctx)
_, err := validatorClient.headers(ctx)
require.ErrorContains(t, "custom error", err)
}
@@ -261,7 +261,7 @@ func TestGetLiveness_Nominal(t *testing.T) {
).Times(1)
validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler}
liveness, err := validatorClient.getLiveness(ctx, 42, indexes)
liveness, err := validatorClient.liveness(ctx, 42, indexes)
require.NoError(t, err)
assert.DeepEqual(t, &expected, liveness)
@@ -285,12 +285,12 @@ func TestGetLiveness_Invalid(t *testing.T) {
).Times(1)
validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler}
_, err := validatorClient.getLiveness(ctx, 42, nil)
_, err := validatorClient.liveness(ctx, 42, nil)
require.ErrorContains(t, "custom error", err)
}
const syncingEnpoint = "/eth/v1/node/syncing"
const syncingEndpoint = "/eth/v1/node/syncing"
func TestGetIsSyncing_Nominal(t *testing.T) {
testCases := []struct {
@@ -325,7 +325,7 @@ func TestGetIsSyncing_Nominal(t *testing.T) {
jsonRestHandler.EXPECT().Get(
ctx,
syncingEnpoint,
syncingEndpoint,
&syncingResponseJson,
).Return(
nil,
@@ -356,7 +356,7 @@ func TestGetIsSyncing_Invalid(t *testing.T) {
jsonRestHandler.EXPECT().Get(
ctx,
syncingEnpoint,
syncingEndpoint,
&syncingResponseJson,
).Return(
errors.New("custom error"),

View File

@@ -25,7 +25,7 @@ type beaconApiNodeClient struct {
healthTracker *beacon.NodeHealthTracker
}
func (c *beaconApiNodeClient) GetSyncStatus(ctx context.Context, _ *empty.Empty) (*ethpb.SyncStatus, error) {
func (c *beaconApiNodeClient) SyncStatus(ctx context.Context, _ *empty.Empty) (*ethpb.SyncStatus, error) {
syncingResponse := structs.SyncStatusResponse{}
if err := c.jsonRestHandler.Get(ctx, "/eth/v1/node/syncing", &syncingResponse); err != nil {
return nil, err
@@ -40,8 +40,8 @@ func (c *beaconApiNodeClient) GetSyncStatus(ctx context.Context, _ *empty.Empty)
}, nil
}
func (c *beaconApiNodeClient) GetGenesis(ctx context.Context, _ *empty.Empty) (*ethpb.Genesis, error) {
genesisJson, err := c.genesisProvider.GetGenesis(ctx)
func (c *beaconApiNodeClient) Genesis(ctx context.Context, _ *empty.Empty) (*ethpb.Genesis, error) {
genesisJson, err := c.genesisProvider.Genesis(ctx)
if err != nil {
return nil, errors.Wrap(err, "failed to get genesis")
}
@@ -79,7 +79,7 @@ func (c *beaconApiNodeClient) GetGenesis(ctx context.Context, _ *empty.Empty) (*
}, nil
}
func (c *beaconApiNodeClient) GetVersion(ctx context.Context, _ *empty.Empty) (*ethpb.Version, error) {
func (c *beaconApiNodeClient) Version(ctx context.Context, _ *empty.Empty) (*ethpb.Version, error) {
var versionResponse structs.GetVersionResponse
if err := c.jsonRestHandler.Get(ctx, "/eth/v1/node/version", &versionResponse); err != nil {
return nil, err
@@ -94,13 +94,13 @@ func (c *beaconApiNodeClient) GetVersion(ctx context.Context, _ *empty.Empty) (*
}, nil
}
func (c *beaconApiNodeClient) ListPeers(ctx context.Context, in *empty.Empty) (*ethpb.Peers, error) {
func (c *beaconApiNodeClient) Peers(ctx context.Context, in *empty.Empty) (*ethpb.Peers, error) {
if c.fallbackClient != nil {
return c.fallbackClient.ListPeers(ctx, in)
return c.fallbackClient.Peers(ctx, in)
}
// TODO: Implement me
panic("beaconApiNodeClient.ListPeers is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiNodeClientWithFallback.")
panic("beaconApiNodeClient.Peers is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiNodeClientWithFallback.")
}
func (c *beaconApiNodeClient) IsHealthy(ctx context.Context) bool {

View File

@@ -112,7 +112,7 @@ func TestGetGenesis(t *testing.T) {
ctx := context.Background()
genesisProvider := mock.NewMockGenesisProvider(ctrl)
genesisProvider.EXPECT().GetGenesis(
genesisProvider.EXPECT().Genesis(
ctx,
).Return(
testCase.genesisResponse,
@@ -139,7 +139,7 @@ func TestGetGenesis(t *testing.T) {
genesisProvider: genesisProvider,
jsonRestHandler: jsonRestHandler,
}
response, err := nodeClient.GetGenesis(ctx, &emptypb.Empty{})
response, err := nodeClient.Genesis(ctx, &emptypb.Empty{})
if testCase.expectedResponse == nil {
assert.ErrorContains(t, testCase.expectedError, err)
@@ -214,7 +214,7 @@ func TestGetSyncStatus(t *testing.T) {
)
nodeClient := &beaconApiNodeClient{jsonRestHandler: jsonRestHandler}
syncStatus, err := nodeClient.GetSyncStatus(ctx, &emptypb.Empty{})
syncStatus, err := nodeClient.SyncStatus(ctx, &emptypb.Empty{})
if testCase.expectedResponse == nil {
assert.ErrorContains(t, testCase.expectedError, err)
@@ -278,7 +278,7 @@ func TestGetVersion(t *testing.T) {
)
nodeClient := &beaconApiNodeClient{jsonRestHandler: jsonRestHandler}
version, err := nodeClient.GetVersion(ctx, &emptypb.Empty{})
version, err := nodeClient.Version(ctx, &emptypb.Empty{})
if testCase.expectedResponse == nil {
assert.ErrorContains(t, testCase.expectedError, err)

View File

@@ -46,9 +46,9 @@ func NewBeaconApiValidatorClient(jsonRestHandler JsonRestHandler, opts ...Valida
return c
}
func (c *beaconApiValidatorClient) GetDuties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) {
return wrapInMetrics[*ethpb.DutiesResponse]("GetDuties", func() (*ethpb.DutiesResponse, error) {
return c.getDuties(ctx, in)
func (c *beaconApiValidatorClient) Duties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) {
return wrapInMetrics[*ethpb.DutiesResponse]("Duties", func() (*ethpb.DutiesResponse, error) {
return c.duties(ctx, in)
})
}
@@ -65,41 +65,41 @@ func (c *beaconApiValidatorClient) DomainData(ctx context.Context, in *ethpb.Dom
domainType := bytesutil.ToBytes4(in.Domain)
return wrapInMetrics[*ethpb.DomainResponse]("DomainData", func() (*ethpb.DomainResponse, error) {
return c.getDomainData(ctx, in.Epoch, domainType)
return c.domainData(ctx, in.Epoch, domainType)
})
}
func (c *beaconApiValidatorClient) GetAttestationData(ctx context.Context, in *ethpb.AttestationDataRequest) (*ethpb.AttestationData, error) {
return wrapInMetrics[*ethpb.AttestationData]("GetAttestationData", func() (*ethpb.AttestationData, error) {
return c.getAttestationData(ctx, in.Slot, in.CommitteeIndex)
func (c *beaconApiValidatorClient) AttestationData(ctx context.Context, in *ethpb.AttestationDataRequest) (*ethpb.AttestationData, error) {
return wrapInMetrics[*ethpb.AttestationData]("AttestationData", func() (*ethpb.AttestationData, error) {
return c.attestationData(ctx, in.Slot, in.CommitteeIndex)
})
}
func (c *beaconApiValidatorClient) GetBeaconBlock(ctx context.Context, in *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) {
return wrapInMetrics[*ethpb.GenericBeaconBlock]("GetBeaconBlock", func() (*ethpb.GenericBeaconBlock, error) {
return c.getBeaconBlock(ctx, in.Slot, in.RandaoReveal, in.Graffiti)
func (c *beaconApiValidatorClient) BeaconBlock(ctx context.Context, in *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) {
return wrapInMetrics[*ethpb.GenericBeaconBlock]("BeaconBlock", func() (*ethpb.GenericBeaconBlock, error) {
return c.beaconBlock(ctx, in.Slot, in.RandaoReveal, in.Graffiti)
})
}
func (c *beaconApiValidatorClient) GetFeeRecipientByPubKey(_ context.Context, _ *ethpb.FeeRecipientByPubKeyRequest) (*ethpb.FeeRecipientByPubKeyResponse, error) {
func (c *beaconApiValidatorClient) FeeRecipientByPubKey(_ context.Context, _ *ethpb.FeeRecipientByPubKeyRequest) (*ethpb.FeeRecipientByPubKeyResponse, error) {
return nil, nil
}
func (c *beaconApiValidatorClient) GetSyncCommitteeContribution(ctx context.Context, in *ethpb.SyncCommitteeContributionRequest) (*ethpb.SyncCommitteeContribution, error) {
return wrapInMetrics[*ethpb.SyncCommitteeContribution]("GetSyncCommitteeContribution", func() (*ethpb.SyncCommitteeContribution, error) {
return c.getSyncCommitteeContribution(ctx, in)
func (c *beaconApiValidatorClient) SyncCommitteeContribution(ctx context.Context, in *ethpb.SyncCommitteeContributionRequest) (*ethpb.SyncCommitteeContribution, error) {
return wrapInMetrics[*ethpb.SyncCommitteeContribution]("SyncCommitteeContribution", func() (*ethpb.SyncCommitteeContribution, error) {
return c.syncCommitteeContribution(ctx, in)
})
}
func (c *beaconApiValidatorClient) GetSyncMessageBlockRoot(ctx context.Context, _ *empty.Empty) (*ethpb.SyncMessageBlockRootResponse, error) {
return wrapInMetrics[*ethpb.SyncMessageBlockRootResponse]("GetSyncMessageBlockRoot", func() (*ethpb.SyncMessageBlockRootResponse, error) {
return c.getSyncMessageBlockRoot(ctx)
func (c *beaconApiValidatorClient) SyncMessageBlockRoot(ctx context.Context, _ *empty.Empty) (*ethpb.SyncMessageBlockRootResponse, error) {
return wrapInMetrics[*ethpb.SyncMessageBlockRootResponse]("SyncMessageBlockRoot", func() (*ethpb.SyncMessageBlockRootResponse, error) {
return c.syncMessageBlockRoot(ctx)
})
}
func (c *beaconApiValidatorClient) GetSyncSubcommitteeIndex(ctx context.Context, in *ethpb.SyncSubcommitteeIndexRequest) (*ethpb.SyncSubcommitteeIndexResponse, error) {
return wrapInMetrics[*ethpb.SyncSubcommitteeIndexResponse]("GetSyncSubcommitteeIndex", func() (*ethpb.SyncSubcommitteeIndexResponse, error) {
return c.getSyncSubcommitteeIndex(ctx, in)
func (c *beaconApiValidatorClient) SyncSubcommitteeIndex(ctx context.Context, in *ethpb.SyncSubcommitteeIndexRequest) (*ethpb.SyncSubcommitteeIndexResponse, error) {
return wrapInMetrics[*ethpb.SyncSubcommitteeIndexResponse]("SyncSubcommitteeIndex", func() (*ethpb.SyncSubcommitteeIndexResponse, error) {
return c.syncSubcommitteeIndex(ctx, in)
})
}
@@ -211,12 +211,12 @@ func (c *beaconApiValidatorClient) EventStreamIsRunning() bool {
return c.isEventStreamRunning
}
func (c *beaconApiValidatorClient) GetAggregatedSelections(ctx context.Context, selections []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) {
return c.getAggregatedSelection(ctx, selections)
func (c *beaconApiValidatorClient) AggregatedSelections(ctx context.Context, selections []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) {
return c.aggregatedSelection(ctx, selections)
}
func (c *beaconApiValidatorClient) GetAggregatedSyncSelections(ctx context.Context, selections []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) {
return c.getAggregatedSyncSelections(ctx, selections)
func (c *beaconApiValidatorClient) AggregatedSyncSelections(ctx context.Context, selections []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) {
return c.aggregatedSyncSelections(ctx, selections)
}
func wrapInMetrics[Resp any](action string, f func() (Resp, error)) (Resp, error) {

View File

@@ -19,7 +19,7 @@ import (
"github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock"
)
// Make sure that GetAttestationData() returns the same thing as the internal getAttestationData()
// Make sure that AttestationData() returns the same thing as the internal attestationData()
func TestBeaconApiValidatorClient_GetAttestationDataValid(t *testing.T) {
const slot = primitives.Slot(1)
const committeeIndex = primitives.CommitteeIndex(2)
@@ -43,9 +43,9 @@ func TestBeaconApiValidatorClient_GetAttestationDataValid(t *testing.T) {
).Times(2)
validatorClient := beaconApiValidatorClient{jsonRestHandler: jsonRestHandler}
expectedResp, expectedErr := validatorClient.getAttestationData(ctx, slot, committeeIndex)
expectedResp, expectedErr := validatorClient.attestationData(ctx, slot, committeeIndex)
resp, err := validatorClient.GetAttestationData(
resp, err := validatorClient.AttestationData(
context.Background(),
&ethpb.AttestationDataRequest{Slot: slot, CommitteeIndex: committeeIndex},
)
@@ -77,9 +77,9 @@ func TestBeaconApiValidatorClient_GetAttestationDataError(t *testing.T) {
).Times(2)
validatorClient := beaconApiValidatorClient{jsonRestHandler: jsonRestHandler}
expectedResp, expectedErr := validatorClient.getAttestationData(ctx, slot, committeeIndex)
expectedResp, expectedErr := validatorClient.attestationData(ctx, slot, committeeIndex)
resp, err := validatorClient.GetAttestationData(
resp, err := validatorClient.AttestationData(
context.Background(),
&ethpb.AttestationDataRequest{Slot: slot, CommitteeIndex: committeeIndex},
)
@@ -93,7 +93,7 @@ func TestBeaconApiValidatorClient_GetFeeRecipientByPubKey(t *testing.T) {
validatorClient := beaconApiValidatorClient{}
var expected *ethpb.FeeRecipientByPubKeyResponse = nil
resp, err := validatorClient.GetFeeRecipientByPubKey(ctx, nil)
resp, err := validatorClient.FeeRecipientByPubKey(ctx, nil)
require.NoError(t, err)
require.Equal(t, expected, resp)
}
@@ -109,7 +109,7 @@ func TestBeaconApiValidatorClient_DomainDataValid(t *testing.T) {
ctx := context.Background()
genesisProvider := mock.NewMockGenesisProvider(ctrl)
genesisProvider.EXPECT().GetGenesis(ctx).Return(
genesisProvider.EXPECT().Genesis(ctx).Return(
&structs.Genesis{GenesisValidatorsRoot: genesisValidatorRoot},
nil,
).Times(2)
@@ -118,7 +118,7 @@ func TestBeaconApiValidatorClient_DomainDataValid(t *testing.T) {
resp, err := validatorClient.DomainData(context.Background(), &ethpb.DomainRequest{Epoch: epoch, Domain: domainType})
domainTypeArray := bytesutil.ToBytes4(domainType)
expectedResp, expectedErr := validatorClient.getDomainData(ctx, epoch, domainTypeArray)
expectedResp, expectedErr := validatorClient.domainData(ctx, epoch, domainTypeArray)
assert.DeepEqual(t, expectedErr, err)
assert.DeepEqual(t, expectedResp, resp)
}

View File

@@ -6,13 +6,13 @@ import (
"github.com/prysmaticlabs/prysm/v5/api/server/structs"
"github.com/prysmaticlabs/prysm/v5/testing/assert"
"github.com/prysmaticlabs/prysm/v5/testing/require"
test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers"
testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers"
)
func TestGetBeaconBlockConverter_Phase0Valid(t *testing.T) {
expectedBeaconBlock := test_helpers.GenerateProtoPhase0BeaconBlock()
expectedBeaconBlock := testhelpers.GenerateProtoPhase0BeaconBlock()
beaconBlockConverter := &beaconApiBeaconBlockConverter{}
beaconBlock, err := beaconBlockConverter.ConvertRESTPhase0BlockToProto(test_helpers.GenerateJsonPhase0BeaconBlock())
beaconBlock, err := beaconBlockConverter.ConvertRESTPhase0BlockToProto(testhelpers.GenerateJsonPhase0BeaconBlock())
require.NoError(t, err)
assert.DeepEqual(t, expectedBeaconBlock, beaconBlock)
}
@@ -27,7 +27,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) {
name: "nil body",
expectedErrorMessage: "block body is nil",
generateData: func() *structs.BeaconBlock {
beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock()
beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock()
beaconBlock.Body = nil
return beaconBlock
},
@@ -36,7 +36,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) {
name: "nil eth1 data",
expectedErrorMessage: "eth1 data is nil",
generateData: func() *structs.BeaconBlock {
beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock()
beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock()
beaconBlock.Body.Eth1Data = nil
return beaconBlock
},
@@ -45,7 +45,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) {
name: "bad slot",
expectedErrorMessage: "failed to parse slot `foo`",
generateData: func() *structs.BeaconBlock {
beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock()
beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock()
beaconBlock.Slot = "foo"
return beaconBlock
},
@@ -54,7 +54,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) {
name: "bad proposer index",
expectedErrorMessage: "failed to parse proposer index `bar`",
generateData: func() *structs.BeaconBlock {
beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock()
beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock()
beaconBlock.ProposerIndex = "bar"
return beaconBlock
},
@@ -63,7 +63,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) {
name: "bad parent root",
expectedErrorMessage: "failed to decode parent root `foo`",
generateData: func() *structs.BeaconBlock {
beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock()
beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock()
beaconBlock.ParentRoot = "foo"
return beaconBlock
},
@@ -72,7 +72,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) {
name: "bad state root",
expectedErrorMessage: "failed to decode state root `bar`",
generateData: func() *structs.BeaconBlock {
beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock()
beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock()
beaconBlock.StateRoot = "bar"
return beaconBlock
},
@@ -81,7 +81,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) {
name: "bad randao reveal",
expectedErrorMessage: "failed to decode randao reveal `foo`",
generateData: func() *structs.BeaconBlock {
beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock()
beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock()
beaconBlock.Body.RandaoReveal = "foo"
return beaconBlock
},
@@ -90,7 +90,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) {
name: "bad deposit root",
expectedErrorMessage: "failed to decode deposit root `bar`",
generateData: func() *structs.BeaconBlock {
beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock()
beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock()
beaconBlock.Body.Eth1Data.DepositRoot = "bar"
return beaconBlock
},
@@ -99,7 +99,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) {
name: "bad deposit count",
expectedErrorMessage: "failed to parse deposit count `foo`",
generateData: func() *structs.BeaconBlock {
beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock()
beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock()
beaconBlock.Body.Eth1Data.DepositCount = "foo"
return beaconBlock
},
@@ -108,7 +108,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) {
name: "bad block hash",
expectedErrorMessage: "failed to decode block hash `bar`",
generateData: func() *structs.BeaconBlock {
beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock()
beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock()
beaconBlock.Body.Eth1Data.BlockHash = "bar"
return beaconBlock
},
@@ -117,7 +117,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) {
name: "bad graffiti",
expectedErrorMessage: "failed to decode graffiti `foo`",
generateData: func() *structs.BeaconBlock {
beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock()
beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock()
beaconBlock.Body.Graffiti = "foo"
return beaconBlock
},
@@ -126,7 +126,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) {
name: "bad proposer slashings",
expectedErrorMessage: "failed to get proposer slashings",
generateData: func() *structs.BeaconBlock {
beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock()
beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock()
beaconBlock.Body.ProposerSlashings[0] = nil
return beaconBlock
},
@@ -135,7 +135,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) {
name: "bad attester slashings",
expectedErrorMessage: "failed to get attester slashings",
generateData: func() *structs.BeaconBlock {
beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock()
beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock()
beaconBlock.Body.AttesterSlashings[0] = nil
return beaconBlock
},
@@ -144,7 +144,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) {
name: "bad attestations",
expectedErrorMessage: "failed to get attestations",
generateData: func() *structs.BeaconBlock {
beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock()
beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock()
beaconBlock.Body.Attestations[0] = nil
return beaconBlock
},
@@ -153,7 +153,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) {
name: "bad deposits",
expectedErrorMessage: "failed to get deposits",
generateData: func() *structs.BeaconBlock {
beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock()
beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock()
beaconBlock.Body.Deposits[0] = nil
return beaconBlock
},
@@ -162,7 +162,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) {
name: "bad voluntary exits",
expectedErrorMessage: "failed to get voluntary exits",
generateData: func() *structs.BeaconBlock {
beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock()
beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock()
beaconBlock.Body.VoluntaryExits[0] = nil
return beaconBlock
},
@@ -181,9 +181,9 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) {
}
func TestGetBeaconBlockConverter_AltairValid(t *testing.T) {
expectedBeaconBlock := test_helpers.GenerateProtoAltairBeaconBlock()
expectedBeaconBlock := testhelpers.GenerateProtoAltairBeaconBlock()
beaconBlockConverter := &beaconApiBeaconBlockConverter{}
beaconBlock, err := beaconBlockConverter.ConvertRESTAltairBlockToProto(test_helpers.GenerateJsonAltairBeaconBlock())
beaconBlock, err := beaconBlockConverter.ConvertRESTAltairBlockToProto(testhelpers.GenerateJsonAltairBeaconBlock())
require.NoError(t, err)
assert.DeepEqual(t, expectedBeaconBlock, beaconBlock)
}
@@ -198,7 +198,7 @@ func TestGetBeaconBlockConverter_AltairError(t *testing.T) {
name: "nil body",
expectedErrorMessage: "block body is nil",
generateData: func() *structs.BeaconBlockAltair {
beaconBlock := test_helpers.GenerateJsonAltairBeaconBlock()
beaconBlock := testhelpers.GenerateJsonAltairBeaconBlock()
beaconBlock.Body = nil
return beaconBlock
},
@@ -207,7 +207,7 @@ func TestGetBeaconBlockConverter_AltairError(t *testing.T) {
name: "nil sync aggregate",
expectedErrorMessage: "sync aggregate is nil",
generateData: func() *structs.BeaconBlockAltair {
beaconBlock := test_helpers.GenerateJsonAltairBeaconBlock()
beaconBlock := testhelpers.GenerateJsonAltairBeaconBlock()
beaconBlock.Body.SyncAggregate = nil
return beaconBlock
},
@@ -216,7 +216,7 @@ func TestGetBeaconBlockConverter_AltairError(t *testing.T) {
name: "bad phase0 fields",
expectedErrorMessage: "failed to get the phase0 fields of the altair block",
generateData: func() *structs.BeaconBlockAltair {
beaconBlock := test_helpers.GenerateJsonAltairBeaconBlock()
beaconBlock := testhelpers.GenerateJsonAltairBeaconBlock()
beaconBlock.Body.Eth1Data = nil
return beaconBlock
},
@@ -225,7 +225,7 @@ func TestGetBeaconBlockConverter_AltairError(t *testing.T) {
name: "bad sync committee bits",
expectedErrorMessage: "failed to decode sync committee bits `foo`",
generateData: func() *structs.BeaconBlockAltair {
beaconBlock := test_helpers.GenerateJsonAltairBeaconBlock()
beaconBlock := testhelpers.GenerateJsonAltairBeaconBlock()
beaconBlock.Body.SyncAggregate.SyncCommitteeBits = "foo"
return beaconBlock
},
@@ -234,7 +234,7 @@ func TestGetBeaconBlockConverter_AltairError(t *testing.T) {
name: "bad sync committee signature",
expectedErrorMessage: "failed to decode sync committee signature `bar`",
generateData: func() *structs.BeaconBlockAltair {
beaconBlock := test_helpers.GenerateJsonAltairBeaconBlock()
beaconBlock := testhelpers.GenerateJsonAltairBeaconBlock()
beaconBlock.Body.SyncAggregate.SyncCommitteeSignature = "bar"
return beaconBlock
},
@@ -253,9 +253,9 @@ func TestGetBeaconBlockConverter_AltairError(t *testing.T) {
}
func TestGetBeaconBlockConverter_BellatrixValid(t *testing.T) {
expectedBeaconBlock := test_helpers.GenerateProtoBellatrixBeaconBlock()
expectedBeaconBlock := testhelpers.GenerateProtoBellatrixBeaconBlock()
beaconBlockConverter := &beaconApiBeaconBlockConverter{}
beaconBlock, err := beaconBlockConverter.ConvertRESTBellatrixBlockToProto(test_helpers.GenerateJsonBellatrixBeaconBlock())
beaconBlock, err := beaconBlockConverter.ConvertRESTBellatrixBlockToProto(testhelpers.GenerateJsonBellatrixBeaconBlock())
require.NoError(t, err)
assert.DeepEqual(t, expectedBeaconBlock, beaconBlock)
}
@@ -270,7 +270,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) {
name: "nil body",
expectedErrorMessage: "block body is nil",
generateData: func() *structs.BeaconBlockBellatrix {
beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock.Body = nil
return beaconBlock
},
@@ -279,7 +279,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) {
name: "nil execution payload",
expectedErrorMessage: "execution payload is nil",
generateData: func() *structs.BeaconBlockBellatrix {
beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock.Body.ExecutionPayload = nil
return beaconBlock
},
@@ -288,7 +288,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) {
name: "bad altair fields",
expectedErrorMessage: "failed to get the altair fields of the bellatrix block",
generateData: func() *structs.BeaconBlockBellatrix {
beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock.Body.Eth1Data = nil
return beaconBlock
},
@@ -297,7 +297,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) {
name: "bad parent hash",
expectedErrorMessage: "failed to decode execution payload parent hash `foo`",
generateData: func() *structs.BeaconBlockBellatrix {
beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock.Body.ExecutionPayload.ParentHash = "foo"
return beaconBlock
},
@@ -306,7 +306,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) {
name: "bad fee recipient",
expectedErrorMessage: "failed to decode execution payload fee recipient `bar`",
generateData: func() *structs.BeaconBlockBellatrix {
beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock.Body.ExecutionPayload.FeeRecipient = "bar"
return beaconBlock
},
@@ -315,7 +315,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) {
name: "bad state root",
expectedErrorMessage: "failed to decode execution payload state root `foo`",
generateData: func() *structs.BeaconBlockBellatrix {
beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock.Body.ExecutionPayload.StateRoot = "foo"
return beaconBlock
},
@@ -324,7 +324,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) {
name: "bad receipts root",
expectedErrorMessage: "failed to decode execution payload receipts root `bar`",
generateData: func() *structs.BeaconBlockBellatrix {
beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock.Body.ExecutionPayload.ReceiptsRoot = "bar"
return beaconBlock
},
@@ -333,7 +333,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) {
name: "bad logs bloom",
expectedErrorMessage: "failed to decode execution payload logs bloom `foo`",
generateData: func() *structs.BeaconBlockBellatrix {
beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock.Body.ExecutionPayload.LogsBloom = "foo"
return beaconBlock
},
@@ -342,7 +342,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) {
name: "bad prev randao",
expectedErrorMessage: "failed to decode execution payload prev randao `bar`",
generateData: func() *structs.BeaconBlockBellatrix {
beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock.Body.ExecutionPayload.PrevRandao = "bar"
return beaconBlock
},
@@ -351,7 +351,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) {
name: "bad block number",
expectedErrorMessage: "failed to parse execution payload block number `foo`",
generateData: func() *structs.BeaconBlockBellatrix {
beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock.Body.ExecutionPayload.BlockNumber = "foo"
return beaconBlock
},
@@ -360,7 +360,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) {
name: "bad gas limit",
expectedErrorMessage: "failed to parse execution payload gas limit `bar`",
generateData: func() *structs.BeaconBlockBellatrix {
beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock.Body.ExecutionPayload.GasLimit = "bar"
return beaconBlock
},
@@ -369,7 +369,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) {
name: "bad gas used",
expectedErrorMessage: "failed to parse execution payload gas used `foo`",
generateData: func() *structs.BeaconBlockBellatrix {
beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock.Body.ExecutionPayload.GasUsed = "foo"
return beaconBlock
},
@@ -378,7 +378,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) {
name: "bad timestamp",
expectedErrorMessage: "failed to parse execution payload timestamp `bar`",
generateData: func() *structs.BeaconBlockBellatrix {
beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock.Body.ExecutionPayload.Timestamp = "bar"
return beaconBlock
},
@@ -387,7 +387,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) {
name: "bad extra data",
expectedErrorMessage: "failed to decode execution payload extra data `foo`",
generateData: func() *structs.BeaconBlockBellatrix {
beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock.Body.ExecutionPayload.ExtraData = "foo"
return beaconBlock
},
@@ -396,7 +396,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) {
name: "bad base fee per gas",
expectedErrorMessage: "failed to parse execution payload base fee per gas `bar`",
generateData: func() *structs.BeaconBlockBellatrix {
beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock.Body.ExecutionPayload.BaseFeePerGas = "bar"
return beaconBlock
},
@@ -405,7 +405,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) {
name: "bad block hash",
expectedErrorMessage: "failed to decode execution payload block hash `foo`",
generateData: func() *structs.BeaconBlockBellatrix {
beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock.Body.ExecutionPayload.BlockHash = "foo"
return beaconBlock
},
@@ -414,7 +414,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) {
name: "bad transactions",
expectedErrorMessage: "failed to get execution payload transactions",
generateData: func() *structs.BeaconBlockBellatrix {
beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock()
beaconBlock.Body.ExecutionPayload.Transactions[0] = "bar"
return beaconBlock
},
@@ -433,9 +433,9 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) {
}
func TestGetBeaconBlockConverter_CapellaValid(t *testing.T) {
expectedBeaconBlock := test_helpers.GenerateProtoCapellaBeaconBlock()
expectedBeaconBlock := testhelpers.GenerateProtoCapellaBeaconBlock()
beaconBlockConverter := &beaconApiBeaconBlockConverter{}
beaconBlock, err := beaconBlockConverter.ConvertRESTCapellaBlockToProto(test_helpers.GenerateJsonCapellaBeaconBlock())
beaconBlock, err := beaconBlockConverter.ConvertRESTCapellaBlockToProto(testhelpers.GenerateJsonCapellaBeaconBlock())
require.NoError(t, err)
assert.DeepEqual(t, expectedBeaconBlock, beaconBlock)
}
@@ -450,7 +450,7 @@ func TestGetBeaconBlockConverter_CapellaError(t *testing.T) {
name: "nil body",
expectedErrorMessage: "block body is nil",
generateData: func() *structs.BeaconBlockCapella {
beaconBlock := test_helpers.GenerateJsonCapellaBeaconBlock()
beaconBlock := testhelpers.GenerateJsonCapellaBeaconBlock()
beaconBlock.Body = nil
return beaconBlock
},
@@ -459,7 +459,7 @@ func TestGetBeaconBlockConverter_CapellaError(t *testing.T) {
name: "nil execution payload",
expectedErrorMessage: "execution payload is nil",
generateData: func() *structs.BeaconBlockCapella {
beaconBlock := test_helpers.GenerateJsonCapellaBeaconBlock()
beaconBlock := testhelpers.GenerateJsonCapellaBeaconBlock()
beaconBlock.Body.ExecutionPayload = nil
return beaconBlock
},
@@ -468,7 +468,7 @@ func TestGetBeaconBlockConverter_CapellaError(t *testing.T) {
name: "bad bellatrix fields",
expectedErrorMessage: "failed to get the bellatrix fields of the capella block",
generateData: func() *structs.BeaconBlockCapella {
beaconBlock := test_helpers.GenerateJsonCapellaBeaconBlock()
beaconBlock := testhelpers.GenerateJsonCapellaBeaconBlock()
beaconBlock.Body.Eth1Data = nil
return beaconBlock
},
@@ -477,7 +477,7 @@ func TestGetBeaconBlockConverter_CapellaError(t *testing.T) {
name: "bad withdrawals",
expectedErrorMessage: "failed to get withdrawals",
generateData: func() *structs.BeaconBlockCapella {
beaconBlock := test_helpers.GenerateJsonCapellaBeaconBlock()
beaconBlock := testhelpers.GenerateJsonCapellaBeaconBlock()
beaconBlock.Body.ExecutionPayload.Withdrawals[0] = nil
return beaconBlock
},
@@ -486,7 +486,7 @@ func TestGetBeaconBlockConverter_CapellaError(t *testing.T) {
name: "bad bls execution changes",
expectedErrorMessage: "failed to get bls to execution changes",
generateData: func() *structs.BeaconBlockCapella {
beaconBlock := test_helpers.GenerateJsonCapellaBeaconBlock()
beaconBlock := testhelpers.GenerateJsonCapellaBeaconBlock()
beaconBlock.Body.BLSToExecutionChanges[0] = nil
return beaconBlock
},

View File

@@ -14,7 +14,7 @@ type aggregatedSelectionResponse struct {
Data []iface.BeaconCommitteeSelection `json:"data"`
}
func (c *beaconApiValidatorClient) getAggregatedSelection(ctx context.Context, selections []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) {
func (c *beaconApiValidatorClient) aggregatedSelection(ctx context.Context, selections []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) {
body, err := json.Marshal(selections)
if err != nil {
return nil, errors.Wrap(err, "failed to marshal selections")

View File

@@ -11,7 +11,7 @@ import (
"github.com/pkg/errors"
"github.com/prysmaticlabs/prysm/v5/testing/require"
"github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock"
test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers"
testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers"
"go.uber.org/mock/gomock"
)
@@ -27,14 +27,14 @@ func TestGetAggregatedSelections(t *testing.T) {
name: "valid",
req: []iface.BeaconCommitteeSelection{
{
SelectionProof: test_helpers.FillByteSlice(96, 82),
SelectionProof: testhelpers.FillByteSlice(96, 82),
Slot: 75,
ValidatorIndex: 76,
},
},
res: []iface.BeaconCommitteeSelection{
{
SelectionProof: test_helpers.FillByteSlice(96, 100),
SelectionProof: testhelpers.FillByteSlice(96, 100),
Slot: 75,
ValidatorIndex: 76,
},
@@ -44,7 +44,7 @@ func TestGetAggregatedSelections(t *testing.T) {
name: "endpoint error",
req: []iface.BeaconCommitteeSelection{
{
SelectionProof: test_helpers.FillByteSlice(96, 82),
SelectionProof: testhelpers.FillByteSlice(96, 82),
Slot: 75,
ValidatorIndex: 76,
},
@@ -56,7 +56,7 @@ func TestGetAggregatedSelections(t *testing.T) {
name: "no response error",
req: []iface.BeaconCommitteeSelection{
{
SelectionProof: test_helpers.FillByteSlice(96, 82),
SelectionProof: testhelpers.FillByteSlice(96, 82),
Slot: 75,
ValidatorIndex: 76,
},
@@ -67,19 +67,19 @@ func TestGetAggregatedSelections(t *testing.T) {
name: "mismatch response",
req: []iface.BeaconCommitteeSelection{
{
SelectionProof: test_helpers.FillByteSlice(96, 82),
SelectionProof: testhelpers.FillByteSlice(96, 82),
Slot: 75,
ValidatorIndex: 76,
},
{
SelectionProof: test_helpers.FillByteSlice(96, 102),
SelectionProof: testhelpers.FillByteSlice(96, 102),
Slot: 75,
ValidatorIndex: 79,
},
},
res: []iface.BeaconCommitteeSelection{
{
SelectionProof: test_helpers.FillByteSlice(96, 100),
SelectionProof: testhelpers.FillByteSlice(96, 100),
Slot: 75,
ValidatorIndex: 76,
},
@@ -111,7 +111,7 @@ func TestGetAggregatedSelections(t *testing.T) {
).Times(1)
validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler}
res, err := validatorClient.GetAggregatedSelections(ctx, test.req)
res, err := validatorClient.AggregatedSelections(ctx, test.req)
if test.expectedErrorMessage != "" {
require.ErrorContains(t, test.expectedErrorMessage, err)
return

View File

@@ -11,7 +11,7 @@ import (
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
)
func (c beaconApiValidatorClient) getDomainData(ctx context.Context, epoch primitives.Epoch, domainType [4]byte) (*ethpb.DomainResponse, error) {
func (c *beaconApiValidatorClient) domainData(ctx context.Context, epoch primitives.Epoch, domainType [4]byte) (*ethpb.DomainResponse, error) {
// Get the fork version from the given epoch
fork, err := forks.Fork(epoch)
if err != nil {
@@ -19,7 +19,7 @@ func (c beaconApiValidatorClient) getDomainData(ctx context.Context, epoch primi
}
// Get the genesis validator root
genesis, err := c.genesisProvider.GetGenesis(ctx)
genesis, err := c.genesisProvider.Genesis(ctx)
if err != nil {
return nil, errors.Wrapf(err, "failed to get genesis info")
}

View File

@@ -35,15 +35,15 @@ func TestGetDomainData_ValidDomainData(t *testing.T) {
ctx := context.Background()
// Make sure that GetGenesis() is called exactly once
// Make sure that Genesis() is called exactly once
genesisProvider := mock.NewMockGenesisProvider(ctrl)
genesisProvider.EXPECT().GetGenesis(ctx).Return(
genesisProvider.EXPECT().Genesis(ctx).Return(
&structs.Genesis{GenesisValidatorsRoot: genesisValidatorRoot},
nil,
).Times(1)
validatorClient := &beaconApiValidatorClient{genesisProvider: genesisProvider}
resp, err := validatorClient.getDomainData(ctx, epoch, domainType)
resp, err := validatorClient.domainData(ctx, epoch, domainType)
assert.NoError(t, err)
require.NotNil(t, resp)
@@ -64,12 +64,12 @@ func TestGetDomainData_GenesisError(t *testing.T) {
ctx := context.Background()
// Make sure that GetGenesis() is called exactly once
// Make sure that Genesis() is called exactly once
genesisProvider := mock.NewMockGenesisProvider(ctrl)
genesisProvider.EXPECT().GetGenesis(ctx).Return(nil, errors.New("foo error")).Times(1)
genesisProvider.EXPECT().Genesis(ctx).Return(nil, errors.New("foo error")).Times(1)
validatorClient := &beaconApiValidatorClient{genesisProvider: genesisProvider}
_, err := validatorClient.getDomainData(ctx, epoch, domainType)
_, err := validatorClient.domainData(ctx, epoch, domainType)
assert.ErrorContains(t, "failed to get genesis info", err)
assert.ErrorContains(t, "foo error", err)
}
@@ -83,14 +83,14 @@ func TestGetDomainData_InvalidGenesisRoot(t *testing.T) {
ctx := context.Background()
// Make sure that GetGenesis() is called exactly once
// Make sure that Genesis() is called exactly once
genesisProvider := mock.NewMockGenesisProvider(ctrl)
genesisProvider.EXPECT().GetGenesis(ctx).Return(
genesisProvider.EXPECT().Genesis(ctx).Return(
&structs.Genesis{GenesisValidatorsRoot: "foo"},
nil,
).Times(1)
validatorClient := &beaconApiValidatorClient{genesisProvider: genesisProvider}
_, err := validatorClient.getDomainData(ctx, epoch, domainType)
_, err := validatorClient.domainData(ctx, epoch, domainType)
assert.ErrorContains(t, "invalid genesis validators root: foo", err)
}

View File

@@ -73,7 +73,7 @@ func (c *beaconApiValidatorClient) checkDoppelGanger(ctx context.Context, in *et
}
// Retrieve fork version -- Return early if we are in phase0.
forkResponse, err := c.getFork(ctx)
forkResponse, err := c.fork(ctx)
if err != nil || forkResponse == nil || forkResponse.Data == nil {
return nil, errors.Wrapf(err, "failed to get fork")
}
@@ -91,7 +91,7 @@ func (c *beaconApiValidatorClient) checkDoppelGanger(ctx context.Context, in *et
}
// Retrieve current epoch.
headers, err := c.getHeaders(ctx)
headers, err := c.headers(ctx)
if err != nil || headers == nil || headers.Data == nil || len(headers.Data) == 0 ||
headers.Data[0].Header == nil || headers.Data[0].Header.Message == nil {
return nil, errors.Wrapf(err, "failed to get headers")
@@ -127,7 +127,7 @@ func (c *beaconApiValidatorClient) checkDoppelGanger(ctx context.Context, in *et
}
// Retrieve correspondence between validator pubkey and index.
stateValidators, err := c.stateValidatorsProvider.GetStateValidators(ctx, notRecentStringPubKeys, nil, nil)
stateValidators, err := c.stateValidatorsProvider.StateValidators(ctx, notRecentStringPubKeys, nil, nil)
if err != nil || stateValidators == nil || stateValidators.Data == nil {
return nil, errors.Wrapf(err, "failed to get state validators")
}
@@ -156,13 +156,13 @@ func (c *beaconApiValidatorClient) checkDoppelGanger(ctx context.Context, in *et
// since we assume that we are not in phase0.
previousEpoch := currentEpoch - 1
indexToPreviousLiveness, err := c.getIndexToLiveness(ctx, previousEpoch, indexes)
indexToPreviousLiveness, err := c.indexToLiveness(ctx, previousEpoch, indexes)
if err != nil {
return nil, errors.Wrapf(err, "failed to get map from validator index to liveness for previous epoch %d", previousEpoch)
}
// Get validators liveness for the current epoch.
indexToCurrentLiveness, err := c.getIndexToLiveness(ctx, currentEpoch, indexes)
indexToCurrentLiveness, err := c.indexToLiveness(ctx, currentEpoch, indexes)
if err != nil {
return nil, errors.Wrapf(err, "failed to get map from validator index to liveness for current epoch %d", currentEpoch)
}
@@ -218,8 +218,8 @@ func buildResponse(
}
}
func (c *beaconApiValidatorClient) getIndexToLiveness(ctx context.Context, epoch primitives.Epoch, indexes []string) (map[string]bool, error) {
livenessResponse, err := c.getLiveness(ctx, epoch, indexes)
func (c *beaconApiValidatorClient) indexToLiveness(ctx context.Context, epoch primitives.Epoch, indexes []string) (map[string]bool, error) {
livenessResponse, err := c.liveness(ctx, epoch, indexes)
if err != nil || livenessResponse.Data == nil {
return nil, errors.Wrapf(err, fmt.Sprintf("failed to get liveness for epoch %d", epoch))
}

View File

@@ -298,7 +298,7 @@ func TestCheckDoppelGanger_Nominal(t *testing.T) {
jsonRestHandler.EXPECT().Get(
ctx,
syncingEnpoint,
syncingEndpoint,
&syncingResponseJson,
).Return(
nil,
@@ -363,7 +363,7 @@ func TestCheckDoppelGanger_Nominal(t *testing.T) {
stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl)
if testCase.getStateValidatorsInterface != nil {
stateValidatorsProvider.EXPECT().GetStateValidators(
stateValidatorsProvider.EXPECT().StateValidators(
ctx,
testCase.getStateValidatorsInterface.input,
nil,
@@ -489,7 +489,7 @@ func TestCheckDoppelGanger_Errors(t *testing.T) {
},
},
{
name: "getFork on error",
name: "fork on error",
expectedErrorMessage: "failed to get fork",
inputValidatorRequests: standardInputValidatorRequests,
getSyncingOutput: standardGetSyncingOutput,
@@ -734,7 +734,7 @@ func TestCheckDoppelGanger_Errors(t *testing.T) {
jsonRestHandler.EXPECT().Get(
ctx,
syncingEnpoint,
syncingEndpoint,
&syncingResponseJson,
).Return(
testCase.getSyncingError,
@@ -777,7 +777,7 @@ func TestCheckDoppelGanger_Errors(t *testing.T) {
stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl)
if testCase.getStateValidatorsInterface != nil {
stateValidatorsProvider.EXPECT().GetStateValidators(
stateValidatorsProvider.EXPECT().StateValidators(
ctx,
testCase.getStateValidatorsInterface.input,
nil,

View File

@@ -19,10 +19,10 @@ import (
)
type dutiesProvider interface {
GetAttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.AttesterDuty, error)
GetProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*structs.ProposerDuty, error)
GetSyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.SyncCommitteeDuty, error)
GetCommittees(ctx context.Context, epoch primitives.Epoch) ([]*structs.Committee, error)
AttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.AttesterDuty, error)
ProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*structs.ProposerDuty, error)
SyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.SyncCommitteeDuty, error)
Committees(ctx context.Context, epoch primitives.Epoch) ([]*structs.Committee, error)
}
type beaconApiDutiesProvider struct {
@@ -40,8 +40,8 @@ type validatorForDuty struct {
status ethpb.ValidatorStatus
}
func (c beaconApiValidatorClient) getDuties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) {
vals, err := c.getValidatorsForDuties(ctx, in.PublicKeys)
func (c *beaconApiValidatorClient) duties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) {
vals, err := c.validatorsForDuties(ctx, in.PublicKeys)
if err != nil {
return nil, errors.Wrap(err, "failed to get validators for duties")
}
@@ -53,7 +53,7 @@ func (c beaconApiValidatorClient) getDuties(ctx context.Context, in *ethpb.Dutie
var currentEpochDuties []*ethpb.DutiesResponse_Duty
go func() {
currentEpochDuties, err = c.getDutiesForEpoch(ctx, in.Epoch, vals, fetchSyncDuties)
currentEpochDuties, err = c.dutiesForEpoch(ctx, in.Epoch, vals, fetchSyncDuties)
if err != nil {
errCh <- errors.Wrapf(err, "failed to get duties for current epoch `%d`", in.Epoch)
return
@@ -61,7 +61,7 @@ func (c beaconApiValidatorClient) getDuties(ctx context.Context, in *ethpb.Dutie
errCh <- nil
}()
nextEpochDuties, err := c.getDutiesForEpoch(ctx, in.Epoch+1, vals, fetchSyncDuties)
nextEpochDuties, err := c.dutiesForEpoch(ctx, in.Epoch+1, vals, fetchSyncDuties)
if err != nil {
return nil, errors.Wrapf(err, "failed to get duties for next epoch `%d`", in.Epoch+1)
}
@@ -76,7 +76,7 @@ func (c beaconApiValidatorClient) getDuties(ctx context.Context, in *ethpb.Dutie
}, nil
}
func (c beaconApiValidatorClient) getDutiesForEpoch(
func (c *beaconApiValidatorClient) dutiesForEpoch(
ctx context.Context,
epoch primitives.Epoch,
vals []validatorForDuty,
@@ -103,7 +103,7 @@ func (c beaconApiValidatorClient) getDutiesForEpoch(
var wg errgroup.Group
wg.Go(func() error {
attesterDuties, err := c.dutiesProvider.GetAttesterDuties(ctx, epoch, indices)
attesterDuties, err := c.dutiesProvider.AttesterDuties(ctx, epoch, indices)
if err != nil {
return errors.Wrapf(err, "failed to get attester duties for epoch `%d`", epoch)
}
@@ -131,7 +131,7 @@ func (c beaconApiValidatorClient) getDutiesForEpoch(
if fetchSyncDuties {
wg.Go(func() error {
syncDuties, err := c.dutiesProvider.GetSyncDuties(ctx, epoch, indices)
syncDuties, err := c.dutiesProvider.SyncDuties(ctx, epoch, indices)
if err != nil {
return errors.Wrapf(err, "failed to get sync duties for epoch `%d`", epoch)
}
@@ -148,7 +148,7 @@ func (c beaconApiValidatorClient) getDutiesForEpoch(
}
wg.Go(func() error {
proposerDuties, err := c.dutiesProvider.GetProposerDuties(ctx, epoch)
proposerDuties, err := c.dutiesProvider.ProposerDuties(ctx, epoch)
if err != nil {
return errors.Wrapf(err, "failed to get proposer duties for epoch `%d`", epoch)
}
@@ -168,7 +168,7 @@ func (c beaconApiValidatorClient) getDutiesForEpoch(
return nil
})
committees, err := c.dutiesProvider.GetCommittees(ctx, epoch)
committees, err := c.dutiesProvider.Committees(ctx, epoch)
if err != nil {
return nil, errors.Wrapf(err, "failed to get committees for epoch `%d`", epoch)
}
@@ -242,7 +242,7 @@ func (c beaconApiValidatorClient) getDutiesForEpoch(
return duties, nil
}
func (c *beaconApiValidatorClient) getValidatorsForDuties(ctx context.Context, pubkeys [][]byte) ([]validatorForDuty, error) {
func (c *beaconApiValidatorClient) validatorsForDuties(ctx context.Context, pubkeys [][]byte) ([]validatorForDuty, error) {
vals := make([]validatorForDuty, 0, len(pubkeys))
stringPubkeysToPubkeys := make(map[string][]byte, len(pubkeys))
stringPubkeys := make([]string, len(pubkeys))
@@ -254,7 +254,7 @@ func (c *beaconApiValidatorClient) getValidatorsForDuties(ctx context.Context, p
}
statusesWithDuties := []string{validator.ActiveOngoing.String(), validator.ActiveExiting.String()}
stateValidatorsResponse, err := c.stateValidatorsProvider.GetStateValidators(ctx, stringPubkeys, nil, statusesWithDuties)
stateValidatorsResponse, err := c.stateValidatorsProvider.StateValidators(ctx, stringPubkeys, nil, statusesWithDuties)
if err != nil {
return nil, errors.Wrap(err, "failed to get state validators")
}
@@ -288,7 +288,7 @@ func (c *beaconApiValidatorClient) getValidatorsForDuties(ctx context.Context, p
}
// GetCommittees retrieves the committees for the given epoch
func (c beaconApiDutiesProvider) GetCommittees(ctx context.Context, epoch primitives.Epoch) ([]*structs.Committee, error) {
func (c beaconApiDutiesProvider) Committees(ctx context.Context, epoch primitives.Epoch) ([]*structs.Committee, error) {
committeeParams := url.Values{}
committeeParams.Add("epoch", strconv.FormatUint(uint64(epoch), 10))
committeesRequest := buildURL("/eth/v1/beacon/states/head/committees", committeeParams)
@@ -312,7 +312,7 @@ func (c beaconApiDutiesProvider) GetCommittees(ctx context.Context, epoch primit
}
// GetAttesterDuties retrieves the attester duties for the given epoch and validatorIndices
func (c beaconApiDutiesProvider) GetAttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.AttesterDuty, error) {
func (c beaconApiDutiesProvider) AttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.AttesterDuty, error) {
jsonValidatorIndices := make([]string, len(validatorIndices))
for index, validatorIndex := range validatorIndices {
jsonValidatorIndices[index] = strconv.FormatUint(uint64(validatorIndex), 10)
@@ -344,7 +344,7 @@ func (c beaconApiDutiesProvider) GetAttesterDuties(ctx context.Context, epoch pr
}
// GetProposerDuties retrieves the proposer duties for the given epoch
func (c beaconApiDutiesProvider) GetProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*structs.ProposerDuty, error) {
func (c beaconApiDutiesProvider) ProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*structs.ProposerDuty, error) {
proposerDuties := structs.GetProposerDutiesResponse{}
if err := c.jsonRestHandler.Get(ctx, fmt.Sprintf("/eth/v1/validator/duties/proposer/%d", epoch), &proposerDuties); err != nil {
return nil, err
@@ -364,7 +364,7 @@ func (c beaconApiDutiesProvider) GetProposerDuties(ctx context.Context, epoch pr
}
// GetSyncDuties retrieves the sync committee duties for the given epoch and validatorIndices
func (c beaconApiDutiesProvider) GetSyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.SyncCommitteeDuty, error) {
func (c beaconApiDutiesProvider) SyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.SyncCommitteeDuty, error) {
jsonValidatorIndices := make([]string, len(validatorIndices))
for index, validatorIndex := range validatorIndices {
jsonValidatorIndices[index] = strconv.FormatUint(uint64(validatorIndex), 10)

View File

@@ -76,7 +76,7 @@ func TestGetAttesterDuties_Valid(t *testing.T) {
).Times(1)
dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler}
attesterDuties, err := dutiesProvider.GetAttesterDuties(ctx, epoch, validatorIndices)
attesterDuties, err := dutiesProvider.AttesterDuties(ctx, epoch, validatorIndices)
require.NoError(t, err)
assert.DeepEqual(t, expectedAttesterDuties.Data, attesterDuties)
}
@@ -101,7 +101,7 @@ func TestGetAttesterDuties_HttpError(t *testing.T) {
).Times(1)
dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler}
_, err := dutiesProvider.GetAttesterDuties(ctx, epoch, nil)
_, err := dutiesProvider.AttesterDuties(ctx, epoch, nil)
assert.ErrorContains(t, "foo error", err)
}
@@ -130,7 +130,7 @@ func TestGetAttesterDuties_NilAttesterDuty(t *testing.T) {
).Times(1)
dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler}
_, err := dutiesProvider.GetAttesterDuties(ctx, epoch, nil)
_, err := dutiesProvider.AttesterDuties(ctx, epoch, nil)
assert.ErrorContains(t, "attester duty at index `0` is nil", err)
}
@@ -170,7 +170,7 @@ func TestGetProposerDuties_Valid(t *testing.T) {
).Times(1)
dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler}
proposerDuties, err := dutiesProvider.GetProposerDuties(ctx, epoch)
proposerDuties, err := dutiesProvider.ProposerDuties(ctx, epoch)
require.NoError(t, err)
assert.DeepEqual(t, expectedProposerDuties.Data, proposerDuties)
}
@@ -193,7 +193,7 @@ func TestGetProposerDuties_HttpError(t *testing.T) {
).Times(1)
dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler}
_, err := dutiesProvider.GetProposerDuties(ctx, epoch)
_, err := dutiesProvider.ProposerDuties(ctx, epoch)
assert.ErrorContains(t, "foo error", err)
}
@@ -220,7 +220,7 @@ func TestGetProposerDuties_NilData(t *testing.T) {
).Times(1)
dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler}
_, err := dutiesProvider.GetProposerDuties(ctx, epoch)
_, err := dutiesProvider.ProposerDuties(ctx, epoch)
assert.ErrorContains(t, "proposer duties data is nil", err)
}
@@ -247,7 +247,7 @@ func TestGetProposerDuties_NilProposerDuty(t *testing.T) {
).Times(1)
dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler}
_, err := dutiesProvider.GetProposerDuties(ctx, epoch)
_, err := dutiesProvider.ProposerDuties(ctx, epoch)
assert.ErrorContains(t, "proposer duty at index `0` is nil", err)
}
@@ -300,7 +300,7 @@ func TestGetSyncDuties_Valid(t *testing.T) {
).Times(1)
dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler}
syncDuties, err := dutiesProvider.GetSyncDuties(ctx, epoch, validatorIndices)
syncDuties, err := dutiesProvider.SyncDuties(ctx, epoch, validatorIndices)
require.NoError(t, err)
assert.DeepEqual(t, expectedSyncDuties.Data, syncDuties)
}
@@ -325,7 +325,7 @@ func TestGetSyncDuties_HttpError(t *testing.T) {
).Times(1)
dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler}
_, err := dutiesProvider.GetSyncDuties(ctx, epoch, nil)
_, err := dutiesProvider.SyncDuties(ctx, epoch, nil)
assert.ErrorContains(t, "foo error", err)
}
@@ -354,7 +354,7 @@ func TestGetSyncDuties_NilData(t *testing.T) {
).Times(1)
dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler}
_, err := dutiesProvider.GetSyncDuties(ctx, epoch, nil)
_, err := dutiesProvider.SyncDuties(ctx, epoch, nil)
assert.ErrorContains(t, "sync duties data is nil", err)
}
@@ -383,7 +383,7 @@ func TestGetSyncDuties_NilSyncDuty(t *testing.T) {
).Times(1)
dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler}
_, err := dutiesProvider.GetSyncDuties(ctx, epoch, nil)
_, err := dutiesProvider.SyncDuties(ctx, epoch, nil)
assert.ErrorContains(t, "sync duty at index `0` is nil", err)
}
@@ -429,7 +429,7 @@ func TestGetCommittees_Valid(t *testing.T) {
).Times(1)
dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler}
committees, err := dutiesProvider.GetCommittees(ctx, epoch)
committees, err := dutiesProvider.Committees(ctx, epoch)
require.NoError(t, err)
assert.DeepEqual(t, expectedCommittees.Data, committees)
}
@@ -452,7 +452,7 @@ func TestGetCommittees_HttpError(t *testing.T) {
).Times(1)
dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler}
_, err := dutiesProvider.GetCommittees(ctx, epoch)
_, err := dutiesProvider.Committees(ctx, epoch)
assert.ErrorContains(t, "foo error", err)
}
@@ -479,7 +479,7 @@ func TestGetCommittees_NilData(t *testing.T) {
).Times(1)
dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler}
_, err := dutiesProvider.GetCommittees(ctx, epoch)
_, err := dutiesProvider.Committees(ctx, epoch)
assert.ErrorContains(t, "state committees data is nil", err)
}
@@ -506,7 +506,7 @@ func TestGetCommittees_NilCommittee(t *testing.T) {
).Times(1)
dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler}
_, err := dutiesProvider.GetCommittees(ctx, epoch)
_, err := dutiesProvider.Committees(ctx, epoch)
assert.ErrorContains(t, "committee at index `0` is nil", err)
}
@@ -682,7 +682,7 @@ func TestGetDutiesForEpoch_Error(t *testing.T) {
}
dutiesProvider := mock.NewMockdutiesProvider(ctrl)
dutiesProvider.EXPECT().GetAttesterDuties(
dutiesProvider.EXPECT().AttesterDuties(
ctx,
epoch,
gomock.Any(),
@@ -691,7 +691,7 @@ func TestGetDutiesForEpoch_Error(t *testing.T) {
testCase.fetchAttesterDutiesError,
).AnyTimes()
dutiesProvider.EXPECT().GetProposerDuties(
dutiesProvider.EXPECT().ProposerDuties(
ctx,
epoch,
).Return(
@@ -699,7 +699,7 @@ func TestGetDutiesForEpoch_Error(t *testing.T) {
testCase.fetchProposerDutiesError,
).AnyTimes()
dutiesProvider.EXPECT().GetSyncDuties(
dutiesProvider.EXPECT().SyncDuties(
ctx,
epoch,
gomock.Any(),
@@ -708,7 +708,7 @@ func TestGetDutiesForEpoch_Error(t *testing.T) {
testCase.fetchSyncDutiesError,
).AnyTimes()
dutiesProvider.EXPECT().GetCommittees(
dutiesProvider.EXPECT().Committees(
ctx,
epoch,
).Return(
@@ -726,7 +726,7 @@ func TestGetDutiesForEpoch_Error(t *testing.T) {
}
validatorClient := &beaconApiValidatorClient{dutiesProvider: dutiesProvider}
_, err := validatorClient.getDutiesForEpoch(
_, err := validatorClient.dutiesForEpoch(
ctx,
epoch,
vals,
@@ -767,7 +767,7 @@ func TestGetDutiesForEpoch_Valid(t *testing.T) {
ctx := context.Background()
dutiesProvider := mock.NewMockdutiesProvider(ctrl)
dutiesProvider.EXPECT().GetCommittees(
dutiesProvider.EXPECT().Committees(
ctx,
epoch,
).Return(
@@ -775,7 +775,7 @@ func TestGetDutiesForEpoch_Valid(t *testing.T) {
nil,
).Times(1)
dutiesProvider.EXPECT().GetAttesterDuties(
dutiesProvider.EXPECT().AttesterDuties(
ctx,
epoch,
validatorIndices,
@@ -784,7 +784,7 @@ func TestGetDutiesForEpoch_Valid(t *testing.T) {
nil,
).Times(1)
dutiesProvider.EXPECT().GetProposerDuties(
dutiesProvider.EXPECT().ProposerDuties(
ctx,
epoch,
).Return(
@@ -793,7 +793,7 @@ func TestGetDutiesForEpoch_Valid(t *testing.T) {
).Times(1)
if testCase.fetchSyncDuties {
dutiesProvider.EXPECT().GetSyncDuties(
dutiesProvider.EXPECT().SyncDuties(
ctx,
epoch,
validatorIndices,
@@ -951,7 +951,7 @@ func TestGetDutiesForEpoch_Valid(t *testing.T) {
status: ethpb.ValidatorStatus_ACTIVE,
}
}
duties, err := validatorClient.getDutiesForEpoch(
duties, err := validatorClient.dutiesForEpoch(
ctx,
epoch,
vals,
@@ -1004,7 +1004,7 @@ func TestGetDuties_Valid(t *testing.T) {
ctx := context.Background()
dutiesProvider := mock.NewMockdutiesProvider(ctrl)
dutiesProvider.EXPECT().GetCommittees(
dutiesProvider.EXPECT().Committees(
ctx,
testCase.epoch,
).Return(
@@ -1012,7 +1012,7 @@ func TestGetDuties_Valid(t *testing.T) {
nil,
).Times(2)
dutiesProvider.EXPECT().GetAttesterDuties(
dutiesProvider.EXPECT().AttesterDuties(
ctx,
testCase.epoch,
validatorIndices,
@@ -1021,7 +1021,7 @@ func TestGetDuties_Valid(t *testing.T) {
nil,
).Times(2)
dutiesProvider.EXPECT().GetProposerDuties(
dutiesProvider.EXPECT().ProposerDuties(
ctx,
testCase.epoch,
).Return(
@@ -1031,7 +1031,7 @@ func TestGetDuties_Valid(t *testing.T) {
fetchSyncDuties := testCase.epoch >= params.BeaconConfig().AltairForkEpoch
if fetchSyncDuties {
dutiesProvider.EXPECT().GetSyncDuties(
dutiesProvider.EXPECT().SyncDuties(
ctx,
testCase.epoch,
validatorIndices,
@@ -1041,7 +1041,7 @@ func TestGetDuties_Valid(t *testing.T) {
).Times(2)
}
dutiesProvider.EXPECT().GetCommittees(
dutiesProvider.EXPECT().Committees(
ctx,
testCase.epoch+1,
).Return(
@@ -1049,7 +1049,7 @@ func TestGetDuties_Valid(t *testing.T) {
nil,
).Times(2)
dutiesProvider.EXPECT().GetAttesterDuties(
dutiesProvider.EXPECT().AttesterDuties(
ctx,
testCase.epoch+1,
validatorIndices,
@@ -1058,7 +1058,7 @@ func TestGetDuties_Valid(t *testing.T) {
nil,
).Times(2)
dutiesProvider.EXPECT().GetProposerDuties(
dutiesProvider.EXPECT().ProposerDuties(
ctx,
testCase.epoch+1,
).Return(
@@ -1067,7 +1067,7 @@ func TestGetDuties_Valid(t *testing.T) {
).Times(2)
if fetchSyncDuties {
dutiesProvider.EXPECT().GetSyncDuties(
dutiesProvider.EXPECT().SyncDuties(
ctx,
testCase.epoch+1,
validatorIndices,
@@ -1078,7 +1078,7 @@ func TestGetDuties_Valid(t *testing.T) {
}
stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl)
stateValidatorsProvider.EXPECT().GetStateValidators(
stateValidatorsProvider.EXPECT().StateValidators(
ctx,
gomock.Any(),
gomock.Any(),
@@ -1187,13 +1187,13 @@ func TestGetDuties_Valid(t *testing.T) {
nil,
).MinTimes(1)
// Make sure that our values are equal to what would be returned by calling getDutiesForEpoch individually
// Make sure that our values are equal to what would be returned by calling dutiesForEpoch individually
validatorClient := &beaconApiValidatorClient{
dutiesProvider: dutiesProvider,
stateValidatorsProvider: stateValidatorsProvider,
}
expectedCurrentEpochDuties, err := validatorClient.getDutiesForEpoch(
expectedCurrentEpochDuties, err := validatorClient.dutiesForEpoch(
ctx,
testCase.epoch,
vals,
@@ -1201,7 +1201,7 @@ func TestGetDuties_Valid(t *testing.T) {
)
require.NoError(t, err)
expectedNextEpochDuties, err := validatorClient.getDutiesForEpoch(
expectedNextEpochDuties, err := validatorClient.dutiesForEpoch(
ctx,
testCase.epoch+1,
vals,
@@ -1214,7 +1214,7 @@ func TestGetDuties_Valid(t *testing.T) {
NextEpochDuties: expectedNextEpochDuties,
}
duties, err := validatorClient.getDuties(ctx, &ethpb.DutiesRequest{
duties, err := validatorClient.duties(ctx, &ethpb.DutiesRequest{
Epoch: testCase.epoch,
PublicKeys: append(pubkeys, []byte("0xunknown")),
})
@@ -1232,7 +1232,7 @@ func TestGetDuties_GetStateValidatorsFailed(t *testing.T) {
ctx := context.Background()
stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl)
stateValidatorsProvider.EXPECT().GetStateValidators(
stateValidatorsProvider.EXPECT().StateValidators(
ctx,
gomock.Any(),
gomock.Any(),
@@ -1246,7 +1246,7 @@ func TestGetDuties_GetStateValidatorsFailed(t *testing.T) {
stateValidatorsProvider: stateValidatorsProvider,
}
_, err := validatorClient.getDuties(ctx, &ethpb.DutiesRequest{
_, err := validatorClient.duties(ctx, &ethpb.DutiesRequest{
Epoch: 1,
PublicKeys: [][]byte{},
})
@@ -1262,7 +1262,7 @@ func TestGetDuties_GetDutiesForEpochFailed(t *testing.T) {
pubkey := []byte{1, 2, 3}
stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl)
stateValidatorsProvider.EXPECT().GetStateValidators(
stateValidatorsProvider.EXPECT().StateValidators(
ctx,
gomock.Any(),
gomock.Any(),
@@ -1281,7 +1281,7 @@ func TestGetDuties_GetDutiesForEpochFailed(t *testing.T) {
).Times(1)
dutiesProvider := mock.NewMockdutiesProvider(ctrl)
dutiesProvider.EXPECT().GetAttesterDuties(
dutiesProvider.EXPECT().AttesterDuties(
ctx,
primitives.Epoch(1),
gomock.Any(),
@@ -1289,16 +1289,16 @@ func TestGetDuties_GetDutiesForEpochFailed(t *testing.T) {
nil,
errors.New("foo error"),
).Times(1)
dutiesProvider.EXPECT().GetAttesterDuties(
dutiesProvider.EXPECT().AttesterDuties(
ctx,
primitives.Epoch(2),
gomock.Any(),
).Times(1)
dutiesProvider.EXPECT().GetProposerDuties(
dutiesProvider.EXPECT().ProposerDuties(
ctx,
gomock.Any(),
).Times(2)
dutiesProvider.EXPECT().GetCommittees(
dutiesProvider.EXPECT().Committees(
ctx,
gomock.Any(),
).Times(2)
@@ -1308,7 +1308,7 @@ func TestGetDuties_GetDutiesForEpochFailed(t *testing.T) {
dutiesProvider: dutiesProvider,
}
_, err := validatorClient.getDuties(ctx, &ethpb.DutiesRequest{
_, err := validatorClient.duties(ctx, &ethpb.DutiesRequest{
Epoch: 1,
PublicKeys: [][]byte{pubkey},
})
@@ -1456,7 +1456,7 @@ func generateValidSyncDuties(pubkeys [][]byte, validatorIndices []primitives.Val
}
}
// We will use a reverse function to easily make sure that the current epoch and next epoch data returned by getDutiesForEpoch
// We will use a reverse function to easily make sure that the current epoch and next epoch data returned by dutiesForEpoch
// are not the same
func reverseSlice[T interface{}](slice []T) []T {
reversedSlice := make([]T, len(slice))

View File

@@ -15,7 +15,7 @@ import (
)
type GenesisProvider interface {
GetGenesis(ctx context.Context) (*structs.Genesis, error)
Genesis(ctx context.Context) (*structs.Genesis, error)
}
type beaconApiGenesisProvider struct {
@@ -24,8 +24,8 @@ type beaconApiGenesisProvider struct {
once sync.Once
}
func (c beaconApiValidatorClient) waitForChainStart(ctx context.Context) (*ethpb.ChainStartResponse, error) {
genesis, err := c.genesisProvider.GetGenesis(ctx)
func (c *beaconApiValidatorClient) waitForChainStart(ctx context.Context) (*ethpb.ChainStartResponse, error) {
genesis, err := c.genesisProvider.Genesis(ctx)
for err != nil {
jsonErr := &httputil.DefaultJsonError{}
@@ -37,7 +37,7 @@ func (c beaconApiValidatorClient) waitForChainStart(ctx context.Context) (*ethpb
// Error 404 means that the chain genesis info is not yet known, so we query it every second until it's ready
select {
case <-time.After(time.Second):
genesis, err = c.genesisProvider.GetGenesis(ctx)
genesis, err = c.genesisProvider.Genesis(ctx)
case <-ctx.Done():
return nil, errors.New("context canceled")
}
@@ -67,7 +67,7 @@ func (c beaconApiValidatorClient) waitForChainStart(ctx context.Context) (*ethpb
}
// GetGenesis gets the genesis information from the beacon node via the /eth/v1/beacon/genesis endpoint
func (c *beaconApiGenesisProvider) GetGenesis(ctx context.Context) (*structs.Genesis, error) {
func (c *beaconApiGenesisProvider) Genesis(ctx context.Context) (*structs.Genesis, error) {
genesisJson := &structs.GetGenesisResponse{}
var doErr error
c.once.Do(func() {

View File

@@ -37,7 +37,7 @@ func TestGetGenesis_ValidGenesis(t *testing.T) {
).Times(1)
genesisProvider := &beaconApiGenesisProvider{jsonRestHandler: jsonRestHandler}
resp, err := genesisProvider.GetGenesis(ctx)
resp, err := genesisProvider.Genesis(ctx)
assert.NoError(t, err)
require.NotNil(t, resp)
assert.Equal(t, "1234", resp.GenesisTime)
@@ -64,7 +64,7 @@ func TestGetGenesis_NilData(t *testing.T) {
).Times(1)
genesisProvider := &beaconApiGenesisProvider{jsonRestHandler: jsonRestHandler}
_, err := genesisProvider.GetGenesis(ctx)
_, err := genesisProvider.Genesis(ctx)
assert.ErrorContains(t, "genesis data is nil", err)
}
@@ -93,9 +93,9 @@ func TestGetGenesis_EndpointCalledOnlyOnce(t *testing.T) {
).Times(1)
genesisProvider := &beaconApiGenesisProvider{jsonRestHandler: jsonRestHandler}
_, err := genesisProvider.GetGenesis(ctx)
_, err := genesisProvider.Genesis(ctx)
assert.NoError(t, err)
resp, err := genesisProvider.GetGenesis(ctx)
resp, err := genesisProvider.Genesis(ctx)
assert.NoError(t, err)
require.NotNil(t, resp)
assert.Equal(t, "1234", resp.GenesisTime)
@@ -134,9 +134,9 @@ func TestGetGenesis_EndpointCanBeCalledAgainAfterError(t *testing.T) {
).Times(1)
genesisProvider := &beaconApiGenesisProvider{jsonRestHandler: jsonRestHandler}
_, err := genesisProvider.GetGenesis(ctx)
_, err := genesisProvider.Genesis(ctx)
require.ErrorContains(t, "foo", err)
resp, err := genesisProvider.GetGenesis(ctx)
resp, err := genesisProvider.Genesis(ctx)
assert.NoError(t, err)
require.NotNil(t, resp)
assert.Equal(t, "1234", resp.GenesisTime)

View File

@@ -22,7 +22,7 @@ type abstractProduceBlockResponseJson struct {
Data json.RawMessage `json:"data"`
}
func (c beaconApiValidatorClient) getBeaconBlock(ctx context.Context, slot primitives.Slot, randaoReveal []byte, graffiti []byte) (*ethpb.GenericBeaconBlock, error) {
func (c *beaconApiValidatorClient) beaconBlock(ctx context.Context, slot primitives.Slot, randaoReveal, graffiti []byte) (*ethpb.GenericBeaconBlock, error) {
queryParams := neturl.Values{}
queryParams.Add("randao_reveal", hexutil.Encode(randaoReveal))
if len(graffiti) > 0 {
@@ -164,7 +164,7 @@ func (c beaconApiValidatorClient) getBeaconBlock(ctx context.Context, slot primi
return response, nil
}
func (c beaconApiValidatorClient) fallBackToBlinded(
func (c *beaconApiValidatorClient) fallBackToBlinded(
ctx context.Context,
slot primitives.Slot,
queryParams neturl.Values,
@@ -177,7 +177,7 @@ func (c beaconApiValidatorClient) fallBackToBlinded(
return resp, nil
}
func (c beaconApiValidatorClient) fallBackToFull(
func (c *beaconApiValidatorClient) fallBackToFull(
ctx context.Context,
slot primitives.Slot,
queryParams neturl.Values,

View File

@@ -16,7 +16,7 @@ import (
"github.com/prysmaticlabs/prysm/v5/testing/assert"
"github.com/prysmaticlabs/prysm/v5/testing/require"
"github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock"
test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers"
testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers"
"go.uber.org/mock/gomock"
)
@@ -36,7 +36,7 @@ func TestGetBeaconBlock_RequestFailed(t *testing.T) {
).Times(1)
validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler}
_, err := validatorClient.getBeaconBlock(ctx, 1, []byte{1}, []byte{2})
_, err := validatorClient.beaconBlock(ctx, 1, []byte{1}, []byte{2})
assert.ErrorContains(t, "foo error", err)
}
@@ -139,7 +139,7 @@ func TestGetBeaconBlock_Error(t *testing.T) {
).Times(1)
validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler}
_, err := validatorClient.getBeaconBlock(ctx, 1, []byte{1}, []byte{2})
_, err := validatorClient.beaconBlock(ctx, 1, []byte{1}, []byte{2})
assert.ErrorContains(t, testCase.expectedErrorMessage, err)
})
}
@@ -149,8 +149,8 @@ func TestGetBeaconBlock_Phase0Valid(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
proto := test_helpers.GenerateProtoPhase0BeaconBlock()
block := test_helpers.GenerateJsonPhase0BeaconBlock()
proto := testhelpers.GenerateProtoPhase0BeaconBlock()
block := testhelpers.GenerateJsonPhase0BeaconBlock()
bytes, err := json.Marshal(block)
require.NoError(t, err)
@@ -175,7 +175,7 @@ func TestGetBeaconBlock_Phase0Valid(t *testing.T) {
).Times(1)
validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler}
beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti)
beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti)
require.NoError(t, err)
expectedBeaconBlock := &ethpb.GenericBeaconBlock{
@@ -191,8 +191,8 @@ func TestGetBeaconBlock_AltairValid(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
proto := test_helpers.GenerateProtoAltairBeaconBlock()
block := test_helpers.GenerateJsonAltairBeaconBlock()
proto := testhelpers.GenerateProtoAltairBeaconBlock()
block := testhelpers.GenerateJsonAltairBeaconBlock()
bytes, err := json.Marshal(block)
require.NoError(t, err)
@@ -218,7 +218,7 @@ func TestGetBeaconBlock_AltairValid(t *testing.T) {
).Times(1)
validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler}
beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti)
beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti)
require.NoError(t, err)
expectedBeaconBlock := &ethpb.GenericBeaconBlock{
@@ -234,8 +234,8 @@ func TestGetBeaconBlock_BellatrixValid(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
proto := test_helpers.GenerateProtoBellatrixBeaconBlock()
block := test_helpers.GenerateJsonBellatrixBeaconBlock()
proto := testhelpers.GenerateProtoBellatrixBeaconBlock()
block := testhelpers.GenerateJsonBellatrixBeaconBlock()
bytes, err := json.Marshal(block)
require.NoError(t, err)
@@ -262,7 +262,7 @@ func TestGetBeaconBlock_BellatrixValid(t *testing.T) {
).Times(1)
validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler}
beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti)
beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti)
require.NoError(t, err)
expectedBeaconBlock := &ethpb.GenericBeaconBlock{
@@ -279,8 +279,8 @@ func TestGetBeaconBlock_BlindedBellatrixValid(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
proto := test_helpers.GenerateProtoBlindedBellatrixBeaconBlock()
block := test_helpers.GenerateJsonBlindedBellatrixBeaconBlock()
proto := testhelpers.GenerateProtoBlindedBellatrixBeaconBlock()
block := testhelpers.GenerateJsonBlindedBellatrixBeaconBlock()
bytes, err := json.Marshal(block)
require.NoError(t, err)
@@ -307,7 +307,7 @@ func TestGetBeaconBlock_BlindedBellatrixValid(t *testing.T) {
).Times(1)
validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler}
beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti)
beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti)
require.NoError(t, err)
expectedBeaconBlock := &ethpb.GenericBeaconBlock{
@@ -324,8 +324,8 @@ func TestGetBeaconBlock_CapellaValid(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
proto := test_helpers.GenerateProtoCapellaBeaconBlock()
block := test_helpers.GenerateJsonCapellaBeaconBlock()
proto := testhelpers.GenerateProtoCapellaBeaconBlock()
block := testhelpers.GenerateJsonCapellaBeaconBlock()
bytes, err := json.Marshal(block)
require.NoError(t, err)
@@ -352,7 +352,7 @@ func TestGetBeaconBlock_CapellaValid(t *testing.T) {
).Times(1)
validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler}
beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti)
beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti)
require.NoError(t, err)
expectedBeaconBlock := &ethpb.GenericBeaconBlock{
@@ -369,8 +369,8 @@ func TestGetBeaconBlock_BlindedCapellaValid(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
proto := test_helpers.GenerateProtoBlindedCapellaBeaconBlock()
block := test_helpers.GenerateJsonBlindedCapellaBeaconBlock()
proto := testhelpers.GenerateProtoBlindedCapellaBeaconBlock()
block := testhelpers.GenerateJsonBlindedCapellaBeaconBlock()
bytes, err := json.Marshal(block)
require.NoError(t, err)
@@ -397,7 +397,7 @@ func TestGetBeaconBlock_BlindedCapellaValid(t *testing.T) {
).Times(1)
validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler}
beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti)
beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti)
require.NoError(t, err)
expectedBeaconBlock := &ethpb.GenericBeaconBlock{
@@ -414,8 +414,8 @@ func TestGetBeaconBlock_DenebValid(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
proto := test_helpers.GenerateProtoDenebBeaconBlockContents()
block := test_helpers.GenerateJsonDenebBeaconBlockContents()
proto := testhelpers.GenerateProtoDenebBeaconBlockContents()
block := testhelpers.GenerateJsonDenebBeaconBlockContents()
bytes, err := json.Marshal(block)
require.NoError(t, err)
@@ -442,7 +442,7 @@ func TestGetBeaconBlock_DenebValid(t *testing.T) {
).Times(1)
validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler}
beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti)
beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti)
require.NoError(t, err)
expectedBeaconBlock := &ethpb.GenericBeaconBlock{
@@ -459,8 +459,8 @@ func TestGetBeaconBlock_BlindedDenebValid(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
proto := test_helpers.GenerateProtoBlindedDenebBeaconBlock()
block := test_helpers.GenerateJsonBlindedDenebBeaconBlock()
proto := testhelpers.GenerateProtoBlindedDenebBeaconBlock()
block := testhelpers.GenerateJsonBlindedDenebBeaconBlock()
bytes, err := json.Marshal(block)
require.NoError(t, err)
@@ -487,7 +487,7 @@ func TestGetBeaconBlock_BlindedDenebValid(t *testing.T) {
).Times(1)
validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler}
beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti)
beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti)
require.NoError(t, err)
expectedBeaconBlock := &ethpb.GenericBeaconBlock{
@@ -504,8 +504,8 @@ func TestGetBeaconBlock_FallbackToBlindedBlock(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
proto := test_helpers.GenerateProtoBlindedDenebBeaconBlock()
block := test_helpers.GenerateJsonBlindedDenebBeaconBlock()
proto := testhelpers.GenerateProtoBlindedDenebBeaconBlock()
block := testhelpers.GenerateJsonBlindedDenebBeaconBlock()
blockBytes, err := json.Marshal(block)
require.NoError(t, err)
@@ -538,7 +538,7 @@ func TestGetBeaconBlock_FallbackToBlindedBlock(t *testing.T) {
).Times(1)
validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler}
beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti)
beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti)
require.NoError(t, err)
expectedBeaconBlock := &ethpb.GenericBeaconBlock{
@@ -555,8 +555,8 @@ func TestGetBeaconBlock_FallbackToFullBlock(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
proto := test_helpers.GenerateProtoDenebBeaconBlockContents()
block := test_helpers.GenerateJsonDenebBeaconBlockContents()
proto := testhelpers.GenerateProtoDenebBeaconBlockContents()
block := testhelpers.GenerateJsonDenebBeaconBlockContents()
blockBytes, err := json.Marshal(block)
require.NoError(t, err)
@@ -596,7 +596,7 @@ func TestGetBeaconBlock_FallbackToFullBlock(t *testing.T) {
).Times(1)
validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler}
beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti)
beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti)
require.NoError(t, err)
expectedBeaconBlock := &ethpb.GenericBeaconBlock{

View File

@@ -28,10 +28,10 @@ func (e *IndexNotFoundError) Error() string {
return e.message
}
func (c beaconApiValidatorClient) validatorIndex(ctx context.Context, in *ethpb.ValidatorIndexRequest) (*ethpb.ValidatorIndexResponse, error) {
func (c *beaconApiValidatorClient) validatorIndex(ctx context.Context, in *ethpb.ValidatorIndexRequest) (*ethpb.ValidatorIndexResponse, error) {
stringPubKey := hexutil.Encode(in.PublicKey)
stateValidator, err := c.stateValidatorsProvider.GetStateValidators(ctx, []string{stringPubKey}, nil, nil)
stateValidator, err := c.stateValidatorsProvider.StateValidators(ctx, []string{stringPubKey}, nil, nil)
if err != nil {
return nil, errors.Wrap(err, "failed to get state validator")
}

View File

@@ -41,62 +41,62 @@ func (m *MockdutiesProvider) EXPECT() *MockdutiesProviderMockRecorder {
return m.recorder
}
// GetAttesterDuties mocks base method.
func (m *MockdutiesProvider) GetAttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.AttesterDuty, error) {
// AttesterDuties mocks base method.
func (m *MockdutiesProvider) AttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.AttesterDuty, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetAttesterDuties", ctx, epoch, validatorIndices)
ret := m.ctrl.Call(m, "AttesterDuties", ctx, epoch, validatorIndices)
ret0, _ := ret[0].([]*structs.AttesterDuty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetAttesterDuties indicates an expected call of GetAttesterDuties.
func (mr *MockdutiesProviderMockRecorder) GetAttesterDuties(ctx, epoch, validatorIndices any) *gomock.Call {
// AttesterDuties indicates an expected call of AttesterDuties.
func (mr *MockdutiesProviderMockRecorder) AttesterDuties(ctx, epoch, validatorIndices any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAttesterDuties", reflect.TypeOf((*MockdutiesProvider)(nil).GetAttesterDuties), ctx, epoch, validatorIndices)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AttesterDuties", reflect.TypeOf((*MockdutiesProvider)(nil).AttesterDuties), ctx, epoch, validatorIndices)
}
// GetCommittees mocks base method.
func (m *MockdutiesProvider) GetCommittees(ctx context.Context, epoch primitives.Epoch) ([]*structs.Committee, error) {
// Committees mocks base method.
func (m *MockdutiesProvider) Committees(ctx context.Context, epoch primitives.Epoch) ([]*structs.Committee, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetCommittees", ctx, epoch)
ret := m.ctrl.Call(m, "Committees", ctx, epoch)
ret0, _ := ret[0].([]*structs.Committee)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetCommittees indicates an expected call of GetCommittees.
func (mr *MockdutiesProviderMockRecorder) GetCommittees(ctx, epoch any) *gomock.Call {
// Committees indicates an expected call of Committees.
func (mr *MockdutiesProviderMockRecorder) Committees(ctx, epoch any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCommittees", reflect.TypeOf((*MockdutiesProvider)(nil).GetCommittees), ctx, epoch)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Committees", reflect.TypeOf((*MockdutiesProvider)(nil).Committees), ctx, epoch)
}
// GetProposerDuties mocks base method.
func (m *MockdutiesProvider) GetProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*structs.ProposerDuty, error) {
// ProposerDuties mocks base method.
func (m *MockdutiesProvider) ProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*structs.ProposerDuty, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetProposerDuties", ctx, epoch)
ret := m.ctrl.Call(m, "ProposerDuties", ctx, epoch)
ret0, _ := ret[0].([]*structs.ProposerDuty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetProposerDuties indicates an expected call of GetProposerDuties.
func (mr *MockdutiesProviderMockRecorder) GetProposerDuties(ctx, epoch any) *gomock.Call {
// ProposerDuties indicates an expected call of ProposerDuties.
func (mr *MockdutiesProviderMockRecorder) ProposerDuties(ctx, epoch any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProposerDuties", reflect.TypeOf((*MockdutiesProvider)(nil).GetProposerDuties), ctx, epoch)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProposerDuties", reflect.TypeOf((*MockdutiesProvider)(nil).ProposerDuties), ctx, epoch)
}
// GetSyncDuties mocks base method.
func (m *MockdutiesProvider) GetSyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.SyncCommitteeDuty, error) {
// SyncDuties mocks base method.
func (m *MockdutiesProvider) SyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.SyncCommitteeDuty, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetSyncDuties", ctx, epoch, validatorIndices)
ret := m.ctrl.Call(m, "SyncDuties", ctx, epoch, validatorIndices)
ret0, _ := ret[0].([]*structs.SyncCommitteeDuty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetSyncDuties indicates an expected call of GetSyncDuties.
func (mr *MockdutiesProviderMockRecorder) GetSyncDuties(ctx, epoch, validatorIndices any) *gomock.Call {
// SyncDuties indicates an expected call of SyncDuties.
func (mr *MockdutiesProviderMockRecorder) SyncDuties(ctx, epoch, validatorIndices any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncDuties", reflect.TypeOf((*MockdutiesProvider)(nil).GetSyncDuties), ctx, epoch, validatorIndices)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncDuties", reflect.TypeOf((*MockdutiesProvider)(nil).SyncDuties), ctx, epoch, validatorIndices)
}

View File

@@ -40,17 +40,17 @@ func (m *MockGenesisProvider) EXPECT() *MockGenesisProviderMockRecorder {
return m.recorder
}
// GetGenesis mocks base method.
func (m *MockGenesisProvider) GetGenesis(ctx context.Context) (*structs.Genesis, error) {
// Genesis mocks base method.
func (m *MockGenesisProvider) Genesis(ctx context.Context) (*structs.Genesis, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetGenesis", ctx)
ret := m.ctrl.Call(m, "Genesis", ctx)
ret0, _ := ret[0].(*structs.Genesis)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetGenesis indicates an expected call of GetGenesis.
func (mr *MockGenesisProviderMockRecorder) GetGenesis(ctx any) *gomock.Call {
// Genesis indicates an expected call of Genesis.
func (mr *MockGenesisProviderMockRecorder) Genesis(ctx any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGenesis", reflect.TypeOf((*MockGenesisProvider)(nil).GetGenesis), ctx)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Genesis", reflect.TypeOf((*MockGenesisProvider)(nil).Genesis), ctx)
}

View File

@@ -41,47 +41,47 @@ func (m *MockStateValidatorsProvider) EXPECT() *MockStateValidatorsProviderMockR
return m.recorder
}
// GetStateValidators mocks base method.
func (m *MockStateValidatorsProvider) GetStateValidators(arg0 context.Context, arg1 []string, arg2 []primitives.ValidatorIndex, arg3 []string) (*structs.GetValidatorsResponse, error) {
// StateValidators mocks base method.
func (m *MockStateValidatorsProvider) StateValidators(arg0 context.Context, arg1 []string, arg2 []primitives.ValidatorIndex, arg3 []string) (*structs.GetValidatorsResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetStateValidators", arg0, arg1, arg2, arg3)
ret := m.ctrl.Call(m, "StateValidators", arg0, arg1, arg2, arg3)
ret0, _ := ret[0].(*structs.GetValidatorsResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetStateValidators indicates an expected call of GetStateValidators.
func (mr *MockStateValidatorsProviderMockRecorder) GetStateValidators(arg0, arg1, arg2, arg3 any) *gomock.Call {
// StateValidators indicates an expected call of StateValidators.
func (mr *MockStateValidatorsProviderMockRecorder) StateValidators(arg0, arg1, arg2, arg3 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStateValidators", reflect.TypeOf((*MockStateValidatorsProvider)(nil).GetStateValidators), arg0, arg1, arg2, arg3)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateValidators", reflect.TypeOf((*MockStateValidatorsProvider)(nil).StateValidators), arg0, arg1, arg2, arg3)
}
// GetStateValidatorsForHead mocks base method.
func (m *MockStateValidatorsProvider) GetStateValidatorsForHead(arg0 context.Context, arg1 []string, arg2 []primitives.ValidatorIndex, arg3 []string) (*structs.GetValidatorsResponse, error) {
// StateValidatorsForHead mocks base method.
func (m *MockStateValidatorsProvider) StateValidatorsForHead(arg0 context.Context, arg1 []string, arg2 []primitives.ValidatorIndex, arg3 []string) (*structs.GetValidatorsResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetStateValidatorsForHead", arg0, arg1, arg2, arg3)
ret := m.ctrl.Call(m, "StateValidatorsForHead", arg0, arg1, arg2, arg3)
ret0, _ := ret[0].(*structs.GetValidatorsResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetStateValidatorsForHead indicates an expected call of GetStateValidatorsForHead.
func (mr *MockStateValidatorsProviderMockRecorder) GetStateValidatorsForHead(arg0, arg1, arg2, arg3 any) *gomock.Call {
// StateValidatorsForHead indicates an expected call of StateValidatorsForHead.
func (mr *MockStateValidatorsProviderMockRecorder) StateValidatorsForHead(arg0, arg1, arg2, arg3 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStateValidatorsForHead", reflect.TypeOf((*MockStateValidatorsProvider)(nil).GetStateValidatorsForHead), arg0, arg1, arg2, arg3)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateValidatorsForHead", reflect.TypeOf((*MockStateValidatorsProvider)(nil).StateValidatorsForHead), arg0, arg1, arg2, arg3)
}
// GetStateValidatorsForSlot mocks base method.
func (m *MockStateValidatorsProvider) GetStateValidatorsForSlot(arg0 context.Context, arg1 primitives.Slot, arg2 []string, arg3 []primitives.ValidatorIndex, arg4 []string) (*structs.GetValidatorsResponse, error) {
// StateValidatorsForSlot mocks base method.
func (m *MockStateValidatorsProvider) StateValidatorsForSlot(arg0 context.Context, arg1 primitives.Slot, arg2 []string, arg3 []primitives.ValidatorIndex, arg4 []string) (*structs.GetValidatorsResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetStateValidatorsForSlot", arg0, arg1, arg2, arg3, arg4)
ret := m.ctrl.Call(m, "StateValidatorsForSlot", arg0, arg1, arg2, arg3, arg4)
ret0, _ := ret[0].(*structs.GetValidatorsResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetStateValidatorsForSlot indicates an expected call of GetStateValidatorsForSlot.
func (mr *MockStateValidatorsProviderMockRecorder) GetStateValidatorsForSlot(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call {
// StateValidatorsForSlot indicates an expected call of StateValidatorsForSlot.
func (mr *MockStateValidatorsProviderMockRecorder) StateValidatorsForSlot(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStateValidatorsForSlot", reflect.TypeOf((*MockStateValidatorsProvider)(nil).GetStateValidatorsForSlot), arg0, arg1, arg2, arg3, arg4)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateValidatorsForSlot", reflect.TypeOf((*MockStateValidatorsProvider)(nil).StateValidatorsForSlot), arg0, arg1, arg2, arg3, arg4)
}

View File

@@ -9,7 +9,7 @@ import (
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
)
func (c beaconApiValidatorClient) proposeAttestation(ctx context.Context, attestation *ethpb.Attestation) (*ethpb.AttestResponse, error) {
func (c *beaconApiValidatorClient) proposeAttestation(ctx context.Context, attestation *ethpb.Attestation) (*ethpb.AttestResponse, error) {
if err := checkNilAttestation(attestation); err != nil {
return nil, err
}

View File

@@ -11,27 +11,27 @@ import (
"github.com/prysmaticlabs/prysm/v5/testing/assert"
"github.com/prysmaticlabs/prysm/v5/testing/require"
"github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock"
test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers"
testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers"
"go.uber.org/mock/gomock"
)
func TestProposeAttestation(t *testing.T) {
attestation := &ethpb.Attestation{
AggregationBits: test_helpers.FillByteSlice(4, 74),
AggregationBits: testhelpers.FillByteSlice(4, 74),
Data: &ethpb.AttestationData{
Slot: 75,
CommitteeIndex: 76,
BeaconBlockRoot: test_helpers.FillByteSlice(32, 38),
BeaconBlockRoot: testhelpers.FillByteSlice(32, 38),
Source: &ethpb.Checkpoint{
Epoch: 78,
Root: test_helpers.FillByteSlice(32, 79),
Root: testhelpers.FillByteSlice(32, 79),
},
Target: &ethpb.Checkpoint{
Epoch: 80,
Root: test_helpers.FillByteSlice(32, 81),
Root: testhelpers.FillByteSlice(32, 81),
},
},
Signature: test_helpers.FillByteSlice(96, 82),
Signature: testhelpers.FillByteSlice(96, 82),
}
tests := []struct {
@@ -53,30 +53,30 @@ func TestProposeAttestation(t *testing.T) {
{
name: "nil attestation data",
attestation: &ethpb.Attestation{
AggregationBits: test_helpers.FillByteSlice(4, 74),
Signature: test_helpers.FillByteSlice(96, 82),
AggregationBits: testhelpers.FillByteSlice(4, 74),
Signature: testhelpers.FillByteSlice(96, 82),
},
expectedErrorMessage: "attestation data is nil",
},
{
name: "nil source checkpoint",
attestation: &ethpb.Attestation{
AggregationBits: test_helpers.FillByteSlice(4, 74),
AggregationBits: testhelpers.FillByteSlice(4, 74),
Data: &ethpb.AttestationData{
Target: &ethpb.Checkpoint{},
},
Signature: test_helpers.FillByteSlice(96, 82),
Signature: testhelpers.FillByteSlice(96, 82),
},
expectedErrorMessage: "source/target in attestation data is nil",
},
{
name: "nil target checkpoint",
attestation: &ethpb.Attestation{
AggregationBits: test_helpers.FillByteSlice(4, 74),
AggregationBits: testhelpers.FillByteSlice(4, 74),
Data: &ethpb.AttestationData{
Source: &ethpb.Checkpoint{},
},
Signature: test_helpers.FillByteSlice(96, 82),
Signature: testhelpers.FillByteSlice(96, 82),
},
expectedErrorMessage: "source/target in attestation data is nil",
},
@@ -87,14 +87,14 @@ func TestProposeAttestation(t *testing.T) {
Source: &ethpb.Checkpoint{},
Target: &ethpb.Checkpoint{},
},
Signature: test_helpers.FillByteSlice(96, 82),
Signature: testhelpers.FillByteSlice(96, 82),
},
expectedErrorMessage: "attestation aggregation bits is empty",
},
{
name: "nil signature",
attestation: &ethpb.Attestation{
AggregationBits: test_helpers.FillByteSlice(4, 74),
AggregationBits: testhelpers.FillByteSlice(4, 74),
Data: &ethpb.AttestationData{
Source: &ethpb.Checkpoint{},
Target: &ethpb.Checkpoint{},

View File

@@ -14,7 +14,7 @@ import (
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
)
func (c beaconApiValidatorClient) proposeBeaconBlock(ctx context.Context, in *ethpb.GenericSignedBeaconBlock) (*ethpb.ProposeResponse, error) {
func (c *beaconApiValidatorClient) proposeBeaconBlock(ctx context.Context, in *ethpb.GenericSignedBeaconBlock) (*ethpb.ProposeResponse, error) {
var consensusVersion string
var beaconBlockRoot [32]byte

View File

@@ -12,7 +12,7 @@ import (
"github.com/prysmaticlabs/prysm/v5/testing/assert"
"github.com/prysmaticlabs/prysm/v5/testing/require"
"github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock"
test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers"
testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers"
"go.uber.org/mock/gomock"
)
@@ -80,8 +80,8 @@ func TestProposeBeaconBlock_Altair(t *testing.T) {
func generateSignedAltairBlock() *ethpb.GenericSignedBeaconBlock_Altair {
return &ethpb.GenericSignedBeaconBlock_Altair{
Altair: &ethpb.SignedBeaconBlockAltair{
Block: test_helpers.GenerateProtoAltairBeaconBlock(),
Signature: test_helpers.FillByteSlice(96, 112),
Block: testhelpers.GenerateProtoAltairBeaconBlock(),
Signature: testhelpers.FillByteSlice(96, 112),
},
}
}

View File

@@ -13,7 +13,7 @@ import (
"github.com/prysmaticlabs/prysm/v5/testing/assert"
"github.com/prysmaticlabs/prysm/v5/testing/require"
"github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock"
test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers"
testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers"
"go.uber.org/mock/gomock"
)
@@ -97,8 +97,8 @@ func TestProposeBeaconBlock_Bellatrix(t *testing.T) {
func generateSignedBellatrixBlock() *ethpb.GenericSignedBeaconBlock_Bellatrix {
return &ethpb.GenericSignedBeaconBlock_Bellatrix{
Bellatrix: &ethpb.SignedBeaconBlockBellatrix{
Block: test_helpers.GenerateProtoBellatrixBeaconBlock(),
Signature: test_helpers.FillByteSlice(96, 127),
Block: testhelpers.GenerateProtoBellatrixBeaconBlock(),
Signature: testhelpers.FillByteSlice(96, 127),
},
}
}

View File

@@ -14,7 +14,7 @@ import (
"github.com/prysmaticlabs/prysm/v5/testing/assert"
"github.com/prysmaticlabs/prysm/v5/testing/require"
"github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock"
test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers"
testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers"
"go.uber.org/mock/gomock"
)
@@ -101,37 +101,37 @@ func generateSignedBlindedBellatrixBlock() *ethpb.GenericSignedBeaconBlock_Blind
Block: &ethpb.BlindedBeaconBlockBellatrix{
Slot: 1,
ProposerIndex: 2,
ParentRoot: test_helpers.FillByteSlice(32, 3),
StateRoot: test_helpers.FillByteSlice(32, 4),
ParentRoot: testhelpers.FillByteSlice(32, 3),
StateRoot: testhelpers.FillByteSlice(32, 4),
Body: &ethpb.BlindedBeaconBlockBodyBellatrix{
RandaoReveal: test_helpers.FillByteSlice(96, 5),
RandaoReveal: testhelpers.FillByteSlice(96, 5),
Eth1Data: &ethpb.Eth1Data{
DepositRoot: test_helpers.FillByteSlice(32, 6),
DepositRoot: testhelpers.FillByteSlice(32, 6),
DepositCount: 7,
BlockHash: test_helpers.FillByteSlice(32, 8),
BlockHash: testhelpers.FillByteSlice(32, 8),
},
Graffiti: test_helpers.FillByteSlice(32, 9),
Graffiti: testhelpers.FillByteSlice(32, 9),
ProposerSlashings: []*ethpb.ProposerSlashing{
{
Header_1: &ethpb.SignedBeaconBlockHeader{
Header: &ethpb.BeaconBlockHeader{
Slot: 10,
ProposerIndex: 11,
ParentRoot: test_helpers.FillByteSlice(32, 12),
StateRoot: test_helpers.FillByteSlice(32, 13),
BodyRoot: test_helpers.FillByteSlice(32, 14),
ParentRoot: testhelpers.FillByteSlice(32, 12),
StateRoot: testhelpers.FillByteSlice(32, 13),
BodyRoot: testhelpers.FillByteSlice(32, 14),
},
Signature: test_helpers.FillByteSlice(96, 15),
Signature: testhelpers.FillByteSlice(96, 15),
},
Header_2: &ethpb.SignedBeaconBlockHeader{
Header: &ethpb.BeaconBlockHeader{
Slot: 16,
ProposerIndex: 17,
ParentRoot: test_helpers.FillByteSlice(32, 18),
StateRoot: test_helpers.FillByteSlice(32, 19),
BodyRoot: test_helpers.FillByteSlice(32, 20),
ParentRoot: testhelpers.FillByteSlice(32, 18),
StateRoot: testhelpers.FillByteSlice(32, 19),
BodyRoot: testhelpers.FillByteSlice(32, 20),
},
Signature: test_helpers.FillByteSlice(96, 21),
Signature: testhelpers.FillByteSlice(96, 21),
},
},
{
@@ -139,21 +139,21 @@ func generateSignedBlindedBellatrixBlock() *ethpb.GenericSignedBeaconBlock_Blind
Header: &ethpb.BeaconBlockHeader{
Slot: 22,
ProposerIndex: 23,
ParentRoot: test_helpers.FillByteSlice(32, 24),
StateRoot: test_helpers.FillByteSlice(32, 25),
BodyRoot: test_helpers.FillByteSlice(32, 26),
ParentRoot: testhelpers.FillByteSlice(32, 24),
StateRoot: testhelpers.FillByteSlice(32, 25),
BodyRoot: testhelpers.FillByteSlice(32, 26),
},
Signature: test_helpers.FillByteSlice(96, 27),
Signature: testhelpers.FillByteSlice(96, 27),
},
Header_2: &ethpb.SignedBeaconBlockHeader{
Header: &ethpb.BeaconBlockHeader{
Slot: 28,
ProposerIndex: 29,
ParentRoot: test_helpers.FillByteSlice(32, 30),
StateRoot: test_helpers.FillByteSlice(32, 31),
BodyRoot: test_helpers.FillByteSlice(32, 32),
ParentRoot: testhelpers.FillByteSlice(32, 30),
StateRoot: testhelpers.FillByteSlice(32, 31),
BodyRoot: testhelpers.FillByteSlice(32, 32),
},
Signature: test_helpers.FillByteSlice(96, 33),
Signature: testhelpers.FillByteSlice(96, 33),
},
},
},
@@ -164,34 +164,34 @@ func generateSignedBlindedBellatrixBlock() *ethpb.GenericSignedBeaconBlock_Blind
Data: &ethpb.AttestationData{
Slot: 36,
CommitteeIndex: 37,
BeaconBlockRoot: test_helpers.FillByteSlice(32, 38),
BeaconBlockRoot: testhelpers.FillByteSlice(32, 38),
Source: &ethpb.Checkpoint{
Epoch: 39,
Root: test_helpers.FillByteSlice(32, 40),
Root: testhelpers.FillByteSlice(32, 40),
},
Target: &ethpb.Checkpoint{
Epoch: 41,
Root: test_helpers.FillByteSlice(32, 42),
Root: testhelpers.FillByteSlice(32, 42),
},
},
Signature: test_helpers.FillByteSlice(96, 43),
Signature: testhelpers.FillByteSlice(96, 43),
},
Attestation_2: &ethpb.IndexedAttestation{
AttestingIndices: []uint64{44, 45},
Data: &ethpb.AttestationData{
Slot: 46,
CommitteeIndex: 47,
BeaconBlockRoot: test_helpers.FillByteSlice(32, 38),
BeaconBlockRoot: testhelpers.FillByteSlice(32, 38),
Source: &ethpb.Checkpoint{
Epoch: 49,
Root: test_helpers.FillByteSlice(32, 50),
Root: testhelpers.FillByteSlice(32, 50),
},
Target: &ethpb.Checkpoint{
Epoch: 51,
Root: test_helpers.FillByteSlice(32, 52),
Root: testhelpers.FillByteSlice(32, 52),
},
},
Signature: test_helpers.FillByteSlice(96, 53),
Signature: testhelpers.FillByteSlice(96, 53),
},
},
{
@@ -200,90 +200,90 @@ func generateSignedBlindedBellatrixBlock() *ethpb.GenericSignedBeaconBlock_Blind
Data: &ethpb.AttestationData{
Slot: 56,
CommitteeIndex: 57,
BeaconBlockRoot: test_helpers.FillByteSlice(32, 38),
BeaconBlockRoot: testhelpers.FillByteSlice(32, 38),
Source: &ethpb.Checkpoint{
Epoch: 59,
Root: test_helpers.FillByteSlice(32, 60),
Root: testhelpers.FillByteSlice(32, 60),
},
Target: &ethpb.Checkpoint{
Epoch: 61,
Root: test_helpers.FillByteSlice(32, 62),
Root: testhelpers.FillByteSlice(32, 62),
},
},
Signature: test_helpers.FillByteSlice(96, 63),
Signature: testhelpers.FillByteSlice(96, 63),
},
Attestation_2: &ethpb.IndexedAttestation{
AttestingIndices: []uint64{64, 65},
Data: &ethpb.AttestationData{
Slot: 66,
CommitteeIndex: 67,
BeaconBlockRoot: test_helpers.FillByteSlice(32, 38),
BeaconBlockRoot: testhelpers.FillByteSlice(32, 38),
Source: &ethpb.Checkpoint{
Epoch: 69,
Root: test_helpers.FillByteSlice(32, 70),
Root: testhelpers.FillByteSlice(32, 70),
},
Target: &ethpb.Checkpoint{
Epoch: 71,
Root: test_helpers.FillByteSlice(32, 72),
Root: testhelpers.FillByteSlice(32, 72),
},
},
Signature: test_helpers.FillByteSlice(96, 73),
Signature: testhelpers.FillByteSlice(96, 73),
},
},
},
Attestations: []*ethpb.Attestation{
{
AggregationBits: test_helpers.FillByteSlice(4, 74),
AggregationBits: testhelpers.FillByteSlice(4, 74),
Data: &ethpb.AttestationData{
Slot: 75,
CommitteeIndex: 76,
BeaconBlockRoot: test_helpers.FillByteSlice(32, 38),
BeaconBlockRoot: testhelpers.FillByteSlice(32, 38),
Source: &ethpb.Checkpoint{
Epoch: 78,
Root: test_helpers.FillByteSlice(32, 79),
Root: testhelpers.FillByteSlice(32, 79),
},
Target: &ethpb.Checkpoint{
Epoch: 80,
Root: test_helpers.FillByteSlice(32, 81),
Root: testhelpers.FillByteSlice(32, 81),
},
},
Signature: test_helpers.FillByteSlice(96, 82),
Signature: testhelpers.FillByteSlice(96, 82),
},
{
AggregationBits: test_helpers.FillByteSlice(4, 83),
AggregationBits: testhelpers.FillByteSlice(4, 83),
Data: &ethpb.AttestationData{
Slot: 84,
CommitteeIndex: 85,
BeaconBlockRoot: test_helpers.FillByteSlice(32, 38),
BeaconBlockRoot: testhelpers.FillByteSlice(32, 38),
Source: &ethpb.Checkpoint{
Epoch: 87,
Root: test_helpers.FillByteSlice(32, 88),
Root: testhelpers.FillByteSlice(32, 88),
},
Target: &ethpb.Checkpoint{
Epoch: 89,
Root: test_helpers.FillByteSlice(32, 90),
Root: testhelpers.FillByteSlice(32, 90),
},
},
Signature: test_helpers.FillByteSlice(96, 91),
Signature: testhelpers.FillByteSlice(96, 91),
},
},
Deposits: []*ethpb.Deposit{
{
Proof: test_helpers.FillByteArraySlice(33, test_helpers.FillByteSlice(32, 92)),
Proof: testhelpers.FillByteArraySlice(33, testhelpers.FillByteSlice(32, 92)),
Data: &ethpb.Deposit_Data{
PublicKey: test_helpers.FillByteSlice(48, 94),
WithdrawalCredentials: test_helpers.FillByteSlice(32, 95),
PublicKey: testhelpers.FillByteSlice(48, 94),
WithdrawalCredentials: testhelpers.FillByteSlice(32, 95),
Amount: 96,
Signature: test_helpers.FillByteSlice(96, 97),
Signature: testhelpers.FillByteSlice(96, 97),
},
},
{
Proof: test_helpers.FillByteArraySlice(33, test_helpers.FillByteSlice(32, 98)),
Proof: testhelpers.FillByteArraySlice(33, testhelpers.FillByteSlice(32, 98)),
Data: &ethpb.Deposit_Data{
PublicKey: test_helpers.FillByteSlice(48, 100),
WithdrawalCredentials: test_helpers.FillByteSlice(32, 101),
PublicKey: testhelpers.FillByteSlice(48, 100),
WithdrawalCredentials: testhelpers.FillByteSlice(32, 101),
Amount: 102,
Signature: test_helpers.FillByteSlice(96, 103),
Signature: testhelpers.FillByteSlice(96, 103),
},
},
},
@@ -293,39 +293,39 @@ func generateSignedBlindedBellatrixBlock() *ethpb.GenericSignedBeaconBlock_Blind
Epoch: 104,
ValidatorIndex: 105,
},
Signature: test_helpers.FillByteSlice(96, 106),
Signature: testhelpers.FillByteSlice(96, 106),
},
{
Exit: &ethpb.VoluntaryExit{
Epoch: 107,
ValidatorIndex: 108,
},
Signature: test_helpers.FillByteSlice(96, 109),
Signature: testhelpers.FillByteSlice(96, 109),
},
},
SyncAggregate: &ethpb.SyncAggregate{
SyncCommitteeBits: test_helpers.FillByteSlice(64, 110),
SyncCommitteeSignature: test_helpers.FillByteSlice(96, 111),
SyncCommitteeBits: testhelpers.FillByteSlice(64, 110),
SyncCommitteeSignature: testhelpers.FillByteSlice(96, 111),
},
ExecutionPayloadHeader: &enginev1.ExecutionPayloadHeader{
ParentHash: test_helpers.FillByteSlice(32, 112),
FeeRecipient: test_helpers.FillByteSlice(20, 113),
StateRoot: test_helpers.FillByteSlice(32, 114),
ReceiptsRoot: test_helpers.FillByteSlice(32, 115),
LogsBloom: test_helpers.FillByteSlice(256, 116),
PrevRandao: test_helpers.FillByteSlice(32, 117),
ParentHash: testhelpers.FillByteSlice(32, 112),
FeeRecipient: testhelpers.FillByteSlice(20, 113),
StateRoot: testhelpers.FillByteSlice(32, 114),
ReceiptsRoot: testhelpers.FillByteSlice(32, 115),
LogsBloom: testhelpers.FillByteSlice(256, 116),
PrevRandao: testhelpers.FillByteSlice(32, 117),
BlockNumber: 118,
GasLimit: 119,
GasUsed: 120,
Timestamp: 121,
ExtraData: test_helpers.FillByteSlice(32, 122),
BaseFeePerGas: test_helpers.FillByteSlice(32, 123),
BlockHash: test_helpers.FillByteSlice(32, 124),
TransactionsRoot: test_helpers.FillByteSlice(32, 125),
ExtraData: testhelpers.FillByteSlice(32, 122),
BaseFeePerGas: testhelpers.FillByteSlice(32, 123),
BlockHash: testhelpers.FillByteSlice(32, 124),
TransactionsRoot: testhelpers.FillByteSlice(32, 125),
},
},
},
Signature: test_helpers.FillByteSlice(96, 126),
Signature: testhelpers.FillByteSlice(96, 126),
},
}
}

View File

@@ -14,7 +14,7 @@ import (
"github.com/prysmaticlabs/prysm/v5/testing/assert"
"github.com/prysmaticlabs/prysm/v5/testing/require"
"github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock"
test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers"
testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers"
"go.uber.org/mock/gomock"
)
@@ -103,37 +103,37 @@ func generateSignedBlindedCapellaBlock() *ethpb.GenericSignedBeaconBlock_Blinded
Block: &ethpb.BlindedBeaconBlockCapella{
Slot: 1,
ProposerIndex: 2,
ParentRoot: test_helpers.FillByteSlice(32, 3),
StateRoot: test_helpers.FillByteSlice(32, 4),
ParentRoot: testhelpers.FillByteSlice(32, 3),
StateRoot: testhelpers.FillByteSlice(32, 4),
Body: &ethpb.BlindedBeaconBlockBodyCapella{
RandaoReveal: test_helpers.FillByteSlice(96, 5),
RandaoReveal: testhelpers.FillByteSlice(96, 5),
Eth1Data: &ethpb.Eth1Data{
DepositRoot: test_helpers.FillByteSlice(32, 6),
DepositRoot: testhelpers.FillByteSlice(32, 6),
DepositCount: 7,
BlockHash: test_helpers.FillByteSlice(32, 8),
BlockHash: testhelpers.FillByteSlice(32, 8),
},
Graffiti: test_helpers.FillByteSlice(32, 9),
Graffiti: testhelpers.FillByteSlice(32, 9),
ProposerSlashings: []*ethpb.ProposerSlashing{
{
Header_1: &ethpb.SignedBeaconBlockHeader{
Header: &ethpb.BeaconBlockHeader{
Slot: 10,
ProposerIndex: 11,
ParentRoot: test_helpers.FillByteSlice(32, 12),
StateRoot: test_helpers.FillByteSlice(32, 13),
BodyRoot: test_helpers.FillByteSlice(32, 14),
ParentRoot: testhelpers.FillByteSlice(32, 12),
StateRoot: testhelpers.FillByteSlice(32, 13),
BodyRoot: testhelpers.FillByteSlice(32, 14),
},
Signature: test_helpers.FillByteSlice(96, 15),
Signature: testhelpers.FillByteSlice(96, 15),
},
Header_2: &ethpb.SignedBeaconBlockHeader{
Header: &ethpb.BeaconBlockHeader{
Slot: 16,
ProposerIndex: 17,
ParentRoot: test_helpers.FillByteSlice(32, 18),
StateRoot: test_helpers.FillByteSlice(32, 19),
BodyRoot: test_helpers.FillByteSlice(32, 20),
ParentRoot: testhelpers.FillByteSlice(32, 18),
StateRoot: testhelpers.FillByteSlice(32, 19),
BodyRoot: testhelpers.FillByteSlice(32, 20),
},
Signature: test_helpers.FillByteSlice(96, 21),
Signature: testhelpers.FillByteSlice(96, 21),
},
},
{
@@ -141,21 +141,21 @@ func generateSignedBlindedCapellaBlock() *ethpb.GenericSignedBeaconBlock_Blinded
Header: &ethpb.BeaconBlockHeader{
Slot: 22,
ProposerIndex: 23,
ParentRoot: test_helpers.FillByteSlice(32, 24),
StateRoot: test_helpers.FillByteSlice(32, 25),
BodyRoot: test_helpers.FillByteSlice(32, 26),
ParentRoot: testhelpers.FillByteSlice(32, 24),
StateRoot: testhelpers.FillByteSlice(32, 25),
BodyRoot: testhelpers.FillByteSlice(32, 26),
},
Signature: test_helpers.FillByteSlice(96, 27),
Signature: testhelpers.FillByteSlice(96, 27),
},
Header_2: &ethpb.SignedBeaconBlockHeader{
Header: &ethpb.BeaconBlockHeader{
Slot: 28,
ProposerIndex: 29,
ParentRoot: test_helpers.FillByteSlice(32, 30),
StateRoot: test_helpers.FillByteSlice(32, 31),
BodyRoot: test_helpers.FillByteSlice(32, 32),
ParentRoot: testhelpers.FillByteSlice(32, 30),
StateRoot: testhelpers.FillByteSlice(32, 31),
BodyRoot: testhelpers.FillByteSlice(32, 32),
},
Signature: test_helpers.FillByteSlice(96, 33),
Signature: testhelpers.FillByteSlice(96, 33),
},
},
},
@@ -166,34 +166,34 @@ func generateSignedBlindedCapellaBlock() *ethpb.GenericSignedBeaconBlock_Blinded
Data: &ethpb.AttestationData{
Slot: 36,
CommitteeIndex: 37,
BeaconBlockRoot: test_helpers.FillByteSlice(32, 38),
BeaconBlockRoot: testhelpers.FillByteSlice(32, 38),
Source: &ethpb.Checkpoint{
Epoch: 39,
Root: test_helpers.FillByteSlice(32, 40),
Root: testhelpers.FillByteSlice(32, 40),
},
Target: &ethpb.Checkpoint{
Epoch: 41,
Root: test_helpers.FillByteSlice(32, 42),
Root: testhelpers.FillByteSlice(32, 42),
},
},
Signature: test_helpers.FillByteSlice(96, 43),
Signature: testhelpers.FillByteSlice(96, 43),
},
Attestation_2: &ethpb.IndexedAttestation{
AttestingIndices: []uint64{44, 45},
Data: &ethpb.AttestationData{
Slot: 46,
CommitteeIndex: 47,
BeaconBlockRoot: test_helpers.FillByteSlice(32, 38),
BeaconBlockRoot: testhelpers.FillByteSlice(32, 38),
Source: &ethpb.Checkpoint{
Epoch: 49,
Root: test_helpers.FillByteSlice(32, 50),
Root: testhelpers.FillByteSlice(32, 50),
},
Target: &ethpb.Checkpoint{
Epoch: 51,
Root: test_helpers.FillByteSlice(32, 52),
Root: testhelpers.FillByteSlice(32, 52),
},
},
Signature: test_helpers.FillByteSlice(96, 53),
Signature: testhelpers.FillByteSlice(96, 53),
},
},
{
@@ -202,90 +202,90 @@ func generateSignedBlindedCapellaBlock() *ethpb.GenericSignedBeaconBlock_Blinded
Data: &ethpb.AttestationData{
Slot: 56,
CommitteeIndex: 57,
BeaconBlockRoot: test_helpers.FillByteSlice(32, 38),
BeaconBlockRoot: testhelpers.FillByteSlice(32, 38),
Source: &ethpb.Checkpoint{
Epoch: 59,
Root: test_helpers.FillByteSlice(32, 60),
Root: testhelpers.FillByteSlice(32, 60),
},
Target: &ethpb.Checkpoint{
Epoch: 61,
Root: test_helpers.FillByteSlice(32, 62),
Root: testhelpers.FillByteSlice(32, 62),
},
},
Signature: test_helpers.FillByteSlice(96, 63),
Signature: testhelpers.FillByteSlice(96, 63),
},
Attestation_2: &ethpb.IndexedAttestation{
AttestingIndices: []uint64{64, 65},
Data: &ethpb.AttestationData{
Slot: 66,
CommitteeIndex: 67,
BeaconBlockRoot: test_helpers.FillByteSlice(32, 38),
BeaconBlockRoot: testhelpers.FillByteSlice(32, 38),
Source: &ethpb.Checkpoint{
Epoch: 69,
Root: test_helpers.FillByteSlice(32, 70),
Root: testhelpers.FillByteSlice(32, 70),
},
Target: &ethpb.Checkpoint{
Epoch: 71,
Root: test_helpers.FillByteSlice(32, 72),
Root: testhelpers.FillByteSlice(32, 72),
},
},
Signature: test_helpers.FillByteSlice(96, 73),
Signature: testhelpers.FillByteSlice(96, 73),
},
},
},
Attestations: []*ethpb.Attestation{
{
AggregationBits: test_helpers.FillByteSlice(4, 74),
AggregationBits: testhelpers.FillByteSlice(4, 74),
Data: &ethpb.AttestationData{
Slot: 75,
CommitteeIndex: 76,
BeaconBlockRoot: test_helpers.FillByteSlice(32, 38),
BeaconBlockRoot: testhelpers.FillByteSlice(32, 38),
Source: &ethpb.Checkpoint{
Epoch: 78,
Root: test_helpers.FillByteSlice(32, 79),
Root: testhelpers.FillByteSlice(32, 79),
},
Target: &ethpb.Checkpoint{
Epoch: 80,
Root: test_helpers.FillByteSlice(32, 81),
Root: testhelpers.FillByteSlice(32, 81),
},
},
Signature: test_helpers.FillByteSlice(96, 82),
Signature: testhelpers.FillByteSlice(96, 82),
},
{
AggregationBits: test_helpers.FillByteSlice(4, 83),
AggregationBits: testhelpers.FillByteSlice(4, 83),
Data: &ethpb.AttestationData{
Slot: 84,
CommitteeIndex: 85,
BeaconBlockRoot: test_helpers.FillByteSlice(32, 38),
BeaconBlockRoot: testhelpers.FillByteSlice(32, 38),
Source: &ethpb.Checkpoint{
Epoch: 87,
Root: test_helpers.FillByteSlice(32, 88),
Root: testhelpers.FillByteSlice(32, 88),
},
Target: &ethpb.Checkpoint{
Epoch: 89,
Root: test_helpers.FillByteSlice(32, 90),
Root: testhelpers.FillByteSlice(32, 90),
},
},
Signature: test_helpers.FillByteSlice(96, 91),
Signature: testhelpers.FillByteSlice(96, 91),
},
},
Deposits: []*ethpb.Deposit{
{
Proof: test_helpers.FillByteArraySlice(33, test_helpers.FillByteSlice(32, 92)),
Proof: testhelpers.FillByteArraySlice(33, testhelpers.FillByteSlice(32, 92)),
Data: &ethpb.Deposit_Data{
PublicKey: test_helpers.FillByteSlice(48, 94),
WithdrawalCredentials: test_helpers.FillByteSlice(32, 95),
PublicKey: testhelpers.FillByteSlice(48, 94),
WithdrawalCredentials: testhelpers.FillByteSlice(32, 95),
Amount: 96,
Signature: test_helpers.FillByteSlice(96, 97),
Signature: testhelpers.FillByteSlice(96, 97),
},
},
{
Proof: test_helpers.FillByteArraySlice(33, test_helpers.FillByteSlice(32, 98)),
Proof: testhelpers.FillByteArraySlice(33, testhelpers.FillByteSlice(32, 98)),
Data: &ethpb.Deposit_Data{
PublicKey: test_helpers.FillByteSlice(48, 100),
WithdrawalCredentials: test_helpers.FillByteSlice(32, 101),
PublicKey: testhelpers.FillByteSlice(48, 100),
WithdrawalCredentials: testhelpers.FillByteSlice(32, 101),
Amount: 102,
Signature: test_helpers.FillByteSlice(96, 103),
Signature: testhelpers.FillByteSlice(96, 103),
},
},
},
@@ -295,58 +295,58 @@ func generateSignedBlindedCapellaBlock() *ethpb.GenericSignedBeaconBlock_Blinded
Epoch: 104,
ValidatorIndex: 105,
},
Signature: test_helpers.FillByteSlice(96, 106),
Signature: testhelpers.FillByteSlice(96, 106),
},
{
Exit: &ethpb.VoluntaryExit{
Epoch: 107,
ValidatorIndex: 108,
},
Signature: test_helpers.FillByteSlice(96, 109),
Signature: testhelpers.FillByteSlice(96, 109),
},
},
SyncAggregate: &ethpb.SyncAggregate{
SyncCommitteeBits: test_helpers.FillByteSlice(64, 110),
SyncCommitteeSignature: test_helpers.FillByteSlice(96, 111),
SyncCommitteeBits: testhelpers.FillByteSlice(64, 110),
SyncCommitteeSignature: testhelpers.FillByteSlice(96, 111),
},
ExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderCapella{
ParentHash: test_helpers.FillByteSlice(32, 112),
FeeRecipient: test_helpers.FillByteSlice(20, 113),
StateRoot: test_helpers.FillByteSlice(32, 114),
ReceiptsRoot: test_helpers.FillByteSlice(32, 115),
LogsBloom: test_helpers.FillByteSlice(256, 116),
PrevRandao: test_helpers.FillByteSlice(32, 117),
ParentHash: testhelpers.FillByteSlice(32, 112),
FeeRecipient: testhelpers.FillByteSlice(20, 113),
StateRoot: testhelpers.FillByteSlice(32, 114),
ReceiptsRoot: testhelpers.FillByteSlice(32, 115),
LogsBloom: testhelpers.FillByteSlice(256, 116),
PrevRandao: testhelpers.FillByteSlice(32, 117),
BlockNumber: 118,
GasLimit: 119,
GasUsed: 120,
Timestamp: 121,
ExtraData: test_helpers.FillByteSlice(32, 122),
BaseFeePerGas: test_helpers.FillByteSlice(32, 123),
BlockHash: test_helpers.FillByteSlice(32, 124),
TransactionsRoot: test_helpers.FillByteSlice(32, 125),
WithdrawalsRoot: test_helpers.FillByteSlice(32, 126),
ExtraData: testhelpers.FillByteSlice(32, 122),
BaseFeePerGas: testhelpers.FillByteSlice(32, 123),
BlockHash: testhelpers.FillByteSlice(32, 124),
TransactionsRoot: testhelpers.FillByteSlice(32, 125),
WithdrawalsRoot: testhelpers.FillByteSlice(32, 126),
},
BlsToExecutionChanges: []*ethpb.SignedBLSToExecutionChange{
{
Message: &ethpb.BLSToExecutionChange{
ValidatorIndex: 127,
FromBlsPubkey: test_helpers.FillByteSlice(48, 128),
ToExecutionAddress: test_helpers.FillByteSlice(20, 129),
FromBlsPubkey: testhelpers.FillByteSlice(48, 128),
ToExecutionAddress: testhelpers.FillByteSlice(20, 129),
},
Signature: test_helpers.FillByteSlice(96, 130),
Signature: testhelpers.FillByteSlice(96, 130),
},
{
Message: &ethpb.BLSToExecutionChange{
ValidatorIndex: 131,
FromBlsPubkey: test_helpers.FillByteSlice(48, 132),
ToExecutionAddress: test_helpers.FillByteSlice(20, 133),
FromBlsPubkey: testhelpers.FillByteSlice(48, 132),
ToExecutionAddress: testhelpers.FillByteSlice(20, 133),
},
Signature: test_helpers.FillByteSlice(96, 134),
Signature: testhelpers.FillByteSlice(96, 134),
},
},
},
},
Signature: test_helpers.FillByteSlice(96, 135),
Signature: testhelpers.FillByteSlice(96, 135),
},
}
}

Some files were not shown because too many files have changed in this diff Show More