|
|
@ -166,10 +166,10 @@ func NewConsensusAPI(eth *eth.Ethereum) *ConsensusAPI { |
|
|
|
func (api *ConsensusAPI) ForkchoiceUpdatedV1(update engine.ForkchoiceStateV1, payloadAttributes *engine.PayloadAttributes) (engine.ForkChoiceResponse, error) { |
|
|
|
func (api *ConsensusAPI) ForkchoiceUpdatedV1(update engine.ForkchoiceStateV1, payloadAttributes *engine.PayloadAttributes) (engine.ForkChoiceResponse, error) { |
|
|
|
if payloadAttributes != nil { |
|
|
|
if payloadAttributes != nil { |
|
|
|
if payloadAttributes.Withdrawals != nil { |
|
|
|
if payloadAttributes.Withdrawals != nil { |
|
|
|
return engine.STATUS_INVALID, engine.InvalidParams.With(fmt.Errorf("withdrawals not supported in V1")) |
|
|
|
return engine.STATUS_INVALID, engine.InvalidParams.With(errors.New("withdrawals not supported in V1")) |
|
|
|
} |
|
|
|
} |
|
|
|
if api.eth.BlockChain().Config().IsShanghai(api.eth.BlockChain().Config().LondonBlock, payloadAttributes.Timestamp) { |
|
|
|
if api.eth.BlockChain().Config().IsShanghai(api.eth.BlockChain().Config().LondonBlock, payloadAttributes.Timestamp) { |
|
|
|
return engine.STATUS_INVALID, engine.InvalidParams.With(fmt.Errorf("forkChoiceUpdateV1 called post-shanghai")) |
|
|
|
return engine.STATUS_INVALID, engine.InvalidParams.With(errors.New("forkChoiceUpdateV1 called post-shanghai")) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return api.forkchoiceUpdated(update, payloadAttributes) |
|
|
|
return api.forkchoiceUpdated(update, payloadAttributes) |
|
|
@ -386,7 +386,7 @@ func (api *ConsensusAPI) ExchangeTransitionConfigurationV1(config engine.Transit |
|
|
|
TerminalBlockNumber: config.TerminalBlockNumber, |
|
|
|
TerminalBlockNumber: config.TerminalBlockNumber, |
|
|
|
}, nil |
|
|
|
}, nil |
|
|
|
} |
|
|
|
} |
|
|
|
return nil, fmt.Errorf("invalid terminal block hash") |
|
|
|
return nil, errors.New("invalid terminal block hash") |
|
|
|
} |
|
|
|
} |
|
|
|
return &engine.TransitionConfigurationV1{TerminalTotalDifficulty: (*hexutil.Big)(ttd)}, nil |
|
|
|
return &engine.TransitionConfigurationV1{TerminalTotalDifficulty: (*hexutil.Big)(ttd)}, nil |
|
|
|
} |
|
|
|
} |
|
|
@ -417,7 +417,7 @@ func (api *ConsensusAPI) getPayload(payloadID engine.PayloadID) (*engine.Executi |
|
|
|
// NewPayloadV1 creates an Eth1 block, inserts it in the chain, and returns the status of the chain.
|
|
|
|
// NewPayloadV1 creates an Eth1 block, inserts it in the chain, and returns the status of the chain.
|
|
|
|
func (api *ConsensusAPI) NewPayloadV1(params engine.ExecutableData) (engine.PayloadStatusV1, error) { |
|
|
|
func (api *ConsensusAPI) NewPayloadV1(params engine.ExecutableData) (engine.PayloadStatusV1, error) { |
|
|
|
if params.Withdrawals != nil { |
|
|
|
if params.Withdrawals != nil { |
|
|
|
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(fmt.Errorf("withdrawals not supported in V1")) |
|
|
|
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(errors.New("withdrawals not supported in V1")) |
|
|
|
} |
|
|
|
} |
|
|
|
return api.newPayload(params) |
|
|
|
return api.newPayload(params) |
|
|
|
} |
|
|
|
} |
|
|
@ -426,10 +426,10 @@ func (api *ConsensusAPI) NewPayloadV1(params engine.ExecutableData) (engine.Payl |
|
|
|
func (api *ConsensusAPI) NewPayloadV2(params engine.ExecutableData) (engine.PayloadStatusV1, error) { |
|
|
|
func (api *ConsensusAPI) NewPayloadV2(params engine.ExecutableData) (engine.PayloadStatusV1, error) { |
|
|
|
if api.eth.BlockChain().Config().IsShanghai(new(big.Int).SetUint64(params.Number), params.Timestamp) { |
|
|
|
if api.eth.BlockChain().Config().IsShanghai(new(big.Int).SetUint64(params.Number), params.Timestamp) { |
|
|
|
if params.Withdrawals == nil { |
|
|
|
if params.Withdrawals == nil { |
|
|
|
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(fmt.Errorf("nil withdrawals post-shanghai")) |
|
|
|
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(errors.New("nil withdrawals post-shanghai")) |
|
|
|
} |
|
|
|
} |
|
|
|
} else if params.Withdrawals != nil { |
|
|
|
} else if params.Withdrawals != nil { |
|
|
|
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(fmt.Errorf("non-nil withdrawals pre-shanghai")) |
|
|
|
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(errors.New("non-nil withdrawals pre-shanghai")) |
|
|
|
} |
|
|
|
} |
|
|
|
return api.newPayload(params) |
|
|
|
return api.newPayload(params) |
|
|
|
} |
|
|
|
} |
|
|
|