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

feat(abci): nil error #1572

Merged
merged 5 commits into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
bet
  • Loading branch information
itsdevbear committed Jun 23, 2024
commit 06bd557c144eecc7a4a91e4dae724f299c0d0f3d
6 changes: 3 additions & 3 deletions mod/beacon/blockchain/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (s *Service[
]) ProcessGenesisData(
ctx context.Context,
genesisData GenesisT,
) ([]*transition.ValidatorUpdate, error) {
) (transition.ValidatorUpdates, error) {
return s.sp.InitializePreminedBeaconStateFromEth1(
s.sb.StateFromContext(ctx),
genesisData.GetDeposits(),
Expand All @@ -74,7 +74,7 @@ func (s *Service[
]) ProcessBeaconBlock(
ctx context.Context,
blk BeaconBlockT,
) ([]*transition.ValidatorUpdate, error) {
) (transition.ValidatorUpdates, error) {
// If the block is nil, exit early.
if blk.IsNil() {
return nil, ErrNilBlk
Expand Down Expand Up @@ -133,7 +133,7 @@ func (s *Service[
ctx context.Context,
st BeaconStateT,
blk BeaconBlockT,
) ([]*transition.ValidatorUpdate, error) {
) (transition.ValidatorUpdates, error) {
startTime := time.Now()
defer s.metrics.measureStateTransitionDuration(startTime)
valUpdates, err := s.sp.Transition(
Expand Down
6 changes: 3 additions & 3 deletions mod/beacon/blockchain/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,17 @@ type StateProcessor[
[]DepositT,
ExecutionPayloadHeaderT,
common.Version,
) ([]*transition.ValidatorUpdate, error)
) (transition.ValidatorUpdates, error)
// ProcessSlots processes the state transition for a range of slots.
ProcessSlots(
BeaconStateT, math.Slot,
) ([]*transition.ValidatorUpdate, error)
) (transition.ValidatorUpdates, error)
// Transition processes the state transition for a given block.
Transition(
ContextT,
BeaconStateT,
BeaconBlockT,
) ([]*transition.ValidatorUpdate, error)
) (transition.ValidatorUpdates, error)
}

// StorageBackend defines an interface for accessing various storage components
Expand Down
4 changes: 2 additions & 2 deletions mod/beacon/validator/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,13 @@ type StateProcessor[
// ProcessSlot processes the slot.
ProcessSlots(
st BeaconStateT, slot math.Slot,
) ([]*transition.ValidatorUpdate, error)
) (transition.ValidatorUpdates, error)
// Transition performs the core state transition.
Transition(
ctx ContextT,
st BeaconStateT,
blk BeaconBlockT,
) ([]*transition.ValidatorUpdate, error)
) (transition.ValidatorUpdates, error)
}

// StorageBackend is the interface for the storage backend.
Expand Down
6 changes: 3 additions & 3 deletions mod/da/pkg/da/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,17 @@ type StateProcessor[
[]DepositT,
ExecutionPayloadHeaderT,
common.Version,
) ([]*transition.ValidatorUpdate, error)
) (transition.ValidatorUpdates, error)
// ProcessSlots processes the state transition for a range of slots.
ProcessSlots(
BeaconStateT, math.Slot,
) ([]*transition.ValidatorUpdate, error)
) (transition.ValidatorUpdates, error)
// Transition processes the state transition for a given block.
Transition(
ContextT,
BeaconStateT,
BeaconBlockT,
) ([]*transition.ValidatorUpdate, error)
) (transition.ValidatorUpdates, error)
}

// StorageBackend defines an interface for accessing various storage components
Expand Down
10 changes: 5 additions & 5 deletions mod/state-transition/pkg/core/state_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (sp *StateProcessor[
ctx ContextT,
st BeaconStateT,
blk BeaconBlockT,
) ([]*transition.ValidatorUpdate, error) {
) (transition.ValidatorUpdates, error) {
if blk.IsNil() {
return nil, nil
}
Expand Down Expand Up @@ -175,10 +175,10 @@ func (sp *StateProcessor[
ForkT, ForkDataT, ValidatorT, WithdrawalT, WithdrawalCredentialsT,
]) ProcessSlots(
st BeaconStateT, slot math.U64,
) ([]*transition.ValidatorUpdate, error) {
) (transition.ValidatorUpdates, error) {
var (
validatorUpdates []*transition.ValidatorUpdate
epochValidatorUpdates []*transition.ValidatorUpdate
validatorUpdates transition.ValidatorUpdates
epochValidatorUpdates transition.ValidatorUpdates
)

stateSlot, err := st.GetSlot()
Expand Down Expand Up @@ -354,7 +354,7 @@ func (sp *StateProcessor[
ForkT, ForkDataT, ValidatorT, WithdrawalT, WithdrawalCredentialsT,
]) processEpoch(
st BeaconStateT,
) ([]*transition.ValidatorUpdate, error) {
) (transition.ValidatorUpdates, error) {
if err := sp.processRewardsAndPenalties(st); err != nil {
return nil, err
} else if err = sp.processSlashingsReset(st); err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (sp *StateProcessor[
ForkT, ForkDataT, ValidatorT, WithdrawalT, WithdrawalCredentialsT,
]) processSyncCommitteeUpdates(
st BeaconStateT,
) ([]*transition.ValidatorUpdate, error) {
) (transition.ValidatorUpdates, error) {
vals, err := st.GetValidatorsByEffectiveBalance()
if err != nil {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions mod/state-transition/pkg/core/state_processor_genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (sp *StateProcessor[
deposits []DepositT,
executionPayloadHeader ExecutionPayloadHeaderT,
genesisVersion common.Version,
) ([]*transition.ValidatorUpdate, error) {
) (transition.ValidatorUpdates, error) {
var (
blkHeader BeaconBlockHeaderT
blkBody BeaconBlockBodyT
Expand Down Expand Up @@ -156,7 +156,7 @@ func (sp *StateProcessor[
return nil, err
}

var updates []*transition.ValidatorUpdate
var updates transition.ValidatorUpdates
updates, err = sp.processSyncCommitteeUpdates(st)
if err != nil {
return nil, err
Expand Down
Loading