blsync: use new payload v2

This commit is contained in:
lightclient 2023-10-31 16:51:15 -06:00
parent 838f96b332
commit 46a154eb74
No known key found for this signature in database
GPG key ID: 75C916AFEE20183E
2 changed files with 3 additions and 3 deletions

View file

@ -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)

View file

@ -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
}