Documentation
¶
Index ¶
- Variables
- func IsTTDReached(chain consensus.ChainHeaderReader, parentHash libcommon.Hash, number uint64) (bool, error)
- type Merge
- func (s *Merge) APIs(chain consensus.ChainHeaderReader) []rpc.API
- func (s *Merge) Author(header *types.Header) (libcommon.Address, error)
- func (s *Merge) CalcDifficulty(chain consensus.ChainHeaderReader, time, parentTime uint64, ...) *big.Int
- func (s *Merge) CalculateRewards(config *chain.Config, header *types.Header, uncles []*types.Header, ...) ([]consensus.Reward, error)
- func (s *Merge) Close() error
- func (s *Merge) Finalize(config *chain.Config, header *types.Header, state *state.IntraBlockState, ...) (types.Transactions, types.Receipts, types.FlatRequests, error)
- func (s *Merge) FinalizeAndAssemble(config *chain.Config, header *types.Header, state *state.IntraBlockState, ...) (*types.Block, types.Transactions, types.Receipts, types.FlatRequests, error)
- func (s *Merge) GetPostApplyMessageFunc() evmtypes.PostApplyMessageFunc
- func (s *Merge) GetTransferFunc() evmtypes.TransferFunc
- func (s *Merge) Initialize(config *chain.Config, chain consensus.ChainHeaderReader, header *types.Header, ...)
- func (s *Merge) InnerEngine() consensus.Engine
- func (s *Merge) IsServiceTransaction(sender libcommon.Address, syscall consensus.SystemCall) bool
- func (s *Merge) Prepare(chain consensus.ChainHeaderReader, header *types.Header, ...) error
- func (s *Merge) Seal(chain consensus.ChainHeaderReader, blockWithReceipts *types.BlockWithReceipts, ...) error
- func (s *Merge) SealHash(header *types.Header) (hash libcommon.Hash)
- func (s *Merge) Type() chain.ConsensusName
- func (s *Merge) VerifyHeader(chain consensus.ChainHeaderReader, header *types.Header, seal bool) error
- func (s *Merge) VerifyUncles(chain consensus.ChainReader, header *types.Header, uncles []*types.Header) error
Constants ¶
This section is empty.
Variables ¶
var ( ProofOfStakeDifficulty = libcommon.Big0 // PoS block's difficulty is always 0 ProofOfStakeNonce = types.BlockNonce{} // PoS block's have all-zero nonces )
Constants for The Merge as specified by EIP-3675: Upgrade consensus to Proof-of-Stake
Functions ¶
func IsTTDReached ¶
func IsTTDReached(chain consensus.ChainHeaderReader, parentHash libcommon.Hash, number uint64) (bool, error)
IsTTDReached checks if the TotalTerminalDifficulty has been surpassed on the `parentHash` block. It depends on the parentHash already being stored in the database. If the total difficulty is not stored in the database a ErrUnknownAncestorTD error is returned.
Types ¶
type Merge ¶
type Merge struct {
// contains filtered or unexported fields
}
Merge Consensus Engine for the Execution Layer. Merge is a consensus engine that combines the eth1 consensus and proof-of-stake algorithm. The transition rule is described in the eth1/2 merge spec: https://eips.ethereum.org/EIPS/eip-3675
Note: After the Merge the work is mostly done on the Consensus Layer, so nothing much is to be added on this side.
func (*Merge) Author ¶
Author implements consensus.Engine, returning the header's coinbase as the proof-of-stake verified author of the block. This is thread-safe (only access the header.Coinbase or the underlying engine's thread-safe method)
func (*Merge) CalcDifficulty ¶
func (*Merge) CalculateRewards ¶
func (*Merge) Finalize ¶
func (s *Merge) Finalize(config *chain.Config, header *types.Header, state *state.IntraBlockState, txs types.Transactions, uncles []*types.Header, receipts types.Receipts, withdrawals []*types.Withdrawal, chain consensus.ChainReader, syscall consensus.SystemCall, logger log.Logger, ) (types.Transactions, types.Receipts, types.FlatRequests, error)
func (*Merge) FinalizeAndAssemble ¶
func (s *Merge) FinalizeAndAssemble(config *chain.Config, header *types.Header, state *state.IntraBlockState, txs types.Transactions, uncles []*types.Header, receipts types.Receipts, withdrawals []*types.Withdrawal, chain consensus.ChainReader, syscall consensus.SystemCall, call consensus.Call, logger log.Logger, ) (*types.Block, types.Transactions, types.Receipts, types.FlatRequests, error)
func (*Merge) GetPostApplyMessageFunc ¶
func (s *Merge) GetPostApplyMessageFunc() evmtypes.PostApplyMessageFunc
func (*Merge) GetTransferFunc ¶
func (s *Merge) GetTransferFunc() evmtypes.TransferFunc
func (*Merge) Initialize ¶
func (s *Merge) Initialize(config *chain.Config, chain consensus.ChainHeaderReader, header *types.Header, state *state.IntraBlockState, syscall consensus.SysCallCustom, logger log.Logger, tracer *tracing.Hooks, )
func (*Merge) InnerEngine ¶
InnerEngine returns the embedded eth1 consensus engine.
func (*Merge) IsServiceTransaction ¶
func (*Merge) Prepare ¶
func (s *Merge) Prepare(chain consensus.ChainHeaderReader, header *types.Header, state *state.IntraBlockState) error
Prepare makes sure difficulty and nonce are correct
func (*Merge) Seal ¶
func (s *Merge) Seal(chain consensus.ChainHeaderReader, blockWithReceipts *types.BlockWithReceipts, results chan<- *types.BlockWithReceipts, stop <-chan struct{}) error
func (*Merge) Type ¶
func (s *Merge) Type() chain.ConsensusName
Type returns the type of the underlying consensus engine.
func (*Merge) VerifyHeader ¶
func (*Merge) VerifyUncles ¶
func (s *Merge) VerifyUncles(chain consensus.ChainReader, header *types.Header, uncles []*types.Header) error
VerifyUncles implements consensus.Engine, always returning an error for any uncles as this consensus mechanism doesn't permit uncles.