Skip to content

Commit

Permalink
compose: fix very large smoke test (#1797)
Browse files Browse the repository at this point in the history
Enables very large smoke test with 7 of 10 cluster and 100 validators.

category: test
ticket: #1471
  • Loading branch information
dB2510 authored Feb 14, 2023
1 parent 2403c2a commit bc73565
Show file tree
Hide file tree
Showing 28 changed files with 190 additions and 95 deletions.
8 changes: 7 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ type Config struct {
SimnetBMock bool
SimnetVMock bool
SimnetValidatorKeysDir string
SimnetSlotDuration time.Duration
SyntheticBlockProposals bool
BuilderAPI bool

Expand Down Expand Up @@ -685,10 +686,15 @@ func newETH2Client(ctx context.Context, conf Config, life *lifecycle.Manager,
return nil, err
}

// Default to 1s slot duration if not set.
if conf.SimnetSlotDuration == 0 {
conf.SimnetSlotDuration = time.Second
}

if conf.SimnetBMock { // Configure the beacon mock.
const dutyFactor = 100 // Duty factor spreads duties deterministically in an epoch.
opts := []beaconmock.Option{
beaconmock.WithSlotDuration(time.Second),
beaconmock.WithSlotDuration(conf.SimnetSlotDuration),
beaconmock.WithDeterministicAttesterDuties(dutyFactor),
beaconmock.WithDeterministicSyncCommDuties(2, 8), // First 2 epochs of every 8
beaconmock.WithValidatorSet(createMockValidators(pubkeys)),
Expand Down
5 changes: 4 additions & 1 deletion app/vmock.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,10 @@ func newVMockSigner(conf Config, pubshares []eth2p0.BLSPubKey) (validatormock.Si
}
}

signer := validatormock.NewSigner(secrets...)
signer, err := validatormock.NewSigner(secrets...)
if err != nil {
return nil, err
}

if len(secrets) == 0 && len(pubshares) != 0 {
return nil, errors.New("validator mock keys empty")
Expand Down
2 changes: 2 additions & 0 deletions cmd/cmd_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"os"
"strings"
"testing"
"time"

"github.com/spf13/pflag"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -88,6 +89,7 @@ func TestCmdFlags(t *testing.T) {
LockFile: ".charon/cluster-lock.json",
PrivKeyFile: ".charon/charon-enr-private-key",
SimnetValidatorKeysDir: ".charon/validator_keys",
SimnetSlotDuration: time.Second,
MonitoringAddr: "127.0.0.1:3620",
ValidatorAPIAddr: "127.0.0.1:3600",
BeaconNodeAddrs: []string{"http://beacon.node"},
Expand Down
2 changes: 2 additions & 0 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package cmd
import (
"context"
"net/url"
"time"

"github.com/spf13/cobra"
"github.com/spf13/pflag"
Expand Down Expand Up @@ -83,6 +84,7 @@ func bindRunFlags(cmd *cobra.Command, config *app.Config) {
cmd.Flags().StringVar(&config.SimnetValidatorKeysDir, "simnet-validator-keys-dir", ".charon/validator_keys", "The directory containing the simnet validator key shares.")
cmd.Flags().BoolVar(&config.BuilderAPI, "builder-api", false, "Enables the builder api. Will only produce builder blocks. Builder API must also be enabled on the validator client. Beacon node must be connected to a builder-relay to access the builder network.")
cmd.Flags().BoolVar(&config.SyntheticBlockProposals, "synthetic-block-proposals", false, "Enables additional synthetic block proposal duties. Used for testing of rare duties.")
cmd.Flags().DurationVar(&config.SimnetSlotDuration, "simnet-slot-duration", time.Second, "Configures slot duration in simnet beacon mock.")

wrapPreRunE(cmd, func(cmd *cobra.Command, args []string) error {
if len(config.BeaconNodeAddrs) == 0 && !config.SimnetBMock {
Expand Down
12 changes: 6 additions & 6 deletions core/scheduler/testdata/TestSchedulerDuties_grouped.golden
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
"Time": "00:04.000",
"duty": "0/attester",
"DutyDefSet": {
"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea": "{\"pubkey\":\"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea\",\"slot\":\"0\",\"validator_index\":\"2\",\"committee_index\":\"0\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}",
"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76": "{\"pubkey\":\"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76\",\"slot\":\"0\",\"validator_index\":\"3\",\"committee_index\":\"0\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}",
"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490": "{\"pubkey\":\"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490\",\"slot\":\"0\",\"validator_index\":\"1\",\"committee_index\":\"0\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea": "{\"pubkey\":\"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea\",\"slot\":\"0\",\"validator_index\":\"2\",\"committee_index\":\"2\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}",
"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76": "{\"pubkey\":\"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76\",\"slot\":\"0\",\"validator_index\":\"3\",\"committee_index\":\"3\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}",
"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490": "{\"pubkey\":\"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490\",\"slot\":\"0\",\"validator_index\":\"1\",\"committee_index\":\"1\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
}
},
{
"Time": "00:08.000",
"duty": "0/aggregator",
"DutyDefSet": {
"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea": "{\"pubkey\":\"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea\",\"slot\":\"0\",\"validator_index\":\"2\",\"committee_index\":\"0\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}",
"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76": "{\"pubkey\":\"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76\",\"slot\":\"0\",\"validator_index\":\"3\",\"committee_index\":\"0\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}",
"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490": "{\"pubkey\":\"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490\",\"slot\":\"0\",\"validator_index\":\"1\",\"committee_index\":\"0\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea": "{\"pubkey\":\"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea\",\"slot\":\"0\",\"validator_index\":\"2\",\"committee_index\":\"2\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}",
"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76": "{\"pubkey\":\"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76\",\"slot\":\"0\",\"validator_index\":\"3\",\"committee_index\":\"3\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}",
"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490": "{\"pubkey\":\"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490\",\"slot\":\"0\",\"validator_index\":\"1\",\"committee_index\":\"1\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
}
}
]
12 changes: 6 additions & 6 deletions core/scheduler/testdata/TestSchedulerDuties_spread.golden
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
"Time": "00:04.000",
"duty": "0/attester",
"DutyDefSet": {
"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490": "{\"pubkey\":\"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490\",\"slot\":\"0\",\"validator_index\":\"1\",\"committee_index\":\"0\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490": "{\"pubkey\":\"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490\",\"slot\":\"0\",\"validator_index\":\"1\",\"committee_index\":\"1\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
}
},
{
"Time": "00:08.000",
"duty": "0/aggregator",
"DutyDefSet": {
"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490": "{\"pubkey\":\"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490\",\"slot\":\"0\",\"validator_index\":\"1\",\"committee_index\":\"0\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490": "{\"pubkey\":\"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490\",\"slot\":\"0\",\"validator_index\":\"1\",\"committee_index\":\"1\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
}
},
{
Expand All @@ -31,14 +31,14 @@
"Time": "00:16.000",
"duty": "1/attester",
"DutyDefSet": {
"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea": "{\"pubkey\":\"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea\",\"slot\":\"1\",\"validator_index\":\"2\",\"committee_index\":\"1\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea": "{\"pubkey\":\"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea\",\"slot\":\"1\",\"validator_index\":\"2\",\"committee_index\":\"2\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
}
},
{
"Time": "00:20.000",
"duty": "1/aggregator",
"DutyDefSet": {
"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea": "{\"pubkey\":\"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea\",\"slot\":\"1\",\"validator_index\":\"2\",\"committee_index\":\"1\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea": "{\"pubkey\":\"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea\",\"slot\":\"1\",\"validator_index\":\"2\",\"committee_index\":\"2\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
}
},
{
Expand All @@ -52,14 +52,14 @@
"Time": "00:28.000",
"duty": "2/attester",
"DutyDefSet": {
"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76": "{\"pubkey\":\"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76\",\"slot\":\"2\",\"validator_index\":\"3\",\"committee_index\":\"2\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76": "{\"pubkey\":\"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76\",\"slot\":\"2\",\"validator_index\":\"3\",\"committee_index\":\"3\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
}
},
{
"Time": "00:32.000",
"duty": "2/aggregator",
"DutyDefSet": {
"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76": "{\"pubkey\":\"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76\",\"slot\":\"2\",\"validator_index\":\"3\",\"committee_index\":\"2\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76": "{\"pubkey\":\"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76\",\"slot\":\"2\",\"validator_index\":\"3\",\"committee_index\":\"3\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
}
}
]
12 changes: 6 additions & 6 deletions core/scheduler/testdata/TestSchedulerDuties_spread_errors.golden
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"Time": "00:04.000",
"duty": "0/attester",
"DutyDefSet": {
"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490": "{\"pubkey\":\"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490\",\"slot\":\"0\",\"validator_index\":\"1\",\"committee_index\":\"0\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490": "{\"pubkey\":\"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490\",\"slot\":\"0\",\"validator_index\":\"1\",\"committee_index\":\"1\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
}
},
{
"Time": "00:08.000",
"duty": "0/aggregator",
"DutyDefSet": {
"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490": "{\"pubkey\":\"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490\",\"slot\":\"0\",\"validator_index\":\"1\",\"committee_index\":\"0\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490": "{\"pubkey\":\"0x914cff835a769156ba43ad50b931083c2dadd94e8359ce394bc7a3e06424d0214922ddf15f81640530b9c25c0bc0d490\",\"slot\":\"0\",\"validator_index\":\"1\",\"committee_index\":\"1\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
}
},
{
Expand All @@ -24,14 +24,14 @@
"Time": "00:16.000",
"duty": "1/attester",
"DutyDefSet": {
"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea": "{\"pubkey\":\"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea\",\"slot\":\"1\",\"validator_index\":\"2\",\"committee_index\":\"1\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea": "{\"pubkey\":\"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea\",\"slot\":\"1\",\"validator_index\":\"2\",\"committee_index\":\"2\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
}
},
{
"Time": "00:20.000",
"duty": "1/aggregator",
"DutyDefSet": {
"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea": "{\"pubkey\":\"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea\",\"slot\":\"1\",\"validator_index\":\"2\",\"committee_index\":\"1\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea": "{\"pubkey\":\"0x8dae41352b69f2b3a1c0b05330c1bf65f03730c520273028864b11fcb94d8ce8f26d64f979a0ee3025467f45fd2241ea\",\"slot\":\"1\",\"validator_index\":\"2\",\"committee_index\":\"2\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
}
},
{
Expand All @@ -45,14 +45,14 @@
"Time": "00:28.000",
"duty": "2/attester",
"DutyDefSet": {
"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76": "{\"pubkey\":\"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76\",\"slot\":\"2\",\"validator_index\":\"3\",\"committee_index\":\"2\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76": "{\"pubkey\":\"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76\",\"slot\":\"2\",\"validator_index\":\"3\",\"committee_index\":\"3\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
}
},
{
"Time": "00:32.000",
"duty": "2/aggregator",
"DutyDefSet": {
"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76": "{\"pubkey\":\"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76\",\"slot\":\"2\",\"validator_index\":\"3\",\"committee_index\":\"2\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76": "{\"pubkey\":\"0x8ee91545183c8c2db86633626f5074fd8ef93c4c9b7a2879ad1768f600c5b5906c3af20d47de42c3b032956fa8db1a76\",\"slot\":\"2\",\"validator_index\":\"3\",\"committee_index\":\"3\",\"committee_length\":\"1\",\"committees_at_slot\":\"16\",\"validator_committee_index\":\"0\"}"
}
}
]
12 changes: 9 additions & 3 deletions core/validatorapi/validatorapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func TestSubmitAttestations_Verify(t *testing.T) {

vapi.RegisterPubKeyByAttestation(func(ctx context.Context, slot, commIdx, valCommIdx int64) (core.PubKey, error) {
require.EqualValues(t, slot, epochSlot)
require.EqualValues(t, commIdx, 0)
require.EqualValues(t, commIdx, vIdx)
require.EqualValues(t, valCommIdx, 0)

return corePubKey, nil
Expand All @@ -226,11 +226,14 @@ func TestSubmitAttestations_Verify(t *testing.T) {
// Configure beacon mock to call validator API for submissions
bmock.SubmitAttestationsFunc = vapi.SubmitAttestations

signer, err := validatormock.NewSigner(secret)
require.NoError(t, err)

// Run attestation using validator mock
attester := validatormock.NewSlotAttester(
bmock,
eth2p0.Slot(epochSlot),
validatormock.NewSigner(secret),
signer,
[]eth2p0.BLSPubKey{validator.Validator.PublicKey},
)

Expand Down Expand Up @@ -290,8 +293,11 @@ func TestSignAndVerify(t *testing.T) {
require.NoError(t, err)
eth2Pubkey := eth2p0.BLSPubKey(pubkey)

signer, err := validatormock.NewSigner(secretKey)
require.NoError(t, err)

// Sign
sig, err := validatormock.NewSigner(secretKey)(eth2Pubkey, sigDataBytes[:])
sig, err := signer(eth2Pubkey, sigDataBytes[:])
require.NoError(t, err)

// Assert signature
Expand Down
1 change: 1 addition & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ Flags:
--p2p-tcp-address strings Comma-separated list of listening TCP addresses (ip and port) for libP2P traffic. Empty default doesn't bind to local port therefore only supports outgoing connections.
--private-key-file string The path to the charon enr private key file. (default ".charon/charon-enr-private-key")
--simnet-beacon-mock Enables an internal mock beacon node for running a simnet.
--simnet-slot-duration duration Configures slot duration in simnet beacon mock. (default 1s)
--simnet-validator-keys-dir string The directory containing the simnet validator key shares. (default ".charon/validator_keys")
--simnet-validator-mock Enables an internal mock validator client when running a simnet. Requires simnet-beacon-mock.
--synthetic-block-proposals Enables additional synthetic block proposal duties. Used for testing of rare duties.
Expand Down
Loading

0 comments on commit bc73565

Please sign in to comment.