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 2f2c1c4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
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 2f2c1c4

Please sign in to comment.