mirror of https://github.com/hyperledger/besu
Fcu verify payload attributes (#3837)
* check that the timestamp in fcu payload attributes is greater than the one of the head block Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>pull/3965/head
parent
c3a222a725
commit
81f25e15f9
@ -0,0 +1,28 @@ |
||||
{ |
||||
"request": { |
||||
"jsonrpc": "2.0", |
||||
"method": "engine_forkchoiceUpdatedV1", |
||||
"params": [ |
||||
{ |
||||
"headBlockHash": "0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858", |
||||
"safeBlockHash": "0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858", |
||||
"finalizedBlockHash": "0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a" |
||||
}, |
||||
{ |
||||
"timestamp": "0x0", |
||||
"prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", |
||||
"suggestedFeeRecipient": "0x0000000000000000000000000000000000000000" |
||||
} |
||||
], |
||||
"id": 67 |
||||
}, |
||||
"response": { |
||||
"jsonrpc": "2.0", |
||||
"id": 67, |
||||
"error": { |
||||
"code": -38003, |
||||
"message": "Invalid payload attributes" |
||||
} |
||||
}, |
||||
"statusCode": 200 |
||||
} |
@ -0,0 +1,44 @@ |
||||
/* |
||||
* Copyright Hyperledger Besu Contributors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on |
||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the |
||||
* specific language governing permissions and limitations under the License. |
||||
* |
||||
* SPDX-License-Identifier: Apache-2.0 |
||||
*/ |
||||
package org.hyperledger.besu.consensus.merge.blockcreation; |
||||
|
||||
import org.hyperledger.besu.datatypes.Address; |
||||
|
||||
import org.apache.tuweni.bytes.Bytes32; |
||||
|
||||
public class PayloadAttributes { |
||||
private final Long timestamp; |
||||
private final Bytes32 prevRandao; |
||||
private final Address suggestedFeeRecipient; |
||||
|
||||
public PayloadAttributes( |
||||
final Long timestamp, final Bytes32 prevRandao, final Address suggestedFeeRecipient) { |
||||
this.timestamp = timestamp; |
||||
this.prevRandao = prevRandao; |
||||
this.suggestedFeeRecipient = suggestedFeeRecipient; |
||||
} |
||||
|
||||
public Long getTimestamp() { |
||||
return timestamp; |
||||
} |
||||
|
||||
public Bytes32 getPrevRandao() { |
||||
return prevRandao; |
||||
} |
||||
|
||||
public Address getSuggestedFeeRecipient() { |
||||
return suggestedFeeRecipient; |
||||
} |
||||
} |
Loading…
Reference in new issue