Skip to content

Commit

Permalink
eth/catalyst: disable full payload when not in dev mode (ethereum#27921)
Browse files Browse the repository at this point in the history
eth/catalyst: only enable full payload in dev mode
  • Loading branch information
rjl493456442 authored and devopsbo3 committed Nov 10, 2023
1 parent 2aa9c9c commit 1e72cdb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions eth/catalyst/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ func (api *ConsensusAPI) ExchangeTransitionConfigurationV1(config engine.Transit

// GetPayloadV1 returns a cached payload by id.
func (api *ConsensusAPI) GetPayloadV1(payloadID engine.PayloadID) (*engine.ExecutableData, error) {
data, err := api.getPayload(payloadID)
data, err := api.getPayload(payloadID, false)
if err != nil {
return nil, err
}
Expand All @@ -404,17 +404,17 @@ func (api *ConsensusAPI) GetPayloadV1(payloadID engine.PayloadID) (*engine.Execu

// GetPayloadV2 returns a cached payload by id.
func (api *ConsensusAPI) GetPayloadV2(payloadID engine.PayloadID) (*engine.ExecutionPayloadEnvelope, error) {
return api.getPayload(payloadID)
return api.getPayload(payloadID, false)
}

// GetPayloadV3 returns a cached payload by id.
func (api *ConsensusAPI) GetPayloadV3(payloadID engine.PayloadID) (*engine.ExecutionPayloadEnvelope, error) {
return api.getPayload(payloadID)
return api.getPayload(payloadID, false)
}

func (api *ConsensusAPI) getPayload(payloadID engine.PayloadID) (*engine.ExecutionPayloadEnvelope, error) {
func (api *ConsensusAPI) getPayload(payloadID engine.PayloadID, full bool) (*engine.ExecutionPayloadEnvelope, error) {
log.Trace("Engine API request received", "method", "GetPayload", "id", payloadID)
data := api.localBlocks.get(payloadID, true)
data := api.localBlocks.get(payloadID, full)
if data == nil {
return nil, engine.UnknownPayload
}
Expand Down
2 changes: 1 addition & 1 deletion eth/catalyst/simulated_beacon.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func (c *SimulatedBeacon) sealBlock(withdrawals []*types.Withdrawal) error {
return fmt.Errorf("error calling forkchoice update: %v", err)
}

envelope, err := c.engineAPI.getPayload(*fcResponse.PayloadID)
envelope, err := c.engineAPI.getPayload(*fcResponse.PayloadID, true)
if err != nil {
return fmt.Errorf("error retrieving payload: %v", err)
}
Expand Down

0 comments on commit 1e72cdb

Please sign in to comment.