Compare commits

...

21 Commits

Author SHA1 Message Date
prylabs-bulldozer[bot]
dd37678802 Merge refs/heads/develop into init-client 2022-03-29 19:48:40 +00:00
terence tsao
59b9519284 Forkchoice spec test: set boost with deterministic timing (#10428)
* Set boost with deterministic timing

* confs

* gaz

* Update runner.go

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2022-03-29 19:48:33 +00:00
prylabs-bulldozer[bot]
652134c1ff Merge refs/heads/develop into init-client 2022-03-29 13:55:48 +00:00
prylabs-bulldozer[bot]
32a0da89e8 Merge refs/heads/develop into init-client 2022-03-28 22:17:36 +00:00
prylabs-bulldozer[bot]
a5e73640de Merge refs/heads/develop into init-client 2022-03-28 21:34:47 +00:00
prylabs-bulldozer[bot]
9526860ba5 Merge refs/heads/develop into init-client 2022-03-28 21:02:01 +00:00
prylabs-bulldozer[bot]
6cbaddd79c Merge refs/heads/develop into init-client 2022-03-28 17:14:08 +00:00
prylabs-bulldozer[bot]
b7ab6e4d9e Merge refs/heads/develop into init-client 2022-03-28 15:25:54 +00:00
prylabs-bulldozer[bot]
d43a32a99d Merge refs/heads/develop into init-client 2022-03-28 14:48:20 +00:00
prylabs-bulldozer[bot]
4a4b34d43c Merge refs/heads/develop into init-client 2022-03-28 12:27:20 +00:00
prylabs-bulldozer[bot]
08156a4b72 Merge refs/heads/develop into init-client 2022-03-26 07:34:34 +00:00
prylabs-bulldozer[bot]
4fe6c79ec9 Merge refs/heads/develop into init-client 2022-03-25 23:00:49 +00:00
terence tsao
526843ba27 Update service.go 2022-03-25 14:31:09 -07:00
Raul Jordan
bfdd154081 bellatrix epoch not set 2022-03-25 15:37:35 -04:00
prylabs-bulldozer[bot]
cd95c571f9 Merge refs/heads/develop into init-client 2022-03-25 17:18:08 +00:00
prylabs-bulldozer[bot]
fac981b32a Merge refs/heads/develop into init-client 2022-03-25 16:31:55 +00:00
prylabs-bulldozer[bot]
26476dcdd4 Merge refs/heads/develop into init-client 2022-03-25 16:03:21 +00:00
prylabs-bulldozer[bot]
45e41eb8ea Merge refs/heads/develop into init-client 2022-03-25 15:35:49 +00:00
Raul Jordan
dce3d1e8ea Merge branch 'develop' into init-client 2022-03-25 15:09:30 +00:00
terence tsao
bd255a5790 Comment 2022-03-25 08:08:53 -07:00
terence tsao
ad400fcf6e Fix 2022-03-25 07:49:37 -07:00
3 changed files with 21 additions and 5 deletions

View File

@@ -212,6 +212,10 @@ func NewService(ctx context.Context, opts ...Option) (*Service, error) {
}
}
if err := s.initializeEngineAPIClient(ctx); err != nil {
return nil, err
}
if err := s.ensureValidPowchainData(ctx); err != nil {
return nil, errors.Wrap(err, "unable to validate powchain data")
}
@@ -247,10 +251,6 @@ func (s *Service) Start() {
return
}
if err := s.initializeEngineAPIClient(s.ctx); err != nil {
log.WithError(err).Fatal("unable to initialize engine API client")
}
// Check transition configuration for the engine API client in the background.
go s.checkTransitionConfiguration(s.ctx, make(chan *statefeed.BlockProcessedData, 1))
@@ -1056,8 +1056,12 @@ func (s *Service) ensureValidPowchainData(ctx context.Context) error {
return nil
}
// Initializes a connection to the engine API if an execution provider endpoint is set.
// Initializes a client for the engine API if an execution provider endpoint is set.
func (s *Service) initializeEngineAPIClient(ctx context.Context) error {
// If Bellatrix fork epoch is not yet set, we exit early.
//if params.BeaconConfig().BellatrixForkEpoch == math.MaxUint64 {
// return nil
//}
opts := []engine.Option{
engine.WithJWTSecret(s.cfg.executionEndpointJWTSecret),
}

View File

@@ -17,6 +17,7 @@ go_library(
"//beacon-chain/core/time:go_default_library",
"//beacon-chain/db/testing:go_default_library",
"//beacon-chain/forkchoice/protoarray:go_default_library",
"//beacon-chain/forkchoice/types:go_default_library",
"//beacon-chain/operations/attestations:go_default_library",
"//beacon-chain/state:go_default_library",
"//beacon-chain/state/stategen:go_default_library",
@@ -34,6 +35,7 @@ go_library(
"//testing/require:go_default_library",
"//testing/spectest/utils:go_default_library",
"//testing/util:go_default_library",
"//time/slots:go_default_library",
"@com_github_ethereum_go_ethereum//common:go_default_library",
"@com_github_ethereum_go_ethereum//common/hexutil:go_default_library",
"@com_github_golang_snappy//:go_default_library",

View File

@@ -11,6 +11,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/golang/snappy"
types "github.com/prysmaticlabs/eth2-types"
forkchoicetypes "github.com/prysmaticlabs/prysm/beacon-chain/forkchoice/types"
"github.com/prysmaticlabs/prysm/beacon-chain/state"
v1 "github.com/prysmaticlabs/prysm/beacon-chain/state/v1"
v2 "github.com/prysmaticlabs/prysm/beacon-chain/state/v2"
@@ -25,6 +26,7 @@ import (
"github.com/prysmaticlabs/prysm/testing/require"
"github.com/prysmaticlabs/prysm/testing/spectest/utils"
"github.com/prysmaticlabs/prysm/testing/util"
"github.com/prysmaticlabs/prysm/time/slots"
)
// Run executes "forkchoice" test.
@@ -103,6 +105,14 @@ func Run(t *testing.T, config string, fork int) {
}
r, err := beaconBlock.Block().HashTreeRoot()
require.NoError(t, err)
slotsSinceGenesis := slots.SinceGenesis(service.GenesisTime())
args := &forkchoicetypes.ProposerBoostRootArgs{
BlockRoot: r,
BlockSlot: beaconBlock.Block().Slot(),
CurrentSlot: slotsSinceGenesis,
SecondsIntoSlot: uint64(lastTick) % params.BeaconConfig().SecondsPerSlot,
}
require.NoError(t, service.ForkChoicer().BoostProposerRoot(ctx, args))
if step.Valid != nil && !*step.Valid {
require.Equal(t, true, service.ReceiveBlock(ctx, beaconBlock, r) != nil)
} else {