Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix comments #9958

Merged
merged 2 commits into from
Apr 25, 2024
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
17 changes: 11 additions & 6 deletions cl/phase1/core/state/accessors.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ func FinalityDelay(b abstract.BeaconState) uint64 {
return PreviousEpoch(b) - b.FinalizedCheckpoint().Epoch()
}

// Implementation of is_in_inactivity_leak. tells us if network is in danger pretty much. defined in ETH 2.0 specs.
// InactivityLeaking returns whether epochs are in inactivity penalty.
// Implementation of is_in_inactivity_leak as defined in the ETH 2.0 specs.
func InactivityLeaking(b abstract.BeaconState) bool {
return FinalityDelay(b) > b.BeaconConfig().MinEpochsToInactivityPenalty
}
Expand Down Expand Up @@ -147,7 +148,7 @@ func IsValidIndexedAttestation(b abstract.BeaconStateBasic, att *cltypes.Indexed
return true, nil
}

// getUnslashedParticipatingIndices returns set of currently unslashed participating indexes
// GetUnslashedParticipatingIndices returns set of currently unslashed participating indexes.
func GetUnslashedParticipatingIndices(b abstract.BeaconState, flagIndex int, epoch uint64) (validatorSet []uint64, err error) {
var participation *solid.BitList
// Must be either previous or current epoch
Expand All @@ -172,24 +173,28 @@ func GetUnslashedParticipatingIndices(b abstract.BeaconState, flagIndex int, epo
return
}

// Implementation of is_eligible_for_activation_queue. Specs at: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#is_eligible_for_activation_queue
// IsValidatorEligibleForActivationQueue returns whether the validator is eligible to be placed into the activation queue.
// Implementation of is_eligible_for_activation_queue.
// Specs at: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#is_eligible_for_activation_queue
func IsValidatorEligibleForActivationQueue(b abstract.BeaconState, validator solid.Validator) bool {
return validator.ActivationEligibilityEpoch() == b.BeaconConfig().FarFutureEpoch &&
validator.EffectiveBalance() == b.BeaconConfig().MaxEffectiveBalance
}

// Implementation of is_eligible_for_activation. Specs at: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#is_eligible_for_activation
// IsValidatorEligibleForActivation returns whether the validator is eligible for activation.
// Implementation of is_eligible_for_activation.
// Specs at: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#is_eligible_for_activation
func IsValidatorEligibleForActivation(b abstract.BeaconState, validator solid.Validator) bool {
return validator.ActivationEligibilityEpoch() <= b.FinalizedCheckpoint().Epoch() &&
validator.ActivationEpoch() == b.BeaconConfig().FarFutureEpoch
}

// Check whether a merge transition is complete by verifying the presence of a valid execution payload header.
// IsMergeTransitionComplete returns whether a merge transition is complete by verifying the presence of a valid execution payload header.
func IsMergeTransitionComplete(b abstract.BeaconState) bool {
return !b.LatestExecutionPayloadHeader().IsZero()
}

// Compute the Unix timestamp at the specified slot number.
// ComputeTimestampAtSlot computes the Unix timestamp at the specified slot number.
func ComputeTimestampAtSlot(b abstract.BeaconState, slot uint64) uint64 {
return b.GenesisTime() + (slot-b.BeaconConfig().GenesisSlot)*b.BeaconConfig().SecondsPerSlot
}
Expand Down
2 changes: 1 addition & 1 deletion eth/tracers/logger/access_list_tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func (a *AccessListTracer) AccessList() types2.AccessList {
return a.list.accessList()
}

// AccessList returns the current accesslist maintained by the tracer.
// AccessListSorted returns the current accesslist maintained by the tracer.
func (a *AccessListTracer) AccessListSorted() types2.AccessList {
return a.list.accessListSorted()
}
Expand Down
Loading