Skip to content
This repository was archived by the owner on May 30, 2025. It is now read-only.
This repository was archived by the owner on May 30, 2025. It is now read-only.

[feature] modify execution api ExecuteTxs and SetFinal to include previous block hash and app hashes #25

@gupadhyaya

Description

@gupadhyaya

In the ExecuteTxs and SetFinal implementations we need to have access to previous block hash and app hash while making the engine_forkchoiceUpdatedV3 call (see: https://github.com/rollkit/go-execution-evm/blob/fix_execute_tx/execution.go#L215)

var forkchoiceResult engine.ForkChoiceResponse
	err := c.engineClient.CallContext(ctx, &forkchoiceResult, "engine_forkchoiceUpdatedV3",
		engine.ForkchoiceStateV1{
			HeadBlockHash:      c.prevBlockHash,
			SafeBlockHash:      c.prevBlockHash,
			FinalizedBlockHash: c.prevBlockHash,
		},
		&engine.PayloadAttributes{
			Timestamp:             uint64(timestamp.Unix()), 
			Random:                c.derivePrevRandao(height),
			SuggestedFeeRecipient: c.feeRecipient,
			Withdrawals:           []*types.Withdrawal{},
			BeaconRoot:            &c.genesisHash, // this is app hash
		},
	)

instead of persisting the previous block hash and using the genesis hash for beacon root, we can pass these parameters to ExecuteTxs and SetFinal calls. Note that, BeaconRoot is the consensus clients commitment, or in other words, it is the hash of the header.

the evm middleware (the go-execution-evm) not having to deal with persisting these will make it really robust and lightweight.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions