Compare commits

...

2 Commits

Author SHA1 Message Date
terence tsao
144dbe6d2c Comment out deposit 2022-07-01 08:27:53 -07:00
Potuz
d8158f3bb3 boundary test 2022-06-30 11:10:10 -03:00
2 changed files with 33 additions and 18 deletions

View File

@@ -22,21 +22,21 @@ func (vs *Server) packDepositsAndAttestations(ctx context.Context, head state.Be
var deposits []*ethpb.Deposit
var atts []*ethpb.Attestation
eg.Go(func() error {
// Pack ETH1 deposits which have not been included in the beacon chain.
localDeposits, err := vs.deposits(egctx, head, eth1Data)
if err != nil {
return status.Errorf(codes.Internal, "Could not get ETH1 deposits: %v", err)
}
// if the original context is cancelled, then cancel this routine too
select {
case <-egctx.Done():
return egctx.Err()
default:
}
deposits = localDeposits
return nil
})
//eg.Go(func() error {
// // Pack ETH1 deposits which have not been included in the beacon chain.
// localDeposits, err := vs.deposits(egctx, head, eth1Data)
// if err != nil {
// return status.Errorf(codes.Internal, "Could not get ETH1 deposits: %v", err)
// }
// // if the original context is cancelled, then cancel this routine too
// select {
// case <-egctx.Done():
// return egctx.Err()
// default:
// }
// deposits = localDeposits
// return nil
//})
eg.Go(func() error {
// Pack aggregated attestations which have not been included in the beacon chain.

View File

@@ -10,11 +10,13 @@ import (
"github.com/prysmaticlabs/prysm/beacon-chain/core/transition"
"github.com/prysmaticlabs/prysm/beacon-chain/core/transition/interop"
v "github.com/prysmaticlabs/prysm/beacon-chain/core/validators"
"github.com/prysmaticlabs/prysm/beacon-chain/state"
"github.com/prysmaticlabs/prysm/config/params"
types "github.com/prysmaticlabs/prysm/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/consensus-types/wrapper"
"github.com/prysmaticlabs/prysm/encoding/bytesutil"
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/time/slots"
"go.opencensus.io/trace"
)
@@ -91,10 +93,23 @@ func (vs *Server) buildPhase0BlockData(ctx context.Context, req *ethpb.BlockRequ
if err != nil {
return nil, fmt.Errorf("could not retrieve head root: %v", err)
}
var head state.BeaconState
head, err := vs.HeadFetcher.HeadState(ctx)
if err != nil {
return nil, fmt.Errorf("could not get head state %v", err)
if slots.SinceEpochStarts(req.Slot) == 0 {
root, err := vs.ForkFetcher.ForkChoicer().AncestorRoot(ctx, bytesutil.ToBytes32(parentRoot), req.Slot-5)
if err != nil {
return nil, fmt.Errorf("could not retrieve head root: %v", err)
}
parentRoot = root[:]
head, err = vs.StateGen.StateByRoot(ctx, root)
if err != nil {
return nil, fmt.Errorf("could not get head state %v", err)
}
} else {
head, err = vs.HeadFetcher.HeadState(ctx)
if err != nil {
return nil, fmt.Errorf("could not get head state %v", err)
}
}
head, err = transition.ProcessSlotsUsingNextSlotCache(ctx, head, parentRoot, req.Slot)