good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 1a811f0a authored by Giulio Rebuffo's avatar Giulio Rebuffo Committed by GitHub
Browse files

added latest valid hash (#4188)

parent ec08a284
No related branches found
No related tags found
No related merge requests found
......@@ -461,9 +461,12 @@ func (s *EthBackendServer) EngineForkChoiceUpdatedV1(ctx context.Context, req *r
// MUST NOT begin a payload build process if forkchoiceState.headBlockHash doesn't reference a leaf of the block tree
// (i.e. it references an old block).
// https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.6/src/engine/specification.md#specification-1
if rawdb.ReadHeadBlockHash(tx1) == forkChoice.HeadBlockHash && req.PayloadAttributes == nil {
headHash := rawdb.ReadHeadBlockHash(tx1)
if headHash == forkChoice.HeadBlockHash && req.PayloadAttributes == nil {
return &remote.EngineForkChoiceUpdatedReply{
PayloadStatus: &remote.EnginePayloadStatus{Status: remote.EngineStatus_VALID},
PayloadStatus: &remote.EnginePayloadStatus{Status: remote.EngineStatus_VALID,
LatestValidHash: gointerfaces.ConvertHashToH256(headHash),
},
}, nil
}
tx1.Rollback()
......@@ -503,7 +506,6 @@ func (s *EthBackendServer) EngineForkChoiceUpdatedV1(ctx context.Context, req *r
if err != nil {
return nil, err
}
headHash := rawdb.ReadHeadBlockHash(tx2)
headNumber := rawdb.ReadHeaderNumber(tx2, headHash)
headHeader := rawdb.ReadHeader(tx2, headHash, *headNumber)
tx2.Rollback()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment