Documentation ¶
Index ¶
- Constants
- Variables
- func IsCeremonyCandidate(identity Identity) bool
- func IsCeremonyCandidateData(state IdentityState, hasDoneAllRequiredFlips bool) bool
- func ReadTreeFrom2(pdb *dbm.PrefixDB, height uint64, root common.Hash, from io.Reader) error
- func WriteTreeTo2(sourceDb dbm.DB, height uint64, to io.Writer) (common.Hash, error)
- type Account
- type ApprovedIdentity
- type ApprovedIdentityFlag
- type BitArray
- func (bA *BitArray) Bytes() []byte
- func (bA *BitArray) GetIndex(i int) bool
- func (bA *BitArray) MarshalJSON() ([]byte, error)
- func (bA *BitArray) SetIndex(i int, v bool) bool
- func (bA *BitArray) Size() uint
- func (bA *BitArray) String() string
- func (bA *BitArray) StringIndented(indent string) string
- func (bA *BitArray) UnmarshalJSON(bz []byte) error
- type BurntCoins
- type BurntCoinsItem
- type ContractData
- type DelayedPenalties
- type Delegation
- type DelegationSwitch
- type Global
- type Identity
- func (i *Identity) Delegatee() *common.Address
- func (i *Identity) FromBytes(data []byte) error
- func (i *Identity) GetMaximumAvailableFlips() uint8
- func (i *Identity) GetShortFlipPoints() float32
- func (i *Identity) GetTotalWordPairsCount() int
- func (i *Identity) HasDoneAllRequiredFlips() bool
- func (i *Identity) HasValidationTx(txType types.TxType) bool
- func (i *Identity) IsDiscriminated(epoch uint16) bool
- func (i *Identity) Metadata() interface{}
- func (i *Identity) PenaltySeconds() uint16
- func (i *Identity) PenaltyTimestamp() int64
- func (i *Identity) PendingUndelegation() *common.Address
- func (i *Identity) ReplenishedStake() *big.Int
- func (i *Identity) SetPenaltySeconds(penaltySeconds uint16)
- func (i *Identity) SetPenaltyTimestamp(penaltyTimestamp int64)
- func (i *Identity) ShiftedShardId() common.ShardId
- func (i *Identity) ToBytes() ([]byte, error)
- func (i *Identity) UndelegationEpoch() uint16
- type IdentityFlip
- type IdentityState
- type IdentityStateDB
- func (s *IdentityStateDB) AddDiff(height uint64, diff *IdentityStateDiff)
- func (s *IdentityStateDB) Clear()
- func (s *IdentityStateDB) Commit(deleteEmptyObjects bool) (root []byte, version int64, diff *IdentityStateDiff, err error)
- func (s *IdentityStateDB) CommitSnapshot(height uint64) (dropDb dbm.DB)
- func (s *IdentityStateDB) CommitTree(newVersion int64) (root []byte, version int64, err error)
- func (s *IdentityStateDB) CreatePreliminaryCopy(height uint64) (*IdentityStateDB, error)
- func (s *IdentityStateDB) Delegatee(addr common.Address) *common.Address
- func (s *IdentityStateDB) DropPreliminary()
- func (s *IdentityStateDB) ForCheck(height uint64) (*IdentityStateDB, error)
- func (s *IdentityStateDB) ForCheckWithOverwrite(height uint64) (*IdentityStateDB, error)
- func (s *IdentityStateDB) GetOrNewIdentityObject(addr common.Address) *stateApprovedIdentity
- func (s *IdentityStateDB) HasVersion(height uint64) bool
- func (s *IdentityStateDB) IsOnline(addr common.Address) bool
- func (s *IdentityStateDB) IsValidated(addr common.Address) bool
- func (s *IdentityStateDB) IterateIdentities(fn func(key []byte, value []byte) bool) bool
- func (s *IdentityStateDB) Load(height uint64) error
- func (s *IdentityStateDB) LoadPreliminary(height uint64) (*IdentityStateDB, error)
- func (s *IdentityStateDB) MarkStateIdentityObjectDirty(addr common.Address)
- func (s *IdentityStateDB) Precommit(deleteEmptyObjects bool) *IdentityStateDiff
- func (s *IdentityStateDB) Readonly(height uint64) (*IdentityStateDB, error)
- func (s *IdentityStateDB) RecoverSnapshot2(height uint64, treeRoot common.Hash, from io.Reader) error
- func (s *IdentityStateDB) Remove(identity common.Address)
- func (s *IdentityStateDB) RemoveDelegatee(addr common.Address)
- func (s *IdentityStateDB) Reset()
- func (s *IdentityStateDB) ResetTo(height uint64) error
- func (s *IdentityStateDB) Root() common.Hash
- func (s *IdentityStateDB) SaveForcedVersion(height uint64) error
- func (s *IdentityStateDB) SetDelegatee(addr common.Address, delegatee common.Address)
- func (s *IdentityStateDB) SetDiscriminated(identity common.Address, discriminated bool)
- func (s *IdentityStateDB) SetOnline(addr common.Address, online bool)
- func (s *IdentityStateDB) SetPredefinedIdentities(state *models.ProtoPredefinedState)
- func (s *IdentityStateDB) SetValidated(identity common.Address, validated bool)
- func (s *IdentityStateDB) SwitchToPreliminary(height uint64) (batch dbm.Batch, dropDb dbm.DB, err error)
- func (s *IdentityStateDB) Version() uint64
- type IdentityStateDiff
- func (diff *IdentityStateDiff) Empty() bool
- func (diff *IdentityStateDiff) FromBytes(data []byte) error
- func (diff *IdentityStateDiff) FromProto(protoDiff *models.ProtoIdentityStateDiff) *IdentityStateDiff
- func (diff *IdentityStateDiff) ToBytes() ([]byte, error)
- func (diff *IdentityStateDiff) ToProto() *models.ProtoIdentityStateDiff
- type IdentityStateDiffValue
- type IdentityStatusSwitch
- type IdentityUpdateHook
- type ImmutableTree
- func (t *ImmutableTree) AvailableVersions() []int
- func (t *ImmutableTree) DeleteVersion(version int64) error
- func (t *ImmutableTree) ExistVersion(version int64) bool
- func (t *ImmutableTree) Exporter() *iavl.Exporter
- func (t *ImmutableTree) Get(key []byte) (index int64, value []byte)
- func (t *ImmutableTree) GetImmutable() *ImmutableTree
- func (t *ImmutableTree) GetWithProof(key []byte) ([]byte, error)
- func (t *ImmutableTree) Hash() common.Hash
- func (t *ImmutableTree) Iterate(fn func(key []byte, value []byte) bool) (stopped bool)
- func (t *ImmutableTree) IterateRange(start, end []byte, ascending bool, fn func(key []byte, value []byte) bool) (stopped bool)
- func (t *ImmutableTree) IterateRangeInclusive(start, end []byte, ascending bool, ...) (stopped bool)
- func (t *ImmutableTree) Load() (int64, error)
- func (t *ImmutableTree) LoadVersion(targetVersion int64) (int64, error)
- func (t *ImmutableTree) LoadVersionForOverwriting(targetVersion int64) (int64, error)
- func (t *ImmutableTree) Remove(key []byte) ([]byte, bool)
- func (t *ImmutableTree) Rollback()
- func (t *ImmutableTree) SaveVersion() ([]byte, int64, error)
- func (t *ImmutableTree) SaveVersionAt(version int64) ([]byte, int64, error)
- func (t *ImmutableTree) Set(key, value []byte) bool
- func (t *ImmutableTree) SetVirtualVersion(version int64)
- func (t *ImmutableTree) ValidateTree() bool
- func (t *ImmutableTree) Version() int64
- func (t *ImmutableTree) WorkingHash() common.Hash
- type Inviter
- type MutableTree
- func (t *MutableTree) AvailableVersions() []int
- func (t *MutableTree) DeleteVersion(version int64) error
- func (t *MutableTree) ExistVersion(version int64) bool
- func (t *MutableTree) Get(key []byte) (index int64, value []byte)
- func (t *MutableTree) GetImmutable() *ImmutableTree
- func (t *MutableTree) Hash() common.Hash
- func (t *MutableTree) Importer(version int64) (*iavl.Importer, error)
- func (t *MutableTree) LazyLoad(version int64) (int64, error)
- func (t *MutableTree) Load() (int64, error)
- func (t *MutableTree) LoadVersion(targetVersion int64) (int64, error)
- func (t *MutableTree) LoadVersionForOverwriting(targetVersion int64) (int64, error)
- func (t *MutableTree) Remove(key []byte) ([]byte, bool)
- func (t *MutableTree) Rollback()
- func (t *MutableTree) SaveVersion() ([]byte, int64, error)
- func (t *MutableTree) SaveVersionAt(version int64) ([]byte, int64, error)
- func (t *MutableTree) Set(key, value []byte) bool
- func (t *MutableTree) SetVirtualVersion(version int64)
- func (t *MutableTree) ValidateTree() bool
- func (t *MutableTree) Version() int64
- func (t *MutableTree) WorkingHash() common.Hash
- type NonceCache
- func (ns *NonceCache) Clear()
- func (ns *NonceCache) GetNonce(addr common.Address, epoch uint16) uint32
- func (ns *NonceCache) Lock()
- func (ns *NonceCache) ReloadFallback(sdb *StateDB) error
- func (ns *NonceCache) SetNonce(addr common.Address, txEpoch uint16, nonce uint32)
- func (ns *NonceCache) UnLock()
- func (ns *NonceCache) UnsafeSetNonce(addr common.Address, txEpoch uint16, nonce uint32)
- type SnapshotManager
- func (m *SnapshotManager) AddInvalidManifest(cid []byte)
- func (m *SnapshotManager) AddTimeoutManifest(cid []byte)
- func (m *SnapshotManager) DownloadSnapshot(snapshot *snapshot.Manifest) (filePath string, version SnapshotVersion, err error)
- func (m *SnapshotManager) IsInvalidManifest(cid []byte) bool
- func (m *SnapshotManager) StartSync()
- func (m *SnapshotManager) StopSync()
- type SnapshotVersion
- type StateDB
- func (s *StateDB) AccountExists(address common.Address) bool
- func (s *StateDB) AddBalance(addr common.Address, amount *big.Int)
- func (s *StateDB) AddBlockBit(empty bool)
- func (s *StateDB) AddBurntCoins(height uint64, address common.Address, key string, amount *big.Int)
- func (s *StateDB) AddDelayedPenalty(addr common.Address)
- func (s *StateDB) AddDiff(diffs []*StateTreeDiff)
- func (s *StateDB) AddEmptyBlockByShard(onlineSize int, shardId common.ShardId, proposer common.Address)
- func (s *StateDB) AddFlip(addr common.Address, cid []byte, pair uint8)
- func (s *StateDB) AddInvite(address common.Address, amount uint8)
- func (s *StateDB) AddInvitee(address, inviteeAddress common.Address, txHash common.Hash)
- func (s *StateDB) AddNewScore(address common.Address, score byte)
- func (s *StateDB) AddPrevEpochBlock(height uint64)
- func (s *StateDB) AddReplenishedStake(address common.Address, intStake *big.Int)
- func (s *StateDB) AddStake(address common.Address, intStake *big.Int)
- func (s *StateDB) BlocksCntWithoutCeremonialTxs() uint32
- func (s *StateDB) CanCompleteEpoch() bool
- func (s *StateDB) Clear()
- func (s *StateDB) ClearAccount(addr common.Address)
- func (s *StateDB) ClearDelayedOfflinePenalties()
- func (s *StateDB) ClearDelegations()
- func (s *StateDB) ClearEmptyBlocksByShard()
- func (s *StateDB) ClearFlips(addr common.Address)
- func (s *StateDB) ClearOutdatedBurntCoins(height uint64) bool
- func (s *StateDB) ClearPenalty(address common.Address)
- func (s *StateDB) ClearStatusSwitchAddresses()
- func (s *StateDB) CollectKilledDelegators() []common.Address
- func (s *StateDB) Commit(deleteEmptyObjects bool) (diff []*StateTreeDiff, root []byte, version int64, err error)
- func (s *StateDB) CommitSnapshot(height uint64, batch dbm.Batch) (dropDb dbm.DB)
- func (s *StateDB) CommitTree(newVersion int64) (root []byte, version int64, err error)
- func (s *StateDB) DecreaseShardSize(shardId common.ShardId)
- func (s *StateDB) DelayedOfflinePenalties() []common.Address
- func (s *StateDB) Delegatee(addr common.Address) *common.Address
- func (s *StateDB) DelegationEpoch(addr common.Address) uint16
- func (s *StateDB) DelegationSwitch(sender common.Address) *Delegation
- func (s *StateDB) Delegations() []*Delegation
- func (s *StateDB) DeleteFlip(addr common.Address, cid []byte)
- func (s *StateDB) DeployContract(addr common.Address, codeHash common.Hash, stake *big.Int)
- func (s *StateDB) DropContract(addr common.Address)
- func (s *StateDB) DropSnapshot(manifest *snapshot.Manifest)
- func (s *StateDB) EmptyBlocksByShard() map[common.ShardId][]common.Address
- func (s *StateDB) EmptyBlocksCount() int
- func (s *StateDB) Epoch() uint16
- func (s *StateDB) EpochBlock() uint64
- func (s *StateDB) FeePerGas() *big.Int
- func (s *StateDB) FlipWordsSeed() types.Seed
- func (s *StateDB) ForCheck(height uint64) (*StateDB, error)
- func (s *StateDB) ForCheckWithOverwrite(height uint64) (*StateDB, error)
- func (s *StateDB) GeneticCode(address common.Address) (generation uint32, code []byte)
- func (s *StateDB) GetBalance(addr common.Address) *big.Int
- func (s *StateDB) GetCodeHash(addr common.Address) *common.Hash
- func (s *StateDB) GetContractStake(addr common.Address) *big.Int
- func (s *StateDB) GetContractValue(addr common.Address, key []byte) []byte
- func (s *StateDB) GetEpoch(addr common.Address) uint16
- func (s *StateDB) GetIdentity(addr common.Address) Identity
- func (s *StateDB) GetIdentityState(addr common.Address) IdentityState
- func (s *StateDB) GetIdentityWithProof(addr common.Address) ([]byte, error)
- func (s *StateDB) GetInvitees(address common.Address) []TxAddr
- func (s *StateDB) GetInviter(address common.Address) *Inviter
- func (s *StateDB) GetInvites(addr common.Address) uint8
- func (s *StateDB) GetMadeFlips(addr common.Address) uint8
- func (s *StateDB) GetNonce(addr common.Address) uint32
- func (s *StateDB) GetOrNewAccountObject(addr common.Address) *stateAccount
- func (s *StateDB) GetOrNewDelayedOfflinePenaltyObject() *stateDelayedOfflinePenalties
- func (s *StateDB) GetOrNewDelegationSwitchObject() *stateDelegationSwitch
- func (s *StateDB) GetOrNewGlobalObject() *stateGlobal
- func (s *StateDB) GetOrNewIdentityObject(addr common.Address) *stateIdentity
- func (s *StateDB) GetOrNewStatusSwitchObject() *stateStatusSwitch
- func (s *StateDB) GetPenalty(address common.Address) *big.Int
- func (s *StateDB) GetPenaltySeconds(address common.Address) uint16
- func (s *StateDB) GetPenaltyTimestamp(address common.Address) int64
- func (s *StateDB) GetProfileHash(addr common.Address) []byte
- func (s *StateDB) GetQualifiedFlipsCount(addr common.Address) uint32
- func (s *StateDB) GetReplenishedStakeBalance(addr common.Address) *big.Int
- func (s *StateDB) GetRequiredFlips(addr common.Address) uint8
- func (s *StateDB) GetScores(addr common.Address) []byte
- func (s *StateDB) GetShortFlipPoints(addr common.Address) float32
- func (s *StateDB) GetStakeBalance(addr common.Address) *big.Int
- func (s *StateDB) GodAddress() common.Address
- func (s *StateDB) GodAddressInvites() uint16
- func (s *StateDB) HasDelayedOfflinePenalty(addr common.Address) bool
- func (s *StateDB) HasStatusSwitchAddresses(addr common.Address) bool
- func (s *StateDB) HasValidationTx(addr common.Address, txType types.TxType) bool
- func (s *StateDB) HasVersion(h uint64) bool
- func (s *StateDB) IncBlocksCntWithoutCeremonialTxs()
- func (s *StateDB) IncEpoch()
- func (s *StateDB) IncreaseShardSize(shardId common.ShardId)
- func (s *StateDB) IsDiscriminated(addr common.Address, epoch uint16) bool
- func (s *StateDB) IterateAccounts(fn func(key []byte, value []byte) bool) bool
- func (s *StateDB) IterateBurntCoins(callback func(height uint64, value BurntCoins))
- func (s *StateDB) IterateContractStore(addr common.Address, minKey []byte, maxKey []byte, ...)
- func (s *StateDB) IterateContractValues(f func(key []byte, value []byte) bool)
- func (s *StateDB) IterateIdentities(fn func(key []byte, value []byte) bool) bool
- func (s *StateDB) IterateOverAccounts(callback func(addr common.Address, account Account))
- func (s *StateDB) IterateOverIdentities(callback func(addr common.Address, identity Identity))
- func (s *StateDB) LastSnapshot() uint64
- func (s *StateDB) Load(height uint64) error
- func (s *StateDB) MarkStateAccountObjectDirty(addr common.Address)
- func (s *StateDB) MarkStateBurntCoinsObjectDirty(height uint64)
- func (s *StateDB) MarkStateDelayedOfflinePenaltyObjectDirty()
- func (s *StateDB) MarkStateDelegationSwitchObjectDirty()
- func (s *StateDB) MarkStateGlobalObjectDirty()
- func (s *StateDB) MarkStateIdentityObjectDirty(addr common.Address)
- func (s *StateDB) MarkStateStatusSwitchObjectDirty()
- func (s *StateDB) NextValidationTime() time.Time
- func (s *StateDB) PendingUndelegation(addr common.Address) *common.Address
- func (s *StateDB) Precommit(deleteEmptyObjects bool) []*StateTreeDiff
- func (s *StateDB) PrevEpochBlocks() []uint64
- func (s *StateDB) ProvideIdentityUpdateHook(hook IdentityUpdateHook)
- func (s *StateDB) Readonly(height int64) (*StateDB, error)
- func (s *StateDB) RecoverSnapshot2(height uint64, treeRoot common.Hash, from io.Reader) error
- func (s *StateDB) RemoveContractValue(addr common.Address, key []byte)
- func (s *StateDB) RemoveDelayedOfflinePenalty(addr common.Address)
- func (s *StateDB) RemoveDelegatee(addr common.Address)
- func (s *StateDB) RemoveInvitee(address, inviteeAddress common.Address)
- func (s *StateDB) RemovePendingUndelegation(addr common.Address)
- func (s *StateDB) Reset()
- func (s *StateDB) ResetBlocksCntWithoutCeremonialTxs()
- func (s *StateDB) ResetEmptyBlockByShard(shardId common.ShardId)
- func (s *StateDB) ResetInviter(address common.Address)
- func (s *StateDB) ResetTo(height uint64) error
- func (s *StateDB) ResetValidationTxBits(addr common.Address)
- func (s *StateDB) Root() common.Hash
- func (s *StateDB) SaveForcedVersion(height uint64) (root []byte, version int64, err error)
- func (s *StateDB) SetBalance(addr common.Address, amount *big.Int)
- func (s *StateDB) SetBirthday(address common.Address, birthday uint16)
- func (s *StateDB) SetContractStake(addr common.Address, stake *big.Int)
- func (s *StateDB) SetContractValue(addr common.Address, key []byte, value []byte)
- func (s *StateDB) SetDelegatee(addr common.Address, delegatee common.Address)
- func (s *StateDB) SetDelegationEpoch(addr common.Address, epoch uint16)
- func (s *StateDB) SetDelegationNonce(addr common.Address, nonce uint32)
- func (s *StateDB) SetEpoch(addr common.Address, epoch uint16)
- func (s *StateDB) SetEpochBlock(height uint64)
- func (s *StateDB) SetFeePerGas(fee *big.Int)
- func (s *StateDB) SetFlipWordsSeed(seed types.Seed)
- func (s *StateDB) SetGeneticCode(address common.Address, generation uint32, code []byte)
- func (s *StateDB) SetGlobalEpoch(epoch uint16)
- func (s *StateDB) SetGodAddress(godAddress common.Address)
- func (s *StateDB) SetGodAddressInvites(count uint16)
- func (s *StateDB) SetInviter(address, inviterAddress common.Address, txHash common.Hash, epochHeight uint32)
- func (s *StateDB) SetInvites(address common.Address, amount uint8)
- func (s *StateDB) SetLastSnapshot(height uint64)
- func (s *StateDB) SetMetadata(address common.Address, metadata interface{})
- func (s *StateDB) SetNextValidationTime(t time.Time)
- func (s *StateDB) SetNonce(addr common.Address, nonce uint32)
- func (s *StateDB) SetPenaltySeconds(address common.Address, seconds uint16)
- func (s *StateDB) SetPenaltyTimestamp(address common.Address, timestamp int64)
- func (s *StateDB) SetPendingUndelegation(addr common.Address)
- func (s *StateDB) SetPredefinedAccounts(state *models.ProtoPredefinedState)
- func (s *StateDB) SetPredefinedContractValues(state *models.ProtoPredefinedState)
- func (s *StateDB) SetPredefinedGlobal(state *models.ProtoPredefinedState)
- func (s *StateDB) SetPredefinedIdentities(state *models.ProtoPredefinedState)
- func (s *StateDB) SetPredefinedStatusSwitch(state *models.ProtoPredefinedState)
- func (s *StateDB) SetProfileHash(addr common.Address, hash []byte)
- func (s *StateDB) SetPubKey(address common.Address, pubKey []byte)
- func (s *StateDB) SetRequiredFlips(addr common.Address, amount uint8)
- func (s *StateDB) SetShardId(addr common.Address, shardId common.ShardId)
- func (s *StateDB) SetShardSize(shardId common.ShardId, size uint32)
- func (s *StateDB) SetShardsNum(num uint32)
- func (s *StateDB) SetState(address common.Address, state IdentityState)
- func (s *StateDB) SetUndelegationEpoch(addr common.Address, epoch uint16)
- func (s *StateDB) SetValidationPeriod(period ValidationPeriod)
- func (s *StateDB) SetValidationStatus(addr common.Address, status ValidationStatusFlag)
- func (s *StateDB) SetValidationTxBit(addr common.Address, txType types.TxType)
- func (s *StateDB) SetVrfProposerThreshold(value float64)
- func (s *StateDB) ShardId(address common.Address) common.ShardId
- func (s *StateDB) ShardSizes() map[common.ShardId]uint32
- func (s *StateDB) ShardsNum() uint32
- func (s *StateDB) StatusSwitchAddresses() []common.Address
- func (s *StateDB) SubBalance(addr common.Address, amount *big.Int)
- func (s *StateDB) SubGodAddressInvite()
- func (s *StateDB) SubInvite(address common.Address, amount uint8)
- func (s *StateDB) SubPenalty(address common.Address, penalty *big.Int)
- func (s *StateDB) SubPenaltySeconds(address common.Address, value uint16)
- func (s *StateDB) SubReplenishedStake(addr common.Address, amount *big.Int)
- func (s *StateDB) SubStake(addr common.Address, amount *big.Int)
- func (s *StateDB) ToggleDelegationAddress(sender common.Address, delegatee common.Address)
- func (s *StateDB) ToggleStatusSwitchAddress(sender common.Address)
- func (s *StateDB) ValidationPeriod() ValidationPeriod
- func (s *StateDB) Version() int64
- func (s *StateDB) VrfProposerThreshold() float64
- func (s *StateDB) WriteSnapshot2(height uint64, to io.Writer) (root common.Hash, err error)
- type StateTreeDiff
- type Tree
- type TxAddr
- type ValidationPeriod
- type ValidationStatusFlag
Constants ¶
const ( Undefined IdentityState = 0 Invite IdentityState = 1 Candidate IdentityState = 2 Verified IdentityState = 3 Suspended IdentityState = 4 Killed IdentityState = 5 Zombie IdentityState = 6 Newbie IdentityState = 7 Human IdentityState = 8 MaxInvitesAmount = math.MaxUint8 EmptyBlocksBitsSize = 25 AdditionalVerifiedFlips = 1 AdditionalHumanFlips = 2 // Minimal number of blocks in after long period which should be without ceremonial txs AfterLongRequiredBlocks = 5 )
const ( MaxSavedStatesCount = 100 GeneticCodeSize = 12 )
const (
SnapshotBlockSize = 10000
)
const SnapshotVersionV2 = SnapshotVersion(2)
const (
SnapshotsFolder = "/snapshots"
)
Variables ¶
var ( StateDbKeys = &stateDbKeys{} IdentityStateDbKeys = &identityStateDbPrefix{} )
var ( InvalidManifestPrefix = []byte("im") MaxManifestTimeouts = byte(5) )
Functions ¶
func IsCeremonyCandidate ¶
func IsCeremonyCandidateData ¶ added in v0.28.5
func IsCeremonyCandidateData(state IdentityState, hasDoneAllRequiredFlips bool) bool
func ReadTreeFrom2 ¶ added in v0.26.7
Types ¶
type Account ¶
type Account struct { Nonce uint32 Epoch uint16 Balance *big.Int Contract *ContractData }
Account is the Idena consensus representation of accounts. These objects are stored in the main account trie.
type ApprovedIdentity ¶
type ApprovedIdentity struct { Validated bool Online bool Discriminated bool Delegatee *common.Address }
func (*ApprovedIdentity) FromBytes ¶ added in v0.21.0
func (s *ApprovedIdentity) FromBytes(data []byte) error
func (*ApprovedIdentity) ToBytes ¶ added in v0.21.0
func (s *ApprovedIdentity) ToBytes() ([]byte, error)
type ApprovedIdentityFlag ¶ added in v0.29.0
type ApprovedIdentityFlag uint32
const ( Validated ApprovedIdentityFlag = 1 << iota Online Discriminated )
func (ApprovedIdentityFlag) HasFlag ¶ added in v0.29.0
func (f ApprovedIdentityFlag) HasFlag(flag ApprovedIdentityFlag) bool
type BitArray ¶
type BitArray struct { Bits uint `json:"bits"` // NOTE: persisted via reflect, must be exported Elems []uint64 `json:"elems"` // NOTE: persisted via reflect, must be exported // contains filtered or unexported fields }
BitArray is a thread-safe implementation of a bit array.
func NewBitArray ¶
NewBitArray returns a new bit array. It returns nil if the number of bits is zero.
func (*BitArray) GetIndex ¶
GetIndex returns the bit at index i within the bit array. The behavior is undefined if i >= bA.Bits
func (*BitArray) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface by marshaling bit array using a custom format: a string of '-' or 'x' where 'x' denotes the 1 bit.
func (*BitArray) SetIndex ¶
SetIndex sets the bit at index i within the bit array. The behavior is undefined if i >= bA.Bits
func (*BitArray) String ¶
String returns a string representation of BitArray: BA{<bit-string>}, where <bit-string> is a sequence of 'x' (1) and '_' (0). The <bit-string> includes spaces and newlines to help people. For a simple sequence of 'x' and '_' characters with no spaces or newlines, see the MarshalJSON() method. Example: "BA{_x_}" or "nil-BitArray" for nil.
func (*BitArray) StringIndented ¶
StringIndented returns the same thing as String(), but applies the indent at every 10th bit, and twice at every 50th bit.
func (*BitArray) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler interface by unmarshaling a custom JSON description.
type BurntCoins ¶ added in v0.31.0
type BurntCoins struct {
Items []BurntCoinsItem
}
func (*BurntCoins) FromBytes ¶ added in v0.31.0
func (v *BurntCoins) FromBytes(data []byte) error
func (*BurntCoins) ToBytes ¶ added in v0.31.0
func (v *BurntCoins) ToBytes() ([]byte, error)
type BurntCoinsItem ¶ added in v0.31.0
type ContractData ¶ added in v0.22.0
type DelayedPenalties ¶ added in v0.25.3
func (*DelayedPenalties) FromBytes ¶ added in v0.25.3
func (dp *DelayedPenalties) FromBytes(data []byte) error
func (*DelayedPenalties) ToBytes ¶ added in v0.25.3
func (dp *DelayedPenalties) ToBytes() ([]byte, error)
type Delegation ¶ added in v0.25.0
type DelegationSwitch ¶ added in v0.25.0
type DelegationSwitch struct {
Delegations []*Delegation
}
func (*DelegationSwitch) FromBytes ¶ added in v0.25.0
func (s *DelegationSwitch) FromBytes(data []byte) error
func (*DelegationSwitch) ToBytes ¶ added in v0.25.0
func (s *DelegationSwitch) ToBytes() ([]byte, error)
type Global ¶
type Global struct { Epoch uint16 NextValidationTime int64 ValidationPeriod ValidationPeriod GodAddress common.Address WordsSeed types.Seed LastSnapshot uint64 EpochBlock uint64 PrevEpochBlocks []uint64 FeePerGas *big.Int VrfProposerThreshold uint64 EmptyBlocksBits *big.Int GodAddressInvites uint16 BlocksCntWithoutCeremonialTxs uint32 ShardsNum uint32 EmptyBlocksByShards map[common.ShardId][]common.Address ShardSizes map[common.ShardId]uint32 }
type Identity ¶
type Identity struct { ProfileHash []byte Stake *big.Int Invites uint8 Birthday uint16 State IdentityState QualifiedFlips uint32 // should use GetShortFlipPoints instead of reading directly ShortFlipPoints uint32 PubKey []byte RequiredFlips uint8 Flips []IdentityFlip Generation uint32 Code []byte Invitees []TxAddr Inviter *Inviter Penalty *big.Int ValidationTxsBits byte LastValidationStatus ValidationStatusFlag Scores []byte DelegationNonce uint32 DelegationEpoch uint16 // do not use directly ShardId common.ShardId // contains filtered or unexported fields }
func (*Identity) GetMaximumAvailableFlips ¶
func (*Identity) GetShortFlipPoints ¶
func (*Identity) GetTotalWordPairsCount ¶
func (*Identity) HasDoneAllRequiredFlips ¶
func (*Identity) HasValidationTx ¶ added in v0.29.0
func (*Identity) IsDiscriminated ¶ added in v0.29.0
func (*Identity) PenaltySeconds ¶ added in v0.30.0
func (*Identity) PenaltyTimestamp ¶ added in v0.30.0
func (*Identity) PendingUndelegation ¶ added in v0.29.0
func (*Identity) ReplenishedStake ¶ added in v0.29.0
func (*Identity) SetPenaltySeconds ¶ added in v0.30.0
func (*Identity) SetPenaltyTimestamp ¶ added in v0.30.0
func (*Identity) ShiftedShardId ¶ added in v0.27.0
func (*Identity) UndelegationEpoch ¶ added in v0.31.0
type IdentityFlip ¶
type IdentityState ¶
type IdentityState uint8
func (IdentityState) IsInShard ¶ added in v0.27.0
func (s IdentityState) IsInShard() bool
func (IdentityState) NewbieOrBetter ¶
func (s IdentityState) NewbieOrBetter() bool
func (IdentityState) VerifiedOrBetter ¶
func (s IdentityState) VerifiedOrBetter() bool
type IdentityStateDB ¶
type IdentityStateDB struct {
// contains filtered or unexported fields
}
func NewLazyIdentityState ¶
func NewLazyIdentityState(db dbm.DB) (*IdentityStateDB, error)
func (*IdentityStateDB) AddDiff ¶
func (s *IdentityStateDB) AddDiff(height uint64, diff *IdentityStateDiff)
func (*IdentityStateDB) Clear ¶
func (s *IdentityStateDB) Clear()
func (*IdentityStateDB) Commit ¶
func (s *IdentityStateDB) Commit(deleteEmptyObjects bool) (root []byte, version int64, diff *IdentityStateDiff, err error)
Commit writes the state to the underlying in-memory trie database.
func (*IdentityStateDB) CommitSnapshot ¶ added in v0.23.0
func (s *IdentityStateDB) CommitSnapshot(height uint64) (dropDb dbm.DB)
func (*IdentityStateDB) CommitTree ¶
func (s *IdentityStateDB) CommitTree(newVersion int64) (root []byte, version int64, err error)
func (*IdentityStateDB) CreatePreliminaryCopy ¶
func (s *IdentityStateDB) CreatePreliminaryCopy(height uint64) (*IdentityStateDB, error)
func (*IdentityStateDB) Delegatee ¶ added in v0.25.0
func (s *IdentityStateDB) Delegatee(addr common.Address) *common.Address
func (*IdentityStateDB) DropPreliminary ¶
func (s *IdentityStateDB) DropPreliminary()
func (*IdentityStateDB) ForCheck ¶
func (s *IdentityStateDB) ForCheck(height uint64) (*IdentityStateDB, error)
func (*IdentityStateDB) ForCheckWithOverwrite ¶ added in v0.19.3
func (s *IdentityStateDB) ForCheckWithOverwrite(height uint64) (*IdentityStateDB, error)
func (*IdentityStateDB) GetOrNewIdentityObject ¶
func (s *IdentityStateDB) GetOrNewIdentityObject(addr common.Address) *stateApprovedIdentity
Retrieve a state object or create a new state object if nil
func (*IdentityStateDB) HasVersion ¶
func (s *IdentityStateDB) HasVersion(height uint64) bool
func (*IdentityStateDB) IsValidated ¶ added in v0.29.0
func (s *IdentityStateDB) IsValidated(addr common.Address) bool
func (*IdentityStateDB) IterateIdentities ¶
func (s *IdentityStateDB) IterateIdentities(fn func(key []byte, value []byte) bool) bool
func (*IdentityStateDB) Load ¶
func (s *IdentityStateDB) Load(height uint64) error
func (*IdentityStateDB) LoadPreliminary ¶
func (s *IdentityStateDB) LoadPreliminary(height uint64) (*IdentityStateDB, error)
func (*IdentityStateDB) MarkStateIdentityObjectDirty ¶
func (s *IdentityStateDB) MarkStateIdentityObjectDirty(addr common.Address)
MarkStateAccountObjectDirty adds the specified object to the dirty map to avoid costly state object cache iteration to find a handful of modified ones.
func (*IdentityStateDB) Precommit ¶
func (s *IdentityStateDB) Precommit(deleteEmptyObjects bool) *IdentityStateDiff
func (*IdentityStateDB) Readonly ¶
func (s *IdentityStateDB) Readonly(height uint64) (*IdentityStateDB, error)
func (*IdentityStateDB) RecoverSnapshot2 ¶ added in v0.27.3
func (*IdentityStateDB) Remove ¶
func (s *IdentityStateDB) Remove(identity common.Address)
func (*IdentityStateDB) RemoveDelegatee ¶ added in v0.25.0
func (s *IdentityStateDB) RemoveDelegatee(addr common.Address)
func (*IdentityStateDB) Reset ¶
func (s *IdentityStateDB) Reset()
func (*IdentityStateDB) ResetTo ¶
func (s *IdentityStateDB) ResetTo(height uint64) error
func (*IdentityStateDB) Root ¶
func (s *IdentityStateDB) Root() common.Hash
func (*IdentityStateDB) SaveForcedVersion ¶
func (s *IdentityStateDB) SaveForcedVersion(height uint64) error
func (*IdentityStateDB) SetDelegatee ¶ added in v0.25.0
func (s *IdentityStateDB) SetDelegatee(addr common.Address, delegatee common.Address)
func (*IdentityStateDB) SetDiscriminated ¶ added in v0.29.0
func (s *IdentityStateDB) SetDiscriminated(identity common.Address, discriminated bool)
func (*IdentityStateDB) SetOnline ¶
func (s *IdentityStateDB) SetOnline(addr common.Address, online bool)
func (*IdentityStateDB) SetPredefinedIdentities ¶
func (s *IdentityStateDB) SetPredefinedIdentities(state *models.ProtoPredefinedState)
func (*IdentityStateDB) SetValidated ¶ added in v0.29.0
func (s *IdentityStateDB) SetValidated(identity common.Address, validated bool)
func (*IdentityStateDB) SwitchToPreliminary ¶
func (*IdentityStateDB) Version ¶
func (s *IdentityStateDB) Version() uint64
type IdentityStateDiff ¶
type IdentityStateDiff struct {
Values []*IdentityStateDiffValue
}
func (*IdentityStateDiff) Empty ¶
func (diff *IdentityStateDiff) Empty() bool
func (*IdentityStateDiff) FromBytes ¶ added in v0.21.0
func (diff *IdentityStateDiff) FromBytes(data []byte) error
func (*IdentityStateDiff) FromProto ¶ added in v0.21.0
func (diff *IdentityStateDiff) FromProto(protoDiff *models.ProtoIdentityStateDiff) *IdentityStateDiff
func (*IdentityStateDiff) ToBytes ¶ added in v0.21.0
func (diff *IdentityStateDiff) ToBytes() ([]byte, error)
func (*IdentityStateDiff) ToProto ¶ added in v0.21.0
func (diff *IdentityStateDiff) ToProto() *models.ProtoIdentityStateDiff
type IdentityStateDiffValue ¶
type IdentityStatusSwitch ¶
func (*IdentityStatusSwitch) FromBytes ¶ added in v0.21.0
func (s *IdentityStatusSwitch) FromBytes(data []byte) error
func (*IdentityStatusSwitch) ToBytes ¶ added in v0.21.0
func (s *IdentityStatusSwitch) ToBytes() ([]byte, error)
type IdentityUpdateHook ¶ added in v0.30.0
type IdentityUpdateHook = func(identity *Identity)
type ImmutableTree ¶
type ImmutableTree struct {
// contains filtered or unexported fields
}
func (*ImmutableTree) AvailableVersions ¶
func (t *ImmutableTree) AvailableVersions() []int
func (*ImmutableTree) DeleteVersion ¶
func (t *ImmutableTree) DeleteVersion(version int64) error
func (*ImmutableTree) ExistVersion ¶
func (t *ImmutableTree) ExistVersion(version int64) bool
func (*ImmutableTree) Exporter ¶ added in v0.26.7
func (t *ImmutableTree) Exporter() *iavl.Exporter
func (*ImmutableTree) GetImmutable ¶
func (t *ImmutableTree) GetImmutable() *ImmutableTree
func (*ImmutableTree) GetWithProof ¶ added in v0.28.3
func (t *ImmutableTree) GetWithProof(key []byte) ([]byte, error)
func (*ImmutableTree) Hash ¶
func (t *ImmutableTree) Hash() common.Hash
func (*ImmutableTree) Iterate ¶
func (t *ImmutableTree) Iterate(fn func(key []byte, value []byte) bool) (stopped bool)
Iterate iterates over all keys of the tree, in order.
func (*ImmutableTree) IterateRange ¶
func (t *ImmutableTree) IterateRange(start, end []byte, ascending bool, fn func(key []byte, value []byte) bool) (stopped bool)
IterateRange makes a callback for all nodes with key between start and end non-inclusive. If either are nil, then it is open on that side (nil, nil is the same as Iterate)
func (*ImmutableTree) IterateRangeInclusive ¶
func (t *ImmutableTree) IterateRangeInclusive(start, end []byte, ascending bool, fn func(key, value []byte, version int64) bool) (stopped bool)
IterateRangeInclusive makes a callback for all nodes with key between start and end inclusive. If either are nil, then it is open on that side (nil, nil is the same as Iterate)
func (*ImmutableTree) Load ¶
func (t *ImmutableTree) Load() (int64, error)
func (*ImmutableTree) LoadVersion ¶
func (t *ImmutableTree) LoadVersion(targetVersion int64) (int64, error)
func (*ImmutableTree) LoadVersionForOverwriting ¶
func (t *ImmutableTree) LoadVersionForOverwriting(targetVersion int64) (int64, error)
func (*ImmutableTree) Rollback ¶
func (t *ImmutableTree) Rollback()
func (*ImmutableTree) SaveVersion ¶
func (t *ImmutableTree) SaveVersion() ([]byte, int64, error)
func (*ImmutableTree) SaveVersionAt ¶
func (t *ImmutableTree) SaveVersionAt(version int64) ([]byte, int64, error)
func (*ImmutableTree) Set ¶
func (t *ImmutableTree) Set(key, value []byte) bool
func (*ImmutableTree) SetVirtualVersion ¶
func (t *ImmutableTree) SetVirtualVersion(version int64)
func (*ImmutableTree) ValidateTree ¶
func (t *ImmutableTree) ValidateTree() bool
func (*ImmutableTree) Version ¶
func (t *ImmutableTree) Version() int64
func (*ImmutableTree) WorkingHash ¶
func (t *ImmutableTree) WorkingHash() common.Hash
type MutableTree ¶
type MutableTree struct {
// contains filtered or unexported fields
}
func NewMutableTree ¶
func NewMutableTree(db dbm.DB) *MutableTree
func (*MutableTree) AvailableVersions ¶
func (t *MutableTree) AvailableVersions() []int
func (*MutableTree) DeleteVersion ¶
func (t *MutableTree) DeleteVersion(version int64) error
func (*MutableTree) ExistVersion ¶
func (t *MutableTree) ExistVersion(version int64) bool
func (*MutableTree) GetImmutable ¶
func (t *MutableTree) GetImmutable() *ImmutableTree
func (*MutableTree) Hash ¶
func (t *MutableTree) Hash() common.Hash
func (*MutableTree) Importer ¶ added in v0.26.7
func (t *MutableTree) Importer(version int64) (*iavl.Importer, error)
func (*MutableTree) LazyLoad ¶ added in v0.19.3
func (t *MutableTree) LazyLoad(version int64) (int64, error)
func (*MutableTree) Load ¶
func (t *MutableTree) Load() (int64, error)
func (*MutableTree) LoadVersion ¶
func (t *MutableTree) LoadVersion(targetVersion int64) (int64, error)
func (*MutableTree) LoadVersionForOverwriting ¶
func (t *MutableTree) LoadVersionForOverwriting(targetVersion int64) (int64, error)
func (*MutableTree) Rollback ¶
func (t *MutableTree) Rollback()
func (*MutableTree) SaveVersion ¶
func (t *MutableTree) SaveVersion() ([]byte, int64, error)
func (*MutableTree) SaveVersionAt ¶
func (t *MutableTree) SaveVersionAt(version int64) ([]byte, int64, error)
func (*MutableTree) Set ¶
func (t *MutableTree) Set(key, value []byte) bool
func (*MutableTree) SetVirtualVersion ¶
func (t *MutableTree) SetVirtualVersion(version int64)
func (*MutableTree) ValidateTree ¶
func (t *MutableTree) ValidateTree() bool
func (*MutableTree) Version ¶
func (t *MutableTree) Version() int64
func (*MutableTree) WorkingHash ¶
func (t *MutableTree) WorkingHash() common.Hash
type NonceCache ¶
type NonceCache struct {
// contains filtered or unexported fields
}
func NewNonceCache ¶
func NewNonceCache(sdb *StateDB) (*NonceCache, error)
func (*NonceCache) Clear ¶ added in v0.19.3
func (ns *NonceCache) Clear()
func (*NonceCache) GetNonce ¶
func (ns *NonceCache) GetNonce(addr common.Address, epoch uint16) uint32
GetNonce returns the canonical nonce for the managed or unmanaged account. Because GetNonce mutates the DB, we must take a write lock.
func (*NonceCache) Lock ¶ added in v0.19.3
func (ns *NonceCache) Lock()
func (*NonceCache) ReloadFallback ¶ added in v0.19.3
func (ns *NonceCache) ReloadFallback(sdb *StateDB) error
func (*NonceCache) SetNonce ¶
func (ns *NonceCache) SetNonce(addr common.Address, txEpoch uint16, nonce uint32)
SetNonce sets the new canonical nonce for the managed state
func (*NonceCache) UnLock ¶ added in v0.19.3
func (ns *NonceCache) UnLock()
func (*NonceCache) UnsafeSetNonce ¶ added in v0.19.3
func (ns *NonceCache) UnsafeSetNonce(addr common.Address, txEpoch uint16, nonce uint32)
type SnapshotManager ¶
type SnapshotManager struct {
// contains filtered or unexported fields
}
func NewSnapshotManager ¶
func (*SnapshotManager) AddInvalidManifest ¶
func (m *SnapshotManager) AddInvalidManifest(cid []byte)
func (*SnapshotManager) AddTimeoutManifest ¶
func (m *SnapshotManager) AddTimeoutManifest(cid []byte)
func (*SnapshotManager) DownloadSnapshot ¶
func (m *SnapshotManager) DownloadSnapshot(snapshot *snapshot.Manifest) (filePath string, version SnapshotVersion, err error)
func (*SnapshotManager) IsInvalidManifest ¶
func (m *SnapshotManager) IsInvalidManifest(cid []byte) bool
func (*SnapshotManager) StartSync ¶
func (m *SnapshotManager) StartSync()
func (*SnapshotManager) StopSync ¶
func (m *SnapshotManager) StopSync()
type SnapshotVersion ¶ added in v0.26.7
type SnapshotVersion byte
type StateDB ¶
type StateDB struct {
// contains filtered or unexported fields
}
func (*StateDB) AddBalance ¶
AddBalance adds amount to the account associated with addr
func (*StateDB) AddBlockBit ¶
func (*StateDB) AddBurntCoins ¶ added in v0.31.0
func (*StateDB) AddDelayedPenalty ¶ added in v0.25.3
func (*StateDB) AddDiff ¶ added in v0.26.3
func (s *StateDB) AddDiff(diffs []*StateTreeDiff)
func (*StateDB) AddEmptyBlockByShard ¶ added in v0.27.0
func (*StateDB) AddInvitee ¶
func (*StateDB) AddNewScore ¶ added in v0.22.0
func (*StateDB) AddPrevEpochBlock ¶ added in v0.25.3
func (*StateDB) AddReplenishedStake ¶ added in v0.29.0
func (*StateDB) BlocksCntWithoutCeremonialTxs ¶ added in v0.21.0
func (*StateDB) CanCompleteEpoch ¶ added in v0.27.0
func (*StateDB) ClearAccount ¶ added in v0.20.0
func (*StateDB) ClearDelayedOfflinePenalties ¶ added in v0.25.3
func (s *StateDB) ClearDelayedOfflinePenalties()
func (*StateDB) ClearDelegations ¶ added in v0.25.0
func (s *StateDB) ClearDelegations()
func (*StateDB) ClearEmptyBlocksByShard ¶ added in v0.27.0
func (s *StateDB) ClearEmptyBlocksByShard()
func (*StateDB) ClearFlips ¶
func (*StateDB) ClearOutdatedBurntCoins ¶ added in v0.31.0
func (*StateDB) ClearPenalty ¶
func (*StateDB) ClearStatusSwitchAddresses ¶
func (s *StateDB) ClearStatusSwitchAddresses()
func (*StateDB) CollectKilledDelegators ¶ added in v0.25.0
func (*StateDB) Commit ¶
func (s *StateDB) Commit(deleteEmptyObjects bool) (diff []*StateTreeDiff, root []byte, version int64, err error)
Commit writes the state to the underlying in-memory trie database.
func (*StateDB) CommitSnapshot ¶
func (*StateDB) CommitTree ¶
func (*StateDB) DecreaseShardSize ¶ added in v0.27.0
func (*StateDB) DelayedOfflinePenalties ¶ added in v0.25.3
func (*StateDB) DelegationEpoch ¶ added in v0.25.0
func (*StateDB) DelegationSwitch ¶ added in v0.25.0
func (s *StateDB) DelegationSwitch(sender common.Address) *Delegation
func (*StateDB) Delegations ¶ added in v0.25.0
func (s *StateDB) Delegations() []*Delegation
func (*StateDB) DeployContract ¶ added in v0.22.0
func (*StateDB) DropContract ¶ added in v0.22.0
func (*StateDB) DropSnapshot ¶
func (*StateDB) EmptyBlocksByShard ¶ added in v0.27.0
func (*StateDB) EmptyBlocksCount ¶
func (*StateDB) EpochBlock ¶
func (*StateDB) FlipWordsSeed ¶
func (*StateDB) ForCheckWithOverwrite ¶ added in v0.19.3
func (*StateDB) GeneticCode ¶
func (*StateDB) GetBalance ¶
Retrieve the balance from the given address or 0 if object not found
func (*StateDB) GetCodeHash ¶ added in v0.22.0
func (*StateDB) GetContractStake ¶ added in v0.22.0
func (*StateDB) GetContractValue ¶ added in v0.22.0
func (*StateDB) GetIdentityState ¶
func (s *StateDB) GetIdentityState(addr common.Address) IdentityState
func (*StateDB) GetIdentityWithProof ¶ added in v0.28.3
func (*StateDB) GetOrNewAccountObject ¶
Retrieve a state object or create a new state object if nil
func (*StateDB) GetOrNewDelayedOfflinePenaltyObject ¶ added in v0.25.3
func (s *StateDB) GetOrNewDelayedOfflinePenaltyObject() *stateDelayedOfflinePenalties
func (*StateDB) GetOrNewDelegationSwitchObject ¶ added in v0.25.0
func (s *StateDB) GetOrNewDelegationSwitchObject() *stateDelegationSwitch
func (*StateDB) GetOrNewGlobalObject ¶
func (s *StateDB) GetOrNewGlobalObject() *stateGlobal
Retrieve a state object or create a new state object if nil
func (*StateDB) GetOrNewIdentityObject ¶
Retrieve a state object or create a new state object if nil
func (*StateDB) GetOrNewStatusSwitchObject ¶
func (s *StateDB) GetOrNewStatusSwitchObject() *stateStatusSwitch
func (*StateDB) GetPenaltySeconds ¶ added in v0.30.0
func (*StateDB) GetPenaltyTimestamp ¶ added in v0.30.0
func (*StateDB) GetQualifiedFlipsCount ¶
func (*StateDB) GetReplenishedStakeBalance ¶ added in v0.29.0
func (*StateDB) GetShortFlipPoints ¶
func (*StateDB) GodAddress ¶
func (*StateDB) GodAddressInvites ¶
func (*StateDB) HasDelayedOfflinePenalty ¶ added in v0.25.3
func (*StateDB) HasStatusSwitchAddresses ¶
func (*StateDB) HasValidationTx ¶
func (*StateDB) HasVersion ¶ added in v0.26.7
func (*StateDB) IncBlocksCntWithoutCeremonialTxs ¶ added in v0.21.0
func (s *StateDB) IncBlocksCntWithoutCeremonialTxs()
func (*StateDB) IncreaseShardSize ¶ added in v0.27.0
func (*StateDB) IsDiscriminated ¶ added in v0.29.0
func (*StateDB) IterateAccounts ¶
func (*StateDB) IterateBurntCoins ¶ added in v0.31.0
func (s *StateDB) IterateBurntCoins(callback func(height uint64, value BurntCoins))
func (*StateDB) IterateContractStore ¶ added in v0.22.0
func (*StateDB) IterateContractValues ¶ added in v0.22.0
Iterate over all stored contract data
func (*StateDB) IterateIdentities ¶
func (*StateDB) IterateOverAccounts ¶ added in v0.20.0
func (*StateDB) IterateOverIdentities ¶
func (*StateDB) LastSnapshot ¶
func (*StateDB) MarkStateAccountObjectDirty ¶
MarkStateAccountObjectDirty adds the specified object to the dirty map to avoid costly state object cache iteration to find a handful of modified ones.
func (*StateDB) MarkStateBurntCoinsObjectDirty ¶ added in v0.31.0
func (*StateDB) MarkStateDelayedOfflinePenaltyObjectDirty ¶ added in v0.25.3
func (s *StateDB) MarkStateDelayedOfflinePenaltyObjectDirty()
func (*StateDB) MarkStateDelegationSwitchObjectDirty ¶ added in v0.25.0
func (s *StateDB) MarkStateDelegationSwitchObjectDirty()
func (*StateDB) MarkStateGlobalObjectDirty ¶
func (s *StateDB) MarkStateGlobalObjectDirty()
MarkStateAccountObjectDirty adds the specified object to the dirty map to avoid costly state object cache iteration to find a handful of modified ones.
func (*StateDB) MarkStateIdentityObjectDirty ¶
MarkStateAccountObjectDirty adds the specified object to the dirty map to avoid costly state object cache iteration to find a handful of modified ones.
func (*StateDB) MarkStateStatusSwitchObjectDirty ¶
func (s *StateDB) MarkStateStatusSwitchObjectDirty()
func (*StateDB) NextValidationTime ¶
func (*StateDB) PendingUndelegation ¶ added in v0.29.0
func (*StateDB) Precommit ¶
func (s *StateDB) Precommit(deleteEmptyObjects bool) []*StateTreeDiff
func (*StateDB) PrevEpochBlocks ¶ added in v0.25.3
func (*StateDB) ProvideIdentityUpdateHook ¶ added in v0.30.0
func (s *StateDB) ProvideIdentityUpdateHook(hook IdentityUpdateHook)
func (*StateDB) RecoverSnapshot2 ¶ added in v0.26.7
func (*StateDB) RemoveContractValue ¶ added in v0.22.0
func (*StateDB) RemoveDelayedOfflinePenalty ¶ added in v0.25.3
func (*StateDB) RemoveDelegatee ¶ added in v0.25.0
func (*StateDB) RemoveInvitee ¶
func (*StateDB) RemovePendingUndelegation ¶ added in v0.29.0
func (*StateDB) ResetBlocksCntWithoutCeremonialTxs ¶ added in v0.21.0
func (s *StateDB) ResetBlocksCntWithoutCeremonialTxs()
func (*StateDB) ResetEmptyBlockByShard ¶ added in v0.27.0
func (*StateDB) ResetInviter ¶
func (*StateDB) ResetValidationTxBits ¶
func (*StateDB) SaveForcedVersion ¶
func (*StateDB) SetBirthday ¶
func (*StateDB) SetContractStake ¶ added in v0.22.0
func (*StateDB) SetContractValue ¶ added in v0.22.0
func (*StateDB) SetDelegatee ¶ added in v0.25.0
func (*StateDB) SetDelegationEpoch ¶ added in v0.25.0
func (*StateDB) SetDelegationNonce ¶ added in v0.25.0
func (*StateDB) SetEpochBlock ¶
func (*StateDB) SetFeePerGas ¶ added in v0.22.0
func (*StateDB) SetFlipWordsSeed ¶
func (*StateDB) SetGeneticCode ¶
func (*StateDB) SetGlobalEpoch ¶
func (*StateDB) SetGodAddress ¶
func (*StateDB) SetGodAddressInvites ¶
func (*StateDB) SetInviter ¶
func (*StateDB) SetLastSnapshot ¶
func (*StateDB) SetMetadata ¶ added in v0.30.0
func (*StateDB) SetNextValidationTime ¶
func (*StateDB) SetPenaltySeconds ¶ added in v0.30.1
func (*StateDB) SetPenaltyTimestamp ¶ added in v0.30.0
func (*StateDB) SetPendingUndelegation ¶ added in v0.29.0
func (*StateDB) SetPredefinedAccounts ¶
func (s *StateDB) SetPredefinedAccounts(state *models.ProtoPredefinedState)
func (*StateDB) SetPredefinedContractValues ¶ added in v0.22.0
func (s *StateDB) SetPredefinedContractValues(state *models.ProtoPredefinedState)
func (*StateDB) SetPredefinedGlobal ¶
func (s *StateDB) SetPredefinedGlobal(state *models.ProtoPredefinedState)
func (*StateDB) SetPredefinedIdentities ¶
func (s *StateDB) SetPredefinedIdentities(state *models.ProtoPredefinedState)
func (*StateDB) SetPredefinedStatusSwitch ¶
func (s *StateDB) SetPredefinedStatusSwitch(state *models.ProtoPredefinedState)
func (*StateDB) SetRequiredFlips ¶
func (*StateDB) SetShardId ¶ added in v0.27.0
func (*StateDB) SetShardSize ¶ added in v0.27.0
func (*StateDB) SetShardsNum ¶ added in v0.27.0
func (*StateDB) SetUndelegationEpoch ¶ added in v0.31.0
func (*StateDB) SetValidationPeriod ¶
func (s *StateDB) SetValidationPeriod(period ValidationPeriod)
func (*StateDB) SetValidationStatus ¶
func (s *StateDB) SetValidationStatus(addr common.Address, status ValidationStatusFlag)
func (*StateDB) SetValidationTxBit ¶
func (*StateDB) SetVrfProposerThreshold ¶
func (*StateDB) ShardSizes ¶ added in v0.27.0
func (*StateDB) StatusSwitchAddresses ¶
func (*StateDB) SubBalance ¶
SubBalance subtracts amount from the account associated with addr
func (*StateDB) SubGodAddressInvite ¶
func (s *StateDB) SubGodAddressInvite()
func (*StateDB) SubPenaltySeconds ¶ added in v0.30.0
func (*StateDB) SubReplenishedStake ¶ added in v0.29.0
func (*StateDB) ToggleDelegationAddress ¶ added in v0.25.0
func (*StateDB) ToggleStatusSwitchAddress ¶
func (*StateDB) ValidationPeriod ¶
func (s *StateDB) ValidationPeriod() ValidationPeriod
func (*StateDB) VrfProposerThreshold ¶
type StateTreeDiff ¶ added in v0.26.3
type Tree ¶
type Tree interface { Get(key []byte) (index int64, value []byte) Set(key, value []byte) bool Remove(key []byte) ([]byte, bool) LoadVersion(targetVersion int64) (int64, error) Load() (int64, error) SaveVersion() ([]byte, int64, error) DeleteVersion(version int64) error GetImmutable() *ImmutableTree Version() int64 Hash() common.Hash WorkingHash() common.Hash ExistVersion(version int64) bool LoadVersionForOverwriting(targetVersion int64) (int64, error) Rollback() AvailableVersions() []int SaveVersionAt(version int64) ([]byte, int64, error) SetVirtualVersion(version int64) ValidateTree() bool }
type ValidationPeriod ¶
type ValidationPeriod uint32
const ( NonePeriod ValidationPeriod = 0 FlipLotteryPeriod ValidationPeriod = 1 ShortSessionPeriod ValidationPeriod = 2 LongSessionPeriod ValidationPeriod = 3 AfterLongSessionPeriod ValidationPeriod = 4 )
type ValidationStatusFlag ¶
type ValidationStatusFlag uint16
const ( AtLeastOneFlipReported ValidationStatusFlag = 1 << iota AtLeastOneFlipNotQualified AllFlipsNotQualified )
func (ValidationStatusFlag) HasFlag ¶
func (f ValidationStatusFlag) HasFlag(flag ValidationStatusFlag) bool