mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
26 lines
1.4 KiB
Go
26 lines
1.4 KiB
Go
package utils
|
|
|
|
import (
|
|
"github.com/XinFinOrg/XDPoSChain/common/hexutil"
|
|
"github.com/XinFinOrg/XDPoSChain/core/types"
|
|
)
|
|
|
|
// XDPoS delegated-proof-of-stake protocol constants.
|
|
const (
|
|
BlockSignersCacheLimit = 9000
|
|
EpochLength = uint64(900) // Default number of blocks after which to checkpoint and reset the pending votes
|
|
ExtraVanity = 32 // Fixed number of extra-data prefix bytes reserved for signer vanity
|
|
ExtraSeal = 65 // Fixed number of extra-data suffix bytes reserved for signer seal
|
|
InMemoryEpochs = 5 * EpochLength // Number of mapping from block to epoch switch infos to keep in memory
|
|
InMemoryRound2Epochs = 65536 // Number of mapping of epoch switch blocks for quickly locating epoch switch block. One epoch ~ 0.5hours, so 65536 epochs ~ 3.7 years. And it uses ~ 10MB memory.
|
|
InMemorySnapshots = 128 // Number of recent vote snapshots to keep in memory
|
|
M2ByteLength = 4
|
|
PeriodicJobPeriod = 60
|
|
PoolHygieneRound = 10
|
|
)
|
|
|
|
var (
|
|
NonceAuthVote = hexutil.MustDecode("0xffffffffffffffff") // Magic nonce number to vote on adding a new signer
|
|
NonceDropVote = hexutil.MustDecode("0x0000000000000000") // Magic nonce number to vote on removing a signer.
|
|
UncleHash = types.CalcUncleHash(nil) // Always Keccak256(RLP([])) as uncles are meaningless outside of PoW.
|
|
)
|