Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caplin: fixed mem-leak #12733

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions cl/phase1/network/services/blob_sidecar_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"
"errors"
"fmt"
"sync"
"time"

"github.com/Giulio2002/bls"
Expand All @@ -47,8 +46,8 @@ type blobSidecarService struct {
ethClock eth_clock.EthereumClock
emitters *beaconevents.EventEmitter

blobSidecarsScheduledForLaterExecution sync.Map
test bool
// blobSidecarsScheduledForLaterExecution sync.Map
test bool
}

type blobSidecarJob struct {
Expand Down Expand Up @@ -115,7 +114,7 @@ func (b *blobSidecarService) ProcessMessage(ctx context.Context, subnetId *uint6

parentHeader, has := b.forkchoiceStore.GetHeader(msg.SignedBlockHeader.Header.ParentRoot)
if !has {
b.scheduleBlobSidecarForLaterExecution(msg)
//b.scheduleBlobSidecarForLaterExecution(msg)
return ErrIgnore
}
if msg.SignedBlockHeader.Header.Slot <= parentHeader.Slot {
Expand Down Expand Up @@ -195,17 +194,17 @@ func (b *blobSidecarService) verifySidecarsSignature(header *cltypes.SignedBeaco
return nil
}

func (b *blobSidecarService) scheduleBlobSidecarForLaterExecution(blobSidecar *cltypes.BlobSidecar) {
blobSidecarJob := &blobSidecarJob{
blobSidecar: blobSidecar,
creationTime: time.Now(),
}
blobSidecarHash, err := blobSidecar.HashSSZ()
if err != nil {
return
}
b.blobSidecarsScheduledForLaterExecution.Store(blobSidecarHash, blobSidecarJob)
}
// func (b *blobSidecarService) scheduleBlobSidecarForLaterExecution(blobSidecar *cltypes.BlobSidecar) {
// blobSidecarJob := &blobSidecarJob{
// blobSidecar: blobSidecar,
// creationTime: time.Now(),
// }
// blobSidecarHash, err := blobSidecar.HashSSZ()
// if err != nil {
// return
// }
// b.blobSidecarsScheduledForLaterExecution.Store(blobSidecarHash, blobSidecarJob)
// }

// // loop is the main loop of the block service
// func (b *blobSidecarService) loop(ctx context.Context) {
Expand Down
Loading