Skip to content

Commit

Permalink
Merge branch 'beacon-endpoints' into genesis-time
Browse files Browse the repository at this point in the history
  • Loading branch information
nidhi-singh02 authored Sep 25, 2024
2 parents d0d1df9 + a6d612b commit d8daecd
Show file tree
Hide file tree
Showing 62 changed files with 1,459 additions and 243 deletions.
2 changes: 1 addition & 1 deletion beacond/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ require (
github.com/berachain/beacon-kit/mod/beacon v0.0.0-20240821052951-c15422305b4e
github.com/berachain/beacon-kit/mod/cli v0.0.0-20240822173558-4e2a8018ae21
github.com/berachain/beacon-kit/mod/consensus v0.0.0-20240821053614-036c5d2945f0
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240906211613-74eea7007e70
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240904192942-99aeabe6bb1f
github.com/berachain/beacon-kit/mod/da v0.0.0-20240820191615-398849c34954
github.com/berachain/beacon-kit/mod/engine-primitives v0.0.0-20240809202957-3e3f169ad720
github.com/berachain/beacon-kit/mod/execution v0.0.0-20240820191615-398849c34954
Expand Down
4 changes: 2 additions & 2 deletions beacond/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ github.com/berachain/beacon-kit/mod/async v0.0.0-20240821213929-f32b8e2dc5c8 h1:
github.com/berachain/beacon-kit/mod/async v0.0.0-20240821213929-f32b8e2dc5c8/go.mod h1:3wR01SglBZ+HvDvhbugz/Mxem22JUThJRwo2Ec8Q0No=
github.com/berachain/beacon-kit/mod/chain-spec v0.0.0-20240705193247-d464364483df h1:mnD1LKqDQ0n+OFdDqOuvKaEiUKRJzsO4V0wyyn/gJYg=
github.com/berachain/beacon-kit/mod/chain-spec v0.0.0-20240705193247-d464364483df/go.mod h1:bTFB4Rdvm7D/WdwPYkqQ+8T0XOMBv0pzXfp1E46BFX8=
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240906211613-74eea7007e70 h1:7L4ZYbwQiyS6qjcjfFcf5+gHzWeAiycNE94PcAQBTlo=
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240906211613-74eea7007e70/go.mod h1:cZd8cFZ+ylhh3/NUbrdXO2ri1/7KOaYBjo1B8MgbgMM=
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240904192942-99aeabe6bb1f h1:Vzglhdv60M7LBS3FBuqK0eUX8vYJBJnL/RwYpxUswpo=
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240904192942-99aeabe6bb1f/go.mod h1:cZd8cFZ+ylhh3/NUbrdXO2ri1/7KOaYBjo1B8MgbgMM=
github.com/berachain/beacon-kit/mod/engine-primitives v0.0.0-20240809202957-3e3f169ad720 h1:rVltwwt4JAhpvqeRDZ8J07e9XM+jzfDCJEghPA4r5lg=
github.com/berachain/beacon-kit/mod/engine-primitives v0.0.0-20240809202957-3e3f169ad720/go.mod h1:kGxAesqTkt75+QYQ73O9I5PqAicSL9JGh5wypiWgb8I=
github.com/berachain/beacon-kit/mod/errors v0.0.0-20240806211103-d1105603bfc0 h1:kCSrkb/uVXfMKJPKjf0c7nlJkwn5cNwMxtzRW4zNq2A=
Expand Down
2 changes: 0 additions & 2 deletions examples/berad/pkg/consensus-types/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,5 +243,3 @@ func (v *Validator) GetActivationEpoch() math.Epoch {
func (v *Validator) GetExitEpoch() math.Epoch {
return v.ExitEpoch
}

//
8 changes: 6 additions & 2 deletions examples/berad/pkg/state-transition/state_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ type StateProcessor[
ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT,
],
ExecutionPayloadHeaderT ExecutionPayloadHeader,
ForkT Fork[ForkT],
ForkT interface {
New(common.Version, common.Version, math.Epoch) ForkT
},
ForkDataT ForkData[ForkDataT],
KVStoreT any,
ValidatorT Validator[ValidatorT, WithdrawalCredentialsT],
Expand Down Expand Up @@ -107,7 +109,9 @@ func NewStateProcessor[
ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT,
],
ExecutionPayloadHeaderT ExecutionPayloadHeader,
ForkT Fork[ForkT],
ForkT interface {
New(common.Version, common.Version, math.Epoch) ForkT
},
ForkDataT ForkData[ForkDataT],
KVStoreT any,
ValidatorT Validator[ValidatorT, WithdrawalCredentialsT],
Expand Down
8 changes: 0 additions & 8 deletions examples/berad/pkg/state-transition/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,3 @@ type Withdrawal[WithdrawalT any] interface {
// GetAddress returns the address of the withdrawal.
GetAddress() common.ExecutionAddress
}

// Fork is the interface for a fork.
type Fork[ForkT any] interface {
New(common.Version, common.Version, math.Epoch) ForkT
GetPreviousVersion() common.Version
GetCurrentVersion() common.Version
GetEpoch() math.Epoch
}
2 changes: 1 addition & 1 deletion mod/cli/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (
cosmossdk.io/log v1.4.1
github.com/berachain/beacon-kit/mod/config v0.0.0-20240705193247-d464364483df
github.com/berachain/beacon-kit/mod/consensus v0.0.0-20240821053614-036c5d2945f0
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240906211613-74eea7007e70
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240904192942-99aeabe6bb1f
github.com/berachain/beacon-kit/mod/engine-primitives v0.0.0-20240809202957-3e3f169ad720
github.com/berachain/beacon-kit/mod/errors v0.0.0-20240806211103-d1105603bfc0
github.com/berachain/beacon-kit/mod/geth-primitives v0.0.0-20240806160829-cde2d1347e7e
Expand Down
4 changes: 2 additions & 2 deletions mod/cli/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ github.com/berachain/beacon-kit/mod/async v0.0.0-20240821213929-f32b8e2dc5c8 h1:
github.com/berachain/beacon-kit/mod/async v0.0.0-20240821213929-f32b8e2dc5c8/go.mod h1:3wR01SglBZ+HvDvhbugz/Mxem22JUThJRwo2Ec8Q0No=
github.com/berachain/beacon-kit/mod/chain-spec v0.0.0-20240705193247-d464364483df h1:mnD1LKqDQ0n+OFdDqOuvKaEiUKRJzsO4V0wyyn/gJYg=
github.com/berachain/beacon-kit/mod/chain-spec v0.0.0-20240705193247-d464364483df/go.mod h1:bTFB4Rdvm7D/WdwPYkqQ+8T0XOMBv0pzXfp1E46BFX8=
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240906211613-74eea7007e70 h1:7L4ZYbwQiyS6qjcjfFcf5+gHzWeAiycNE94PcAQBTlo=
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240906211613-74eea7007e70/go.mod h1:cZd8cFZ+ylhh3/NUbrdXO2ri1/7KOaYBjo1B8MgbgMM=
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240904192942-99aeabe6bb1f h1:Vzglhdv60M7LBS3FBuqK0eUX8vYJBJnL/RwYpxUswpo=
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240904192942-99aeabe6bb1f/go.mod h1:cZd8cFZ+ylhh3/NUbrdXO2ri1/7KOaYBjo1B8MgbgMM=
github.com/berachain/beacon-kit/mod/engine-primitives v0.0.0-20240809202957-3e3f169ad720 h1:rVltwwt4JAhpvqeRDZ8J07e9XM+jzfDCJEghPA4r5lg=
github.com/berachain/beacon-kit/mod/engine-primitives v0.0.0-20240809202957-3e3f169ad720/go.mod h1:kGxAesqTkt75+QYQ73O9I5PqAicSL9JGh5wypiWgb8I=
github.com/berachain/beacon-kit/mod/errors v0.0.0-20240806211103-d1105603bfc0 h1:kCSrkb/uVXfMKJPKjf0c7nlJkwn5cNwMxtzRW4zNq2A=
Expand Down
2 changes: 1 addition & 1 deletion mod/config/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ require (
github.com/VictoriaMetrics/fastcache v1.12.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/berachain/beacon-kit/mod/async v0.0.0-20240821213929-f32b8e2dc5c8 // indirect
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240906211613-74eea7007e70 // indirect
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240904192942-99aeabe6bb1f // indirect
github.com/berachain/beacon-kit/mod/engine-primitives v0.0.0-20240809202957-3e3f169ad720 // indirect
github.com/bits-and-blooms/bitset v1.13.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.3 // indirect
Expand Down
4 changes: 2 additions & 2 deletions mod/config/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ github.com/berachain/beacon-kit/mod/beacon v0.0.0-20240821052951-c15422305b4e h1
github.com/berachain/beacon-kit/mod/beacon v0.0.0-20240821052951-c15422305b4e/go.mod h1:hyB6jdTwCalJ6IMwCtYOXjXrqIg3T1QruIzs4NPrNkw=
github.com/berachain/beacon-kit/mod/chain-spec v0.0.0-20240705193247-d464364483df h1:mnD1LKqDQ0n+OFdDqOuvKaEiUKRJzsO4V0wyyn/gJYg=
github.com/berachain/beacon-kit/mod/chain-spec v0.0.0-20240705193247-d464364483df/go.mod h1:bTFB4Rdvm7D/WdwPYkqQ+8T0XOMBv0pzXfp1E46BFX8=
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240906211613-74eea7007e70 h1:7L4ZYbwQiyS6qjcjfFcf5+gHzWeAiycNE94PcAQBTlo=
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240906211613-74eea7007e70/go.mod h1:cZd8cFZ+ylhh3/NUbrdXO2ri1/7KOaYBjo1B8MgbgMM=
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240904192942-99aeabe6bb1f h1:Vzglhdv60M7LBS3FBuqK0eUX8vYJBJnL/RwYpxUswpo=
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240904192942-99aeabe6bb1f/go.mod h1:cZd8cFZ+ylhh3/NUbrdXO2ri1/7KOaYBjo1B8MgbgMM=
github.com/berachain/beacon-kit/mod/da v0.0.0-20240610210054-bfdc14c4013c h1:WKjF2xYQ3jwTNauJbs34bTzCgf49uHYy7/f+z1DfmyI=
github.com/berachain/beacon-kit/mod/da v0.0.0-20240610210054-bfdc14c4013c/go.mod h1:4hmlXJkl1cwCnZvEISy4K2x9Z7O3Pgtijz1HS/P/uY8=
github.com/berachain/beacon-kit/mod/engine-primitives v0.0.0-20240809202957-3e3f169ad720 h1:rVltwwt4JAhpvqeRDZ8J07e9XM+jzfDCJEghPA4r5lg=
Expand Down
2 changes: 1 addition & 1 deletion mod/consensus-types/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.23.0

require (
github.com/berachain/beacon-kit/mod/engine-primitives v0.0.0-20240808194557-e72e74f58197
github.com/berachain/beacon-kit/mod/errors v0.0.0-20240705193247-d464364483df
github.com/berachain/beacon-kit/mod/errors v0.0.0-20240806211103-d1105603bfc0
github.com/berachain/beacon-kit/mod/primitives v0.0.0-20240911165923-82f71ec86570
github.com/ferranbt/fastssz v0.1.4-0.20240629094022-eac385e6ee79
github.com/holiman/uint256 v1.3.1
Expand Down
4 changes: 2 additions & 2 deletions mod/consensus-types/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ github.com/berachain/beacon-kit/mod/chain-spec v0.0.0-20240705193247-d464364483d
github.com/berachain/beacon-kit/mod/chain-spec v0.0.0-20240705193247-d464364483df/go.mod h1:bTFB4Rdvm7D/WdwPYkqQ+8T0XOMBv0pzXfp1E46BFX8=
github.com/berachain/beacon-kit/mod/engine-primitives v0.0.0-20240808194557-e72e74f58197 h1:wVWkiiERY/7kaXvE/VNPPUtYp/l8ky6QSuKM3ThVMXU=
github.com/berachain/beacon-kit/mod/engine-primitives v0.0.0-20240808194557-e72e74f58197/go.mod h1:LiOiqrJhhLH/GPo0XE5fel3EYyi7X6dwBOyTqZakTeQ=
github.com/berachain/beacon-kit/mod/errors v0.0.0-20240705193247-d464364483df h1:6MJllcmMFt6dtvftM5zmdl1WVDpqZkNy3hFXVZtNV0s=
github.com/berachain/beacon-kit/mod/errors v0.0.0-20240705193247-d464364483df/go.mod h1:yRD7rmnyaaqgq/6+eIVqvSkFJXuLXpBddUu59HUOrtc=
github.com/berachain/beacon-kit/mod/errors v0.0.0-20240806211103-d1105603bfc0 h1:kCSrkb/uVXfMKJPKjf0c7nlJkwn5cNwMxtzRW4zNq2A=
github.com/berachain/beacon-kit/mod/errors v0.0.0-20240806211103-d1105603bfc0/go.mod h1:og0jtHZosPDTyhge9tMBlRItoZ4Iv3aZFM9n4QDpcdo=
github.com/berachain/beacon-kit/mod/geth-primitives v0.0.0-20240806160829-cde2d1347e7e h1:0/FDBXtagMkpta/f4J2uAah2NM1G+0dqxngzMzrmbw4=
github.com/berachain/beacon-kit/mod/geth-primitives v0.0.0-20240806160829-cde2d1347e7e/go.mod h1:7/SXz8S5VpFl2thcKuBdu1OId+SgI1o4N+S1FB92Zw8=
github.com/berachain/beacon-kit/mod/primitives v0.0.0-20240911165923-82f71ec86570 h1:w0Gkg31VQRFDv0EJjYgVtlpza7kSaJq7U28zxZjfZeE=
Expand Down
4 changes: 3 additions & 1 deletion mod/consensus-types/pkg/types/payload_header.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ type ExecutionPayloadHeader struct {

// Empty returns an empty ExecutionPayload for the given fork version.
func (h *ExecutionPayloadHeader) Empty() *ExecutionPayloadHeader {
return &ExecutionPayloadHeader{}
return &ExecutionPayloadHeader{
BaseFeePerGas: &uint256.Int{},
}
}

// NewFromSSZ returns a new ExecutionPayloadHeader from the given SSZ bytes.
Expand Down
12 changes: 8 additions & 4 deletions mod/consensus-types/pkg/types/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ func generateValidBeaconState() *types.BeaconState[
},
Validators: []*types.Validator{
{
Pubkey: [48]byte{0x01},
WithdrawalCredentials: [32]byte{0x02},
Pubkey: [48]byte{0x01},
WithdrawalCredentials: types.NewCredentialsFromExecutionAddress(
common.ExecutionAddress{0x02},
),
EffectiveBalance: 32000000000,
Slashed: false,
ActivationEligibilityEpoch: 1,
Expand All @@ -88,8 +90,10 @@ func generateValidBeaconState() *types.BeaconState[
WithdrawableEpoch: 18446744073709551615,
},
{
Pubkey: [48]byte{0x03},
WithdrawalCredentials: [32]byte{0x04},
Pubkey: [48]byte{0x03},
WithdrawalCredentials: types.NewCredentialsFromExecutionAddress(
common.ExecutionAddress{0x04},
),
EffectiveBalance: 31000000000,
Slashed: true,
ActivationEligibilityEpoch: 3,
Expand Down
32 changes: 16 additions & 16 deletions mod/consensus-types/pkg/types/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,28 +213,28 @@ func (v *Validator) GetTree() (*fastssz.Node, error) {
/* -------------------------------------------------------------------------- */

// GetPubkey returns the public key of the validator.
func (v Validator) GetPubkey() crypto.BLSPubkey {
func (v *Validator) GetPubkey() crypto.BLSPubkey {
return v.Pubkey
}

// GetEffectiveBalance returns the effective balance of the validator.
func (v Validator) GetEffectiveBalance() math.Gwei {
func (v *Validator) GetEffectiveBalance() math.Gwei {
return v.EffectiveBalance
}

// IsActive as defined in the Ethereum 2.0 Spec
// https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#is_active_validator
//
//nolint:lll
func (v Validator) IsActive(epoch math.Epoch) bool {
func (v *Validator) IsActive(epoch math.Epoch) bool {
return v.ActivationEpoch <= epoch && epoch < v.ExitEpoch
}

// IsEligibleForActivation as defined in the Ethereum 2.0 Spec
// https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#is_eligible_for_activation_queue
//
//nolint:lll
func (v Validator) IsEligibleForActivation(
func (v *Validator) IsEligibleForActivation(
finalizedEpoch math.Epoch,
) bool {
return v.ActivationEligibilityEpoch <= finalizedEpoch &&
Expand All @@ -245,7 +245,7 @@ func (v Validator) IsEligibleForActivation(
// https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#is_eligible_for_activation_queue
//
//nolint:lll
func (v Validator) IsEligibleForActivationQueue(
func (v *Validator) IsEligibleForActivationQueue(
maxEffectiveBalance math.Gwei,
) bool {
return v.ActivationEligibilityEpoch == math.Epoch(
Expand All @@ -258,21 +258,21 @@ func (v Validator) IsEligibleForActivationQueue(
// https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#is_slashable_validator
//
//nolint:lll
func (v Validator) IsSlashable(epoch math.Epoch) bool {
func (v *Validator) IsSlashable(epoch math.Epoch) bool {
return !v.Slashed && v.ActivationEpoch <= epoch &&
epoch < v.WithdrawableEpoch
}

// IsSlashed returns whether the validator has been slashed.
func (v Validator) IsSlashed() bool {
func (v *Validator) IsSlashed() bool {
return v.Slashed
}

// IsFullyWithdrawable as defined in the Ethereum 2.0 specification:
// https://github.com/ethereum/consensus-specs/blob/dev/specs/capella/beacon-chain.md#is_fully_withdrawable_validator
//
//nolint:lll
func (v Validator) IsFullyWithdrawable(
func (v *Validator) IsFullyWithdrawable(
balance math.Gwei,
epoch math.Epoch,
) bool {
Expand All @@ -284,7 +284,7 @@ func (v Validator) IsFullyWithdrawable(
// https://github.com/ethereum/consensus-specs/blob/dev/specs/capella/beacon-chain.md#is_partially_withdrawable_validator
//
//nolint:lll
func (v Validator) IsPartiallyWithdrawable(
func (v *Validator) IsPartiallyWithdrawable(
balance, maxEffectiveBalance math.Gwei,
) bool {
hasExcessBalance := balance > maxEffectiveBalance
Expand All @@ -296,13 +296,13 @@ func (v Validator) IsPartiallyWithdrawable(
// https://github.com/ethereum/consensus-specs/blob/dev/specs/capella/beacon-chain.md#has_eth1_withdrawal_credential
//
//nolint:lll
func (v Validator) HasEth1WithdrawalCredentials() bool {
func (v *Validator) HasEth1WithdrawalCredentials() bool {
return v.WithdrawalCredentials[0] == EthSecp256k1CredentialPrefix
}

// HasMaxEffectiveBalance determines if the validator has the maximum effective
// balance.
func (v Validator) HasMaxEffectiveBalance(
func (v *Validator) HasMaxEffectiveBalance(
maxEffectiveBalance math.Gwei,
) bool {
return v.EffectiveBalance == maxEffectiveBalance
Expand All @@ -314,27 +314,27 @@ func (v *Validator) SetEffectiveBalance(balance math.Gwei) {
}

// GetWithdrawableEpoch returns the epoch when the validator can withdraw.
func (v Validator) GetWithdrawableEpoch() math.Epoch {
func (v *Validator) GetWithdrawableEpoch() math.Epoch {
return v.WithdrawableEpoch
}

// GetWithdrawalCredentials returns the withdrawal credentials of the validator.
func (v Validator) GetWithdrawalCredentials() WithdrawalCredentials {
func (v *Validator) GetWithdrawalCredentials() WithdrawalCredentials {
return v.WithdrawalCredentials
}

// GetActivationEligibilityEpoch returns the activation eligibility
// epoch of the validator.
func (v Validator) GetActivationEligibilityEpoch() math.Epoch {
func (v *Validator) GetActivationEligibilityEpoch() math.Epoch {
return v.ActivationEligibilityEpoch
}

// GetActivationEpoch returns the activation epoch of the validator.
func (v Validator) GetActivationEpoch() math.Epoch {
func (v *Validator) GetActivationEpoch() math.Epoch {
return v.ActivationEpoch
}

// GetExitEpoch returns the exit epoch of the validator.
func (v Validator) GetExitEpoch() math.Epoch {
func (v *Validator) GetExitEpoch() math.Epoch {
return v.ExitEpoch
}
5 changes: 5 additions & 0 deletions mod/consensus-types/pkg/types/withdrawal_credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,8 @@ func (wc WithdrawalCredentials) MarshalText() ([]byte, error) {
func (wc *WithdrawalCredentials) UnmarshalText(text []byte) error {
return (*common.Bytes32)(wc).UnmarshalText(text)
}

// Bytes returns the raw byte representation of the withdrawal credentials.
func (wc WithdrawalCredentials) Bytes() []byte {
return wc[:]
}
2 changes: 1 addition & 1 deletion mod/consensus/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc
github.com/berachain/beacon-kit/mod/async v0.0.0-20240821213929-f32b8e2dc5c8
github.com/berachain/beacon-kit/mod/cli v0.0.0-00010101000000-000000000000
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240906211613-74eea7007e70
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240904192942-99aeabe6bb1f
github.com/berachain/beacon-kit/mod/errors v0.0.0-20240806211103-d1105603bfc0
github.com/berachain/beacon-kit/mod/log v0.0.0-20240821000339-4d4242ba4a50
github.com/berachain/beacon-kit/mod/primitives v0.0.0-20240911165923-82f71ec86570
Expand Down
4 changes: 2 additions & 2 deletions mod/consensus/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ github.com/berachain/beacon-kit/mod/async v0.0.0-20240821213929-f32b8e2dc5c8 h1:
github.com/berachain/beacon-kit/mod/async v0.0.0-20240821213929-f32b8e2dc5c8/go.mod h1:3wR01SglBZ+HvDvhbugz/Mxem22JUThJRwo2Ec8Q0No=
github.com/berachain/beacon-kit/mod/chain-spec v0.0.0-20240705193247-d464364483df h1:mnD1LKqDQ0n+OFdDqOuvKaEiUKRJzsO4V0wyyn/gJYg=
github.com/berachain/beacon-kit/mod/chain-spec v0.0.0-20240705193247-d464364483df/go.mod h1:bTFB4Rdvm7D/WdwPYkqQ+8T0XOMBv0pzXfp1E46BFX8=
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240906211613-74eea7007e70 h1:7L4ZYbwQiyS6qjcjfFcf5+gHzWeAiycNE94PcAQBTlo=
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240906211613-74eea7007e70/go.mod h1:cZd8cFZ+ylhh3/NUbrdXO2ri1/7KOaYBjo1B8MgbgMM=
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240904192942-99aeabe6bb1f h1:Vzglhdv60M7LBS3FBuqK0eUX8vYJBJnL/RwYpxUswpo=
github.com/berachain/beacon-kit/mod/consensus-types v0.0.0-20240904192942-99aeabe6bb1f/go.mod h1:cZd8cFZ+ylhh3/NUbrdXO2ri1/7KOaYBjo1B8MgbgMM=
github.com/berachain/beacon-kit/mod/engine-primitives v0.0.0-20240809202957-3e3f169ad720 h1:rVltwwt4JAhpvqeRDZ8J07e9XM+jzfDCJEghPA4r5lg=
github.com/berachain/beacon-kit/mod/engine-primitives v0.0.0-20240809202957-3e3f169ad720/go.mod h1:kGxAesqTkt75+QYQ73O9I5PqAicSL9JGh5wypiWgb8I=
github.com/berachain/beacon-kit/mod/errors v0.0.0-20240806211103-d1105603bfc0 h1:kCSrkb/uVXfMKJPKjf0c7nlJkwn5cNwMxtzRW4zNq2A=
Expand Down
8 changes: 4 additions & 4 deletions mod/node-api/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ type Backend[
StorageBackendT StorageBackend[
AvailabilityStoreT, BeaconStateT, BlockStoreT, DepositStoreT,
],
ValidatorT Validator,
ValidatorT Validator[WithdrawalCredentialsT],
ValidatorsT ~[]ValidatorT,
WithdrawalT Withdrawal[WithdrawalT],
WithdrawalCredentialsT any,
WithdrawalCredentialsT WithdrawalCredentials,
] struct {
sb StorageBackendT
cs common.ChainSpec
Expand Down Expand Up @@ -93,10 +93,10 @@ func New[
StorageBackendT StorageBackend[
AvailabilityStoreT, BeaconStateT, BlockStoreT, DepositStoreT,
],
ValidatorT Validator,
ValidatorT Validator[WithdrawalCredentialsT],
ValidatorsT ~[]ValidatorT,
WithdrawalT Withdrawal[WithdrawalT],
WithdrawalCredentialsT any,
WithdrawalCredentialsT WithdrawalCredentials,
](
storageBackend StorageBackendT,
cs common.ChainSpec,
Expand Down
5 changes: 2 additions & 3 deletions mod/node-api/backend/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/berachain/beacon-kit/mod/primitives/pkg/math"
)

// BlockHeaderAtSlot returns the block header at the given slot.
// BlockHeader returns the block header at the given slot.
func (b Backend[
_, _, _, BeaconBlockHeaderT, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
_,
Expand All @@ -42,7 +42,7 @@ func (b Backend[
return blockHeader, err
}

// BlockRootAtSlot returns the root of the block at the given stateID.
// GetBlockRoot returns the root of the block at the given stateID.
func (b Backend[
_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
]) BlockRootAtSlot(slot math.Slot) (common.Root, error) {
Expand All @@ -56,7 +56,6 @@ func (b Backend[
return st.GetBlockRootAtIndex(slot.Unwrap() % b.cs.SlotsPerHistoricalRoot())
}

// BlockRewardsAtSlot returns the block rewards at the given slot.
// TODO: Implement this.
func (b Backend[
_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
Expand Down
Loading

0 comments on commit d8daecd

Please sign in to comment.