Documentation ¶
Index ¶
- func IncrOne(bytes []byte)
- func IsBlockForked(s, head *big.Int) bool
- func IsForkTransition(fork *uint64, parent *uint64, current uint64) bool
- func IsTimestampForked(s *uint64, head uint64) bool
- func NewUint64(val uint64) *uint64
- func TimeToNewUint64(time time.Time) *uint64
- func Uint64ToTime(val *uint64) time.Time
- type MeteredCache
- func (mc *MeteredCache) Del(k []byte)
- func (mc *MeteredCache) Get(dst, k []byte) []byte
- func (mc *MeteredCache) GetBig(dst, k []byte) []byte
- func (mc *MeteredCache) Has(k []byte) bool
- func (mc *MeteredCache) HasGet(dst, k []byte) ([]byte, bool)
- func (mc *MeteredCache) Set(k, v []byte)
- func (mc *MeteredCache) SetBig(k, v []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsBlockForked ¶ added in v0.12.3
IsBlockForked returns whether a fork scheduled at block s is active at the given head block. Note: [s] and [head] can be either a block number or a block timestamp.
func IsForkTransition ¶ added in v0.8.15
IsForkTransition returns true if [fork] activates during the transition from [parent] to [current]. Taking [parent] as a pointer allows for us to pass nil when checking forks that activate during genesis. Note: this works for both block number and timestamp activated forks.
func IsTimestampForked ¶ added in v0.12.3
IsTimestampForked returns whether a fork scheduled at timestamp s is active at the given head timestamp. Whilst this method is the same as isBlockForked, they are explicitly separate for clearer reading.
func TimeToNewUint64 ¶ added in v0.12.3
func Uint64ToTime ¶ added in v0.12.3
Types ¶
type MeteredCache ¶ added in v0.11.4
MeteredCache wraps *fastcache.Cache and periodically pulls stats from it.
func NewMeteredCache ¶ added in v0.11.4
func NewMeteredCache(size int, journal string, namespace string, updateFrequency uint64) *MeteredCache
NewMeteredCache returns a new MeteredCache that will update stats to the provided namespace once per each [updateFrequency] operations. Note: if [updateFrequency] is passed as 0, it will be treated as 1.
func (*MeteredCache) Del ¶ added in v0.11.4
func (mc *MeteredCache) Del(k []byte)
func (*MeteredCache) Get ¶ added in v0.11.4
func (mc *MeteredCache) Get(dst, k []byte) []byte
func (*MeteredCache) GetBig ¶ added in v0.11.4
func (mc *MeteredCache) GetBig(dst, k []byte) []byte
func (*MeteredCache) Has ¶ added in v0.11.4
func (mc *MeteredCache) Has(k []byte) bool
func (*MeteredCache) HasGet ¶ added in v0.11.4
func (mc *MeteredCache) HasGet(dst, k []byte) ([]byte, bool)
func (*MeteredCache) Set ¶ added in v0.11.4
func (mc *MeteredCache) Set(k, v []byte)
func (*MeteredCache) SetBig ¶ added in v0.11.4
func (mc *MeteredCache) SetBig(k, v []byte)