mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-10 13:58:09 -05:00
Compare commits
1 Commits
eas
...
hackSimula
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c8e420ab4 |
@@ -114,7 +114,7 @@ func (s *State) LoadBlocks(ctx context.Context, startSlot, endSlot types.Slot, e
|
|||||||
}
|
}
|
||||||
|
|
||||||
if blockRoots[length-1] != endBlockRoot {
|
if blockRoots[length-1] != endBlockRoot {
|
||||||
return nil, errors.New("end block roots don't match")
|
return nil, errors.Errorf("end block roots don't match: got %#x but wanted %#x for %d to %d at length %d", blockRoots[length-1], endBlockRoot, startSlot, endSlot, length)
|
||||||
}
|
}
|
||||||
|
|
||||||
filteredBlocks := []interfaces.SignedBeaconBlock{blocks[length-1]}
|
filteredBlocks := []interfaces.SignedBeaconBlock{blocks[length-1]}
|
||||||
|
|||||||
@@ -145,6 +145,8 @@ func (v *ValidatorNode) Start(ctx context.Context) error {
|
|||||||
"--" + cmdshared.E2EConfigFlag.Name,
|
"--" + cmdshared.E2EConfigFlag.Name,
|
||||||
"--" + cmdshared.AcceptTosFlag.Name,
|
"--" + cmdshared.AcceptTosFlag.Name,
|
||||||
}
|
}
|
||||||
|
args = append(args, "--pprof", fmt.Sprintf("--pprofport=%d", e2e.TestParams.Ports.PrysmBeaconNodePprofPort+20+index))
|
||||||
|
|
||||||
// Only apply e2e flags to the current branch. New flags may not exist in previous release.
|
// Only apply e2e flags to the current branch. New flags may not exist in previous release.
|
||||||
if !v.config.UsePrysmShValidator {
|
if !v.config.UsePrysmShValidator {
|
||||||
args = append(args, features.E2EValidatorFlags...)
|
args = append(args, features.E2EValidatorFlags...)
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/prysmaticlabs/prysm/config/params"
|
"github.com/prysmaticlabs/prysm/config/params"
|
||||||
ev "github.com/prysmaticlabs/prysm/testing/endtoend/evaluators"
|
|
||||||
"github.com/prysmaticlabs/prysm/testing/endtoend/helpers"
|
"github.com/prysmaticlabs/prysm/testing/endtoend/helpers"
|
||||||
e2eParams "github.com/prysmaticlabs/prysm/testing/endtoend/params"
|
e2eParams "github.com/prysmaticlabs/prysm/testing/endtoend/params"
|
||||||
"github.com/prysmaticlabs/prysm/testing/endtoend/types"
|
"github.com/prysmaticlabs/prysm/testing/endtoend/types"
|
||||||
@@ -47,28 +46,6 @@ func e2eMinimal(t *testing.T, useWeb3RemoteSigner bool, extraEpochs uint64) {
|
|||||||
tracingPort := e2eParams.TestParams.Ports.JaegerTracingPort
|
tracingPort := e2eParams.TestParams.Ports.JaegerTracingPort
|
||||||
tracingEndpoint := fmt.Sprintf("127.0.0.1:%d", tracingPort)
|
tracingEndpoint := fmt.Sprintf("127.0.0.1:%d", tracingPort)
|
||||||
evals := []types.Evaluator{
|
evals := []types.Evaluator{
|
||||||
ev.PeersConnect,
|
|
||||||
ev.HealthzCheck,
|
|
||||||
ev.MetricsCheck,
|
|
||||||
ev.ValidatorsAreActive,
|
|
||||||
ev.ValidatorsParticipatingAtEpoch(2),
|
|
||||||
ev.FinalizationOccurs(3),
|
|
||||||
ev.PeersCheck,
|
|
||||||
ev.ProcessesDepositsInBlocks,
|
|
||||||
ev.VerifyBlockGraffiti,
|
|
||||||
ev.ActivatesDepositedValidators,
|
|
||||||
ev.DepositedValidatorsAreActive,
|
|
||||||
ev.ProposeVoluntaryExit,
|
|
||||||
ev.ValidatorHasExited,
|
|
||||||
ev.ValidatorsVoteWithTheMajority,
|
|
||||||
ev.ColdStateCheckpoint,
|
|
||||||
ev.AltairForkTransition,
|
|
||||||
ev.BellatrixForkTransition,
|
|
||||||
ev.APIMiddlewareVerifyIntegrity,
|
|
||||||
ev.APIGatewayV1Alpha1VerifyIntegrity,
|
|
||||||
ev.FinishedSyncing,
|
|
||||||
ev.AllNodesHaveSameHead,
|
|
||||||
ev.ValidatorSyncParticipation,
|
|
||||||
//ev.TransactionsPresent, TODO: Renable Transaction evaluator once it tx pool issues are fixed.
|
//ev.TransactionsPresent, TODO: Renable Transaction evaluator once it tx pool issues are fixed.
|
||||||
}
|
}
|
||||||
testConfig := &types.E2EConfig{
|
testConfig := &types.E2EConfig{
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/prysmaticlabs/prysm/async"
|
|
||||||
"github.com/prysmaticlabs/prysm/beacon-chain/core/signing"
|
"github.com/prysmaticlabs/prysm/beacon-chain/core/signing"
|
||||||
fieldparams "github.com/prysmaticlabs/prysm/config/fieldparams"
|
fieldparams "github.com/prysmaticlabs/prysm/config/fieldparams"
|
||||||
"github.com/prysmaticlabs/prysm/config/params"
|
"github.com/prysmaticlabs/prysm/config/params"
|
||||||
@@ -21,7 +20,6 @@ import (
|
|||||||
validatorpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1/validator-client"
|
validatorpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1/validator-client"
|
||||||
"github.com/prysmaticlabs/prysm/runtime/version"
|
"github.com/prysmaticlabs/prysm/runtime/version"
|
||||||
prysmTime "github.com/prysmaticlabs/prysm/time"
|
prysmTime "github.com/prysmaticlabs/prysm/time"
|
||||||
"github.com/prysmaticlabs/prysm/validator/client/iface"
|
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
"go.opencensus.io/trace"
|
"go.opencensus.io/trace"
|
||||||
"google.golang.org/protobuf/types/known/emptypb"
|
"google.golang.org/protobuf/types/known/emptypb"
|
||||||
@@ -46,10 +44,6 @@ func (v *validator) ProposeBlock(ctx context.Context, slot types.Slot, pubKey [f
|
|||||||
ctx, span := trace.StartSpan(ctx, "validator.ProposeBlock")
|
ctx, span := trace.StartSpan(ctx, "validator.ProposeBlock")
|
||||||
defer span.End()
|
defer span.End()
|
||||||
|
|
||||||
lock := async.NewMultilock(fmt.Sprint(iface.RoleProposer), string(pubKey[:]))
|
|
||||||
lock.Lock()
|
|
||||||
defer lock.Unlock()
|
|
||||||
|
|
||||||
fmtKey := fmt.Sprintf("%#x", pubKey[:])
|
fmtKey := fmt.Sprintf("%#x", pubKey[:])
|
||||||
span.AddAttributes(trace.StringAttribute("validator", fmtKey))
|
span.AddAttributes(trace.StringAttribute("validator", fmtKey))
|
||||||
log := log.WithField("pubKey", fmt.Sprintf("%#x", bytesutil.Trunc(pubKey[:])))
|
log := log.WithField("pubKey", fmt.Sprintf("%#x", bytesutil.Trunc(pubKey[:])))
|
||||||
@@ -131,6 +125,34 @@ func (v *validator) ProposeBlock(ctx context.Context, slot types.Slot, pubKey [f
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
hasProposerNextSlot := false
|
||||||
|
hasProposerPrevSlot := false
|
||||||
|
hasProposerPrevPrevSlot := false
|
||||||
|
for _, d := range v.duties.Duties {
|
||||||
|
if slot < 6 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if len(d.ProposerSlots) > 0 && d.ProposerSlots[0] == slot+1 {
|
||||||
|
hasProposerNextSlot = true
|
||||||
|
}
|
||||||
|
if len(d.ProposerSlots) > 0 && d.ProposerSlots[0] == slot-1 {
|
||||||
|
hasProposerPrevSlot = true
|
||||||
|
}
|
||||||
|
if len(d.ProposerSlots) > 0 && d.ProposerSlots[0] == slot-2 {
|
||||||
|
hasProposerPrevPrevSlot = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if hasProposerNextSlot && !hasProposerPrevSlot {
|
||||||
|
log.Infof("waiting for slot %d", slot+1)
|
||||||
|
<-v.propChan
|
||||||
|
log.Infof("received from slot %d", slot+1)
|
||||||
|
}
|
||||||
|
if hasProposerPrevSlot && !hasProposerPrevPrevSlot {
|
||||||
|
log.Infof("sending to slot %d", slot-1)
|
||||||
|
v.propChan <- true
|
||||||
|
log.Infof("sent to slot %d", slot-1)
|
||||||
|
}
|
||||||
|
ctx = context.Background()
|
||||||
blkResp, err := v.validatorClient.ProposeBeaconBlock(ctx, proposal)
|
blkResp, err := v.validatorClient.ProposeBeaconBlock(ctx, proposal)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithError(err).Error("Failed to propose block")
|
log.WithError(err).Error("Failed to propose block")
|
||||||
|
|||||||
@@ -208,6 +208,7 @@ func (v *ValidatorService) Start() {
|
|||||||
Web3SignerConfig: v.Web3SignerConfig,
|
Web3SignerConfig: v.Web3SignerConfig,
|
||||||
feeRecipientConfig: v.feeRecipientConfig,
|
feeRecipientConfig: v.feeRecipientConfig,
|
||||||
walletIntializedChannel: make(chan *wallet.Wallet, 1),
|
walletIntializedChannel: make(chan *wallet.Wallet, 1),
|
||||||
|
propChan: make(chan bool, 1),
|
||||||
}
|
}
|
||||||
// To resolve a race condition at startup due to the interface
|
// To resolve a race condition at startup due to the interface
|
||||||
// nature of the abstracted block type. We initialize
|
// nature of the abstracted block type. We initialize
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ type validator struct {
|
|||||||
domainDataCache *ristretto.Cache
|
domainDataCache *ristretto.Cache
|
||||||
highestValidSlot types.Slot
|
highestValidSlot types.Slot
|
||||||
genesisTime uint64
|
genesisTime uint64
|
||||||
|
propChan chan bool
|
||||||
blockFeed *event.Feed
|
blockFeed *event.Feed
|
||||||
interopKeysConfig *local.InteropKeymanagerConfig
|
interopKeysConfig *local.InteropKeymanagerConfig
|
||||||
wallet *wallet.Wallet
|
wallet *wallet.Wallet
|
||||||
|
|||||||
Reference in New Issue
Block a user