erigon-pulse/consensus/misc/pos.go
Somnath Banerjee 71231140a5
Block Gas limit contract integration for Chiado (#7727)
Changes summary:
- Continue with the gasLimit check skip in ``verifyHeader`` of
``merge.go`` for unless pre-merge block and blockGasLimitContract
present
- Refactor ``aura.go`` a bit
- Have ``sysCall`` method customized to be able to call state (contract)
at a parent (or any other) header state
2023-06-19 22:06:51 +05:30

23 lines
798 B
Go

package misc
import (
libcommon "github.com/ledgerwatch/erigon-lib/common"
"github.com/ledgerwatch/erigon/core/types"
)
// Constants for The Merge as specified by EIP-3675: Upgrade consensus to Proof-of-Stake
var (
ProofOfStakeDifficulty = libcommon.Big0 // PoS block's difficulty is always 0
ProofOfStakeNonce = types.BlockNonce{} // PoS block's have all-zero nonces
)
// IsPoSHeader reports the header belongs to the PoS-stage with some special fields.
// This function is not suitable for a part of APIs like Prepare or CalcDifficulty
// because the header difficulty is not set yet.
func IsPoSHeader(header *types.Header) bool {
if header.Difficulty == nil {
panic("IsPoSHeader called with invalid difficulty")
}
return header.Difficulty.Cmp(ProofOfStakeDifficulty) == 0
}