Documentation ¶
Index ¶
- Variables
- func CalcBaseFee(config *params.ChainConfig, parent *types.Header, timestamp uint64) ([]byte, *big.Int, error)
- func MinRequiredTip(config *params.ChainConfig, header *types.Header) (*big.Int, error)
- type ConsensusCallbacks
- type DummyEngine
- func (self *DummyEngine) APIs(chain consensus.ChainHeaderReader) (res []rpc.API)
- func (self *DummyEngine) Author(header *types.Header) (common.Address, error)
- func (self *DummyEngine) CalcDifficulty(chain consensus.ChainHeaderReader, time uint64, parent *types.Header) *big.Int
- func (self *DummyEngine) Close() error
- func (self *DummyEngine) Finalize(chain consensus.ChainHeaderReader, block *types.Block, parent *types.Header, ...) error
- func (self *DummyEngine) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *types.Header, parent *types.Header, ...) (*types.Block, error)
- func (self *DummyEngine) Prepare(chain consensus.ChainHeaderReader, header *types.Header) error
- func (self *DummyEngine) VerifyHeader(chain consensus.ChainHeaderReader, header *types.Header) error
- func (self *DummyEngine) VerifySeal(chain consensus.ChainHeaderReader, header *types.Header) error
- func (self *DummyEngine) VerifyUncles(chain consensus.ChainReader, block *types.Block) error
- type OnAPIsCallbackType
- type OnExtraStateChangeType
- type OnFinalizeAndAssembleCallbackType
Constants ¶
This section is empty.
Variables ¶
var ( ApricotPhase3MinBaseFee = big.NewInt(params.ApricotPhase3MinBaseFee) ApricotPhase3MaxBaseFee = big.NewInt(params.ApricotPhase3MaxBaseFee) ApricotPhase4MinBaseFee = big.NewInt(params.ApricotPhase4MinBaseFee) ApricotPhase4MaxBaseFee = big.NewInt(params.ApricotPhase4MaxBaseFee) TargetGas uint64 = 10_000_000 ApricotPhase3BlockGasFee uint64 = 1_000_000 ApricotPhase4MinBlockGasCost = new(big.Int).Set(common.Big0) ApricotPhase4MaxBlockGasCost = big.NewInt(1_000_000) ApricotPhase4BlockGasCostStep = big.NewInt(50_000) ApricotPhase4TargetBlockRate uint64 = 2 // in seconds )
Functions ¶
func CalcBaseFee ¶ added in v0.6.0
func CalcBaseFee(config *params.ChainConfig, parent *types.Header, timestamp uint64) ([]byte, *big.Int, error)
CalcBaseFee takes the previous header and the timestamp of its child block and calculates the expected base fee as well as the encoding of the past pricing information for the child block. CalcBaseFee should only be called if [timestamp] >= [config.ApricotPhase3Timestamp]
func MinRequiredTip ¶ added in v0.7.0
MinRequiredTip is the estimated minimum tip a transaction would have needed to pay to be included in a given block (assuming it paid a tip proportional to its gas usage). In reality, there is no minimum tip that is enforced by the consensus engine and high tip paying transactions can subsidize the inclusion of low tip paying transactions. The only correctness check performed is that the sum of all tips is >= the required block fee.
This function will return nil for all return values prior to Apricot Phase 4.
Types ¶
type ConsensusCallbacks ¶
type ConsensusCallbacks struct { OnAPIs OnAPIsCallbackType OnFinalizeAndAssemble OnFinalizeAndAssembleCallbackType OnExtraStateChange OnExtraStateChangeType }
type DummyEngine ¶
type DummyEngine struct {
// contains filtered or unexported fields
}
func NewComplexETHFaker ¶ added in v0.7.0
func NewComplexETHFaker(cb *ConsensusCallbacks) *DummyEngine
func NewDummyEngine ¶
func NewDummyEngine(cb *ConsensusCallbacks) *DummyEngine
func NewETHFaker ¶ added in v0.7.0
func NewETHFaker() *DummyEngine
func NewFaker ¶ added in v0.6.0
func NewFaker() *DummyEngine
func (*DummyEngine) APIs ¶
func (self *DummyEngine) APIs(chain consensus.ChainHeaderReader) (res []rpc.API)
func (*DummyEngine) CalcDifficulty ¶
func (self *DummyEngine) CalcDifficulty(chain consensus.ChainHeaderReader, time uint64, parent *types.Header) *big.Int
func (*DummyEngine) Close ¶
func (self *DummyEngine) Close() error
func (*DummyEngine) FinalizeAndAssemble ¶
func (*DummyEngine) Prepare ¶
func (self *DummyEngine) Prepare(chain consensus.ChainHeaderReader, header *types.Header) error
func (*DummyEngine) VerifyHeader ¶
func (self *DummyEngine) VerifyHeader(chain consensus.ChainHeaderReader, header *types.Header) error
func (*DummyEngine) VerifySeal ¶
func (self *DummyEngine) VerifySeal(chain consensus.ChainHeaderReader, header *types.Header) error
func (*DummyEngine) VerifyUncles ¶
func (self *DummyEngine) VerifyUncles(chain consensus.ChainReader, block *types.Block) error
type OnAPIsCallbackType ¶
type OnAPIsCallbackType = func(consensus.ChainHeaderReader) []rpc.API