Skip to content

Commit

Permalink
Fix logrus imports and build
Browse files Browse the repository at this point in the history
  • Loading branch information
terencechain committed Jan 1, 2025
1 parent 5229ce9 commit 4db08d5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 31 deletions.
23 changes: 1 addition & 22 deletions beacon-chain/core/blocks/withdrawals.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func processWithdrawalStateTransition(
}
}
if st.Version() >= version.Electra {
if err := st.DequeuePartialWithdrawals(partialWithdrawalsCount); err != nil {
if err := st.DequeuePendingPartialWithdrawals(partialWithdrawalsCount); err != nil {
return fmt.Errorf("unable to dequeue partial withdrawals from state: %w", err)
}
}
Expand Down Expand Up @@ -261,27 +261,6 @@ func ProcessWithdrawals(st state.BeaconState, executionData interfaces.Execution
if err != nil {
return nil, errors.Wrap(err, "could not set withdrawals root")
}
}

if st.Version() >= version.Electra {
if err := st.DequeuePendingPartialWithdrawals(partialWithdrawalsCount); err != nil {
return nil, fmt.Errorf("unable to dequeue partial withdrawals from state: %w", err)
}
}

if len(expectedWithdrawals) > 0 {
if err := st.SetNextWithdrawalIndex(expectedWithdrawals[len(expectedWithdrawals)-1].Index + 1); err != nil {
return nil, errors.Wrap(err, "could not set next withdrawal index")
}
}
var nextValidatorIndex primitives.ValidatorIndex
if uint64(len(expectedWithdrawals)) < params.BeaconConfig().MaxWithdrawalsPerPayload {
nextValidatorIndex, err = st.NextWithdrawalValidatorIndex()
if err != nil {
return nil, errors.Wrap(err, "could not get next withdrawal validator index")
}
nextValidatorIndex += primitives.ValidatorIndex(params.BeaconConfig().MaxValidatorsPerWithdrawalsSweep)
nextValidatorIndex = nextValidatorIndex % primitives.ValidatorIndex(st.NumValidators())
} else {
if err := checkWithdrawalsAgainstPayload(executionData, len(expectedWithdrawals), expectedRoot); err != nil {
return nil, err
Expand Down
1 change: 1 addition & 0 deletions beacon-chain/state/state-native/beacon_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ type BeaconState struct {
latestExecutionPayloadHeader *enginev1.ExecutionPayloadHeader
latestExecutionPayloadHeaderCapella *enginev1.ExecutionPayloadHeaderCapella
latestExecutionPayloadHeaderDeneb *enginev1.ExecutionPayloadHeaderDeneb
latestExecutionPayloadHeaderEPBS *enginev1.ExecutionPayloadHeaderEPBS

// Capella fields
nextWithdrawalIndex uint64
Expand Down
6 changes: 3 additions & 3 deletions beacon-chain/verification/execution_payload_envelope.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v5/crypto/bls"
"github.com/prysmaticlabs/prysm/v5/time/slots"
log "github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
)

const (
Expand Down Expand Up @@ -149,8 +149,8 @@ func (v *EnvelopeVerifier) SatisfyRequirement(req Requirement) {
}

// envelopeLogFields returns log fields for a ROExecutionPayloadEnvelope instance.
func envelopeLogFields(e interfaces.ROExecutionPayloadEnvelope) log.Fields {
return log.Fields{
func envelopeLogFields(e interfaces.ROExecutionPayloadEnvelope) logrus.Fields {
return logrus.Fields{
"builderIndex": e.BuilderIndex(),
"beaconBlockRoot": fmt.Sprintf("%#x", e.BeaconBlockRoot()),
"PayloadWithheld": e.PayloadWithheld(),
Expand Down
6 changes: 3 additions & 3 deletions beacon-chain/verification/execution_payload_header.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces"
"github.com/prysmaticlabs/prysm/v5/time/slots"
log "github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
)

const (
Expand Down Expand Up @@ -190,8 +190,8 @@ func (v *HeaderVerifier) record(req Requirement, err *error) {
}

// headerLogFields returns log fields for a ROExecutionPayloadHeader instance.
func headerLogFields(h interfaces.ROExecutionPayloadHeaderEPBS) log.Fields {
return log.Fields{
func headerLogFields(h interfaces.ROExecutionPayloadHeaderEPBS) logrus.Fields {
return logrus.Fields{
"builderIndex": h.BuilderIndex(),
"blockHash": fmt.Sprintf("%#x", h.BlockHash()),
"parentBlockHash": fmt.Sprintf("%#x", h.ParentBlockHash()),
Expand Down
6 changes: 3 additions & 3 deletions beacon-chain/verification/payload_attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v5/crypto/bls"
"github.com/prysmaticlabs/prysm/v5/time/slots"
log "github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
)

// RequirementList defines a list of requirements.
Expand Down Expand Up @@ -214,8 +214,8 @@ func (v *PayloadAttMsgVerifier) record(req Requirement, err *error) {
}

// logFields returns log fields for a ROMessage instance.
func logFields(payload payloadattestation.ROMessage) log.Fields {
return log.Fields{
func logFields(payload payloadattestation.ROMessage) logrus.Fields {
return logrus.Fields{
"slot": payload.Slot(),
"validatorIndex": payload.ValidatorIndex(),
"signature": fmt.Sprintf("%#x", payload.Signature()),
Expand Down

0 comments on commit 4db08d5

Please sign in to comment.