Documentation ¶
Overview ¶
Package alien implements the delegated-proof-of-stake consensus engine.
Package alien implements the delegated-proof-of-stake consensus engine.
Index ¶
- Constants
- Variables
- func Acc(b1, b2, n string) string
- func AlienRLP(header *types.Header) []byte
- func ByteToUint64LittleEndian(b []byte) uint64
- func FlowMinerReportEncodeRlp(items []*FlowMinerReport) (error, []byte)
- func Hash(b1, b2, pos string) string
- func PledgeItemEncodeRlp(items []*PledgeItem) (error, []byte)
- func SealHash(header *types.Header) (hash common.Hash)
- func Sha1(orgin []byte) string
- func UInt64ToByteLittleEndian(i uint64) []byte
- type API
- func (api *API) GetCandidateAutoExitAtNumber(number uint64) (*SnapCanAutoExit, error)
- func (api *API) GetCapSuccAddrsAtNumber(number uint64) (*SnapshotCapSuccAddrs, error)
- func (api *API) GetGrantProfitAtNumber(number uint64) ([]consensus.GrantProfitRecord, error)
- func (api *API) GetLockRewardAtNumber(number uint64) ([]LockRewardRecord, error)
- func (api *API) GetRentSucAtNumber(number uint64) (*SnapshotRentSuc, error)
- func (api *API) GetRevertSRTAtNumber(number uint64) (*SnapshotRevertSRT, error)
- func (api *API) GetSPledgeAtNumber(number uint64) (*SnapshotSPledge, error)
- func (api *API) GetSPledgeCapVerAtNumber(number uint64) (*SnapshotSPledgeCapVer, error)
- func (api *API) GetSPledgeInfoByAddr(address common.Address) (*SnapshotSPledgeInfo, error)
- func (api *API) GetSRTBalAtNumber(number uint64) (*SnapshotSRT, error)
- func (api *API) GetSRTBalance(address common.Address) (*SnapshotAddrSRT, error)
- func (api *API) GetSRTBalanceAtNumber(address common.Address, number uint64) (*SnapshotAddrSRT, error)
- func (api *API) GetSTGBandwidthMakeup() (*SnapshotSTGbwMakeup, error)
- func (api *API) GetSnapshot(number *rpc.BlockNumber) (*Snapshot, error)
- func (api *API) GetSnapshotAtHash(hash common.Hash) (*Snapshot, error)
- func (api *API) GetSnapshotAtNumber(number uint64) (*Snapshot, error)
- func (api *API) GetSnapshotFlowAtNumber(number uint64) (*SnapshotFlow, error)
- func (api *API) GetSnapshotFlowMinerAtNumber(number uint64) (*SnapshotFlowMiner, error)
- func (api *API) GetSnapshotFlowReportAtNumber(number uint64) (*SnapshotFlowReport, error)
- func (api *API) GetSnapshotReleaseAtNumber(number uint64, part string) (*SnapshotRelease, error)
- func (api *API) GetSnapshotReleaseAtNumber2(number uint64, part string, startLNum uint64, endLNum uint64) (*SnapshotRelease, error)
- func (api *API) GetSnapshotSignerAtNumber(number uint64) (*SnapshotSign, error)
- func (api *API) GetStorageDecimalValueAtNumber(number uint64, part string) (*SnapshotSPledgeDecimalValue, error)
- func (api *API) GetStorageRatioValueAtNumber(number uint64, value *big.Int, part string) (*SnapshotSPledgeRatioValue, error)
- func (api *API) GetStorageRatiosAtNumber(number uint64) (*SnapshotStorageRatios, error)
- func (api *API) GetStorageRewardAtNumber(number uint64, part string) (*SnapshotStorageReward, error)
- func (api *API) GetStorageValueAtNumber(number uint64, part string) (*SnapshotSPledgeValue, error)
- func (api *API) GetSucSPledgeAtNumber(number uint64) (*SnapshotSucSPledge, error)
- type Alien
- func (a *Alien) APIs(chain consensus.ChainHeaderReader) []rpc.API
- func (a *Alien) ApplyGenesis(chain consensus.ChainHeaderReader, genesisHash common.Hash) error
- func (a *Alien) Author(header *types.Header) (common.Address, error)
- func (a *Alien) Authorize(signer common.Address, signFn SignerFn, signTxFn SignTxFn)
- func (a *Alien) CalcDifficulty(chain consensus.ChainHeaderReader, time uint64, parent *types.Header) *big.Int
- func (a *Alien) Close() error
- func (a *Alien) Finalize(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, ...) error
- func (a *Alien) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, ...) (*types.Block, error)
- func (a *Alien) GrantProfit(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB) ([]consensus.GrantProfitRecord, []consensus.GrantProfitRecord)
- func (a *Alien) Prepare(chain consensus.ChainHeaderReader, header *types.Header) error
- func (a *Alien) RepairBal(state *state.StateDB, number uint64)
- func (a *Alien) Seal(chain consensus.ChainHeaderReader, block *types.Block, ...) error
- func (a *Alien) SealHash(header *types.Header) common.Hash
- func (a *Alien) StorageProofNew(storageProofRecord []StorageProofRecord, verifyInfo string, ...) ([]string, []StorageProofRecord)
- func (a *Alien) VerifyHeader(chain consensus.ChainHeaderReader, state *state.StateDB, header *types.Header, ...) error
- func (a *Alien) VerifyHeaderExtra(chain consensus.ChainHeaderReader, header *types.Header, verifyExtra []byte) error
- func (a *Alien) VerifyHeaders(chain consensus.ChainHeaderReader, state *state.StateDB, ...) (chan<- struct{}, <-chan error)
- func (a *Alien) VerifyLockReward(header *types.Header, snap *Snapshot, chain consensus.ChainHeaderReader, ...) error
- func (a *Alien) VerifySeal(chain consensus.ChainHeaderReader, state *state.StateDB, header *types.Header) error
- func (a *Alien) VerifyUncles(chain consensus.ChainReader, block *types.Block) error
- type BandwidthMakeup
- type BandwidthPunishRecord
- type CCNotice
- type CandidateChangeRateRecord
- type CandidatePEntrustExitRecord
- type CandidatePledgeEntrustRecord
- type CandidatePledgeNewRecord
- type CandidatePledgeRecord
- type CandidatePunishRecord
- type CandidateState
- type ClaimedBandwidth
- type ClaimedBandwidthRecord
- type ConfigDepositRecord
- type Confirmation
- type Declare
- type DefaultLockState
- func (c *DefaultLockState) AddLockReward(LockReward []LockRewardRecord, snap *Snapshot, db ethdb.Database, ...) ([]LockRewardRecord, error)
- func (c *DefaultLockState) CommitData() (common.Hash, common.Hash, error)
- func (c *DefaultLockState) PayLockReward(LockAccountsRoot common.Hash, number uint64, state *state.StateDB) error
- type DefaultSRTState
- func (c *DefaultSRTState) Add(addr common.Address, amount *big.Int)
- func (c *DefaultSRTState) Copy() SRTState
- func (c *DefaultSRTState) Del(addr common.Address)
- func (c *DefaultSRTState) Get(addr common.Address) *big.Int
- func (c *DefaultSRTState) GetAll() map[common.Address]*big.Int
- func (c *DefaultSRTState) Load(db ethdb.Database, hash common.Hash) error
- func (c *DefaultSRTState) Root() common.Hash
- func (c *DefaultSRTState) Save(db ethdb.Database) (common.Hash, error)
- func (c *DefaultSRTState) Set(addr common.Address, amount *big.Int)
- func (c *DefaultSRTState) Sub(addr common.Address, amount *big.Int) error
- type DeviceBindRecord
- type ExchangeNFCRecord
- type ExchangeSRTRecord
- type FULLBalanceData
- type FlowMinerReport
- type FlowMinerSnap
- type FlowRecord
- type GasCharging
- type HeaderExtra
- type HeaderExtraV5
- type ISPQOSRecord
- type Lease
- type Lease2
- type Lease3
- type LeaseDetail
- type LeaseDetail2
- type LeasePledgeRecord
- type LeaseRenewalPledgeRecord
- type LeaseRenewalRecord
- type LeaseRequestRecord
- type LeaseRescindRecord
- type LockBalanceData
- type LockData
- type LockParameter
- type LockParameterRecord
- type LockProfitSnap
- type LockRewardRecord
- type LockState
- type ManagerAddressRecord
- type MinerFlowReportItem
- type MinerFlowReportRecord
- type MinerStakeRecord
- type NoticeCR
- type OldHeaderExtra
- type PledgeDetail
- type PledgeItem
- type PosPledgeItem
- type Proposal
- type RefundGas
- type RefundHash
- type RefundPair
- type RevenueParameter
- type RlsLockData
- type SCBlockReward
- type SCConfirmation
- type SCRecord
- type SCRentInfo
- type SCReward
- type SCSetCoinbase
- type SExpireRecord
- type SPledge
- type SPledge2
- type SPledge3
- type SPledgeExitRecord
- type SPledgeRecord
- type SPledgeRecoveryRecord
- type SPledgeSpaces
- type SRTItem
- type SRTState
- type SignPledgeItem
- type SignTxFn
- type SignerFn
- type SignerItem
- type SignerSlice
- type SnapCache
- type SnapCanAutoExit
- type Snapshot
- type SnapshotAddrSRT
- type SnapshotCapSuccAddrs
- type SnapshotFlow
- type SnapshotFlowMiner
- type SnapshotFlowReport
- type SnapshotRelease
- type SnapshotRentSuc
- type SnapshotRevertSRT
- type SnapshotSPledge
- type SnapshotSPledgeCapVer
- type SnapshotSPledgeDecimalValue
- type SnapshotSPledgeInfo
- type SnapshotSPledgeRatioValue
- type SnapshotSPledgeValue
- type SnapshotSRT
- type SnapshotSTGbwMakeup
- type SnapshotSign
- type SnapshotStorageRatios
- type SnapshotStorageReward
- type SnapshotSucSPledge
- type SpaceRewardRecord
- type SrtAccount
- type SrtBalRecord
- type SrtBalSlice
- type SrtTrie
- func (s *SrtTrie) Add(addr common.Address, amount *big.Int)
- func (s *SrtTrie) Copy() SRTState
- func (s *SrtTrie) Del(addr common.Address)
- func (s *SrtTrie) Get(addr common.Address) *big.Int
- func (s *SrtTrie) GetAll() map[common.Address]*big.Int
- func (s *SrtTrie) GetOrNewAccount(addr common.Address) *SrtAccount
- func (s *SrtTrie) Hash() common.Hash
- func (s *SrtTrie) Load(db ethdb.Database, hash common.Hash) error
- func (s *SrtTrie) Root() common.Hash
- func (s *SrtTrie) Save(db ethdb.Database) (common.Hash, error)
- func (s *SrtTrie) Set(addr common.Address, amount *big.Int)
- func (s *SrtTrie) Sub(addr common.Address, amount *big.Int) error
- func (s *SrtTrie) TireDB() *trie.Database
- type StorageBwPayRecord
- type StorageData
- type StorageExchangeBwRecord
- type StorageExchangePriceRecord
- type StorageFile
- type StorageHeaderExtraV1
- type StorageHeaderExtraV2
- type StorageHeaderExtraV3
- type StorageHeaderExtraV4
- type StorageProofRecord
- type StorageRatio
- type StorageReward
- type SystemParameter
- type TallyItem
- type TallySlice
- type Vote
Constants ¶
const ( SigerQueueFixBlockNumber = 591790 SigerElectNewEffectBlockNumber = 661874 MinerUpdateStateFixBlockNumber = 757054 TallyPunishdProcessEffectBlockNumber = 757114 TallyPunishdFixBlockNumber = 774331 StorageEffectBlockNumber = 834261 SPledgeRevertFixBlockNumber = 894333 AdjustSPRBlockNumber = 974868 //Adjust calc StoragePledgeReward StorageChBwEffectNumber = 1170700 PledgeRevertLockEffectNumber = 1495994 StoragePledgeOptEffectNumber = 1608207 FixLeaseCapacityNumber = 1660014 PosrIncentiveEffectNumber = 1744720 PosrExitNewRuleEffectNumber = 1953447 PosrNewCalEffectNumber = 2306412 PosNewEffectNumber = 2558551 PosLastPunishFixNumber = 2566675 PosAutoExitPunishChangeNumber = 2755395 GrantEffectNumber = 3713619 )
const ( LOCKREWARDDATA = "reward" LOCKFLOWDATA = "flow" LOCKBANDWIDTHDATA = "bandwidth" LOCKPOSEXITDATA = "posplexit" LOCKPEXITDATA = "posexit" )
const ( SPledgeNormal = 0 SPledgeExit = 1 SPledgeRemoving = 5 //30-day verification failed SPledgeRetrun = 6 //SRT and pledge deposit have been returned LeaseNotPledged = 0 LeaseNormal = 1 LeaseUserRescind = 2 LeaseExpiration = 3 LeaseBreach = 4 LeaseReturn = 6 )
const (
RepairBalanceNumber = 1170523
)
Variables ¶
var ( BurnBase = big.NewInt(10000) BandwidthMakeupPunishDay = uint64(30) IncentivePeriod = big.NewInt(30) BandwidthAdjustPeriodDay = uint64(7) )
var (
ErrDeclareParameter = "1001"
)
var ( // ErrInvalidTimestamp is returned if the timestamp of a block is lower than // the previous block's timestamp + the minimum block period. ErrInvalidTimestamp = errors.New("invalid timestamp") )
Various error messages to mark blocks invalid. These should be private to prevent engine specific errors from being referenced in the remainder of the codebase, inherently breaking if the engine is swapped out. Please put common error types into the consensus package.
var SCCurrentBlockReward = map[uint64]map[uint64]uint64{
1: {1: 100},
2: {1: 30, 2: 70},
3: {1: 15, 2: 30, 3: 55},
4: {1: 5, 2: 15, 3: 30, 4: 50},
5: {1: 5, 2: 10, 3: 15, 4: 25, 5: 45},
6: {1: 1, 2: 4, 3: 10, 4: 15, 5: 25, 6: 45},
}
SCCurrentBlockReward is base on scMaxCountPerPeriod = 6
Functions ¶
func AlienRLP ¶
CliqueRLP returns the rlp bytes which needs to be signed for the proof-of-authority sealing. The RLP to sign consists of the entire header apart from the 65 byte signature contained at the end of the extra data.
Note, the method requires the extra data to be at least 65 bytes, otherwise it panics. This is done to avoid accidentally using both forms (signature present or not), which could be abused to produce different hashes for the same header.
func FlowMinerReportEncodeRlp ¶
func FlowMinerReportEncodeRlp(items []*FlowMinerReport) (error, []byte)
func Hash ¶
//////////////////////////////////////////////////////////////////////////////////////////////
func PledgeItemEncodeRlp ¶
func PledgeItemEncodeRlp(items []*PledgeItem) (error, []byte)
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API is a user facing RPC API to allow controlling the signer and voting mechanisms of the delegated-proof-of-stake scheme.
func (*API) GetCandidateAutoExitAtNumber ¶
func (api *API) GetCandidateAutoExitAtNumber(number uint64) (*SnapCanAutoExit, error)
func (*API) GetCapSuccAddrsAtNumber ¶
func (api *API) GetCapSuccAddrsAtNumber(number uint64) (*SnapshotCapSuccAddrs, error)
func (*API) GetGrantProfitAtNumber ¶
func (api *API) GetGrantProfitAtNumber(number uint64) ([]consensus.GrantProfitRecord, error)
func (*API) GetLockRewardAtNumber ¶
func (api *API) GetLockRewardAtNumber(number uint64) ([]LockRewardRecord, error)
func (*API) GetRentSucAtNumber ¶
func (api *API) GetRentSucAtNumber(number uint64) (*SnapshotRentSuc, error)
func (*API) GetRevertSRTAtNumber ¶
func (api *API) GetRevertSRTAtNumber(number uint64) (*SnapshotRevertSRT, error)
func (*API) GetSPledgeAtNumber ¶
func (api *API) GetSPledgeAtNumber(number uint64) (*SnapshotSPledge, error)
func (*API) GetSPledgeCapVerAtNumber ¶
func (api *API) GetSPledgeCapVerAtNumber(number uint64) (*SnapshotSPledgeCapVer, error)
func (*API) GetSPledgeInfoByAddr ¶
func (api *API) GetSPledgeInfoByAddr(address common.Address) (*SnapshotSPledgeInfo, error)
func (*API) GetSRTBalAtNumber ¶
func (api *API) GetSRTBalAtNumber(number uint64) (*SnapshotSRT, error)
func (*API) GetSRTBalance ¶
func (api *API) GetSRTBalance(address common.Address) (*SnapshotAddrSRT, error)
func (*API) GetSRTBalanceAtNumber ¶
func (*API) GetSTGBandwidthMakeup ¶
func (api *API) GetSTGBandwidthMakeup() (*SnapshotSTGbwMakeup, error)
func (*API) GetSnapshot ¶
func (api *API) GetSnapshot(number *rpc.BlockNumber) (*Snapshot, error)
GetSnapshot retrieves the state snapshot at a given block.
func (*API) GetSnapshotAtHash ¶
GetSnapshotAtHash retrieves the state snapshot at a given block.
func (*API) GetSnapshotAtNumber ¶
GetSnapshotAtNumber retrieves the state snapshot at a given block.
func (*API) GetSnapshotFlowAtNumber ¶
func (api *API) GetSnapshotFlowAtNumber(number uint64) (*SnapshotFlow, error)
func (*API) GetSnapshotFlowMinerAtNumber ¶
func (api *API) GetSnapshotFlowMinerAtNumber(number uint64) (*SnapshotFlowMiner, error)
func (*API) GetSnapshotFlowReportAtNumber ¶
func (api *API) GetSnapshotFlowReportAtNumber(number uint64) (*SnapshotFlowReport, error)
func (*API) GetSnapshotReleaseAtNumber ¶
func (api *API) GetSnapshotReleaseAtNumber(number uint64, part string) (*SnapshotRelease, error)
func (*API) GetSnapshotReleaseAtNumber2 ¶
func (*API) GetSnapshotSignerAtNumber ¶
func (api *API) GetSnapshotSignerAtNumber(number uint64) (*SnapshotSign, error)
func (*API) GetStorageDecimalValueAtNumber ¶
func (api *API) GetStorageDecimalValueAtNumber(number uint64, part string) (*SnapshotSPledgeDecimalValue, error)
func (*API) GetStorageRatioValueAtNumber ¶
func (*API) GetStorageRatiosAtNumber ¶
func (api *API) GetStorageRatiosAtNumber(number uint64) (*SnapshotStorageRatios, error)
func (*API) GetStorageRewardAtNumber ¶
func (api *API) GetStorageRewardAtNumber(number uint64, part string) (*SnapshotStorageReward, error)
func (*API) GetStorageValueAtNumber ¶
func (api *API) GetStorageValueAtNumber(number uint64, part string) (*SnapshotSPledgeValue, error)
func (*API) GetSucSPledgeAtNumber ¶
func (api *API) GetSucSPledgeAtNumber(number uint64) (*SnapshotSucSPledge, error)
type Alien ¶
type Alien struct {
// contains filtered or unexported fields
}
Alien is the delegated-proof-of-stake consensus engine.
func New ¶
func New(config *params.AlienConfig, db ethdb.Database) *Alien
New creates a Alien delegated-proof-of-stake consensus engine with the initial signers set to the ones provided by the user.
func (*Alien) APIs ¶
func (a *Alien) APIs(chain consensus.ChainHeaderReader) []rpc.API
APIs implements consensus.Engine, returning the user facing RPC API to allow controlling the signer voting.
func (*Alien) ApplyGenesis ¶
ApplyGenesis
func (*Alien) Author ¶
Author implements consensus.Engine, returning the Ethereum address recovered from the signature in the header's extra-data section.
func (*Alien) Authorize ¶
Authorize injects a private key into the consensus engine to mint new blocks with.
func (*Alien) CalcDifficulty ¶
func (a *Alien) CalcDifficulty(chain consensus.ChainHeaderReader, time uint64, parent *types.Header) *big.Int
CalcDifficulty is the difficulty adjustment algorithm. It returns the difficulty that a new block should have based on the previous blocks in the chain and the current signer.
func (*Alien) Close ¶
Close implements consensus.Engine. It's a noop for clique as there are no background threads.
func (*Alien) Finalize ¶
func (a *Alien) Finalize(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header, receipts []*types.Receipt, grantProfit []consensus.GrantProfitRecord, gasReward *big.Int) error
Finalize implements consensus.Engine, ensuring no uncles are set, nor block rewards given.
func (*Alien) FinalizeAndAssemble ¶
func (*Alien) GrantProfit ¶
func (a *Alien) GrantProfit(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB) ([]consensus.GrantProfitRecord, []consensus.GrantProfitRecord)
func (*Alien) Prepare ¶
Prepare implements consensus.Engine, preparing all the consensus fields of the header for running the transactions on top.
func (*Alien) Seal ¶
func (a *Alien) Seal(chain consensus.ChainHeaderReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error
Seal implements consensus.Engine, attempting to create a sealed block using the local signing credentials.
func (*Alien) StorageProofNew ¶
func (a *Alien) StorageProofNew(storageProofRecord []StorageProofRecord, verifyInfo string, pledgeAddr common.Address, storagepledge *SPledge, chain consensus.ChainHeaderReader, currNumber *big.Int) ([]string, []StorageProofRecord)
func (*Alien) VerifyHeader ¶
func (a *Alien) VerifyHeader(chain consensus.ChainHeaderReader, state *state.StateDB, header *types.Header, seal bool) error
VerifyHeader checks whether a header conforms to the consensus rules.
func (*Alien) VerifyHeaderExtra ¶
func (*Alien) VerifyHeaders ¶
func (a *Alien) VerifyHeaders(chain consensus.ChainHeaderReader, state *state.StateDB, headers []*types.Header, seals []bool) (chan<- struct{}, <-chan error)
VerifyHeaders is similar to VerifyHeader, but verifies a batch of headers. The method returns a quit channel to abort the operations and a results channel to retrieve the async verifications (the order is that of the input slice).
func (*Alien) VerifyLockReward ¶
func (a *Alien) VerifyLockReward(header *types.Header, snap *Snapshot, chain consensus.ChainHeaderReader, currentHeaderExtra HeaderExtra) error
func (*Alien) VerifySeal ¶
func (a *Alien) VerifySeal(chain consensus.ChainHeaderReader, state *state.StateDB, header *types.Header) error
VerifySeal implements consensus.Engine, checking whether the signature contained in the header satisfies the consensus protocol requirements.
func (*Alien) VerifyUncles ¶
VerifyUncles implements consensus.Engine, always returning an error for any uncles as this consensus mechanism doesn't permit uncles.
type BandwidthMakeup ¶
type BandwidthPunishRecord ¶
type CCNotice ¶
type CCNotice struct { CurrentCharging map[common.Hash]GasCharging `json:"currentCharging"` // common.Hash here is the proposal txHash not the hash of side chain ConfirmReceived map[common.Hash]NoticeCR `json:"confirmReceived"` // record the confirm address }
CCNotice (cross chain notice) contain the information main chain need to notify given side chain
type CandidatePledgeRecord ¶
type CandidatePunishRecord ¶
type CandidateState ¶
type ClaimedBandwidth ¶
type ClaimedBandwidthRecord ¶
type ConfigDepositRecord ¶
type Confirmation ¶
Confirmation : confirmation come from custom tx which data like "ufo:1:event:confirm:123" 123 is the block number be confirmed Sender of tx is Signer only if the signer in the SignerQueue for block number 123
type Declare ¶
Declare : declare come from custom tx which data like "ufo:1:event:declare:hash:yes" proposal only come from the current candidates hash is the hash of proposal tx
type DefaultLockState ¶
type DefaultLockState struct { }
*
- ExtraStateDB
func NewDefaultLockState ¶
func NewDefaultLockState(root common.Hash) (*DefaultLockState, error)
func (*DefaultLockState) AddLockReward ¶
func (c *DefaultLockState) AddLockReward(LockReward []LockRewardRecord, snap *Snapshot, db ethdb.Database, number uint64) ([]LockRewardRecord, error)
func (*DefaultLockState) CommitData ¶
func (*DefaultLockState) PayLockReward ¶
type DefaultSRTState ¶
type DefaultSRTState struct { StorageHash common.Hash `json:"storage"` Hash common.Hash `json:"root"` // contains filtered or unexported fields }
func (*DefaultSRTState) Copy ¶
func (c *DefaultSRTState) Copy() SRTState
func (*DefaultSRTState) Del ¶
func (c *DefaultSRTState) Del(addr common.Address)
func (*DefaultSRTState) Root ¶
func (c *DefaultSRTState) Root() common.Hash
type DeviceBindRecord ¶
type ExchangeSRTRecord ¶
type FULLBalanceData ¶
type FlowMinerReport ¶
type FlowMinerSnap ¶
type FlowMinerSnap struct { DayStartTime uint64 `json:"dayStartTime"` FlowMinerPrevTotal uint64 `json:"flowminerPrevTotal"` FlowMiner map[common.Address]map[common.Hash]*FlowMinerReport `json:"flowminerCurr"` FlowMinerPrev map[common.Address]map[common.Hash]*FlowMinerReport `json:"flowminerPrev"` FlowMinerCache []string `json:"flowminerCurCache"` FlowMinerPrevCache []string `json:"flowminerPrevCache"` }
func NewFlowMinerSnap ¶
func NewFlowMinerSnap(dayStartTime uint64) *FlowMinerSnap
type FlowRecord ¶
type GasCharging ¶
type HeaderExtra ¶
type HeaderExtra struct { CurrentBlockConfirmations []Confirmation CurrentBlockVotes []Vote CurrentBlockProposals []Proposal CurrentBlockDeclares []Declare ModifyPredecessorVotes []Vote LoopStartTime uint64 SignerQueue []common.Address SignerMissing []common.Address ConfirmedBlockNumber uint64 SideChainConfirmations []SCConfirmation SideChainSetCoinbases []SCSetCoinbase SideChainNoticeConfirmed []SCConfirmation SideChainCharging []GasCharging //This only exist in side chain's header.Extra ExchangeNFC []ExchangeNFCRecord DeviceBind []DeviceBindRecord CandidatePledge []CandidatePledgeRecord CandidatePunish []CandidatePunishRecord MinerStake []MinerStakeRecord CandidateExit []common.Address ClaimedBandwidth []ClaimedBandwidthRecord FlowMinerExit []common.Address BandwidthPunish []BandwidthPunishRecord ConfigExchRate uint32 ConfigOffLine uint32 ConfigDeposit []ConfigDepositRecord ConfigISPQOS []ISPQOSRecord LockParameters []LockParameterRecord ManagerAddress []ManagerAddressRecord FlowHarvest *big.Int LockReward []LockRewardRecord GrantProfit []consensus.GrantProfitRecord FlowReport []MinerFlowReportRecord StoragePledge []SPledgeRecord StoragePledgeExit []SPledgeExitRecord LeaseRequest []LeaseRequestRecord ExchangeSRT []ExchangeSRTRecord LeasePledge []LeasePledgeRecord LeaseRenewal []LeaseRenewalRecord LeaseRenewalPledge []LeaseRenewalPledgeRecord LeaseRescind []LeaseRescindRecord StorageRecoveryData []SPledgeRecoveryRecord StorageProofRecord []StorageProofRecord StorageExchangePrice []StorageExchangePriceRecord ExtraStateRoot common.Hash LockAccountsRoot common.Hash StorageDataRoot common.Hash StorageExchangeBw []StorageExchangeBwRecord SRTDataRoot common.Hash StorageBwPay []StorageBwPayRecord GrantProfitHash common.Hash CandidatePledgeNew []CandidatePledgeNewRecord CandidatePledgeEntrust []CandidatePledgeEntrustRecord CandidatePEntrustExit []CandidatePEntrustExitRecord CandidateAutoExit []common.Address CandidateChangeRate []CandidateChangeRateRecord }
HeaderExtra is the struct of info in header.Extra[extraVanity:len(header.extra)-extraSeal] HeaderExtra is the current struct
type HeaderExtraV5 ¶
type HeaderExtraV5 struct { CurrentBlockConfirmations []Confirmation CurrentBlockVotes []Vote CurrentBlockProposals []Proposal CurrentBlockDeclares []Declare ModifyPredecessorVotes []Vote LoopStartTime uint64 SignerQueue []common.Address SignerMissing []common.Address ConfirmedBlockNumber uint64 SideChainConfirmations []SCConfirmation SideChainSetCoinbases []SCSetCoinbase SideChainNoticeConfirmed []SCConfirmation SideChainCharging []GasCharging //This only exist in side chain's header.Extra ExchangeNFC []ExchangeNFCRecord DeviceBind []DeviceBindRecord CandidatePledge []CandidatePledgeRecord CandidatePunish []CandidatePunishRecord MinerStake []MinerStakeRecord CandidateExit []common.Address ClaimedBandwidth []ClaimedBandwidthRecord FlowMinerExit []common.Address BandwidthPunish []BandwidthPunishRecord ConfigExchRate uint32 ConfigOffLine uint32 ConfigDeposit []ConfigDepositRecord ConfigISPQOS []ISPQOSRecord LockParameters []LockParameterRecord ManagerAddress []ManagerAddressRecord FlowHarvest *big.Int LockReward []LockRewardRecord GrantProfit []consensus.GrantProfitRecord FlowReport []MinerFlowReportRecord StoragePledge []SPledgeRecord StoragePledgeExit []SPledgeExitRecord LeaseRequest []LeaseRequestRecord ExchangeSRT []ExchangeSRTRecord LeasePledge []LeasePledgeRecord LeaseRenewal []LeaseRenewalRecord LeaseRenewalPledge []LeaseRenewalPledgeRecord LeaseRescind []LeaseRescindRecord StorageRecoveryData []SPledgeRecoveryRecord StorageProofRecord []StorageProofRecord StorageExchangePrice []StorageExchangePriceRecord ExtraStateRoot common.Hash LockAccountsRoot common.Hash StorageDataRoot common.Hash StorageExchangeBw []StorageExchangeBwRecord SRTDataRoot common.Hash StorageBwPay []StorageBwPayRecord GrantProfitHash common.Hash }
type ISPQOSRecord ¶
type Lease ¶
type Lease struct { Address common.Address `json:"address"` DepositAddress common.Address `json:"depositaddress"` Capacity *big.Int `json:"capacity"` RootHash common.Hash `json:"roothash"` Deposit *big.Int `json:"deposit"` UnitPrice *big.Int `json:"unitprice"` Cost *big.Int `json:"cost"` Duration *big.Int `json:"duration"` StorageFile map[common.Hash]*StorageFile `json:"storagefile"` LeaseList map[common.Hash]*LeaseDetail `json:"leaselist"` LastVerificationTime *big.Int `json:"lastverificationtime"` LastVerificationSuccessTime *big.Int `json:"lastverificationsuccesstime"` ValidationFailureTotalTime *big.Int `json:"validationfailuretotaltime"` Status int `json:"status"` Hash common.Hash `json:"validhash"` }
*
*Rental structure
type Lease2 ¶
type Lease2 struct { Address common.Address `json:"address"` Status int `json:"status"` LastVerificationTime *big.Int `json:"lastverificationtime"` LastVerificationSuccessTime *big.Int `json:"lastverificationsuccesstime"` ValidationFailureTotalTime *big.Int `json:"validationfailuretotaltime"` LeaseList map[common.Hash]*LeaseDetail2 `json:"leaselist"` }
type LeaseDetail ¶
type LeaseDetail struct { RequestHash common.Hash `json:"requesthash"` PledgeHash common.Hash `json:"pledgehash"` RequestTime *big.Int `json:"requesttime"` StartTime *big.Int `json:"starttime"` Duration *big.Int `json:"duration"` Cost *big.Int `json:"cost"` Deposit *big.Int `json:"deposit"` ValidationFailureTotalTime *big.Int `json:"validationfailuretotaltime"` Revert int `json:"revert"` Hash common.Hash `json:"validhash"` }
*
- Lease list
type LeaseDetail2 ¶
type LeasePledgeRecord ¶
type LeasePledgeRecord struct { Address common.Address `json:"address"` DepositAddress common.Address `json:"depositaddress"` Hash common.Hash `json:"hash"` Capacity *big.Int `json:"capacity"` RootHash common.Hash `json:"roothash"` BurnSRTAmount *big.Int `json:"burnsrtamount"` BurnAmount *big.Int `json:"burnamount"` Duration *big.Int `json:"duration"` BurnSRTAddress common.Address `json:"burnsrtaddress"` PledgeHash common.Hash `json:"pledgehash"` LeftCapacity *big.Int `json:"leftcapacity"` LeftRootHash common.Hash `json:"leftroothash"` }
type LeaseRenewalPledgeRecord ¶
type LeaseRenewalPledgeRecord struct { Address common.Address `json:"address"` Hash common.Hash `json:"hash"` Capacity *big.Int `json:"capacity"` RootHash common.Hash `json:"roothash"` BurnSRTAmount *big.Int `json:"burnsrtamount"` BurnAmount *big.Int `json:"burnamount"` Duration *big.Int `json:"duration"` BurnSRTAddress common.Address `json:"burnsrtaddress"` PledgeHash common.Hash `json:"pledgehash"` }
type LeaseRenewalRecord ¶
type LeaseRequestRecord ¶
type LeaseRescindRecord ¶
type LockBalanceData ¶
type LockData ¶
type LockData struct { FlowRevenue map[common.Address]*LockBalanceData `json:"flowrevenve"` CacheL1 []common.Hash `json:"cachel1"` // Store chceckout data CacheL2 common.Hash `json:"cachel2"` //Store data of the previous day //rlsLockBalance map[common.Address]*RlsLockData // The release lock data Locktype string `json:"Locktype"` }
func NewLockData ¶
type LockParameter ¶
type LockParameterRecord ¶
type LockProfitSnap ¶
type LockProfitSnap struct { Number uint64 `json:"number"` // Block number where the snapshot was created Hash common.Hash `json:"hash"` // Block hash where the snapshot was created RewardLock *LockData `json:"reward"` FlowLock *LockData `json:"flow"` BandwidthLock *LockData `json:"bandwidth"` PosPgExitLock *LockData `json:"storagePgExit"` PosExitLock *LockData `json:"posexitlock"` }
func NewLockProfitSnap ¶
func NewLockProfitSnap() *LockProfitSnap
type LockRewardRecord ¶
type LockState ¶
type ManagerAddressRecord ¶
type MinerFlowReportItem ¶
type MinerFlowReportRecord ¶
type MinerFlowReportRecord struct { ChainHash common.Hash ReportTime uint64 ReportContent []MinerFlowReportItem }
type OldHeaderExtra ¶
type OldHeaderExtra struct { CurrentBlockConfirmations []Confirmation CurrentBlockVotes []Vote CurrentBlockProposals []Proposal CurrentBlockDeclares []Declare ModifyPredecessorVotes []Vote LoopStartTime uint64 SignerQueue []common.Address SignerMissing []common.Address ConfirmedBlockNumber uint64 SideChainConfirmations []SCConfirmation SideChainSetCoinbases []SCSetCoinbase SideChainNoticeConfirmed []SCConfirmation SideChainCharging []GasCharging //This only exist in side chain's header.Extra ExchangeNFC []ExchangeNFCRecord DeviceBind []DeviceBindRecord CandidatePledge []CandidatePledgeRecord CandidatePunish []CandidatePunishRecord MinerStake []MinerStakeRecord CandidateExit []common.Address ClaimedBandwidth []ClaimedBandwidthRecord FlowMinerExit []common.Address BandwidthPunish []BandwidthPunishRecord ConfigExchRate uint32 ConfigOffLine uint32 ConfigDeposit []ConfigDepositRecord ConfigISPQOS []ISPQOSRecord LockParameters []LockParameterRecord ManagerAddress []ManagerAddressRecord FlowHarvest *big.Int LockReward []LockRewardRecord GrantProfit []consensus.GrantProfitRecord FlowReport []MinerFlowReportRecord }
type PledgeDetail ¶
type PledgeItem ¶
type PledgeItem struct { Amount *big.Int `json:"lockamount"` //Reward *big.Int `json:"bandwidthreward"` PledgeType uint32 `json:"type"` Playment *big.Int `json:"playment"` LockPeriod uint32 `json:"lockperiod"` RlsPeriod uint32 `json:"releaseperiod"` Interval uint32 `json:"releaseinterval"` StartHigh uint64 `json:"startblocknumber"` TargetAddress common.Address `json:"targetaddress"` RevenueAddress common.Address `json:"revenueaddress"` RevenueContract common.Address `json:"contractaddress"` MultiSignature common.Address `json:"multisignatureaddress"` BurnAddress common.Address `json:"burnaddress"` BurnRatio *big.Int `json:"burnratio"` BurnAmount *big.Int `json:"burnamount"` }
func NewPledgeItem ¶
func NewPledgeItem(amount *big.Int) *PledgeItem
type PosPledgeItem ¶
type Proposal ¶
type Proposal struct { Hash common.Hash `json:"hash"` // tx hash ReceivedNumber *big.Int `json:"receivenumber"` // block number of proposal received CurrentDeposit *big.Int `json:"currentdeposit"` // received deposit for this proposal ValidationLoopCnt uint64 `json:"validationloopcount"` // validation block number length of this proposal from the received block number ProposalType uint64 `json:"proposaltype"` // type of proposal 1 - add candidate 2 - remove candidate ... Proposer common.Address `json:"proposer"` // proposer TargetAddress common.Address `json:"candidateaddress"` // candidate need to add/remove if candidateNeedPD == true MinerRewardPerThousand uint64 `json:"minerrewardperthousand"` // reward of miner + side chain miner SCHash common.Hash `json:"schash"` // side chain genesis parent hash need to add/remove SCBlockCountPerPeriod uint64 `json:"scblockcountperpersiod"` // the number block sealed by this side chain per period, default 1 SCBlockRewardPerPeriod uint64 `json:"scblockrewardperperiod"` // the reward of this side chain per period if SCBlockCountPerPeriod reach, default 0. SCBlockRewardPerPeriod/1000 * MinerRewardPerThousand/1000 * BlockReward is the reward for this side chain Declares []*Declare `json:"declares"` // Declare this proposal received (always empty in block header) MinVoterBalance uint64 `json:"minvoterbalance"` // value of minVoterBalance , need to mul big.Int(1e+18) ProposalDeposit uint64 `json:"proposaldeposit"` // The deposit need to be frozen during before the proposal get final conclusion. (TTC) SCRentFee uint64 `json:"screntfee"` // number of TTC coin, not wei SCRentRate uint64 `json:"screntrate"` // how many coin you want for 1 TTC on main chain SCRentLength uint64 `json:"screntlength"` // minimize block number of main chain , the rent fee will be used as reward of side chain miner. }
Proposal : proposal come from custom tx which data like "ufo:1:event:proposal:candidate:add:address" or "ufo:1:event:proposal:percentage:60" proposal only come from the current candidates not only candidate add/remove , current signer can proposal for params modify like percentage of reward distribution ...
type RevenueParameter ¶
type RlsLockData ¶
type RlsLockData struct {
LockBalance map[uint64]map[uint32]*PledgeItem // The primary key is lock number, The second key is pledge type
}
type SCBlockReward ¶
type SCBlockReward struct {
RewardScoreMap map[common.Address]uint64 `json:"rewardscore"` //sum(this value) in one period == 100
}
Score to calculate at one main chain block, for calculate the side chain reward
type SCConfirmation ¶
type SCConfirmation struct { Hash common.Hash Coinbase common.Address // the side chain signer , may be diff from signer in main chain Number uint64 LoopInfo []string }
SCConfirmation is the confirmed tx send by side chain super node
type SCRecord ¶
type SCRecord struct { Record map[uint64][]*SCConfirmation `json:"record"` // Confirmation Record of one side chain LastConfirmedNumber uint64 `json:"lastConfirmedNumber"` // Last confirmed header number of one side chain MaxHeaderNumber uint64 `json:"maxHeaderNumber"` // max header number of one side chain CountPerPeriod uint64 `json:"countPerPeriod"` // block sealed per period on this side chain RewardPerPeriod uint64 `json:"rewardPerPeriod"` // full reward per period, number per thousand RentReward map[common.Hash]*SCRentInfo `json:"rentReward"` // reward info by rent }
SCRecord is the state record for side chain
type SCRentInfo ¶
type SCReward ¶
type SCReward struct {
SCBlockRewardMap map[uint64]*SCBlockReward `json:"scblockrewards"`
}
Record for one side chain
type SCSetCoinbase ¶
type SCSetCoinbase struct { Hash common.Hash Signer common.Address Coinbase common.Address Type bool }
SCSetCoinbase is the tx send by main chain super node which can set coinbase for side chain
type SExpireRecord ¶
type SPledge ¶
type SPledge struct { Address common.Address `json:"address"` StorageSpaces *SPledgeSpaces `json:"storagespaces"` Number *big.Int `json:"number"` TotalCapacity *big.Int `json:"totalcapacity"` Bandwidth *big.Int `json:"bandwidth"` Price *big.Int `json:"price"` StorageSize *big.Int `json:"storagesize"` SpaceDeposit *big.Int `json:"spacedeposit"` Lease map[common.Hash]*Lease `json:"lease"` LastVerificationTime *big.Int `json:"lastverificationtime"` LastVerificationSuccessTime *big.Int `json:"lastverificationsuccesstime"` ValidationFailureTotalTime *big.Int `json:"validationfailuretotaltime"` PledgeStatus *big.Int `json:"pledgeStatus"` Hash common.Hash `json:"validhash"` }
* Storage pledge struct
type SPledge2 ¶
type SPledge2 struct { PledgeStatus *big.Int `json:"pledgeStatus"` StorageCapacity *big.Int `json:"storagecapacity"` Lease map[common.Hash]*Lease2 `json:"lease"` LastVerificationTime *big.Int `json:"lastverificationtime"` LastVerificationSuccessTime *big.Int `json:"lastverificationsuccesstime"` ValidationFailureTotalTime *big.Int `json:"validationfailuretotaltime"` }
type SPledgeExitRecord ¶
type SPledgeRecord ¶
type SPledgeRecord struct { PledgeAddr common.Address `json:"pledgeAddr"` Address common.Address `json:"address"` Price *big.Int `json:"price"` SpaceDeposit *big.Int `json:"spacedeposit"` StorageCapacity *big.Int `json:"storagecapacity"` StorageSize *big.Int `json:"storagesize"` RootHash common.Hash `json:"roothash"` PledgeNumber *big.Int `json:"pledgeNumber"` Bandwidth *big.Int `json:"bandwidth"` }
type SPledgeRecoveryRecord ¶
type SPledgeSpaces ¶
type SPledgeSpaces struct { Address common.Address `json:"address"` StorageCapacity *big.Int `json:"storagecapacity"` RootHash common.Hash `json:"roothash"` StorageFile map[common.Hash]*StorageFile `json:"storagefile"` LastVerificationTime *big.Int `json:"lastverificationtime"` LastVerificationSuccessTime *big.Int `json:"lastverificationsuccesstime"` ValidationFailureTotalTime *big.Int `json:"validationfailuretotaltime"` Hash common.Hash `json:"validhash"` }
*
- Storage space
type SRTState ¶
type SRTState interface { Set(addr common.Address, amount *big.Int) Add(addr common.Address, amount *big.Int) Sub(addr common.Address, amount *big.Int) error Get(addr common.Address) *big.Int Del(addr common.Address) Copy() SRTState Load(db ethdb.Database, hash common.Hash) error Save(db ethdb.Database) (common.Hash, error) Root() common.Hash GetAll() map[common.Address]*big.Int }
func NewDefaultSRTState ¶
type SignPledgeItem ¶
type SignTxFn ¶
type SignTxFn func(accounts.Account, *types.Transaction, *big.Int) (*types.Transaction, error)
SignTxFn is a signTx
type SignerItem ¶
type SignerItem struct {
// contains filtered or unexported fields
}
type SignerSlice ¶
type SignerSlice []SignerItem
func (SignerSlice) Len ¶
func (s SignerSlice) Len() int
func (SignerSlice) Less ¶
func (s SignerSlice) Less(i, j int) bool
func (SignerSlice) Swap ¶
func (s SignerSlice) Swap(i, j int)
type SnapCanAutoExit ¶
type Snapshot ¶
type Snapshot struct { LCRS uint64 // Loop count to recreate signers from top tally Period uint64 `json:"period"` // Period of seal each block Number uint64 `json:"number"` // Block number where the snapshot was created ConfirmedNumber uint64 `json:"confirmedNumber"` // Block number confirmed when the snapshot was created Hash common.Hash `json:"hash"` // Block hash where the snapshot was created HistoryHash []common.Hash `json:"historyHash"` // Block hash list for two recent loop Signers []*common.Address `json:"signers"` // Signers queue in current header Votes map[common.Address]*Vote `json:"votes"` // All validate votes from genesis block Tally map[common.Address]*big.Int `json:"tally"` // Stake for each candidate address Voters map[common.Address]*big.Int `json:"voters"` // Block number for each voter address Candidates map[common.Address]uint64 `json:"candidates"` // Candidates for Signers (0- adding procedure 1- normal 2- removing procedure) Punished map[common.Address]uint64 `json:"punished"` // The signer be punished count cause of missing seal Confirmations map[uint64][]*common.Address `json:"confirms"` // The signer confirm given block number Proposals map[common.Hash]*Proposal `json:"proposals"` // The Proposals going or success (failed proposal will be removed) HeaderTime uint64 `json:"headerTime"` // Time of the current header LoopStartTime uint64 `json:"loopStartTime"` // Start Time of the current loop ProposalRefund map[uint64]map[common.Address]*big.Int `json:"proposalRefund"` // Refund proposal deposit SCCoinbase map[common.Hash]map[common.Address]common.Address `json:"sideChainCoinbase"` // main chain set Coinbase of side chain setting SCRecordMap map[common.Hash]*SCRecord `json:"sideChainRecord"` // main chain record Confirmation of side chain setting SCRewardMap map[common.Hash]*SCReward `json:"sideChainReward"` // main chain record Side Chain Reward SCNoticeMap map[common.Hash]*CCNotice `json:"sideChainNotice"` // main chain record Notification to side chain LocalNotice *CCNotice `json:"localNotice"` // side chain record Notification MinerReward uint64 `json:"minerReward"` // miner reward per thousand MinVB *big.Int `json:"minVoterBalance"` // min voter balance FULBalance map[common.Address]*FULLBalanceData `json:"fulbalancedata"` RevenueNormal map[common.Address]*RevenueParameter `json:"normalrevenueaddress"` RevenueFlow map[common.Address]*RevenueParameter `json:"flowrevenueaddress"` CandidatePledge map[common.Address]*PledgeItem `json:"candidatepledge"` TallyMiner map[common.Address]*CandidateState `json:"tallyminer"` // Stake for each miner address FlowPledge map[common.Address]*PledgeItem `json:"flowminerpledge"` Bandwidth map[common.Address]*ClaimedBandwidth `json:"claimedbandwidth"` FlowHarvest *big.Int `json:"flowharvest"` //FlowRevenue map[common.Address]*LockBalanceData `json:"flowrevenve"` FlowRevenue *LockProfitSnap SystemConfig SystemParameter `json:"systemconfig"` FlowMiner *FlowMinerSnap `json:"flowminer"` //FlowMiner map[common.Address]map[common.Hash]*FlowMinerReport `json:"flowminerCurr"` //FlowMinerPrev map[common.Address]map[common.Hash]*FlowMinerReport `json:"flowminerPrev"` FlowTotal *big.Int `json:"flowtotal"` SCMinerRevenue map[common.Address]common.Address `json:"scminerrevenue"` SCFlowPledge map[common.Address]bool `json:"scflowpledge"` SCFULBalance map[common.Address]*big.Int `json:"fulbalance"` SignerMissing []common.Address `json:"signermissing"` TallySigner map[common.Address]uint64 `json:"tallySigner"` //StoragePledge map[common.Address]*PledgeItem `json:"Storagepledge"` StorageData *StorageData `json:"storagedata"` ExStateRoot common.Hash `json:"extrasstateRoot"` GrantListRoot common.Hash `json:"grantListRoot"` RevenueStorage map[common.Address]*RevenueParameter `json:"storagerevenueaddress"` SRT SRTState `json:"-"` SRTHash common.Hash `json:"srthash"` STGBandwidthMakeup map[common.Address]*BandwidthMakeup `json:"stgbandwidthmakeup"` PosPledge map[common.Address]*PosPledgeItem `json:"pospledge"` // contains filtered or unexported fields }
Snapshot is the state of the authorization voting at a given point in time.
type SnapshotAddrSRT ¶
type SnapshotCapSuccAddrs ¶
type SnapshotFlow ¶
type SnapshotFlow struct {
LockReward []FlowRecord `json:"flowrecords"`
}
type SnapshotFlowMiner ¶
type SnapshotFlowMiner struct { DayStartTime uint64 `json:"dayStartTime"` FlowMinerPrevTotal uint64 `json:"flowminerPrevTotal"` FlowMiner map[common.Address]map[common.Hash]*FlowMinerReport `json:"flowminerCurr"` FlowMinerReport []*FlowMinerReport `json:"flowminerReport"` FlowMinerPrev map[common.Address]map[common.Hash]*FlowMinerReport `json:"flowminerPrev"` FlowMinerPrevReport []*FlowMinerReport `json:"flowminerPrevReport"` }
type SnapshotFlowReport ¶
type SnapshotFlowReport struct {
FlowReport []MinerFlowReportRecord `json:"flowreport"`
}
type SnapshotRelease ¶
type SnapshotRelease struct { CandidatePledge map[common.Address]*PledgeItem `json:"candidatepledge"` FlowPledge map[common.Address]*PledgeItem `json:"flowminerpledge"` FlowRevenue map[common.Address]*LockBalanceData `json:"flowrevenve"` }
type SnapshotRentSuc ¶
type SnapshotRevertSRT ¶
type SnapshotRevertSRT struct {
RevertSRT []ExchangeSRTRecord `json:"revertsrt"`
}
type SnapshotSPledge ¶
type SnapshotSPledgeCapVer ¶
type SnapshotSPledgeInfo ¶
type SnapshotSPledgeValue ¶
type SnapshotSTGbwMakeup ¶
type SnapshotSTGbwMakeup struct {
STGBandwidthMakeup map[common.Address]*BandwidthMakeup `json:"stgbandwidthmakeup"`
}
type SnapshotSign ¶
type SnapshotStorageRatios ¶
type SnapshotStorageRatios struct {
Ratios map[common.Address]*StorageRatio `json:"ratios"`
}
type SnapshotStorageReward ¶
type SnapshotStorageReward struct {
StorageReward StorageReward `json:"storagereward"`
}
type SnapshotSucSPledge ¶
type SpaceRewardRecord ¶
type SrtAccount ¶
func (*SrtAccount) AddBalance ¶
func (s *SrtAccount) AddBalance(amount *big.Int)
func (*SrtAccount) Encode ¶
func (s *SrtAccount) Encode() ([]byte, error)
func (*SrtAccount) GetBalance ¶
func (s *SrtAccount) GetBalance() *big.Int
func (*SrtAccount) SetBalance ¶
func (s *SrtAccount) SetBalance(amount *big.Int)
func (*SrtAccount) SubBalance ¶
func (s *SrtAccount) SubBalance(amount *big.Int) error
type SrtBalSlice ¶
type SrtBalSlice []SrtBalRecord
func (SrtBalSlice) Len ¶
func (s SrtBalSlice) Len() int
func (SrtBalSlice) Less ¶
func (s SrtBalSlice) Less(i, j int) bool
func (SrtBalSlice) Swap ¶
func (s SrtBalSlice) Swap(i, j int)
type SrtTrie ¶
type SrtTrie struct {
// contains filtered or unexported fields
}
=========================================================================
func NewSrtTrie ¶
====================================================================================
func (*SrtTrie) GetOrNewAccount ¶
func (s *SrtTrie) GetOrNewAccount(addr common.Address) *SrtAccount
type StorageBwPayRecord ¶
type StorageData ¶
type StorageData struct { StoragePledge map[common.Address]*SPledge `json:"spledge"` Hash common.Hash `json:"validhash"` }
func NewStorageSnap ¶
func NewStorageSnap() *StorageData
type StorageExchangeBwRecord ¶
type StorageFile ¶
type StorageFile struct { Capacity *big.Int `json:"capacity"` CreateTime *big.Int `json:"createtime"` LastVerificationTime *big.Int `json:"lastverificationtime"` LastVerificationSuccessTime *big.Int `json:"lastverificationsuccesstime"` ValidationFailureTotalTime *big.Int `json:"validationfailuretotaltime"` Hash common.Hash `json:"validhash"` }
*
- Rental structure
type StorageHeaderExtraV1 ¶
type StorageHeaderExtraV1 struct { CurrentBlockConfirmations []Confirmation CurrentBlockVotes []Vote CurrentBlockProposals []Proposal CurrentBlockDeclares []Declare ModifyPredecessorVotes []Vote LoopStartTime uint64 SignerQueue []common.Address SignerMissing []common.Address ConfirmedBlockNumber uint64 SideChainConfirmations []SCConfirmation SideChainSetCoinbases []SCSetCoinbase SideChainNoticeConfirmed []SCConfirmation SideChainCharging []GasCharging //This only exist in side chain's header.Extra ExchangeNFC []ExchangeNFCRecord DeviceBind []DeviceBindRecord CandidatePledge []CandidatePledgeRecord CandidatePunish []CandidatePunishRecord MinerStake []MinerStakeRecord CandidateExit []common.Address ClaimedBandwidth []ClaimedBandwidthRecord FlowMinerExit []common.Address BandwidthPunish []BandwidthPunishRecord ConfigExchRate uint32 ConfigOffLine uint32 ConfigDeposit []ConfigDepositRecord ConfigISPQOS []ISPQOSRecord LockParameters []LockParameterRecord ManagerAddress []ManagerAddressRecord FlowHarvest *big.Int LockReward []LockRewardRecord GrantProfit []consensus.GrantProfitRecord FlowReport []MinerFlowReportRecord StoragePledge []SPledgeRecord StoragePledgeExit []SPledgeExitRecord LeaseRequest []LeaseRequestRecord ExchangeSRT []ExchangeSRTRecord LeasePledge []LeasePledgeRecord LeaseRenewal []LeaseRenewalRecord LeaseRenewalPledge []LeaseRenewalPledgeRecord LeaseRescind []LeaseRescindRecord StorageRecoveryData []SPledgeRecoveryRecord StorageProofRecord []StorageProofRecord StorageExchangePrice []StorageExchangePriceRecord ExtraStateRoot common.Hash LockAccountsRoot common.Hash StorageDataRoot common.Hash }
type StorageHeaderExtraV2 ¶
type StorageHeaderExtraV2 struct { CurrentBlockConfirmations []Confirmation CurrentBlockVotes []Vote CurrentBlockProposals []Proposal CurrentBlockDeclares []Declare ModifyPredecessorVotes []Vote LoopStartTime uint64 SignerQueue []common.Address SignerMissing []common.Address ConfirmedBlockNumber uint64 SideChainConfirmations []SCConfirmation SideChainSetCoinbases []SCSetCoinbase SideChainNoticeConfirmed []SCConfirmation SideChainCharging []GasCharging //This only exist in side chain's header.Extra ExchangeNFC []ExchangeNFCRecord DeviceBind []DeviceBindRecord CandidatePledge []CandidatePledgeRecord CandidatePunish []CandidatePunishRecord MinerStake []MinerStakeRecord CandidateExit []common.Address ClaimedBandwidth []ClaimedBandwidthRecord FlowMinerExit []common.Address BandwidthPunish []BandwidthPunishRecord ConfigExchRate uint32 ConfigOffLine uint32 ConfigDeposit []ConfigDepositRecord ConfigISPQOS []ISPQOSRecord LockParameters []LockParameterRecord ManagerAddress []ManagerAddressRecord FlowHarvest *big.Int LockReward []LockRewardRecord GrantProfit []consensus.GrantProfitRecord FlowReport []MinerFlowReportRecord StoragePledge []SPledgeRecord StoragePledgeExit []SPledgeExitRecord LeaseRequest []LeaseRequestRecord ExchangeSRT []ExchangeSRTRecord LeasePledge []LeasePledgeRecord LeaseRenewal []LeaseRenewalRecord LeaseRenewalPledge []LeaseRenewalPledgeRecord LeaseRescind []LeaseRescindRecord StorageRecoveryData []SPledgeRecoveryRecord StorageProofRecord []StorageProofRecord StorageExchangePrice []StorageExchangePriceRecord ExtraStateRoot common.Hash LockAccountsRoot common.Hash StorageDataRoot common.Hash StorageExchangeBw []StorageExchangeBwRecord }
type StorageHeaderExtraV3 ¶
type StorageHeaderExtraV3 struct { CurrentBlockConfirmations []Confirmation CurrentBlockVotes []Vote CurrentBlockProposals []Proposal CurrentBlockDeclares []Declare ModifyPredecessorVotes []Vote LoopStartTime uint64 SignerQueue []common.Address SignerMissing []common.Address ConfirmedBlockNumber uint64 SideChainConfirmations []SCConfirmation SideChainSetCoinbases []SCSetCoinbase SideChainNoticeConfirmed []SCConfirmation SideChainCharging []GasCharging //This only exist in side chain's header.Extra ExchangeNFC []ExchangeNFCRecord DeviceBind []DeviceBindRecord CandidatePledge []CandidatePledgeRecord CandidatePunish []CandidatePunishRecord MinerStake []MinerStakeRecord CandidateExit []common.Address ClaimedBandwidth []ClaimedBandwidthRecord FlowMinerExit []common.Address BandwidthPunish []BandwidthPunishRecord ConfigExchRate uint32 ConfigOffLine uint32 ConfigDeposit []ConfigDepositRecord ConfigISPQOS []ISPQOSRecord LockParameters []LockParameterRecord ManagerAddress []ManagerAddressRecord FlowHarvest *big.Int LockReward []LockRewardRecord GrantProfit []consensus.GrantProfitRecord FlowReport []MinerFlowReportRecord StoragePledge []SPledgeRecord StoragePledgeExit []SPledgeExitRecord LeaseRequest []LeaseRequestRecord ExchangeSRT []ExchangeSRTRecord LeasePledge []LeasePledgeRecord LeaseRenewal []LeaseRenewalRecord LeaseRenewalPledge []LeaseRenewalPledgeRecord LeaseRescind []LeaseRescindRecord StorageRecoveryData []SPledgeRecoveryRecord StorageProofRecord []StorageProofRecord StorageExchangePrice []StorageExchangePriceRecord ExtraStateRoot common.Hash LockAccountsRoot common.Hash StorageDataRoot common.Hash StorageExchangeBw []StorageExchangeBwRecord SRTDataRoot common.Hash }
type StorageHeaderExtraV4 ¶
type StorageHeaderExtraV4 struct { CurrentBlockConfirmations []Confirmation CurrentBlockVotes []Vote CurrentBlockProposals []Proposal CurrentBlockDeclares []Declare ModifyPredecessorVotes []Vote LoopStartTime uint64 SignerQueue []common.Address SignerMissing []common.Address ConfirmedBlockNumber uint64 SideChainConfirmations []SCConfirmation SideChainSetCoinbases []SCSetCoinbase SideChainNoticeConfirmed []SCConfirmation SideChainCharging []GasCharging //This only exist in side chain's header.Extra ExchangeNFC []ExchangeNFCRecord DeviceBind []DeviceBindRecord CandidatePledge []CandidatePledgeRecord CandidatePunish []CandidatePunishRecord MinerStake []MinerStakeRecord CandidateExit []common.Address ClaimedBandwidth []ClaimedBandwidthRecord FlowMinerExit []common.Address BandwidthPunish []BandwidthPunishRecord ConfigExchRate uint32 ConfigOffLine uint32 ConfigDeposit []ConfigDepositRecord ConfigISPQOS []ISPQOSRecord LockParameters []LockParameterRecord ManagerAddress []ManagerAddressRecord FlowHarvest *big.Int LockReward []LockRewardRecord GrantProfit []consensus.GrantProfitRecord FlowReport []MinerFlowReportRecord StoragePledge []SPledgeRecord StoragePledgeExit []SPledgeExitRecord LeaseRequest []LeaseRequestRecord ExchangeSRT []ExchangeSRTRecord LeasePledge []LeasePledgeRecord LeaseRenewal []LeaseRenewalRecord LeaseRenewalPledge []LeaseRenewalPledgeRecord LeaseRescind []LeaseRescindRecord StorageRecoveryData []SPledgeRecoveryRecord StorageProofRecord []StorageProofRecord StorageExchangePrice []StorageExchangePriceRecord ExtraStateRoot common.Hash LockAccountsRoot common.Hash StorageDataRoot common.Hash StorageExchangeBw []StorageExchangeBwRecord SRTDataRoot common.Hash StorageBwPay []StorageBwPayRecord }
type StorageProofRecord ¶
type StorageRatio ¶
type StorageReward ¶
type StorageReward struct { Reward []SpaceRewardRecord `json:"reward"` LockPeriod uint32 `json:"LockPeriod"` RlsPeriod uint32 `json:"ReleasePeriod"` Interval uint32 `json:"ReleaseInterval"` }
type SystemParameter ¶
type SystemParameter struct { ExchRate uint32 `json:"ExchangeRatio"` OffLine uint32 `json:"OfflinePenalty"` Deposit map[uint32]*big.Int `json:"SeniorityThreshold"` QosConfig map[uint32]uint32 `json:"BandwidthQOS"` ManagerAddress map[uint32]common.Address `json:"FoundationAddress"` LockParameters map[uint32]*LockParameter `json:"PledgeParameter"` }
type TallySlice ¶
type TallySlice []TallyItem
func (TallySlice) Len ¶
func (s TallySlice) Len() int
func (TallySlice) Less ¶
func (s TallySlice) Less(i, j int) bool
func (TallySlice) Swap ¶
func (s TallySlice) Swap(i, j int)
type Vote ¶
type Vote struct { Voter common.Address `json:"voter"` Candidate common.Address `json:"candidate"` Stake *big.Int `json:"stake"` }
Vote : vote come from custom tx which data like "ufo:1:event:vote" Sender of tx is Voter, the tx.to is Candidate Stake is the balance of Voter when create this vote