mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 08:49:29 +00:00
cmd/evm: add initial forkchoice update to genesis in enginetest
This commit is contained in:
parent
d46370adff
commit
1063416707
1 changed files with 14 additions and 0 deletions
|
|
@ -204,7 +204,21 @@ func (t *EngineTest) Run(scheme string, tracer *tracing.Hooks, postCheck func(er
|
|||
}
|
||||
|
||||
// Create engine handler and execute payloads
|
||||
// Uses the same core functions as ConsensusAPI (ExecutableDataToBlock,
|
||||
// InsertBlockWithoutSetHead, SetCanonical) — different from blocktest's InsertChain.
|
||||
handler := newEngineHandler(chain)
|
||||
|
||||
// Send initial forkchoiceUpdated to genesis (matching consume engine behavior)
|
||||
genesisHash := chain.Genesis().Hash()
|
||||
initialFcResp := handler.forkchoiceUpdated(engine.ForkchoiceStateV1{
|
||||
HeadBlockHash: genesisHash,
|
||||
SafeBlockHash: genesisHash,
|
||||
FinalizedBlockHash: genesisHash,
|
||||
})
|
||||
if initialFcResp.PayloadStatus.Status != engine.VALID {
|
||||
return fmt.Errorf("initial FCU to genesis returned %s", initialFcResp.PayloadStatus.Status)
|
||||
}
|
||||
|
||||
for i, payload := range t.json.Payloads {
|
||||
status, err := handler.newPayloadVersioned(payload)
|
||||
// Check error code expectation
|
||||
|
|
|
|||
Loading…
Reference in a new issue