mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 13:28:01 -05:00
Fix Engine Capabilites Check (#14924)
* Fix Capabilities Check * Changelog
This commit is contained in:
@@ -36,17 +36,19 @@ var (
|
||||
NewPayloadMethod,
|
||||
NewPayloadMethodV2,
|
||||
NewPayloadMethodV3,
|
||||
NewPayloadMethodV4,
|
||||
ForkchoiceUpdatedMethod,
|
||||
ForkchoiceUpdatedMethodV2,
|
||||
ForkchoiceUpdatedMethodV3,
|
||||
GetPayloadMethod,
|
||||
GetPayloadMethodV2,
|
||||
GetPayloadMethodV3,
|
||||
GetPayloadMethodV4,
|
||||
GetPayloadBodiesByHashV1,
|
||||
GetPayloadBodiesByRangeV1,
|
||||
}
|
||||
electraEngineEndpoints = []string{
|
||||
NewPayloadMethodV4,
|
||||
GetPayloadMethodV4,
|
||||
}
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -296,6 +298,10 @@ func (s *Service) ExchangeCapabilities(ctx context.Context) ([]string, error) {
|
||||
ctx, span := trace.StartSpan(ctx, "powchain.engine-api-client.ExchangeCapabilities")
|
||||
defer span.End()
|
||||
|
||||
// Only check for electra related engine methods if it has been activated.
|
||||
if params.ElectraEnabled() {
|
||||
supportedEngineEndpoints = append(supportedEngineEndpoints, electraEngineEndpoints...)
|
||||
}
|
||||
var result []string
|
||||
err := s.rpcClient.CallContext(ctx, &result, ExchangeCapabilities, supportedEngineEndpoints)
|
||||
if err != nil {
|
||||
|
||||
3
changelog/nisdas_fix_capabilites.md
Normal file
3
changelog/nisdas_fix_capabilites.md
Normal file
@@ -0,0 +1,3 @@
|
||||
### Fixed
|
||||
|
||||
- Only check for electra related engine methods if electra is active.
|
||||
@@ -426,6 +426,13 @@ func DenebEnabled() bool {
|
||||
return BeaconConfig().DenebForkEpoch < math.MaxUint64
|
||||
}
|
||||
|
||||
// ElectraEnabled centralizes the check to determine if code paths
|
||||
// that are specific to electra should be allowed to execute. This will make it easier to find call sites that do this
|
||||
// kind of check and remove them post-electra.
|
||||
func ElectraEnabled() bool {
|
||||
return BeaconConfig().ElectraForkEpoch < math.MaxUint64
|
||||
}
|
||||
|
||||
// PeerDASEnabled centralizes the check to determine if code paths
|
||||
// that are specific to peerdas should be allowed to execute.
|
||||
func PeerDASEnabled() bool {
|
||||
|
||||
Reference in New Issue
Block a user