Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
abi87 committed Oct 25, 2024
1 parent 08f00c2 commit 3ee634d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 25 deletions.
13 changes: 3 additions & 10 deletions mod/primitives/pkg/crypto/bls.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,9 @@ package crypto

import "github.com/berachain/beacon-kit/mod/primitives/pkg/bytes"

const (
// CometBLSType is the BLS curve type used in the Comet BFT consensus
// algorithm.
CometBLSType = "bls12_381"

// CometBLSPower is the voting power given to a validator when they
// are in the active set.
// TODO: Move this, it doesn't really belong here.
CometBLSPower = 1e10
)
// CometBLSType is the BLS curve type used in the Comet BFT consensus
// algorithm.
const CometBLSType = "bls12_381"

//nolint:lll // link.
type (
Expand Down
20 changes: 8 additions & 12 deletions mod/state-transition/pkg/core/state_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,29 +278,22 @@ func (sp *StateProcessor[
st BeaconStateT,
blk BeaconBlockT,
) error {
// process the freshly created header.
if err := sp.processBlockHeader(st, blk); err != nil {
if err := sp.processBlockHeader(ctx, st, blk); err != nil {
return err
}

// process the execution payload.
if err := sp.processExecutionPayload(ctx, st, blk); err != nil {
return err
}

// process the withdrawals.
if err := sp.processWithdrawals(st, blk.GetBody()); err != nil {
return err
}

// process the randao reveal.
if err := sp.processRandaoReveal(
st, blk, ctx.GetSkipValidateRandao(),
); err != nil {
if err := sp.processRandaoReveal(ctx, st, blk); err != nil {
return err
}

// process the deposits and ensure they match the local state.
if err := sp.processOperations(st, blk); err != nil {
return err
}
Expand Down Expand Up @@ -332,9 +325,11 @@ func (sp *StateProcessor[
) (transition.ValidatorUpdates, error) {
if err := sp.processRewardsAndPenalties(st); err != nil {
return nil, err
} else if err = sp.processSlashingsReset(st); err != nil {
}
if err := sp.processSlashingsReset(st); err != nil {
return nil, err
} else if err = sp.processRandaoMixesReset(st); err != nil {
}
if err := sp.processRandaoMixesReset(st); err != nil {
return nil, err
}
return sp.processSyncCommitteeUpdates(st)
Expand All @@ -344,8 +339,9 @@ func (sp *StateProcessor[
// state.
func (sp *StateProcessor[
BeaconBlockT, _, BeaconBlockHeaderT, BeaconStateT,
_, _, _, _, _, _, _, _, ValidatorT, _, _, _, _,
ContextT, _, _, _, _, _, _, _, ValidatorT, _, _, _, _,
]) processBlockHeader(
_ ContextT,
st BeaconStateT,
blk BeaconBlockT,
) error {
Expand Down
6 changes: 3 additions & 3 deletions mod/state-transition/pkg/core/state_processor_randao.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ import (
// ensures it matches the local state.
func (sp *StateProcessor[
BeaconBlockT, _, _, BeaconStateT,
_, _, _, _, _, _, ForkDataT, _, _, _, _, _, _,
ContextT, _, _, _, _, _, ForkDataT, _, _, _, _, _, _,
]) processRandaoReveal(
ctx ContextT,
st BeaconStateT,
blk BeaconBlockT,
skipVerification bool,
) error {
slot, err := st.GetSlot()
if err != nil {
Expand Down Expand Up @@ -65,7 +65,7 @@ func (sp *StateProcessor[
), genesisValidatorsRoot,
)

if !skipVerification {
if !ctx.GetSkipValidateRandao() {
signingRoot := fd.ComputeRandaoSigningRoot(
sp.cs.DomainTypeRandao(), epoch,
)
Expand Down

0 comments on commit 3ee634d

Please sign in to comment.