Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 6 additions & 3 deletions beacon-chain/blockchain/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,12 @@ type blobNotifier struct {
// NewService instantiates a new block service instance that will
// be registered into a running beacon node.
func NewService(ctx context.Context, opts ...Option) (*Service, error) {
err := kzg.Start()
if err != nil {
return nil, errors.Wrap(err, "could not initialize go-kzg context")
var err error
if params.DenebEnabled() {
err = kzg.Start()
if err != nil {
return nil, errors.Wrap(err, "could not initialize go-kzg context")
}
}
ctx, cancel := context.WithCancel(ctx)
bn := &blobNotifier{
Expand Down
8 changes: 8 additions & 0 deletions config/params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package params

import (
"math"
"time"

"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -275,3 +276,10 @@ func (b *BeaconChainConfig) PreviousEpochAttestationsLength() uint64 {
func (b *BeaconChainConfig) CurrentEpochAttestationsLength() uint64 {
return uint64(b.SlotsPerEpoch.Mul(b.MaxAttestations))
}

// DenebEnabled centralizes the check to determine if code paths
// that are specific to deneb should be allowed to execute. This will make it easier to find call sites that do this
// kind of check and remove them post-deneb.
func DenebEnabled() bool {
return BeaconConfig().DenebForkEpoch < math.MaxUint64
}