mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
blsync: use new payload v2
This commit is contained in:
parent
838f96b332
commit
46a154eb74
2 changed files with 3 additions and 3 deletions
|
|
@ -291,7 +291,7 @@ func (s *engineApiUpdater) Process(env *request.Environment) {
|
|||
} else {
|
||||
s.updating = true
|
||||
go func() {
|
||||
if status, err := callNewPayloadV1(s.client, execBlock); err == nil {
|
||||
if status, err := callNewPayloadV2(s.client, execBlock); err == nil {
|
||||
log.Info("Successful NewPayload", "block number", execBlock.NumberU64(), "block hash", execRoot, "status", status)
|
||||
} else {
|
||||
log.Error("Failed NewPayload", "block number", execBlock.NumberU64(), "block hash", execRoot, "error", err)
|
||||
|
|
|
|||
|
|
@ -149,10 +149,10 @@ func blsync(ctx *cli.Context) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func callNewPayloadV1(client *rpc.Client, block *ctypes.Block) (string, error) {
|
||||
func callNewPayloadV2(client *rpc.Client, block *ctypes.Block) (string, error) {
|
||||
var resp engine.PayloadStatusV1
|
||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
|
||||
err := client.CallContext(ctx, &resp, "engine_newPayloadV1", *engine.BlockToExecutableData(block, nil).ExecutionPayload)
|
||||
err := client.CallContext(ctx, &resp, "engine_newPayloadV2", *engine.BlockToExecutableData(block, nil).ExecutionPayload)
|
||||
cancel()
|
||||
return resp.Status, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue