Documentation
¶
Index ¶
- Variables
- func BigNumEqual(x, y *big.Int) bool
- func BytesToHashSlice(b []byte) []common.Hash
- func HashSliceToBytes(hashes []common.Hash) []byte
- func IncrOne(bytes []byte)
- func IsForkTransition(fork *big.Int, parent *big.Int, current *big.Int) bool
- func IsForked(s, head *big.Int) bool
- func PackPredicate(predicate []byte) []byte
- func UnpackPredicate(paddedPredicate []byte) ([]byte, error)
- type AddressRange
- 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 ¶
var PredicateEndByte = byte(0xff)
PredicateEndByte is used as a delimiter for the bytes packed into a precompile predicate. Precompile predicates are encoded in the Access List of transactions in the access tuples which means that its length must be a multiple of 32 (common.HashLength). For messages with a length that does not comply to that, this delimiter is used to append/remove padding.
Functions ¶
func BigNumEqual ¶ added in v0.2.8
BigNumEqual returns true if x and y are equivalent ie. both nil or both contain the same value.
func BytesToHashSlice ¶ added in v0.5.0
BytesToHashSlice packs [b] into a slice of hash values with zero padding to the right if the length of b is not a multiple of 32.
func HashSliceToBytes ¶ added in v0.5.0
HashSliceToBytes serializes a []common.Hash into a tightly packed byte array.
func IsForkTransition ¶
IsForkTransition returns true if [fork] activates during the transition from [parent] to [current]. Note: this works for both block number and timestamp activated forks.
func IsForked ¶
IsForked 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 PackPredicate ¶
PackPredicate packs [predicate] by delimiting the actual message with PredicateEndByte and zero padding to reach a length that is a multiple of 32.
func UnpackPredicate ¶
UnpackPredicate unpacks a predicate by stripping right padded zeroes, checking for the delimter, ensuring there is not excess padding, and returning the original message. Returns an error if it finds an incorrect encoding.
Types ¶
type AddressRange ¶ added in v0.4.10
AddressRange represents a continuous range of addresses
type MeteredCache ¶ added in v0.4.1
MeteredCache wraps *fastcache.Cache and periodically pulls stats from it.
func NewMeteredCache ¶ added in v0.4.1
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.4.1
func (mc *MeteredCache) Del(k []byte)
func (*MeteredCache) Get ¶ added in v0.4.1
func (mc *MeteredCache) Get(dst, k []byte) []byte
func (*MeteredCache) GetBig ¶ added in v0.4.1
func (mc *MeteredCache) GetBig(dst, k []byte) []byte
func (*MeteredCache) Has ¶ added in v0.4.1
func (mc *MeteredCache) Has(k []byte) bool
func (*MeteredCache) HasGet ¶ added in v0.4.1
func (mc *MeteredCache) HasGet(dst, k []byte) ([]byte, bool)
func (*MeteredCache) Set ¶ added in v0.4.1
func (mc *MeteredCache) Set(k, v []byte)
func (*MeteredCache) SetBig ¶ added in v0.4.1
func (mc *MeteredCache) SetBig(k, v []byte)