Skip to content

Commit

Permalink
remove use of context.Background()
Browse files Browse the repository at this point in the history
  • Loading branch information
fridrik01 authored and abi87 committed Jan 19, 2025
1 parent 5dfa536 commit 04166e7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions da/blob/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
package blob

import (
"context"
"time"

"github.com/berachain/beacon-kit/chain"
Expand Down Expand Up @@ -66,6 +67,7 @@ func NewProcessor(

// VerifySidecars verifies the blobs and ensures they match the local state.
func (sp *Processor) VerifySidecars(
ctx context.Context,
sidecars datypes.BlobSidecars,
blkHeader *ctypes.BeaconBlockHeader,
kzgCommitments eip4844.KZGCommitments[common.ExecutionHash],
Expand All @@ -81,6 +83,7 @@ func (sp *Processor) VerifySidecars(

// Verify the blobs and ensure they match the local state.
return sp.verifier.verifySidecars(
ctx,
sidecars,
blkHeader,
kzgCommitments,
Expand Down
3 changes: 2 additions & 1 deletion da/blob/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func newVerifier(
// verifySidecars verifies the blobs for both inclusion as well
// as the KZG proofs.
func (bv *verifier) verifySidecars(
ctx context.Context,
sidecars datypes.BlobSidecars,
blkHeader *ctypes.BeaconBlockHeader,
kzgCommitments eip4844.KZGCommitments[common.ExecutionHash],
Expand All @@ -71,7 +72,7 @@ func (bv *verifier) verifySidecars(
bv.proofVerifier.GetImplementation(),
)

g, _ := errgroup.WithContext(context.Background())
g, _ := errgroup.WithContext(ctx)

// Create lookup table for each blob sidecar commitment.
blobSidecarCommitments := make(map[eip4844.KZGCommitment]struct{})
Expand Down
1 change: 1 addition & 0 deletions state-transition/core/core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ func setupState(t *testing.T, cs chain.Spec) (
)

ctx := &transition.Context{
Context: context.Background(),
SkipPayloadVerification: true,
SkipValidateResult: true,
ProposerAddress: dummyProposerAddr,
Expand Down
2 changes: 1 addition & 1 deletion state-transition/core/state_processor_payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (sp *StateProcessor[ContextT]) processExecutionPayload(
body = blk.GetBody()
payload = body.GetExecutionPayload()
header *ctypes.ExecutionPayloadHeader
g, gCtx = errgroup.WithContext(context.Background())
g, gCtx = errgroup.WithContext(ctx)
)

payloadTimestamp := payload.GetTimestamp().Unwrap()
Expand Down

0 comments on commit 04166e7

Please sign in to comment.