Compare commits

...

2 Commits

Author SHA1 Message Date
terence tsao
214b17e3b8 Test 2024-03-15 21:55:42 -10:00
terence tsao
bbb4bc1d2c New gossip cache size
Increase seen aggregate cache size to 4096
2024-03-15 20:19:56 -10:00
3 changed files with 7 additions and 46 deletions

View File

@@ -343,35 +343,7 @@ func (s *Service) ForkChoicer() f.ForkChoicer {
// IsOptimistic returns true if the current head is optimistic.
func (s *Service) IsOptimistic(_ context.Context) (bool, error) {
if slots.ToEpoch(s.CurrentSlot()) < params.BeaconConfig().BellatrixForkEpoch {
return false, nil
}
s.headLock.RLock()
if s.head == nil {
s.headLock.RUnlock()
return false, ErrNilHead
}
headRoot := s.head.root
headSlot := s.head.slot
headOptimistic := s.head.optimistic
s.headLock.RUnlock()
// we trust the head package for recent head slots, otherwise fallback to forkchoice
if headSlot+2 >= s.CurrentSlot() {
return headOptimistic, nil
}
s.cfg.ForkChoiceStore.RLock()
defer s.cfg.ForkChoiceStore.RUnlock()
optimistic, err := s.cfg.ForkChoiceStore.IsOptimistic(headRoot)
if err == nil {
return optimistic, nil
}
if !errors.Is(err, doublylinkedtree.ErrNilNode) {
return true, err
}
// If fockchoice does not have the headroot, then the node is considered
// optimistic
return true, nil
return false, nil
}
// IsFinalized returns true if the input root is finalized.

View File

@@ -224,25 +224,14 @@ func (vs *Server) BuildBlockParallel(ctx context.Context, sBlk interfaces.Signed
vs.setBlsToExecData(sBlk, head)
}()
localPayload, overrideBuilder, err := vs.getLocalPayload(ctx, sBlk.Block(), head)
builderPayload, builderKzgCommitments, err := vs.getBuilderPayloadAndBlobs(ctx, sBlk.Block().Slot(), sBlk.Block().ProposerIndex())
if err != nil {
return status.Errorf(codes.Internal, "Could not get local payload: %v", err)
builderGetPayloadMissCount.Inc()
log.WithError(err).Error("Could not get builder payload")
}
// There's no reason to try to get a builder bid if local override is true.
var builderPayload interfaces.ExecutionData
var builderKzgCommitments [][]byte
overrideBuilder = overrideBuilder || skipMevBoost // Skip using mev-boost if requested by the caller.
if !overrideBuilder {
builderPayload, builderKzgCommitments, err = vs.getBuilderPayloadAndBlobs(ctx, sBlk.Block().Slot(), sBlk.Block().ProposerIndex())
if err != nil {
builderGetPayloadMissCount.Inc()
log.WithError(err).Error("Could not get builder payload")
}
}
if err := setExecutionData(ctx, sBlk, localPayload, builderPayload, builderKzgCommitments, builderBoostFactor); err != nil {
return status.Errorf(codes.Internal, "Could not set execution data: %v", err)
if err := setBuilderExecution(sBlk, builderPayload, builderKzgCommitments); err != nil {
return errors.Wrap(err, "could not set builder execution")
}
wg.Wait() // Wait until block is built via consensus and execution fields.

View File

@@ -53,7 +53,7 @@ const rangeLimit uint64 = 1024
const seenBlockSize = 1000
const seenBlobSize = seenBlockSize * 4 // Each block can have max 4 blobs. Worst case 164kB for cache.
const seenUnaggregatedAttSize = 20000
const seenAggregatedAttSize = 1024
const seenAggregatedAttSize = 4096
const seenSyncMsgSize = 1000 // Maximum of 512 sync committee members, 1000 is a safe amount.
const seenSyncContributionSize = 512 // Maximum of SYNC_COMMITTEE_SIZE as specified by the spec.
const seenExitSize = 100