From 6244a2d9385cfabacf5ad6617d38fb9c0eb92b56 Mon Sep 17 00:00:00 2001 From: sidenaio Date: Wed, 16 Dec 2020 11:55:45 +0500 Subject: [PATCH 01/15] wip --- blockchain/blockchain.go | 4 + blockchain/types/types.go | 2 + blockchain/validation/validation.go | 122 +++++++++++++++++++++------- core/state/state_object.go | 12 +++ core/state/statedb.go | 8 ++ core/validators/validators.go | 4 + 6 files changed, 123 insertions(+), 29 deletions(-) diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index accdefb0..823c75bf 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -1061,6 +1061,10 @@ func (chain *Blockchain) ApplyTxOnState(appState *appstate.AppState, vm vm.VM, t receipt.GasCost = chain.GetGasCost(appState, receipt.GasUsed) fee = fee.Add(fee, receipt.GasCost) collector.AddTxReceipt(statsCollector, receipt, appState) + case types.DelegateTx: + stateDB.SetDelegatee(sender, *tx.To) + case types.UndelegateTx: + stateDB.RemoveDelegatee(sender) } stateDB.SubBalance(sender, fee) diff --git a/blockchain/types/types.go b/blockchain/types/types.go index 5fc3953e..da29a07b 100644 --- a/blockchain/types/types.go +++ b/blockchain/types/types.go @@ -31,6 +31,8 @@ const ( DeployContract uint16 = 0xF CallContract uint16 = 0x10 TerminateContract uint16 = 0x11 + DelegateTx uint16 = 0x12 + UndelegateTx uint16 = 0x13 ) const ( diff --git a/blockchain/validation/validation.go b/blockchain/validation/validation.go index 34f884ec..0e106b46 100644 --- a/blockchain/validation/validation.go +++ b/blockchain/validation/validation.go @@ -31,35 +31,40 @@ const ( ) var ( - NodeAlreadyActivated = errors.New("node is already in validator set") - InvalidSignature = errors.New("invalid signature") - InvalidNonce = errors.New("invalid nonce") - InvalidEpoch = errors.New("invalid epoch") - InvalidAmount = errors.New("invalid amount") - InsufficientFunds = errors.New("insufficient funds") - InsufficientInvites = errors.New("insufficient invites") - RecipientRequired = errors.New("recipient is required") - InvitationIsMissing = errors.New("invitation is missing") - EmptyPayload = errors.New("payload can't be empty") - InvalidEpochTx = errors.New("invalid epoch tx") - InvalidPayload = errors.New("invalid payload") - InvalidRecipient = errors.New("invalid recipient") - EarlyTx = errors.New("tx can't be accepted due to wrong period") - LateTx = errors.New("tx can't be accepted due to validation ceremony") - NotCandidate = errors.New("user is not a candidate") - NotIdentity = errors.New("user is not identity") - InsufficientFlips = errors.New("insufficient flips") - IsAlreadyOnline = errors.New("identity is already online or has pending online status") - IsAlreadyOffline = errors.New("identity is already offline or has pending offline status") - DuplicatedFlip = errors.New("duplicated flip") - DuplicatedFlipPair = errors.New("flip with these words already exists") - BigFee = errors.New("current fee is greater than tx max fee") - InvalidMaxFee = errors.New("invalid max fee") - InvalidSender = errors.New("invalid sender") - FlipIsMissing = errors.New("flip is missing") - DuplicatedTx = errors.New("duplicated tx") - NegativeValue = errors.New("value must be non-negative") - validators map[types.TxType]validator + NodeAlreadyActivated = errors.New("node is already in validator set") + InvalidSignature = errors.New("invalid signature") + InvalidNonce = errors.New("invalid nonce") + InvalidEpoch = errors.New("invalid epoch") + InvalidAmount = errors.New("invalid amount") + InsufficientFunds = errors.New("insufficient funds") + InsufficientInvites = errors.New("insufficient invites") + RecipientRequired = errors.New("recipient is required") + InvitationIsMissing = errors.New("invitation is missing") + EmptyPayload = errors.New("payload can't be empty") + InvalidEpochTx = errors.New("invalid epoch tx") + InvalidPayload = errors.New("invalid payload") + InvalidRecipient = errors.New("invalid recipient") + EarlyTx = errors.New("tx can't be accepted due to wrong period") + LateTx = errors.New("tx can't be accepted due to validation ceremony") + NotCandidate = errors.New("user is not a candidate") + NotIdentity = errors.New("user is not identity") + InsufficientFlips = errors.New("insufficient flips") + IsAlreadyOnline = errors.New("identity is already online or has pending online status") + IsAlreadyOffline = errors.New("identity is already offline or has pending offline status") + DuplicatedFlip = errors.New("duplicated flip") + DuplicatedFlipPair = errors.New("flip with these words already exists") + BigFee = errors.New("current fee is greater than tx max fee") + InvalidMaxFee = errors.New("invalid max fee") + InvalidSender = errors.New("invalid sender") + FlipIsMissing = errors.New("flip is missing") + DuplicatedTx = errors.New("duplicated tx") + NegativeValue = errors.New("value must be non-negative") + SenderHasDelegatee = errors.New("sender has delegatee already") + IdentityShouldBeOffline = errors.New("identity should be offline") + SenderHasNoDelegate = errors.New("sender has not delegatee") + PoolIsTooBig = errors.New("pool is too big") + + validators map[types.TxType]validator ) var ( @@ -101,6 +106,8 @@ func init() { types.DeployContract: validateDeployContractTx, types.CallContract: validateCallContractTx, types.TerminateContract: validateTerminateContractTx, + types.DelegateTx: validateDelegateTx, + types.UndelegateTx: validateUndelegateTx, } } func SetAppConfig(cfg *config.Config) { @@ -690,3 +697,60 @@ func validateTerminateContractTx(appState *appstate.AppState, tx *types.Transact return nil } + +func validateDelegateTx(appState *appstate.AppState, tx *types.Transaction, txType TxType) error { + sender, _ := types.Sender(tx) + if tx.To == nil || *tx.To == (common.Address{}) { + return RecipientRequired + } + + if !common.ZeroOrNil(tx.AmountOrZero()) { + return InvalidAmount + } + if appState.State.ValidationPeriod() >= state.FlipLotteryPeriod { + return LateTx + } + + identity := appState.State.GetIdentity(sender) + + if identity.Delegatee != nil { + return SenderHasDelegatee + } + + hasPendingStatusSwitch := appState.State.HasStatusSwitchAddresses(sender) + isOnline := appState.ValidatorsCache.IsOnlineIdentity(sender) + + if isOnline && !hasPendingStatusSwitch || !isOnline && hasPendingStatusSwitch { + return IdentityShouldBeOffline + } + + return nil +} + +func validateUndelegateTx(appState *appstate.AppState, tx *types.Transaction, txType TxType) error { + sender, _ := types.Sender(tx) + + if tx.To != nil { + return InvalidRecipient + } + + if !common.ZeroOrNil(tx.AmountOrZero()) { + return InvalidAmount + } + + if appState.State.ValidationPeriod() >= state.FlipLotteryPeriod { + return LateTx + } + + identity := appState.State.GetIdentity(sender) + + if identity.Delegatee == nil { + return SenderHasNoDelegate + } + const maxFamilyPoolSize = 20 + if appState.ValidatorsCache.PoolSize(*identity.Delegatee) > maxFamilyPoolSize { + return PoolIsTooBig + } + + return nil +} diff --git a/core/state/state_object.go b/core/state/state_object.go index dc42a22e..1141a346 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -253,6 +253,8 @@ type Identity struct { ValidationTxsBits byte LastValidationStatus ValidationStatusFlag Scores []byte + + Delegatee *common.Address } type TxAddr struct { @@ -806,6 +808,16 @@ func (s *stateIdentity) SetValidationStatus(status ValidationStatusFlag) { s.touch() } +func (s *stateIdentity) SetDelegatee(delegatee common.Address) { + s.data.Delegatee = &delegatee + s.touch() +} + +func (s *stateIdentity) RemoveDelegatee(){ + s.data.Delegatee = nil + s.touch() +} + func (s *stateGlobal) Epoch() uint16 { return s.data.Epoch } diff --git a/core/state/statedb.go b/core/state/statedb.go index ea5e194c..fa208053 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -430,6 +430,14 @@ func (s *StateDB) SetValidationStatus(addr common.Address, status ValidationStat s.GetOrNewIdentityObject(addr).SetValidationStatus(status) } +func (s *StateDB) SetDelegatee(addr common.Address, delegatee common.Address) { + s.GetOrNewIdentityObject(addr).SetDelegatee(delegatee) +} + +func (s *StateDB) RemoveDelegatee(addr common.Address) { + s.GetOrNewIdentityObject(addr).RemoveDelegatee() +} + func (s *StateDB) IncEpoch() { s.GetOrNewGlobalObject().IncEpoch() } diff --git a/core/validators/validators.go b/core/validators/validators.go index 460f5fb7..ea5520a3 100644 --- a/core/validators/validators.go +++ b/core/validators/validators.go @@ -157,6 +157,10 @@ func (v *ValidatorsCache) Height() uint64 { return v.height } +func (v *ValidatorsCache) PoolSize(pool common.Address) int { + return 0 +} + func sortValidNodes(nodes []common.Address) []common.Address { sort.SliceStable(nodes, func(i, j int) bool { return bytes.Compare(nodes[i][:], nodes[j][:]) > 0 From aa6914a8aee582731b26b56708cd8e638ec02471 Mon Sep 17 00:00:00 2001 From: sidenaio Date: Tue, 2 Feb 2021 20:05:21 +0500 Subject: [PATCH 02/15] wip --- blockchain/blockchain.go | 148 +++- blockchain/validation/validation.go | 123 +-- cmd/stategen/main.go | 11 +- common/decimal/decimal.go | 38 + common/math/big.go | 69 ++ common/math/big_test.go | 81 ++ common/types_test.go | 3 + config/consensus.go | 49 +- consensus/engine.go | 4 +- core/state/identity_statedb.go | 21 + core/state/keys.go | 5 + core/state/state_object.go | 131 ++- core/state/statedb.go | 107 ++- core/validators/validators.go | 150 +++- core/validators/validators_test.go | 2 +- protobuf/models.pb.go | 1154 ++++++++++++++++----------- protobuf/models.proto | 13 + 17 files changed, 1468 insertions(+), 641 deletions(-) create mode 100644 common/decimal/decimal.go diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index 823c75bf..54c2d204 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -4,6 +4,7 @@ import ( "bytes" "crypto/ecdsa" "fmt" + "github.com/cockroachdb/apd" mapset "github.com/deckarep/golang-set" "github.com/golang/protobuf/proto" "github.com/idena-network/idena-go/blockchain/attachments" @@ -55,9 +56,17 @@ const ( ) var ( - MaxHash *big.Float + MaxHash *apd.Decimal ParentHashIsInvalid = errors.New("parentHash is invalid") BlockInsertionErr = errors.New("can't insert block") + + apdContext = apd.Context{ + MaxExponent: apd.BaseContext.MaxExponent, + MinExponent: apd.MinExponent, + Precision: 53, + Rounding: apd.BaseContext.Rounding, + Traps: apd.BaseContext.Traps, + } ) type Blockchain struct { @@ -91,7 +100,7 @@ func init() { } i := new(big.Int) i.SetBytes(max[:]) - MaxHash = new(big.Float).SetInt(i) + MaxHash = apd.NewWithBigInt(i, 0) } func NewBlockchain(config *config.Config, db dbm.DB, txpool *mempool.TxPool, appState *appstate.AppState, @@ -233,7 +242,6 @@ func (chain *Blockchain) loadPredefinedGenesis(network types.Network) (*types.Bl if err != nil { return nil, err } - stateDbData, err := Asset("bindata/statedb.tar") if err != nil { return nil, err @@ -460,6 +468,7 @@ func (chain *Blockchain) applyBlockOnState(appState *appstate.AppState, block *t chain.applyNewEpoch(appState, block, statsCollector) chain.applyBlockRewards(totalFee, totalTips, appState, block, prevBlock, statsCollector) chain.applyStatusSwitch(appState, block) + chain.applyDelegationSwitch(appState, block) chain.applyGlobalParams(appState, block, statsCollector) chain.applyNextBlockFee(appState, block, usedGas) chain.applyVrfProposerThreshold(appState, block) @@ -476,6 +485,7 @@ func (chain *Blockchain) applyEmptyBlockOnState( chain.applyNewEpoch(appState, block, statsCollector) chain.applyStatusSwitch(appState, block) + chain.applyDelegationSwitch(appState, block) chain.applyGlobalParams(appState, block, statsCollector) chain.applyVrfProposerThreshold(appState, block) diff = appState.Precommit() @@ -498,7 +508,19 @@ func (chain *Blockchain) applyBlockRewards(totalFee *big.Int, totalTips *big.Int coinbase := block.Header.Coinbase() - reward, stake := splitReward(totalReward, appState.State.GetIdentityState(coinbase) == state.Newbie, chain.config.Consensus) + status := appState.State.GetIdentityState(coinbase) + stakeDest := coinbase + + if appState.ValidatorsCache.IsPool(coinbase) { + delegationNonce := appState.State.GetIdentity(coinbase).DelegationNonce + subIdentity, newNonce := appState.ValidatorsCache.FindSubIdentity(coinbase, delegationNonce) + appState.State.SetDelegationNonce(coinbase, newNonce) + + status = appState.State.GetIdentityState(subIdentity) + stakeDest = subIdentity + } + + reward, stake := splitReward(totalReward, status == state.Newbie, chain.config.Consensus) // calculate penalty balanceAdd, stakeAdd, penaltySub := calculatePenalty(reward, stake, appState.State.GetPenalty(coinbase)) @@ -506,13 +528,13 @@ func (chain *Blockchain) applyBlockRewards(totalFee *big.Int, totalTips *big.Int collector.BeginProposerRewardBalanceUpdate(statsCollector, coinbase, appState) // update state appState.State.AddBalance(coinbase, balanceAdd) - appState.State.AddStake(coinbase, stakeAdd) + appState.State.AddStake(stakeDest, stakeAdd) if penaltySub != nil { appState.State.SubPenalty(coinbase, penaltySub) } collector.CompleteBalanceUpdate(statsCollector, appState) collector.AddMintedCoins(statsCollector, chain.config.Consensus.BlockReward) - collector.AfterAddStake(statsCollector, coinbase, stake, appState) + collector.AfterAddStake(statsCollector, stakeDest, stake, appState) collector.AfterSubPenalty(statsCollector, coinbase, penaltySub, appState) collector.AddPenaltyBurntCoins(statsCollector, coinbase, penaltySub) collector.AddProposerReward(statsCollector, coinbase, reward, stake) @@ -805,6 +827,10 @@ func (chain *Blockchain) applyOfflinePenalty(appState *appstate.AppState, addr c res := coins.Div(decimal.New(int64(networkSize), 0)) collector.BeforeSetPenalty(statsCollector, addr, appState) collector.BeginPenaltyBalanceUpdate(statsCollector, addr, appState) + + if appState.ValidatorsCache.IsPool(addr) { + res = res.Mul(decimal.New(int64(appState.ValidatorsCache.PoolSize(addr)), 0)) + } appState.State.SetPenalty(addr, math.ToInt(res)) collector.CompleteBalanceUpdate(statsCollector, appState) } @@ -818,17 +844,17 @@ func (chain *Blockchain) rewardFinalCommittee(appState *appstate.AppState, block return } identities := appState.ValidatorsCache.GetOnlineValidators(prevBlock.Seed(), block.Height(), types.Final, chain.GetCommitteeSize(appState.ValidatorsCache, true)) - if identities == nil || identities.Cardinality() == 0 { + if identities == nil || identities.Addresses.Cardinality() == 0 { return } totalReward := big.NewInt(0) - totalReward.Div(chain.config.Consensus.FinalCommitteeReward, big.NewInt(int64(identities.Cardinality()))) + totalReward.Div(chain.config.Consensus.FinalCommitteeReward, big.NewInt(int64(identities.Addresses.Cardinality()))) collector.SetCommitteeRewardShare(statsCollector, totalReward) reward, stake := splitReward(totalReward, false, chain.config.Consensus) newbieReward, newbieStake := splitReward(totalReward, true, chain.config.Consensus) - for _, item := range identities.ToSlice() { + for _, item := range identities.Original.ToSlice() { addr := item.(common.Address) identityState := appState.State.GetIdentityState(addr) @@ -837,22 +863,28 @@ func (chain *Blockchain) rewardFinalCommittee(appState *appstate.AppState, block r, s = newbieReward, newbieStake } + penaltySource := addr + balanceDest := addr + if delegator := appState.ValidatorsCache.Delegator(addr);!delegator.IsEmpty(){ + penaltySource = delegator + balanceDest = delegator + } // calculate penalty - balanceAdd, stakeAdd, penaltySub := calculatePenalty(r, s, appState.State.GetPenalty(addr)) + balanceAdd, stakeAdd, penaltySub := calculatePenalty(r, s, appState.State.GetPenalty(penaltySource)) collector.BeginCommitteeRewardBalanceUpdate(statsCollector, addr, appState) // update state - appState.State.AddBalance(addr, balanceAdd) + appState.State.AddBalance(balanceDest, balanceAdd) appState.State.AddStake(addr, stakeAdd) if penaltySub != nil { - appState.State.SubPenalty(addr, penaltySub) + appState.State.SubPenalty(penaltySource, penaltySub) } collector.CompleteBalanceUpdate(statsCollector, appState) collector.AddMintedCoins(statsCollector, r) collector.AddMintedCoins(statsCollector, s) collector.AfterAddStake(statsCollector, addr, s, appState) - collector.AfterSubPenalty(statsCollector, addr, penaltySub, appState) - collector.AddPenaltyBurntCoins(statsCollector, addr, penaltySub) + collector.AfterSubPenalty(statsCollector, penaltySource, penaltySub, appState) + collector.AddPenaltyBurntCoins(statsCollector, penaltySource, penaltySub) collector.AddFinalCommitteeReward(statsCollector, addr, r, s) } } @@ -1062,9 +1094,9 @@ func (chain *Blockchain) ApplyTxOnState(appState *appstate.AppState, vm vm.VM, t fee = fee.Add(fee, receipt.GasCost) collector.AddTxReceipt(statsCollector, receipt, appState) case types.DelegateTx: - stateDB.SetDelegatee(sender, *tx.To) + stateDB.ToggleDelegationAddress(sender, *tx.To) case types.UndelegateTx: - stateDB.RemoveDelegatee(sender) + stateDB.ToggleDelegationAddress(sender, common.EmptyAddress) } stateDB.SubBalance(sender, fee) @@ -1083,6 +1115,7 @@ func (chain *Blockchain) ApplyTxOnState(appState *appstate.AppState, vm vm.VM, t func (chain *Blockchain) getTxFee(feePerGas *big.Int, tx *types.Transaction) *big.Int { return fee.CalculateFee(chain.appState.ValidatorsCache.NetworkSize(), feePerGas, tx) } + func (chain *Blockchain) GetGasCost(appState *appstate.AppState, gasUsed uint64) *big.Int { feePerGas := appState.State.FeePerGas() if common.ZeroOrNil(feePerGas) { @@ -1172,10 +1205,27 @@ func (chain *Blockchain) applyStatusSwitch(appState *appstate.AppState, block *t currentStatus := appState.IdentityState.IsOnline(addr) appState.IdentityState.SetOnline(addr, !currentStatus) } - appState.State.ClearStatusSwitchAddresses() } +func (chain *Blockchain) applyDelegationSwitch(appState *appstate.AppState, block *types.Block) { + if !block.Header.Flags().HasFlag(types.IdentityUpdate) { + return + } + delegations := appState.State.Delegations() + for _, delegation := range delegations { + if delegation.Delegatee.IsEmpty() { + appState.IdentityState.RemoveDelegatee(delegation.Delegator) + appState.State.RemoveDelegatee(delegation.Delegator) + } else { + appState.IdentityState.SetDelegatee(delegation.Delegator, delegation.Delegatee) + appState.State.SetDelegatee(delegation.Delegator, delegation.Delegatee) + appState.IdentityState.SetOnline(delegation.Delegator, false) + } + } + appState.State.ClearDelegations() +} + func (chain *Blockchain) getTxCost(feePerGas *big.Int, tx *types.Transaction) *big.Int { return fee.CalculateCost(chain.appState.ValidatorsCache.NetworkSize(), feePerGas, tx) } @@ -1189,7 +1239,7 @@ func getSeedData(prevBlock *types.Header) []byte { func (chain *Blockchain) GetProposerSortition() (bool, []byte) { if checkIfProposer(chain.coinBaseAddress, chain.appState) { - return chain.getSortition(chain.getProposerData(), chain.appState.State.VrfProposerThreshold()) + return chain.getSortition(chain.getProposerData(), chain.appState.State.VrfProposerThreshold(), int64(chain.appState.ValidatorsCache.PoolSize(chain.coinBaseAddress))) } return false, nil @@ -1350,6 +1400,11 @@ func (chain *Blockchain) calculateFlags(appState *appstate.AppState, block *type if (flags.HasFlag(types.Snapshot) || block.Height()%chain.config.Consensus.StatusSwitchRange == 0) && len(appState.State.StatusSwitchAddresses()) > 0 { flags |= types.IdentityUpdate } + + if block.Height()%chain.config.Consensus.DelegationSwitchRange == 0 && len(appState.State.Delegations()) > 0 { + flags |= types.IdentityUpdate + } + if prevBlock.ProposedHeader != nil && prevBlock.ProposedHeader.Upgrade > 0 && chain.config.Consensus.GenerateGenesisAfterUpgrade { flags |= types.NewGenesis } @@ -1463,14 +1518,30 @@ func (chain *Blockchain) getProposerData() []byte { return result } -func (chain *Blockchain) getSortition(data []byte, threshold float64) (bool, []byte) { +func (chain *Blockchain) getSortition(data []byte, threshold float64, modifier int64) (bool, []byte) { hash, proof := chain.secStore.VrfEvaluate(data) - v := new(big.Float).SetInt(new(big.Int).SetBytes(hash[:])) + v := apd.NewWithBigInt(new(big.Int).SetBytes(hash[:]), 0) - q := new(big.Float).Quo(v, MaxHash) - vrfThreshold := new(big.Float).SetFloat64(threshold) + q := new(apd.Decimal) + _, err := apdContext.Quo(q, v, MaxHash) + if err != nil { + panic(err) + } + if modifier > 1 { + modifiedQ := new(apd.Decimal) + exp := new(apd.Decimal) + apdContext.Quo(exp, apd.New(1, 0), apd.New(modifier, 0)) + _, err := apdContext.Pow(modifiedQ, q, exp) + if err != nil { + panic(err) + } + q = modifiedQ + } + + vrfThreshold := new(apd.Decimal) + vrfThreshold.SetFloat64(threshold) if q.Cmp(vrfThreshold) >= 0 { return true, proof } @@ -1576,7 +1647,7 @@ func (chain *Blockchain) ValidateBlockCert(prevBlock *types.Header, block *types Signature: signature.Signature, } - if !validators.Contains(vote.VoterAddr()) { + if !validators.Addresses.Contains(vote.VoterAddr()) { return errors.New("invalid voter") } if vote.Header.Round != block.Height() { @@ -1592,7 +1663,7 @@ func (chain *Blockchain) ValidateBlockCert(prevBlock *types.Header, block *types voters.Add(vote.VoterAddr()) } - if voters.Cardinality() < chain.GetCommitteeVotesThreshold(validatorsCache, step == types.Final) { + if voters.Cardinality() < chain.GetCommitteeVotesThreshold(validatorsCache, step == types.Final)-validators.VotesCountSubtrahend() { return errors.New("not enough votes") } return nil @@ -1647,17 +1718,36 @@ func (chain *Blockchain) ValidateProposerProof(proof []byte, pubKeyData []byte) h, err := verifier.ProofToHash(chain.getProposerData(), proof) - v := new(big.Float).SetInt(new(big.Int).SetBytes(h[:])) + v := apd.NewWithBigInt(new(big.Int).SetBytes(h[:]), 0) - vrfThreshold := new(big.Float).SetFloat64(chain.appState.State.VrfProposerThreshold()) - q := new(big.Float).Quo(v, MaxHash) + vrfThreshold := new(apd.Decimal) + vrfThreshold.SetFloat64(chain.appState.State.VrfProposerThreshold()) - if q.Cmp(vrfThreshold) == -1 { - return errors.New("Proposer is invalid") + q := new(apd.Decimal) + + _, err = apdContext.Quo(q, v, MaxHash) + if err != nil { + panic(err) } proposerAddr := crypto.PubkeyToAddress(*pubKey) + modifier := chain.appState.ValidatorsCache.PoolSize(proposerAddr) + if modifier > 1 { + modifiedQ := new(apd.Decimal) + exp := new(apd.Decimal) + apdContext.Quo(exp, apd.New(1, 0), apd.New(int64(modifier), 0)) + _, err := apdContext.Pow(modifiedQ, q, exp) + if err != nil { + panic(err) + } + q = modifiedQ + } + + if q.Cmp(vrfThreshold) == -1 { + return errors.New("Proposer is invalid") + } + if !checkIfProposer(proposerAddr, chain.appState) { return errors.New("Proposer is not identity") } diff --git a/blockchain/validation/validation.go b/blockchain/validation/validation.go index 0e106b46..fc0a1fb1 100644 --- a/blockchain/validation/validation.go +++ b/blockchain/validation/validation.go @@ -31,38 +31,37 @@ const ( ) var ( - NodeAlreadyActivated = errors.New("node is already in validator set") - InvalidSignature = errors.New("invalid signature") - InvalidNonce = errors.New("invalid nonce") - InvalidEpoch = errors.New("invalid epoch") - InvalidAmount = errors.New("invalid amount") - InsufficientFunds = errors.New("insufficient funds") - InsufficientInvites = errors.New("insufficient invites") - RecipientRequired = errors.New("recipient is required") - InvitationIsMissing = errors.New("invitation is missing") - EmptyPayload = errors.New("payload can't be empty") - InvalidEpochTx = errors.New("invalid epoch tx") - InvalidPayload = errors.New("invalid payload") - InvalidRecipient = errors.New("invalid recipient") - EarlyTx = errors.New("tx can't be accepted due to wrong period") - LateTx = errors.New("tx can't be accepted due to validation ceremony") - NotCandidate = errors.New("user is not a candidate") - NotIdentity = errors.New("user is not identity") - InsufficientFlips = errors.New("insufficient flips") - IsAlreadyOnline = errors.New("identity is already online or has pending online status") - IsAlreadyOffline = errors.New("identity is already offline or has pending offline status") - DuplicatedFlip = errors.New("duplicated flip") - DuplicatedFlipPair = errors.New("flip with these words already exists") - BigFee = errors.New("current fee is greater than tx max fee") - InvalidMaxFee = errors.New("invalid max fee") - InvalidSender = errors.New("invalid sender") - FlipIsMissing = errors.New("flip is missing") - DuplicatedTx = errors.New("duplicated tx") - NegativeValue = errors.New("value must be non-negative") - SenderHasDelegatee = errors.New("sender has delegatee already") - IdentityShouldBeOffline = errors.New("identity should be offline") - SenderHasNoDelegate = errors.New("sender has not delegatee") - PoolIsTooBig = errors.New("pool is too big") + NodeAlreadyActivated = errors.New("node is already in validator set") + InvalidSignature = errors.New("invalid signature") + InvalidNonce = errors.New("invalid nonce") + InvalidEpoch = errors.New("invalid epoch") + InvalidAmount = errors.New("invalid amount") + InsufficientFunds = errors.New("insufficient funds") + InsufficientInvites = errors.New("insufficient invites") + RecipientRequired = errors.New("recipient is required") + InvitationIsMissing = errors.New("invitation is missing") + EmptyPayload = errors.New("payload can't be empty") + InvalidEpochTx = errors.New("invalid epoch tx") + InvalidPayload = errors.New("invalid payload") + InvalidRecipient = errors.New("invalid recipient") + EarlyTx = errors.New("tx can't be accepted due to wrong period") + LateTx = errors.New("tx can't be accepted due to validation ceremony") + NotCandidate = errors.New("user is not a candidate") + NotIdentity = errors.New("user is not identity") + InsufficientFlips = errors.New("insufficient flips") + IsAlreadyOnline = errors.New("identity is already online or has pending online status") + IsAlreadyOffline = errors.New("identity is already offline or has pending offline status") + DuplicatedFlip = errors.New("duplicated flip") + DuplicatedFlipPair = errors.New("flip with these words already exists") + BigFee = errors.New("current fee is greater than tx max fee") + InvalidMaxFee = errors.New("invalid max fee") + InvalidSender = errors.New("invalid sender") + FlipIsMissing = errors.New("flip is missing") + DuplicatedTx = errors.New("duplicated tx") + NegativeValue = errors.New("value must be non-negative") + SenderHasDelegatee = errors.New("sender has delegatee already") + SenderHasNoDelegatee = errors.New("sender has no delegatee") + PoolIsTooBig = errors.New("pool is too big") validators map[types.TxType]validator ) @@ -112,9 +111,20 @@ func init() { } func SetAppConfig(cfg *config.Config) { appCfg = cfg + } func getValidator(txType types.TxType) (validator, bool) { + if appCfg != nil && cfgInitVersion != appCfg.Consensus.Version { + cfgInitVersion = appCfg.Consensus.Version + if appCfg.Consensus.EnablePools { + validators[types.DelegateTx] = validateDelegateTx + validators[types.UndelegateTx] = validateUndelegateTx + } else { + delete(validators, types.DelegateTx) + delete(validators, types.UndelegateTx) + } + } v, ok := validators[txType] return v, ok } @@ -502,8 +512,8 @@ func validateOnlineStatusTx(appState *appstate.AppState, tx *types.Transaction, if appState.State.ValidationPeriod() >= state.FlipLotteryPeriod { return LateTx } - if !appState.ValidatorsCache.Contains(sender) { - return InvalidRecipient + if !appState.ValidatorsCache.Contains(sender) && !appState.ValidatorsCache.IsPool(sender) { + return InvalidSender } attachment := attachments.ParseOnlineStatusAttachment(tx) @@ -512,6 +522,11 @@ func validateOnlineStatusTx(appState *appstate.AppState, tx *types.Transaction, return InvalidPayload } + identity := appState.State.GetIdentity(sender) + if identity.Delegatee != nil { + return InvalidSender + } + hasPendingStatusSwitch := appState.State.HasStatusSwitchAddresses(sender) isOnline := appState.ValidatorsCache.IsOnlineIdentity(sender) isOffline := !isOnline @@ -704,6 +719,10 @@ func validateDelegateTx(appState *appstate.AppState, tx *types.Transaction, txTy return RecipientRequired } + if sender == *tx.To { + return InvalidRecipient + } + if !common.ZeroOrNil(tx.AmountOrZero()) { return InvalidAmount } @@ -711,17 +730,17 @@ func validateDelegateTx(appState *appstate.AppState, tx *types.Transaction, txTy return LateTx } - identity := appState.State.GetIdentity(sender) - - if identity.Delegatee != nil { - return SenderHasDelegatee - } - - hasPendingStatusSwitch := appState.State.HasStatusSwitchAddresses(sender) - isOnline := appState.ValidatorsCache.IsOnlineIdentity(sender) + delegatee := appState.IdentityState.Delegatee(sender) + delegationSwitch := appState.State.DelegationSwitch(sender) - if isOnline && !hasPendingStatusSwitch || !isOnline && hasPendingStatusSwitch { - return IdentityShouldBeOffline + if delegatee == nil { + if delegationSwitch != nil && !delegationSwitch.Delegatee.IsEmpty() { + return SenderHasDelegatee + } + } else { + if delegationSwitch == nil || !delegationSwitch.Delegatee.IsEmpty() { + return SenderHasDelegatee + } } return nil @@ -742,13 +761,21 @@ func validateUndelegateTx(appState *appstate.AppState, tx *types.Transaction, tx return LateTx } - identity := appState.State.GetIdentity(sender) + delegatee := appState.IdentityState.Delegatee(sender) + delegationSwitch := appState.State.DelegationSwitch(sender) - if identity.Delegatee == nil { - return SenderHasNoDelegate + if delegatee != nil { + if delegationSwitch != nil && delegationSwitch.Delegatee.IsEmpty() { + return SenderHasNoDelegatee + } + } else { + if delegationSwitch == nil || delegationSwitch.Delegatee.IsEmpty() { + return SenderHasNoDelegatee + } } + const maxFamilyPoolSize = 20 - if appState.ValidatorsCache.PoolSize(*identity.Delegatee) > maxFamilyPoolSize { + if delegatee != nil && appState.ValidatorsCache.PoolSize(*delegatee) > maxFamilyPoolSize { return PoolIsTooBig } diff --git a/cmd/stategen/main.go b/cmd/stategen/main.go index c81df25c..09f03bf3 100644 --- a/cmd/stategen/main.go +++ b/cmd/stategen/main.go @@ -161,6 +161,9 @@ func main() { Address: data.Inviter.Address[:], } } + if data.Delegatee != nil { + identity.Delegatee = data.Delegatee.Bytes() + } for idx := range data.Invitees { identity.Invitees = append(identity.Invitees, &models.ProtoPredefinedState_Identity_TxAddr{ Hash: data.Invitees[idx].TxHash[:], @@ -192,11 +195,15 @@ func main() { log.Error(err.Error()) return false } - snapshot.ApprovedIdentities = append(snapshot.ApprovedIdentities, &models.ProtoPredefinedState_ApprovedIdentity{ + identity := &models.ProtoPredefinedState_ApprovedIdentity{ Address: addr[:], Approved: data.Approved, Online: false, - }) + } + if data.Delegatee != nil { + identity.Delegatee = data.Delegatee.Bytes() + } + snapshot.ApprovedIdentities = append(snapshot.ApprovedIdentities, identity) return false }) diff --git a/common/decimal/decimal.go b/common/decimal/decimal.go new file mode 100644 index 00000000..e27925c9 --- /dev/null +++ b/common/decimal/decimal.go @@ -0,0 +1,38 @@ +package decimal + +import "github.com/cockroachdb/apd" + +type Decimal struct { + underlined *apd.Decimal +} + +var apdContext = apd.Context{ + MaxExponent: apd.BaseContext.MaxExponent, + MinExponent: apd.MinExponent, + Precision: 16, + Rounding: apd.BaseContext.Rounding, + Traps: apd.BaseContext.Traps, +} + +func New(m int64, e int32) *Decimal { + return &Decimal{apd.New(m, e)} +} + +func (d *Decimal) Div(d2 *Decimal) *Decimal { + r := new(apd.Decimal) + apdContext.Quo(r, d.underlined, d2.underlined) + return &Decimal{r} +} + +func (d *Decimal) DivWithPrecision(d2 *Decimal, precision uint32) *Decimal { + apdContext := apd.Context{ + MaxExponent: apd.BaseContext.MaxExponent, + MinExponent: apd.MinExponent, + Precision: precision, + Rounding: apd.BaseContext.Rounding, + Traps: apd.BaseContext.Traps, + } + r := new(apd.Decimal) + apdContext.Quo(r, d.underlined, d2.underlined) + return &Decimal{r} +} diff --git a/common/math/big.go b/common/math/big.go index 9d2e7946..b6e1a1fb 100644 --- a/common/math/big.go +++ b/common/math/big.go @@ -210,3 +210,72 @@ func Exp(base, exponent *big.Int) *big.Int { } return result } + +func Pow(a *big.Float, exp uint64) *big.Float { + + z := Zero().SetInt64(1) + y := Zero().Set(a) + // For each loop, we compute a xⁿ where n is a power of two. + for exp > 0 { + if exp&1 == 1 { + // This bit contributes. Multiply it into the result. + z.Mul(z, y) + } + y.Mul(y, y) + exp >>= 1 + } + return z +} + +func Abs(a *big.Float) *big.Float { + return Zero().Abs(a) +} + +func New(f float64) *big.Float { + r := big.NewFloat(f) + r.SetPrec(256) + return r +} + +func Div(a, b *big.Float) *big.Float { + return Zero().Quo(a, b) +} + +func Zero() *big.Float { + r := big.NewFloat(0.0) + r.SetPrec(256) + return r +} + +func Mul(a, b *big.Float) *big.Float { + return Zero().Mul(a, b) +} + +func Add(a, b *big.Float) *big.Float { + return Zero().Add(a, b) +} + +func Sub(a, b *big.Float) *big.Float { + return Zero().Sub(a, b) +} + +func Lesser(x, y *big.Float) bool { + return x.Cmp(y) == -1 +} + +func Root(a *big.Float, n uint64) *big.Float { + limit := Pow(New(2), 128) + n1 := n - 1 + n1f, rn := New(float64(n1)), Div(New(1.0), New(float64(n))) + x, x0 := New(1.0), Zero() + for { + + A := Mul(a, Pow( Div(New(1.0), x), n1)) + + x0, x = x, Mul(rn, Add(Mul(n1f, x), A)) + if Lesser(Mul(Abs(Sub(x, x0)), limit), x) { + break + } + } + return x +} diff --git a/common/math/big_test.go b/common/math/big_test.go index 41527a28..cd3de4a3 100644 --- a/common/math/big_test.go +++ b/common/math/big_test.go @@ -19,6 +19,8 @@ package math import ( "bytes" "encoding/hex" + "github.com/cockroachdb/apd" + "github.com/stretchr/testify/require" "math/big" "testing" ) @@ -319,3 +321,82 @@ func hex2Bytes(str string) []byte { h, _ := hex.DecodeString(str) return h } + +func TestPow(t *testing.T) { + + cases := []struct { + num float64 + n uint64 + expected float64 + }{ + { + 2, 3, 8, + }, + { + 7, 0, 1, + }, { + 0, 0, 1, + }, { + 2, 8, 256, + }, { + 17, 17, 827240261886336764177, + }, + } + + for _, c := range cases { + r, _ := Pow(big.NewFloat(c.num), c.n).Float64() + require.Equal(t, c.expected, r) + } +} + +func TestRoot(t *testing.T) { + cases := []struct { + num float64 + n uint64 + expected float64 + }{ + { + 8, 3, 2, + }, + { + 7, 1, 7, + }, { + 256, 8, 2, + }, { + 827240261886336764177, 17, 17, + }, { + 0.9997, 500, 0.99999939991016204992786560777892, + }, { + 0.9997, 1000, 0.999999699955036, + }, + { + 0.9997, 100000, 0.9999999969995499, + }, { + 0.99999987, 499, 0.9999999997394789410, + }, { + 2, 137, 1.00507228919474226111910, + }, { + 3457395871232236, 43, 2.298085901213781323417130621988, + }, { + 3457395871232236, 2, 58799624.75417879739515291423973129368246, + }, + } + + d := new(apd.Decimal) + + x, _, _ := apd.NewFromString("3457395871232236") + y, _, _ := apd.NewFromString(Div(big.NewFloat(1), big.NewFloat(43)).Text('g', 40)) + c, err := apd.BaseContext.Pow(d, x, y) + t.Log(c, err) + t.Log(d.String()) + for _, c := range cases { + r, _ := Root(big.NewFloat(c.num), c.n).Float64() + require.Equal(t, c.expected, r) + } +} + +func Test_apd(t *testing.T) { + bytes := hex2Bytes("e812f6d1b756dbcd198d60b92457258ccb28b62e") + + t.Log(string(bytes)) +} diff --git a/common/types_test.go b/common/types_test.go index 7095ccd0..ff9df2b6 100644 --- a/common/types_test.go +++ b/common/types_test.go @@ -371,3 +371,6 @@ func TestAddress_Value(t *testing.T) { }) } } + + + diff --git a/config/consensus.go b/config/consensus.go index 3f262bc4..5a1493f0 100644 --- a/config/consensus.go +++ b/config/consensus.go @@ -42,37 +42,33 @@ type ConsensusConf struct { MinBlockDistance time.Duration MaxCommitteeSize int StatusSwitchRange uint64 + DelegationSwitchRange uint64 InvitesPercent float32 MinProposerThreshold float64 UpgradeIntervalBeforeValidation time.Duration - HumanCanFailLongSession bool - UseTxHashIavl bool - EnableContracts bool + EnablePools bool } type ConsensusVerson uint16 const ( - // Base consensus parameters - ConsensusV1 ConsensusVerson = 1 - // Allows human fail long session - ConsensusV2 ConsensusVerson = 2 // Enables contracts ConsensusV3 ConsensusVerson = 3 + // Enables pools + ConsensusV4 ConsensusVerson = 4 ) var ( - v1 ConsensusConf - v2 ConsensusConf v3 ConsensusConf + v4 ConsensusConf ConsensusVersions map[ConsensusVerson]*ConsensusConf ) func init() { ConsensusVersions = map[ConsensusVerson]*ConsensusConf{ } - v1 = ConsensusConf{ - Version: ConsensusV1, + v3 = ConsensusConf{ + Version: ConsensusV3, MaxSteps: 150, CommitteePercent: 0.3, // 30% of valid nodes will be committee members FinalCommitteePercent: 0.7, // 70% of valid nodes will be committee members @@ -102,37 +98,26 @@ func init() { MinBlockDistance: time.Second * 20, MaxCommitteeSize: 100, StatusSwitchRange: 50, + DelegationSwitchRange: 50, InvitesPercent: 0.5, MinProposerThreshold: 0.5, UpgradeIntervalBeforeValidation: time.Hour * 48, } - ConsensusVersions[ConsensusV1] = &v1 - v2 = v1 - ApplyConsensusVersion(ConsensusV2, &v2) - ConsensusVersions[ConsensusV2] = &v2 - - v3 = v2 - ApplyConsensusVersion(ConsensusV3, &v3) ConsensusVersions[ConsensusV3] = &v3 + + v4 = v3 + ApplyConsensusVersion(ConsensusV4, &v4) + ConsensusVersions[ConsensusV4] = &v4 } func ApplyConsensusVersion(ver ConsensusVerson, cfg *ConsensusConf) { switch ver { - case ConsensusV2: - cfg.HumanCanFailLongSession = true - cfg.Version = ConsensusV2 - cfg.StartActivationDate = time.Date(2020, 11, 4, 8, 0, 0, 0, time.UTC).Unix() - cfg.EndActivationDate = time.Date(2020, 11, 11, 0, 0, 0, 0, time.UTC).Unix() - cfg.MigrationTimeout = 0 - cfg.GenerateGenesisAfterUpgrade = false - cfg.UseTxHashIavl = true - case ConsensusV3: - cfg.EnableContracts = true - cfg.Version = ConsensusV3 - cfg.StartActivationDate = time.Date(2020, 12, 24, 8, 0, 0, 0, time.UTC).Unix() - cfg.EndActivationDate = time.Date(2020, 12, 31, 0, 0, 0, 0, time.UTC).Unix() + case ConsensusV4: + cfg.EnablePools = true + cfg.Version = ConsensusV4 + cfg.StartActivationDate = time.Date(2021, 02, 10, 8, 0, 0, 0, time.UTC).Unix() + cfg.EndActivationDate = time.Date(2021, 02, 17, 0, 0, 0, 0, time.UTC).Unix() cfg.MigrationTimeout = 0 - cfg.GenerateGenesisAfterUpgrade = true } } diff --git a/consensus/engine.go b/consensus/engine.go index 8fa5c8af..0a4fbdc3 100644 --- a/consensus/engine.go +++ b/consensus/engine.go @@ -484,6 +484,8 @@ func (engine *Engine) countVotes(round uint64, step uint8, parentHash common.Has return common.Hash{}, nil, errors.Errorf("validators were not setup, step=%v", step) } + necessaryVotesCount -= validators.VotesCountSubtrahend() + for start := time.Now(); time.Since(start) < timeout; { m := engine.votes.GetVotesOfRound(round) if m != nil { @@ -504,7 +506,7 @@ func (engine *Engine) countVotes(round uint64, step uint8, parentHash common.Has if vote.Header.ParentHash != parentHash { return true } - if !validators.Contains(vote.VoterAddr()) { + if !validators.Addresses.Contains(vote.VoterAddr()) { return true } if vote.Header.Step != step { diff --git a/core/state/identity_statedb.go b/core/state/identity_statedb.go index a585a161..058aed10 100644 --- a/core/state/identity_statedb.go +++ b/core/state/identity_statedb.go @@ -143,6 +143,7 @@ func (s *IdentityStateDB) Add(identity common.Address) { func (s *IdentityStateDB) Remove(identity common.Address) { s.GetOrNewIdentityObject(identity).SetState(false) + s.GetOrNewIdentityObject(identity).SetOnline(false) } // Commit writes the state to the underlying in-memory trie database. @@ -318,10 +319,26 @@ func (s *IdentityStateDB) IsOnline(addr common.Address) bool { return false } +func (s *IdentityStateDB) Delegatee(addr common.Address) *common.Address { + stateObject := s.getStateIdentity(addr) + if stateObject != nil { + return stateObject.data.Delegatee + } + return nil +} + func (s *IdentityStateDB) SetOnline(addr common.Address, online bool) { s.GetOrNewIdentityObject(addr).SetOnline(online) } +func (s *IdentityStateDB) SetDelegatee(addr common.Address, delegatee common.Address) { + s.GetOrNewIdentityObject(addr).SetDelegatee(delegatee) +} + +func (s *IdentityStateDB) RemoveDelegatee(addr common.Address) { + s.GetOrNewIdentityObject(addr).RemoveDelegatee() +} + func (s *IdentityStateDB) ResetTo(height uint64) error { s.Clear() _, err := s.tree.LoadVersionForOverwriting(int64(height)) @@ -423,6 +440,10 @@ func (s *IdentityStateDB) SetPredefinedIdentities(state *models.ProtoPredefinedS stateObj := s.GetOrNewIdentityObject(common.BytesToAddress(identity.Address)) stateObj.data.Online = false stateObj.data.Approved = identity.Approved + if identity.Delegatee != nil { + d := common.BytesToAddress(identity.Delegatee) + stateObj.data.Delegatee = &d + } stateObj.touch() } } diff --git a/core/state/keys.go b/core/state/keys.go index d62e3537..cc771171 100644 --- a/core/state/keys.go +++ b/core/state/keys.go @@ -24,6 +24,7 @@ var ( globalKey = []byte{0x3} statusSwitchKey = []byte{0x4} contractStorePrefix = []byte{0x5} + delegationSwitchKey = []byte{0x6} ) var ( @@ -76,6 +77,10 @@ func (s *stateDbKeys) StatusSwitchKey() []byte { return statusSwitchKey } +func (s *stateDbKeys) DelegationSwitchKey() []byte { + return delegationSwitchKey +} + func (s *stateDbKeys) ContractStoreKey(address common.Address, key []byte) []byte { return append(append(contractStorePrefix, address[:]...), key...) } diff --git a/core/state/state_object.go b/core/state/state_object.go index 1141a346..06e89fa0 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -85,6 +85,13 @@ type stateStatusSwitch struct { onDirty func() } +type stateDelegationSwitch struct { + data DelegationSwitch + + deleted bool + onDirty func() +} + type ValidationPeriod uint32 const ( @@ -96,7 +103,7 @@ const ( ) type IdentityStatusSwitch struct { - Addresses []common.Address `rlp:"nil"` + Addresses []common.Address } func (s *IdentityStatusSwitch) ToBytes() ([]byte, error) { @@ -118,12 +125,48 @@ func (s *IdentityStatusSwitch) FromBytes(data []byte) error { return nil } +type Delegation struct { + Delegator common.Address + Delegatee common.Address +} + +type DelegationSwitch struct { + Delegations []*Delegation +} + +func (s *DelegationSwitch) ToBytes() ([]byte, error) { + protoObj := new(models.ProtoStateDelegationSwitch) + for idx := range s.Delegations { + delegation := s.Delegations[idx] + protoObj.Delegations = append(protoObj.Delegations, &models.ProtoStateDelegationSwitch_Delegation{ + Delegator: delegation.Delegator.Bytes(), + Delegatee: delegation.Delegatee.Bytes(), + }) + } + return proto.Marshal(protoObj) +} + +func (s *DelegationSwitch) FromBytes(data []byte) error { + protoObj := new(models.ProtoStateDelegationSwitch) + if err := proto.Unmarshal(data, protoObj); err != nil { + return err + } + for idx := range protoObj.Delegations { + delegation := protoObj.Delegations[idx] + s.Delegations = append(s.Delegations, &Delegation{ + Delegator: common.BytesToAddress(delegation.Delegator), + Delegatee: common.BytesToAddress(delegation.Delegatee), + }) + } + return nil +} + type Global struct { Epoch uint16 NextValidationTime int64 ValidationPeriod ValidationPeriod GodAddress common.Address - WordsSeed types.Seed `rlp:"nil"` + WordsSeed types.Seed LastSnapshot uint64 EpochBlock uint64 FeePerGas *big.Int @@ -142,7 +185,7 @@ func (s *Global) ToBytes() ([]byte, error) { WordsSeed: s.WordsSeed[:], LastSnapshot: s.LastSnapshot, EpochBlock: s.EpochBlock, - FeePerGas: common.BigIntBytesOrNil(s.FeePerGas), + FeePerGas: common.BigIntBytesOrNil(s.FeePerGas), VrfProposerThreshold: s.VrfProposerThreshold, EmptyBlocksBits: common.BigIntBytesOrNil(s.EmptyBlocksBits), GodAddressInvites: uint32(s.GodAddressInvites), @@ -253,8 +296,8 @@ type Identity struct { ValidationTxsBits byte LastValidationStatus ValidationStatusFlag Scores []byte - - Delegatee *common.Address + Delegatee *common.Address + DelegationNonce uint32 } type TxAddr struct { @@ -280,6 +323,9 @@ func (i *Identity) ToBytes() ([]byte, error) { ProfileHash: i.ProfileHash, Scores: i.Scores, } + if i.Delegatee != nil { + protoIdentity.Delegatee = i.Delegatee.Bytes() + } for idx := range i.Flips { protoIdentity.Flips = append(protoIdentity.Flips, &models.ProtoStateIdentity_Flip{ Cid: i.Flips[idx].Cid, @@ -342,6 +388,10 @@ func (i *Identity) FromBytes(data []byte) error { Address: common.BytesToAddress(protoIdentity.Inviter.Address), } } + if protoIdentity.Delegatee != nil { + addr := common.BytesToAddress(protoIdentity.Delegatee) + i.Delegatee = &addr + } return nil } @@ -369,8 +419,9 @@ func (i *Identity) GetMaximumAvailableFlips() uint8 { } type ApprovedIdentity struct { - Approved bool - Online bool + Approved bool + Online bool + Delegatee *common.Address } func (s *ApprovedIdentity) ToBytes() ([]byte, error) { @@ -378,6 +429,9 @@ func (s *ApprovedIdentity) ToBytes() ([]byte, error) { Approved: s.Approved, Online: s.Online, } + if s.Delegatee != nil { + protoAnswer.Delegatee = s.Delegatee.Bytes() + } return proto.Marshal(protoAnswer) } @@ -388,6 +442,10 @@ func (s *ApprovedIdentity) FromBytes(data []byte) error { } s.Approved = protoIdentity.Approved s.Online = protoIdentity.Online + if protoIdentity.Delegatee != nil { + d := common.BytesToAddress(protoIdentity.Delegatee) + s.Delegatee = &d + } return nil } @@ -429,6 +487,13 @@ func newStatusSwitchObject(data IdentityStatusSwitch, onDirty func()) *stateStat } } +func newDelegationSwitchObject(data DelegationSwitch, onDirty func()) *stateDelegationSwitch { + return &stateDelegationSwitch{ + data: data, + onDirty: onDirty, + } +} + func newApprovedIdentityObject(address common.Address, data ApprovedIdentity, onDirty func(addr common.Address)) *stateApprovedIdentity { return &stateApprovedIdentity{ address: address, @@ -813,11 +878,16 @@ func (s *stateIdentity) SetDelegatee(delegatee common.Address) { s.touch() } -func (s *stateIdentity) RemoveDelegatee(){ +func (s *stateIdentity) RemoveDelegatee() { s.data.Delegatee = nil s.touch() } +func (s *stateIdentity) SetDelegationNonce(nonce uint32) { + s.data.DelegationNonce = nonce + s.touch() +} + func (s *stateGlobal) Epoch() uint16 { return s.data.Epoch } @@ -985,7 +1055,7 @@ func (s *stateApprovedIdentity) Online() bool { // empty returns whether the account is considered empty. func (s *stateApprovedIdentity) empty() bool { - return !s.data.Approved + return !s.data.Approved && !s.data.Online } func (s *stateApprovedIdentity) touch() { @@ -1005,6 +1075,16 @@ func (s *stateApprovedIdentity) SetOnline(online bool) { s.touch() } +func (s *stateApprovedIdentity) SetDelegatee(delegatee common.Address) { + s.data.Delegatee = &delegatee + s.touch() +} + +func (s *stateApprovedIdentity) RemoveDelegatee() { + s.data.Delegatee = nil + s.touch() +} + func IsCeremonyCandidate(identity Identity) bool { state := identity.State return (state == Candidate || state.NewbieOrBetter() || state == Suspended || @@ -1050,6 +1130,39 @@ func (s *stateStatusSwitch) touch() { } } +func (s *stateDelegationSwitch) ToggleDelegation(sender common.Address, delegatee common.Address) { + defer s.touch() + for i := 0; i < len(s.data.Delegations); i++ { + if s.data.Delegations[i].Delegator == sender { + s.data.Delegations[i].Delegatee = delegatee + return + } + } + s.data.Delegations = append(s.data.Delegations, &Delegation{ + Delegator: sender, + Delegatee: delegatee, + }) +} + +func (s *stateDelegationSwitch) touch() { + if s.onDirty != nil { + s.onDirty() + } +} + +func (s *stateDelegationSwitch) Clear() { + s.data.Delegations = []*Delegation{} + s.touch() +} +func (s *stateDelegationSwitch) DelegationSwitch(sender common.Address) *Delegation { + for _, d := range s.data.Delegations { + if d.Delegator == sender { + return d + } + } + return nil +} + func (f ValidationStatusFlag) HasFlag(flag ValidationStatusFlag) bool { return f&flag != 0 } diff --git a/core/state/statedb.go b/core/state/statedb.go index fa208053..c87438b2 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -71,6 +71,9 @@ type StateDB struct { stateStatusSwitch *stateStatusSwitch stateStatusSwitchDirty bool + stateDelegationSwitch *stateDelegationSwitch + stateDelegationSwitchDirty bool + log log.Logger lock sync.Mutex } @@ -430,14 +433,6 @@ func (s *StateDB) SetValidationStatus(addr common.Address, status ValidationStat s.GetOrNewIdentityObject(addr).SetValidationStatus(status) } -func (s *StateDB) SetDelegatee(addr common.Address, delegatee common.Address) { - s.GetOrNewIdentityObject(addr).SetDelegatee(delegatee) -} - -func (s *StateDB) RemoveDelegatee(addr common.Address) { - s.GetOrNewIdentityObject(addr).RemoveDelegatee() -} - func (s *StateDB) IncEpoch() { s.GetOrNewGlobalObject().IncEpoch() } @@ -683,6 +678,31 @@ func (s *StateDB) getStateStatusSwitch() (stateObject *stateStatusSwitch) { return obj } +func (s *StateDB) getStateDelegationSwitch() (stateObject *stateDelegationSwitch) { + // Prefer 'live' objects. + if obj := s.stateDelegationSwitch; obj != nil { + if obj.deleted { + return nil + } + return obj + } + + // Load the object from the database. + _, enc := s.tree.Get(StateDbKeys.DelegationSwitchKey()) + if len(enc) == 0 { + return nil + } + var data DelegationSwitch + if err := data.FromBytes(enc); err != nil { + s.log.Error("Failed to decode state delegation switch object", "err", err) + return nil + } + // Insert into the live set. + obj := newDelegationSwitchObject(data, s.MarkStateDelegationSwitchObjectDirty) + s.setStateDelegationSwitchObject(obj) + return obj +} + func (s *StateDB) setStateAccountObject(object *stateAccount) { s.lock.Lock() defer s.lock.Unlock() @@ -711,6 +731,13 @@ func (s *StateDB) setStateStatusSwitchObject(object *stateStatusSwitch) { s.stateStatusSwitch = object } +func (s *StateDB) setStateDelegationSwitchObject(object *stateDelegationSwitch) { + s.lock.Lock() + defer s.lock.Unlock() + + s.stateDelegationSwitch = object +} + // Retrieve a state object or create a new state object if nil func (s *StateDB) GetOrNewAccountObject(addr common.Address) *stateAccount { stateObject := s.getStateAccount(addr) @@ -746,6 +773,14 @@ func (s *StateDB) GetOrNewStatusSwitchObject() *stateStatusSwitch { return stateObject } +func (s *StateDB) GetOrNewDelegationSwitchObject() *stateDelegationSwitch { + stateObject := s.getStateDelegationSwitch() + if stateObject == nil || stateObject.deleted { + stateObject = s.createDelegationSwitch() + } + return stateObject +} + // MarkStateAccountObjectDirty adds the specified object to the dirty map to avoid costly // state object cache iteration to find a handful of modified ones. func (s *StateDB) MarkStateAccountObjectDirty(addr common.Address) { @@ -780,6 +815,13 @@ func (s *StateDB) MarkStateStatusSwitchObjectDirty() { s.stateStatusSwitchDirty = true } +func (s *StateDB) MarkStateDelegationSwitchObjectDirty() { + s.lock.Lock() + defer s.lock.Unlock() + + s.stateDelegationSwitchDirty = true +} + func (s *StateDB) createAccount(addr common.Address) (newobj, prev *stateAccount) { prev = s.getStateAccount(addr) newobj = newAccountObject(addr, Account{}, s.MarkStateAccountObjectDirty) @@ -810,6 +852,13 @@ func (s *StateDB) createStatusSwitch() *stateStatusSwitch { return stateObject } +func (s *StateDB) createDelegationSwitch() *stateDelegationSwitch { + stateObject := newDelegationSwitchObject(DelegationSwitch{}, s.MarkStateDelegationSwitchObjectDirty) + stateObject.touch() + s.setStateDelegationSwitchObject(stateObject) + return stateObject +} + // Commit writes the state to the underlying in-memory trie database. func (s *StateDB) Commit(deleteEmptyObjects bool) (root []byte, version int64, err error) { s.Precommit(deleteEmptyObjects) @@ -1159,6 +1208,10 @@ func (s *StateDB) SetPredefinedIdentities(state *models.ProtoPredefinedState) { Address: common.BytesToAddress(identity.Inviter.Address), } } + if identity.Delegatee !=nil { + addr := common.BytesToAddress(identity.Delegatee) + stateObject.data.Delegatee = &addr + } for _, item := range identity.Invitees { stateObject.data.Invitees = append(stateObject.data.Invitees, TxAddr{ TxHash: common.BytesToHash(item.Hash), @@ -1181,6 +1234,8 @@ func (s *StateDB) HasStatusSwitchAddresses(addr common.Address) bool { return statusSwitch.HasAddress(addr) } + + func (s *StateDB) StatusSwitchAddresses() []common.Address { statusSwitch := s.GetOrNewStatusSwitchObject() return statusSwitch.Addresses() @@ -1192,8 +1247,24 @@ func (s *StateDB) ClearStatusSwitchAddresses() { } func (s *StateDB) ToggleStatusSwitchAddress(sender common.Address) { - statusSwitch := s.GetOrNewStatusSwitchObject() - statusSwitch.ToggleAddress(sender) + delegationSwitch := s.GetOrNewStatusSwitchObject() + delegationSwitch.ToggleAddress(sender) +} + +func (s *StateDB) ToggleDelegationAddress(sender common.Address, delegatee common.Address) { + delegationSwitch := s.GetOrNewDelegationSwitchObject() + delegationSwitch.ToggleDelegation(sender, delegatee) +} + +func (s *StateDB) DelegationSwitch(sender common.Address) *Delegation{ + delegationSwitch := s.GetOrNewDelegationSwitchObject() + return delegationSwitch.DelegationSwitch(sender) +} + + +func (s *StateDB) ClearDelegations() { + statusSwitch := s.GetOrNewDelegationSwitchObject() + statusSwitch.Clear() } func (s *StateDB) SetContractValue(addr common.Address, key []byte, value []byte) { @@ -1297,6 +1368,22 @@ func (s *StateDB) SetContractStake(addr common.Address, stake *big.Int) { contract.SetContractStake(stake) } +func (s *StateDB) Delegations() []*Delegation { + return s.GetOrNewDelegationSwitchObject().data.Delegations +} + +func (s *StateDB) SetDelegatee(addr common.Address, delegatee common.Address) { + s.GetOrNewIdentityObject(addr).SetDelegatee(delegatee) +} + +func (s *StateDB) RemoveDelegatee(addr common.Address) { + s.GetOrNewIdentityObject(addr).RemoveDelegatee() +} + +func (s *StateDB) SetDelegationNonce(addr common.Address, nonce uint32) { + s.GetOrNewIdentityObject(addr).SetDelegationNonce(nonce) +} + type readCloser struct { r io.Reader } diff --git a/core/validators/validators.go b/core/validators/validators.go index ea5520a3..47c3e479 100644 --- a/core/validators/validators.go +++ b/core/validators/validators.go @@ -17,13 +17,17 @@ import ( type ValidatorsCache struct { identityState *state.IdentityStateDB - validOnlineNodes []common.Address - nodesSet mapset.Set - onlineNodesSet mapset.Set - log log.Logger - god common.Address - mutex sync.Mutex - height uint64 + sortedValidators []common.Address + + pools map[common.Address][]common.Address + delegations map[common.Address]common.Address + + nodesSet mapset.Set + onlineNodesSet mapset.Set + log log.Logger + god common.Address + mutex sync.Mutex + height uint64 } func NewValidatorsCache(identityState *state.IdentityStateDB, godAddress common.Address) *ValidatorsCache { @@ -33,6 +37,8 @@ func NewValidatorsCache(identityState *state.IdentityStateDB, godAddress common. onlineNodesSet: mapset.NewSet(), log: log.New(), god: godAddress, + pools: map[common.Address][]common.Address{}, + delegations: map[common.Address]common.Address{}, } } @@ -43,21 +49,43 @@ func (v *ValidatorsCache) Load() { v.loadValidNodes() } -func (v *ValidatorsCache) GetOnlineValidators(seed types.Seed, round uint64, step uint8, limit int) mapset.Set { +func (v *ValidatorsCache) replaceByDelegatee(set mapset.Set) (netSet mapset.Set, votePowers map[common.Address]int) { + mapped := mapset.NewSet() + votePowers = make(map[common.Address]int) + for _, item := range set.ToSlice() { + addr := item.(common.Address) + if d, ok := v.delegations[addr]; ok { + mapped.Add(d) + votePowers[d] ++ + } else { + mapped.Add(addr) + } + } + // increment votePowers for pools which address is in original set, those pools are approved identities + for addr := range votePowers { + if set.Contains(addr) { + votePowers[addr] ++ + } + } + return mapped, votePowers +} + +func (v *ValidatorsCache) GetOnlineValidators(seed types.Seed, round uint64, step uint8, limit int) *StepValidators { set := mapset.NewSet() if v.OnlineSize() == 0 { set.Add(v.god) - return set + return &StepValidators{Original: set, Addresses: set, Size: 1} } - if len(v.validOnlineNodes) == limit { - for _, n := range v.validOnlineNodes { + if len(v.sortedValidators) == limit { + for _, n := range v.sortedValidators { set.Add(n) } - return set + newSet, votePowers := v.replaceByDelegatee(set) + return &StepValidators{Original: set, Addresses: newSet, ExtraVotePowers: votePowers, Size: newSet.Cardinality()} } - if len(v.validOnlineNodes) < limit { + if len(v.sortedValidators) < limit { return nil } @@ -65,13 +93,13 @@ func (v *ValidatorsCache) GetOnlineValidators(seed types.Seed, round uint64, ste randSeed := binary.LittleEndian.Uint64(rndSeed[:]) random := rand.New(rand.NewSource(int64(randSeed))) - indexes := random.Perm(len(v.validOnlineNodes)) + indexes := random.Perm(len(v.sortedValidators)) for i := 0; i < limit; i++ { - set.Add(v.validOnlineNodes[indexes[i]]) + set.Add(v.sortedValidators[indexes[i]]) } - - return set + newSet, votePowers := v.replaceByDelegatee(set) + return &StepValidators{Original: set, Addresses: newSet, ExtraVotePowers: votePowers, Size: newSet.Cardinality()} } func (v *ValidatorsCache) NetworkSize() int { @@ -112,6 +140,8 @@ func (v *ValidatorsCache) loadValidNodes() { v.nodesSet.Clear() v.onlineNodesSet.Clear() + var delegators []common.Address + v.identityState.IterateIdentities(func(key []byte, value []byte) bool { if key == nil { return true @@ -128,13 +158,34 @@ func (v *ValidatorsCache) loadValidNodes() { v.onlineNodesSet.Add(addr) onlineNodes = append(onlineNodes, addr) } - - v.nodesSet.Add(addr) + if data.Delegatee != nil { + list, ok := v.pools[*data.Delegatee] + if !ok { + list = []common.Address{} + v.pools[*data.Delegatee] = list + } + addToSortList(list, addr) + delegators = append(delegators, addr) + v.delegations[addr] = *data.Delegatee + } + if data.Approved { + v.nodesSet.Add(addr) + } return false }) - v.validOnlineNodes = sortValidNodes(onlineNodes) + var validators []common.Address + for _, n := range onlineNodes { + if v.nodesSet.Contains(n) { + validators = append(validators, n) + } + if delegators, ok := v.pools[n]; ok { + validators = append(validators, delegators...) + } + } + + v.sortedValidators = sortValidNodes(validators) v.height = v.identityState.Version() } @@ -147,7 +198,7 @@ func (v *ValidatorsCache) Clone() *ValidatorsCache { identityState: v.identityState, god: v.god, log: v.log, - validOnlineNodes: append(v.validOnlineNodes[:0:0], v.validOnlineNodes...), + sortedValidators: append(v.sortedValidators[:0:0], v.sortedValidators...), nodesSet: v.nodesSet.Clone(), onlineNodesSet: v.onlineNodesSet.Clone(), } @@ -158,7 +209,34 @@ func (v *ValidatorsCache) Height() uint64 { } func (v *ValidatorsCache) PoolSize(pool common.Address) int { - return 0 + if set, ok := v.pools[pool]; ok { + size := len(set) + if v.nodesSet.Contains(pool) { + size++ + } + return size + } + return 1 +} + +func (v *ValidatorsCache) IsPool(pool common.Address) bool { + _, ok := v.pools[pool] + return ok +} + +func (v *ValidatorsCache) FindSubIdentity(pool common.Address, nonce uint32) (common.Address, uint32) { + set := v.pools[pool] + if v.nodesSet.Contains(pool) { + set = append([]common.Address{pool}, set...) + } + if nonce >= uint32(len(set)) { + nonce = 0 + } + return set[nonce], nonce + 1 +} + +func (v *ValidatorsCache) Delegator(addr common.Address) common.Address { + return v.delegations[addr] } func sortValidNodes(nodes []common.Address) []common.Address { @@ -167,3 +245,31 @@ func sortValidNodes(nodes []common.Address) []common.Address { }) return nodes } + +func addToSortList(list []common.Address, e common.Address) { + i := sort.Search(len(list), func(i int) bool { + return bytes.Compare(list[i].Bytes(), e.Bytes()) > 0 + }) + list = append(list, common.Address{}) + copy(list[i+1:], list[i:]) + list[i] = e +} + +type StepValidators struct { + Original mapset.Set + Addresses mapset.Set + Size int + ExtraVotePowers map[common.Address]int +} + +func (sv *StepValidators) Contains(addr common.Address) bool { + return sv.Addresses.Contains(addr) +} + +func (sv *StepValidators) VotesCountSubtrahend() int { + sum := 0 + for _, v := range sv.ExtraVotePowers { + sum += v + } + return sum - len(sv.ExtraVotePowers) +} diff --git a/core/validators/validators_test.go b/core/validators/validators_test.go index fe75fa6a..03a4d207 100644 --- a/core/validators/validators_test.go +++ b/core/validators/validators_test.go @@ -81,7 +81,7 @@ func TestValidatorsCache_Clone(t *testing.T) { require.Equal(vCache.height, clone.height) require.Equal(vCache.god, clone.god) - require.Equal(vCache.validOnlineNodes, clone.validOnlineNodes) + require.Equal(vCache.sortedValidators, clone.sortedValidators) require.Equal(vCache.onlineNodesSet, clone.onlineNodesSet) require.Equal(vCache.nodesSet, clone.nodesSet) require.False(vCache.onlineNodesSet == clone.onlineNodesSet) diff --git a/protobuf/models.pb.go b/protobuf/models.pb.go index 79b0a815..b22172b9 100644 --- a/protobuf/models.pb.go +++ b/protobuf/models.pb.go @@ -2328,6 +2328,7 @@ type ProtoStateIdentity struct { ValidationStatus uint32 `protobuf:"varint,16,opt,name=validationStatus,proto3" json:"validationStatus,omitempty"` ProfileHash []byte `protobuf:"bytes,17,opt,name=profileHash,proto3" json:"profileHash,omitempty"` Scores []byte `protobuf:"bytes,18,opt,name=scores,proto3" json:"scores,omitempty"` + Delegatee []byte `protobuf:"bytes,19,opt,name=delegatee,proto3" json:"delegatee,omitempty"` } func (x *ProtoStateIdentity) Reset() { @@ -2488,6 +2489,13 @@ func (x *ProtoStateIdentity) GetScores() []byte { return nil } +func (x *ProtoStateIdentity) GetDelegatee() []byte { + if x != nil { + return x.Delegatee + } + return nil +} + type ProtoStateGlobal struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2628,8 +2636,9 @@ type ProtoStateApprovedIdentity struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Approved bool `protobuf:"varint,1,opt,name=approved,proto3" json:"approved,omitempty"` - Online bool `protobuf:"varint,2,opt,name=online,proto3" json:"online,omitempty"` + Approved bool `protobuf:"varint,1,opt,name=approved,proto3" json:"approved,omitempty"` + Online bool `protobuf:"varint,2,opt,name=online,proto3" json:"online,omitempty"` + Delegatee []byte `protobuf:"bytes,3,opt,name=delegatee,proto3" json:"delegatee,omitempty"` } func (x *ProtoStateApprovedIdentity) Reset() { @@ -2678,6 +2687,13 @@ func (x *ProtoStateApprovedIdentity) GetOnline() bool { return false } +func (x *ProtoStateApprovedIdentity) GetDelegatee() []byte { + if x != nil { + return x.Delegatee + } + return nil +} + type ProtoStateIdentityStatusSwitch struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2725,6 +2741,53 @@ func (x *ProtoStateIdentityStatusSwitch) GetAddresses() [][]byte { return nil } +type ProtoStateDelegationSwitch struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Delegations []*ProtoStateDelegationSwitch_Delegation `protobuf:"bytes,1,rep,name=delegations,proto3" json:"delegations,omitempty"` +} + +func (x *ProtoStateDelegationSwitch) Reset() { + *x = ProtoStateDelegationSwitch{} + if protoimpl.UnsafeEnabled { + mi := &file_protobuf_models_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProtoStateDelegationSwitch) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProtoStateDelegationSwitch) ProtoMessage() {} + +func (x *ProtoStateDelegationSwitch) ProtoReflect() protoreflect.Message { + mi := &file_protobuf_models_proto_msgTypes[44] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProtoStateDelegationSwitch.ProtoReflect.Descriptor instead. +func (*ProtoStateDelegationSwitch) Descriptor() ([]byte, []int) { + return file_protobuf_models_proto_rawDescGZIP(), []int{44} +} + +func (x *ProtoStateDelegationSwitch) GetDelegations() []*ProtoStateDelegationSwitch_Delegation { + if x != nil { + return x.Delegations + } + return nil +} + type ProtoPredefinedState struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2743,7 +2806,7 @@ type ProtoPredefinedState struct { func (x *ProtoPredefinedState) Reset() { *x = ProtoPredefinedState{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[44] + mi := &file_protobuf_models_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2756,7 +2819,7 @@ func (x *ProtoPredefinedState) String() string { func (*ProtoPredefinedState) ProtoMessage() {} func (x *ProtoPredefinedState) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[44] + mi := &file_protobuf_models_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2769,7 +2832,7 @@ func (x *ProtoPredefinedState) ProtoReflect() protoreflect.Message { // Deprecated: Use ProtoPredefinedState.ProtoReflect.Descriptor instead. func (*ProtoPredefinedState) Descriptor() ([]byte, []int) { - return file_protobuf_models_proto_rawDescGZIP(), []int{44} + return file_protobuf_models_proto_rawDescGZIP(), []int{45} } func (x *ProtoPredefinedState) GetBlock() uint64 { @@ -2840,7 +2903,7 @@ type ProtoCallContractAttachment struct { func (x *ProtoCallContractAttachment) Reset() { *x = ProtoCallContractAttachment{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[45] + mi := &file_protobuf_models_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2853,7 +2916,7 @@ func (x *ProtoCallContractAttachment) String() string { func (*ProtoCallContractAttachment) ProtoMessage() {} func (x *ProtoCallContractAttachment) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[45] + mi := &file_protobuf_models_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2866,7 +2929,7 @@ func (x *ProtoCallContractAttachment) ProtoReflect() protoreflect.Message { // Deprecated: Use ProtoCallContractAttachment.ProtoReflect.Descriptor instead. func (*ProtoCallContractAttachment) Descriptor() ([]byte, []int) { - return file_protobuf_models_proto_rawDescGZIP(), []int{45} + return file_protobuf_models_proto_rawDescGZIP(), []int{46} } func (x *ProtoCallContractAttachment) GetMethod() string { @@ -2895,7 +2958,7 @@ type ProtoDeployContractAttachment struct { func (x *ProtoDeployContractAttachment) Reset() { *x = ProtoDeployContractAttachment{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[46] + mi := &file_protobuf_models_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2908,7 +2971,7 @@ func (x *ProtoDeployContractAttachment) String() string { func (*ProtoDeployContractAttachment) ProtoMessage() {} func (x *ProtoDeployContractAttachment) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[46] + mi := &file_protobuf_models_proto_msgTypes[47] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2921,7 +2984,7 @@ func (x *ProtoDeployContractAttachment) ProtoReflect() protoreflect.Message { // Deprecated: Use ProtoDeployContractAttachment.ProtoReflect.Descriptor instead. func (*ProtoDeployContractAttachment) Descriptor() ([]byte, []int) { - return file_protobuf_models_proto_rawDescGZIP(), []int{46} + return file_protobuf_models_proto_rawDescGZIP(), []int{47} } func (x *ProtoDeployContractAttachment) GetCodeHash() []byte { @@ -2949,7 +3012,7 @@ type ProtoTerminateContractAttachment struct { func (x *ProtoTerminateContractAttachment) Reset() { *x = ProtoTerminateContractAttachment{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[47] + mi := &file_protobuf_models_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2962,7 +3025,7 @@ func (x *ProtoTerminateContractAttachment) String() string { func (*ProtoTerminateContractAttachment) ProtoMessage() {} func (x *ProtoTerminateContractAttachment) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[47] + mi := &file_protobuf_models_proto_msgTypes[48] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2975,7 +3038,7 @@ func (x *ProtoTerminateContractAttachment) ProtoReflect() protoreflect.Message { // Deprecated: Use ProtoTerminateContractAttachment.ProtoReflect.Descriptor instead. func (*ProtoTerminateContractAttachment) Descriptor() ([]byte, []int) { - return file_protobuf_models_proto_rawDescGZIP(), []int{47} + return file_protobuf_models_proto_rawDescGZIP(), []int{48} } func (x *ProtoTerminateContractAttachment) GetArgs() [][]byte { @@ -2996,7 +3059,7 @@ type ProtoTxReceipts struct { func (x *ProtoTxReceipts) Reset() { *x = ProtoTxReceipts{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[48] + mi := &file_protobuf_models_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3009,7 +3072,7 @@ func (x *ProtoTxReceipts) String() string { func (*ProtoTxReceipts) ProtoMessage() {} func (x *ProtoTxReceipts) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[48] + mi := &file_protobuf_models_proto_msgTypes[49] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3022,7 +3085,7 @@ func (x *ProtoTxReceipts) ProtoReflect() protoreflect.Message { // Deprecated: Use ProtoTxReceipts.ProtoReflect.Descriptor instead. func (*ProtoTxReceipts) Descriptor() ([]byte, []int) { - return file_protobuf_models_proto_rawDescGZIP(), []int{48} + return file_protobuf_models_proto_rawDescGZIP(), []int{49} } func (x *ProtoTxReceipts) GetReceipts() []*ProtoTxReceipts_ProtoTxReceipt { @@ -3044,7 +3107,7 @@ type ProtoTxReceiptIndex struct { func (x *ProtoTxReceiptIndex) Reset() { *x = ProtoTxReceiptIndex{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[49] + mi := &file_protobuf_models_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3057,7 +3120,7 @@ func (x *ProtoTxReceiptIndex) String() string { func (*ProtoTxReceiptIndex) ProtoMessage() {} func (x *ProtoTxReceiptIndex) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[49] + mi := &file_protobuf_models_proto_msgTypes[50] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3070,7 +3133,7 @@ func (x *ProtoTxReceiptIndex) ProtoReflect() protoreflect.Message { // Deprecated: Use ProtoTxReceiptIndex.ProtoReflect.Descriptor instead. func (*ProtoTxReceiptIndex) Descriptor() ([]byte, []int) { - return file_protobuf_models_proto_rawDescGZIP(), []int{49} + return file_protobuf_models_proto_rawDescGZIP(), []int{50} } func (x *ProtoTxReceiptIndex) GetCid() []byte { @@ -3098,7 +3161,7 @@ type ProtoDeferredTxs struct { func (x *ProtoDeferredTxs) Reset() { *x = ProtoDeferredTxs{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[50] + mi := &file_protobuf_models_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3111,7 +3174,7 @@ func (x *ProtoDeferredTxs) String() string { func (*ProtoDeferredTxs) ProtoMessage() {} func (x *ProtoDeferredTxs) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[50] + mi := &file_protobuf_models_proto_msgTypes[51] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3124,7 +3187,7 @@ func (x *ProtoDeferredTxs) ProtoReflect() protoreflect.Message { // Deprecated: Use ProtoDeferredTxs.ProtoReflect.Descriptor instead. func (*ProtoDeferredTxs) Descriptor() ([]byte, []int) { - return file_protobuf_models_proto_rawDescGZIP(), []int{50} + return file_protobuf_models_proto_rawDescGZIP(), []int{51} } func (x *ProtoDeferredTxs) GetTxs() []*ProtoDeferredTxs_ProtoDeferredTx { @@ -3147,7 +3210,7 @@ type ProtoSavedEvent struct { func (x *ProtoSavedEvent) Reset() { *x = ProtoSavedEvent{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[51] + mi := &file_protobuf_models_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3160,7 +3223,7 @@ func (x *ProtoSavedEvent) String() string { func (*ProtoSavedEvent) ProtoMessage() {} func (x *ProtoSavedEvent) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[51] + mi := &file_protobuf_models_proto_msgTypes[52] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3173,7 +3236,7 @@ func (x *ProtoSavedEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use ProtoSavedEvent.ProtoReflect.Descriptor instead. func (*ProtoSavedEvent) Descriptor() ([]byte, []int) { - return file_protobuf_models_proto_rawDescGZIP(), []int{51} + return file_protobuf_models_proto_rawDescGZIP(), []int{52} } func (x *ProtoSavedEvent) GetContract() []byte { @@ -3208,7 +3271,7 @@ type ProtoUpgradeVotes struct { func (x *ProtoUpgradeVotes) Reset() { *x = ProtoUpgradeVotes{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[52] + mi := &file_protobuf_models_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3221,7 +3284,7 @@ func (x *ProtoUpgradeVotes) String() string { func (*ProtoUpgradeVotes) ProtoMessage() {} func (x *ProtoUpgradeVotes) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[52] + mi := &file_protobuf_models_proto_msgTypes[53] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3234,7 +3297,7 @@ func (x *ProtoUpgradeVotes) ProtoReflect() protoreflect.Message { // Deprecated: Use ProtoUpgradeVotes.ProtoReflect.Descriptor instead. func (*ProtoUpgradeVotes) Descriptor() ([]byte, []int) { - return file_protobuf_models_proto_rawDescGZIP(), []int{52} + return file_protobuf_models_proto_rawDescGZIP(), []int{53} } func (x *ProtoUpgradeVotes) GetVotes() []*ProtoUpgradeVotes_ProtoUpgradeVote { @@ -3262,7 +3325,7 @@ type ProtoTransaction_Data struct { func (x *ProtoTransaction_Data) Reset() { *x = ProtoTransaction_Data{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[53] + mi := &file_protobuf_models_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3275,7 +3338,7 @@ func (x *ProtoTransaction_Data) String() string { func (*ProtoTransaction_Data) ProtoMessage() {} func (x *ProtoTransaction_Data) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[53] + mi := &file_protobuf_models_proto_msgTypes[54] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3373,7 +3436,7 @@ type ProtoBlockHeader_Proposed struct { func (x *ProtoBlockHeader_Proposed) Reset() { *x = ProtoBlockHeader_Proposed{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[54] + mi := &file_protobuf_models_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3386,7 +3449,7 @@ func (x *ProtoBlockHeader_Proposed) String() string { func (*ProtoBlockHeader_Proposed) ProtoMessage() {} func (x *ProtoBlockHeader_Proposed) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[54] + mi := &file_protobuf_models_proto_msgTypes[55] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3531,7 +3594,7 @@ type ProtoBlockHeader_Empty struct { func (x *ProtoBlockHeader_Empty) Reset() { *x = ProtoBlockHeader_Empty{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[55] + mi := &file_protobuf_models_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3544,7 +3607,7 @@ func (x *ProtoBlockHeader_Empty) String() string { func (*ProtoBlockHeader_Empty) ProtoMessage() {} func (x *ProtoBlockHeader_Empty) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[55] + mi := &file_protobuf_models_proto_msgTypes[56] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3622,7 +3685,7 @@ type ProtoBlockProposal_Data struct { func (x *ProtoBlockProposal_Data) Reset() { *x = ProtoBlockProposal_Data{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[56] + mi := &file_protobuf_models_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3635,7 +3698,7 @@ func (x *ProtoBlockProposal_Data) String() string { func (*ProtoBlockProposal_Data) ProtoMessage() {} func (x *ProtoBlockProposal_Data) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[56] + mi := &file_protobuf_models_proto_msgTypes[57] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3685,7 +3748,7 @@ type ProtoBlockCert_Signature struct { func (x *ProtoBlockCert_Signature) Reset() { *x = ProtoBlockCert_Signature{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[57] + mi := &file_protobuf_models_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3698,7 +3761,7 @@ func (x *ProtoBlockCert_Signature) String() string { func (*ProtoBlockCert_Signature) ProtoMessage() {} func (x *ProtoBlockCert_Signature) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[57] + mi := &file_protobuf_models_proto_msgTypes[58] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3748,7 +3811,7 @@ type ProtoIdentityStateDiff_IdentityStateDiffValue struct { func (x *ProtoIdentityStateDiff_IdentityStateDiffValue) Reset() { *x = ProtoIdentityStateDiff_IdentityStateDiffValue{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[58] + mi := &file_protobuf_models_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3761,7 +3824,7 @@ func (x *ProtoIdentityStateDiff_IdentityStateDiffValue) String() string { func (*ProtoIdentityStateDiff_IdentityStateDiffValue) ProtoMessage() {} func (x *ProtoIdentityStateDiff_IdentityStateDiffValue) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[58] + mi := &file_protobuf_models_proto_msgTypes[59] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3810,7 +3873,7 @@ type ProtoSnapshotBlock_KeyValue struct { func (x *ProtoSnapshotBlock_KeyValue) Reset() { *x = ProtoSnapshotBlock_KeyValue{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[59] + mi := &file_protobuf_models_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3823,7 +3886,7 @@ func (x *ProtoSnapshotBlock_KeyValue) String() string { func (*ProtoSnapshotBlock_KeyValue) ProtoMessage() {} func (x *ProtoSnapshotBlock_KeyValue) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[59] + mi := &file_protobuf_models_proto_msgTypes[60] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3866,7 +3929,7 @@ type ProtoGossipBlockRange_Block struct { func (x *ProtoGossipBlockRange_Block) Reset() { *x = ProtoGossipBlockRange_Block{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[60] + mi := &file_protobuf_models_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3879,7 +3942,7 @@ func (x *ProtoGossipBlockRange_Block) String() string { func (*ProtoGossipBlockRange_Block) ProtoMessage() {} func (x *ProtoGossipBlockRange_Block) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[60] + mi := &file_protobuf_models_proto_msgTypes[61] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3928,7 +3991,7 @@ type ProtoProposeProof_Data struct { func (x *ProtoProposeProof_Data) Reset() { *x = ProtoProposeProof_Data{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[61] + mi := &file_protobuf_models_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3941,7 +4004,7 @@ func (x *ProtoProposeProof_Data) String() string { func (*ProtoProposeProof_Data) ProtoMessage() {} func (x *ProtoProposeProof_Data) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[61] + mi := &file_protobuf_models_proto_msgTypes[62] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3987,7 +4050,7 @@ type ProtoVote_Data struct { func (x *ProtoVote_Data) Reset() { *x = ProtoVote_Data{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[62] + mi := &file_protobuf_models_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4000,7 +4063,7 @@ func (x *ProtoVote_Data) String() string { func (*ProtoVote_Data) ProtoMessage() {} func (x *ProtoVote_Data) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[62] + mi := &file_protobuf_models_proto_msgTypes[63] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4070,7 +4133,7 @@ type ProtoFlipKey_Data struct { func (x *ProtoFlipKey_Data) Reset() { *x = ProtoFlipKey_Data{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[63] + mi := &file_protobuf_models_proto_msgTypes[64] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4083,7 +4146,7 @@ func (x *ProtoFlipKey_Data) String() string { func (*ProtoFlipKey_Data) ProtoMessage() {} func (x *ProtoFlipKey_Data) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[63] + mi := &file_protobuf_models_proto_msgTypes[64] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4125,7 +4188,7 @@ type ProtoPrivateFlipKeysPackage_Data struct { func (x *ProtoPrivateFlipKeysPackage_Data) Reset() { *x = ProtoPrivateFlipKeysPackage_Data{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[64] + mi := &file_protobuf_models_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4138,7 +4201,7 @@ func (x *ProtoPrivateFlipKeysPackage_Data) String() string { func (*ProtoPrivateFlipKeysPackage_Data) ProtoMessage() {} func (x *ProtoPrivateFlipKeysPackage_Data) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[64] + mi := &file_protobuf_models_proto_msgTypes[65] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4180,7 +4243,7 @@ type ProtoAnswersDb_Answer struct { func (x *ProtoAnswersDb_Answer) Reset() { *x = ProtoAnswersDb_Answer{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[65] + mi := &file_protobuf_models_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4193,7 +4256,7 @@ func (x *ProtoAnswersDb_Answer) String() string { func (*ProtoAnswersDb_Answer) ProtoMessage() {} func (x *ProtoAnswersDb_Answer) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[65] + mi := &file_protobuf_models_proto_msgTypes[66] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4235,7 +4298,7 @@ type ProtoActivityMonitor_Activity struct { func (x *ProtoActivityMonitor_Activity) Reset() { *x = ProtoActivityMonitor_Activity{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[66] + mi := &file_protobuf_models_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4248,7 +4311,7 @@ func (x *ProtoActivityMonitor_Activity) String() string { func (*ProtoActivityMonitor_Activity) ProtoMessage() {} func (x *ProtoActivityMonitor_Activity) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[66] + mi := &file_protobuf_models_proto_msgTypes[67] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4290,7 +4353,7 @@ type ProtoStateAccount_ProtoContractData struct { func (x *ProtoStateAccount_ProtoContractData) Reset() { *x = ProtoStateAccount_ProtoContractData{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[67] + mi := &file_protobuf_models_proto_msgTypes[68] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4303,7 +4366,7 @@ func (x *ProtoStateAccount_ProtoContractData) String() string { func (*ProtoStateAccount_ProtoContractData) ProtoMessage() {} func (x *ProtoStateAccount_ProtoContractData) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[67] + mi := &file_protobuf_models_proto_msgTypes[68] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4345,7 +4408,7 @@ type ProtoStateIdentity_Flip struct { func (x *ProtoStateIdentity_Flip) Reset() { *x = ProtoStateIdentity_Flip{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[68] + mi := &file_protobuf_models_proto_msgTypes[69] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4358,7 +4421,7 @@ func (x *ProtoStateIdentity_Flip) String() string { func (*ProtoStateIdentity_Flip) ProtoMessage() {} func (x *ProtoStateIdentity_Flip) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[68] + mi := &file_protobuf_models_proto_msgTypes[69] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4400,7 +4463,7 @@ type ProtoStateIdentity_TxAddr struct { func (x *ProtoStateIdentity_TxAddr) Reset() { *x = ProtoStateIdentity_TxAddr{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[69] + mi := &file_protobuf_models_proto_msgTypes[70] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4413,7 +4476,7 @@ func (x *ProtoStateIdentity_TxAddr) String() string { func (*ProtoStateIdentity_TxAddr) ProtoMessage() {} func (x *ProtoStateIdentity_TxAddr) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[69] + mi := &file_protobuf_models_proto_msgTypes[70] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4443,6 +4506,61 @@ func (x *ProtoStateIdentity_TxAddr) GetAddress() []byte { return nil } +type ProtoStateDelegationSwitch_Delegation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Delegator []byte `protobuf:"bytes,1,opt,name=delegator,proto3" json:"delegator,omitempty"` + Delegatee []byte `protobuf:"bytes,2,opt,name=delegatee,proto3" json:"delegatee,omitempty"` +} + +func (x *ProtoStateDelegationSwitch_Delegation) Reset() { + *x = ProtoStateDelegationSwitch_Delegation{} + if protoimpl.UnsafeEnabled { + mi := &file_protobuf_models_proto_msgTypes[71] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProtoStateDelegationSwitch_Delegation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProtoStateDelegationSwitch_Delegation) ProtoMessage() {} + +func (x *ProtoStateDelegationSwitch_Delegation) ProtoReflect() protoreflect.Message { + mi := &file_protobuf_models_proto_msgTypes[71] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProtoStateDelegationSwitch_Delegation.ProtoReflect.Descriptor instead. +func (*ProtoStateDelegationSwitch_Delegation) Descriptor() ([]byte, []int) { + return file_protobuf_models_proto_rawDescGZIP(), []int{44, 0} +} + +func (x *ProtoStateDelegationSwitch_Delegation) GetDelegator() []byte { + if x != nil { + return x.Delegator + } + return nil +} + +func (x *ProtoStateDelegationSwitch_Delegation) GetDelegatee() []byte { + if x != nil { + return x.Delegatee + } + return nil +} + type ProtoPredefinedState_Global struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4465,7 +4583,7 @@ type ProtoPredefinedState_Global struct { func (x *ProtoPredefinedState_Global) Reset() { *x = ProtoPredefinedState_Global{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[70] + mi := &file_protobuf_models_proto_msgTypes[72] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4478,7 +4596,7 @@ func (x *ProtoPredefinedState_Global) String() string { func (*ProtoPredefinedState_Global) ProtoMessage() {} func (x *ProtoPredefinedState_Global) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[70] + mi := &file_protobuf_models_proto_msgTypes[72] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4491,7 +4609,7 @@ func (x *ProtoPredefinedState_Global) ProtoReflect() protoreflect.Message { // Deprecated: Use ProtoPredefinedState_Global.ProtoReflect.Descriptor instead. func (*ProtoPredefinedState_Global) Descriptor() ([]byte, []int) { - return file_protobuf_models_proto_rawDescGZIP(), []int{44, 0} + return file_protobuf_models_proto_rawDescGZIP(), []int{45, 0} } func (x *ProtoPredefinedState_Global) GetEpoch() uint32 { @@ -4589,7 +4707,7 @@ type ProtoPredefinedState_StatusSwitch struct { func (x *ProtoPredefinedState_StatusSwitch) Reset() { *x = ProtoPredefinedState_StatusSwitch{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[71] + mi := &file_protobuf_models_proto_msgTypes[73] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4602,7 +4720,7 @@ func (x *ProtoPredefinedState_StatusSwitch) String() string { func (*ProtoPredefinedState_StatusSwitch) ProtoMessage() {} func (x *ProtoPredefinedState_StatusSwitch) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[71] + mi := &file_protobuf_models_proto_msgTypes[73] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4615,7 +4733,7 @@ func (x *ProtoPredefinedState_StatusSwitch) ProtoReflect() protoreflect.Message // Deprecated: Use ProtoPredefinedState_StatusSwitch.ProtoReflect.Descriptor instead. func (*ProtoPredefinedState_StatusSwitch) Descriptor() ([]byte, []int) { - return file_protobuf_models_proto_rawDescGZIP(), []int{44, 1} + return file_protobuf_models_proto_rawDescGZIP(), []int{45, 1} } func (x *ProtoPredefinedState_StatusSwitch) GetAddresses() [][]byte { @@ -4640,7 +4758,7 @@ type ProtoPredefinedState_Account struct { func (x *ProtoPredefinedState_Account) Reset() { *x = ProtoPredefinedState_Account{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[72] + mi := &file_protobuf_models_proto_msgTypes[74] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4653,7 +4771,7 @@ func (x *ProtoPredefinedState_Account) String() string { func (*ProtoPredefinedState_Account) ProtoMessage() {} func (x *ProtoPredefinedState_Account) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[72] + mi := &file_protobuf_models_proto_msgTypes[74] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4666,7 +4784,7 @@ func (x *ProtoPredefinedState_Account) ProtoReflect() protoreflect.Message { // Deprecated: Use ProtoPredefinedState_Account.ProtoReflect.Descriptor instead. func (*ProtoPredefinedState_Account) Descriptor() ([]byte, []int) { - return file_protobuf_models_proto_rawDescGZIP(), []int{44, 2} + return file_protobuf_models_proto_rawDescGZIP(), []int{45, 2} } func (x *ProtoPredefinedState_Account) GetAddress() []byte { @@ -4728,12 +4846,13 @@ type ProtoPredefinedState_Identity struct { ValidationStatus uint32 `protobuf:"varint,17,opt,name=validationStatus,proto3" json:"validationStatus,omitempty"` ProfileHash []byte `protobuf:"bytes,18,opt,name=profileHash,proto3" json:"profileHash,omitempty"` Scores []byte `protobuf:"bytes,19,opt,name=scores,proto3" json:"scores,omitempty"` + Delegatee []byte `protobuf:"bytes,20,opt,name=delegatee,proto3" json:"delegatee,omitempty"` } func (x *ProtoPredefinedState_Identity) Reset() { *x = ProtoPredefinedState_Identity{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[73] + mi := &file_protobuf_models_proto_msgTypes[75] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4746,7 +4865,7 @@ func (x *ProtoPredefinedState_Identity) String() string { func (*ProtoPredefinedState_Identity) ProtoMessage() {} func (x *ProtoPredefinedState_Identity) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[73] + mi := &file_protobuf_models_proto_msgTypes[75] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4759,7 +4878,7 @@ func (x *ProtoPredefinedState_Identity) ProtoReflect() protoreflect.Message { // Deprecated: Use ProtoPredefinedState_Identity.ProtoReflect.Descriptor instead. func (*ProtoPredefinedState_Identity) Descriptor() ([]byte, []int) { - return file_protobuf_models_proto_rawDescGZIP(), []int{44, 3} + return file_protobuf_models_proto_rawDescGZIP(), []int{45, 3} } func (x *ProtoPredefinedState_Identity) GetAddress() []byte { @@ -4895,20 +5014,28 @@ func (x *ProtoPredefinedState_Identity) GetScores() []byte { return nil } +func (x *ProtoPredefinedState_Identity) GetDelegatee() []byte { + if x != nil { + return x.Delegatee + } + return nil +} + type ProtoPredefinedState_ApprovedIdentity struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Approved bool `protobuf:"varint,2,opt,name=approved,proto3" json:"approved,omitempty"` - Online bool `protobuf:"varint,3,opt,name=online,proto3" json:"online,omitempty"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Approved bool `protobuf:"varint,2,opt,name=approved,proto3" json:"approved,omitempty"` + Online bool `protobuf:"varint,3,opt,name=online,proto3" json:"online,omitempty"` + Delegatee []byte `protobuf:"bytes,4,opt,name=delegatee,proto3" json:"delegatee,omitempty"` } func (x *ProtoPredefinedState_ApprovedIdentity) Reset() { *x = ProtoPredefinedState_ApprovedIdentity{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[74] + mi := &file_protobuf_models_proto_msgTypes[76] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4921,7 +5048,7 @@ func (x *ProtoPredefinedState_ApprovedIdentity) String() string { func (*ProtoPredefinedState_ApprovedIdentity) ProtoMessage() {} func (x *ProtoPredefinedState_ApprovedIdentity) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[74] + mi := &file_protobuf_models_proto_msgTypes[76] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4934,7 +5061,7 @@ func (x *ProtoPredefinedState_ApprovedIdentity) ProtoReflect() protoreflect.Mess // Deprecated: Use ProtoPredefinedState_ApprovedIdentity.ProtoReflect.Descriptor instead. func (*ProtoPredefinedState_ApprovedIdentity) Descriptor() ([]byte, []int) { - return file_protobuf_models_proto_rawDescGZIP(), []int{44, 4} + return file_protobuf_models_proto_rawDescGZIP(), []int{45, 4} } func (x *ProtoPredefinedState_ApprovedIdentity) GetAddress() []byte { @@ -4958,6 +5085,13 @@ func (x *ProtoPredefinedState_ApprovedIdentity) GetOnline() bool { return false } +func (x *ProtoPredefinedState_ApprovedIdentity) GetDelegatee() []byte { + if x != nil { + return x.Delegatee + } + return nil +} + type ProtoPredefinedState_ContractKeyValue struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4970,7 +5104,7 @@ type ProtoPredefinedState_ContractKeyValue struct { func (x *ProtoPredefinedState_ContractKeyValue) Reset() { *x = ProtoPredefinedState_ContractKeyValue{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[75] + mi := &file_protobuf_models_proto_msgTypes[77] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4983,7 +5117,7 @@ func (x *ProtoPredefinedState_ContractKeyValue) String() string { func (*ProtoPredefinedState_ContractKeyValue) ProtoMessage() {} func (x *ProtoPredefinedState_ContractKeyValue) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[75] + mi := &file_protobuf_models_proto_msgTypes[77] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4996,7 +5130,7 @@ func (x *ProtoPredefinedState_ContractKeyValue) ProtoReflect() protoreflect.Mess // Deprecated: Use ProtoPredefinedState_ContractKeyValue.ProtoReflect.Descriptor instead. func (*ProtoPredefinedState_ContractKeyValue) Descriptor() ([]byte, []int) { - return file_protobuf_models_proto_rawDescGZIP(), []int{44, 5} + return file_protobuf_models_proto_rawDescGZIP(), []int{45, 5} } func (x *ProtoPredefinedState_ContractKeyValue) GetKey() []byte { @@ -5025,7 +5159,7 @@ type ProtoPredefinedState_Account_ContractData struct { func (x *ProtoPredefinedState_Account_ContractData) Reset() { *x = ProtoPredefinedState_Account_ContractData{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[76] + mi := &file_protobuf_models_proto_msgTypes[78] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5038,7 +5172,7 @@ func (x *ProtoPredefinedState_Account_ContractData) String() string { func (*ProtoPredefinedState_Account_ContractData) ProtoMessage() {} func (x *ProtoPredefinedState_Account_ContractData) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[76] + mi := &file_protobuf_models_proto_msgTypes[78] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5051,7 +5185,7 @@ func (x *ProtoPredefinedState_Account_ContractData) ProtoReflect() protoreflect. // Deprecated: Use ProtoPredefinedState_Account_ContractData.ProtoReflect.Descriptor instead. func (*ProtoPredefinedState_Account_ContractData) Descriptor() ([]byte, []int) { - return file_protobuf_models_proto_rawDescGZIP(), []int{44, 2, 0} + return file_protobuf_models_proto_rawDescGZIP(), []int{45, 2, 0} } func (x *ProtoPredefinedState_Account_ContractData) GetCodeHash() []byte { @@ -5080,7 +5214,7 @@ type ProtoPredefinedState_Identity_Flip struct { func (x *ProtoPredefinedState_Identity_Flip) Reset() { *x = ProtoPredefinedState_Identity_Flip{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[77] + mi := &file_protobuf_models_proto_msgTypes[79] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5093,7 +5227,7 @@ func (x *ProtoPredefinedState_Identity_Flip) String() string { func (*ProtoPredefinedState_Identity_Flip) ProtoMessage() {} func (x *ProtoPredefinedState_Identity_Flip) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[77] + mi := &file_protobuf_models_proto_msgTypes[79] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5106,7 +5240,7 @@ func (x *ProtoPredefinedState_Identity_Flip) ProtoReflect() protoreflect.Message // Deprecated: Use ProtoPredefinedState_Identity_Flip.ProtoReflect.Descriptor instead. func (*ProtoPredefinedState_Identity_Flip) Descriptor() ([]byte, []int) { - return file_protobuf_models_proto_rawDescGZIP(), []int{44, 3, 0} + return file_protobuf_models_proto_rawDescGZIP(), []int{45, 3, 0} } func (x *ProtoPredefinedState_Identity_Flip) GetCid() []byte { @@ -5135,7 +5269,7 @@ type ProtoPredefinedState_Identity_TxAddr struct { func (x *ProtoPredefinedState_Identity_TxAddr) Reset() { *x = ProtoPredefinedState_Identity_TxAddr{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[78] + mi := &file_protobuf_models_proto_msgTypes[80] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5148,7 +5282,7 @@ func (x *ProtoPredefinedState_Identity_TxAddr) String() string { func (*ProtoPredefinedState_Identity_TxAddr) ProtoMessage() {} func (x *ProtoPredefinedState_Identity_TxAddr) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[78] + mi := &file_protobuf_models_proto_msgTypes[80] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5161,7 +5295,7 @@ func (x *ProtoPredefinedState_Identity_TxAddr) ProtoReflect() protoreflect.Messa // Deprecated: Use ProtoPredefinedState_Identity_TxAddr.ProtoReflect.Descriptor instead. func (*ProtoPredefinedState_Identity_TxAddr) Descriptor() ([]byte, []int) { - return file_protobuf_models_proto_rawDescGZIP(), []int{44, 3, 1} + return file_protobuf_models_proto_rawDescGZIP(), []int{45, 3, 1} } func (x *ProtoPredefinedState_Identity_TxAddr) GetHash() []byte { @@ -5197,7 +5331,7 @@ type ProtoTxReceipts_ProtoTxReceipt struct { func (x *ProtoTxReceipts_ProtoTxReceipt) Reset() { *x = ProtoTxReceipts_ProtoTxReceipt{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[79] + mi := &file_protobuf_models_proto_msgTypes[81] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5210,7 +5344,7 @@ func (x *ProtoTxReceipts_ProtoTxReceipt) String() string { func (*ProtoTxReceipts_ProtoTxReceipt) ProtoMessage() {} func (x *ProtoTxReceipts_ProtoTxReceipt) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[79] + mi := &file_protobuf_models_proto_msgTypes[81] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5223,7 +5357,7 @@ func (x *ProtoTxReceipts_ProtoTxReceipt) ProtoReflect() protoreflect.Message { // Deprecated: Use ProtoTxReceipts_ProtoTxReceipt.ProtoReflect.Descriptor instead. func (*ProtoTxReceipts_ProtoTxReceipt) Descriptor() ([]byte, []int) { - return file_protobuf_models_proto_rawDescGZIP(), []int{48, 0} + return file_protobuf_models_proto_rawDescGZIP(), []int{49, 0} } func (x *ProtoTxReceipts_ProtoTxReceipt) GetContract() []byte { @@ -5301,7 +5435,7 @@ type ProtoTxReceipts_ProtoEvent struct { func (x *ProtoTxReceipts_ProtoEvent) Reset() { *x = ProtoTxReceipts_ProtoEvent{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[80] + mi := &file_protobuf_models_proto_msgTypes[82] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5314,7 +5448,7 @@ func (x *ProtoTxReceipts_ProtoEvent) String() string { func (*ProtoTxReceipts_ProtoEvent) ProtoMessage() {} func (x *ProtoTxReceipts_ProtoEvent) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[80] + mi := &file_protobuf_models_proto_msgTypes[82] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5327,7 +5461,7 @@ func (x *ProtoTxReceipts_ProtoEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use ProtoTxReceipts_ProtoEvent.ProtoReflect.Descriptor instead. func (*ProtoTxReceipts_ProtoEvent) Descriptor() ([]byte, []int) { - return file_protobuf_models_proto_rawDescGZIP(), []int{48, 1} + return file_protobuf_models_proto_rawDescGZIP(), []int{49, 1} } func (x *ProtoTxReceipts_ProtoEvent) GetEvent() string { @@ -5360,7 +5494,7 @@ type ProtoDeferredTxs_ProtoDeferredTx struct { func (x *ProtoDeferredTxs_ProtoDeferredTx) Reset() { *x = ProtoDeferredTxs_ProtoDeferredTx{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[81] + mi := &file_protobuf_models_proto_msgTypes[83] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5373,7 +5507,7 @@ func (x *ProtoDeferredTxs_ProtoDeferredTx) String() string { func (*ProtoDeferredTxs_ProtoDeferredTx) ProtoMessage() {} func (x *ProtoDeferredTxs_ProtoDeferredTx) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[81] + mi := &file_protobuf_models_proto_msgTypes[83] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5386,7 +5520,7 @@ func (x *ProtoDeferredTxs_ProtoDeferredTx) ProtoReflect() protoreflect.Message { // Deprecated: Use ProtoDeferredTxs_ProtoDeferredTx.ProtoReflect.Descriptor instead. func (*ProtoDeferredTxs_ProtoDeferredTx) Descriptor() ([]byte, []int) { - return file_protobuf_models_proto_rawDescGZIP(), []int{50, 0} + return file_protobuf_models_proto_rawDescGZIP(), []int{51, 0} } func (x *ProtoDeferredTxs_ProtoDeferredTx) GetFrom() []byte { @@ -5443,7 +5577,7 @@ type ProtoUpgradeVotes_ProtoUpgradeVote struct { func (x *ProtoUpgradeVotes_ProtoUpgradeVote) Reset() { *x = ProtoUpgradeVotes_ProtoUpgradeVote{} if protoimpl.UnsafeEnabled { - mi := &file_protobuf_models_proto_msgTypes[82] + mi := &file_protobuf_models_proto_msgTypes[84] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5456,7 +5590,7 @@ func (x *ProtoUpgradeVotes_ProtoUpgradeVote) String() string { func (*ProtoUpgradeVotes_ProtoUpgradeVote) ProtoMessage() {} func (x *ProtoUpgradeVotes_ProtoUpgradeVote) ProtoReflect() protoreflect.Message { - mi := &file_protobuf_models_proto_msgTypes[82] + mi := &file_protobuf_models_proto_msgTypes[84] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5469,7 +5603,7 @@ func (x *ProtoUpgradeVotes_ProtoUpgradeVote) ProtoReflect() protoreflect.Message // Deprecated: Use ProtoUpgradeVotes_ProtoUpgradeVote.ProtoReflect.Descriptor instead. func (*ProtoUpgradeVotes_ProtoUpgradeVote) Descriptor() ([]byte, []int) { - return file_protobuf_models_proto_rawDescGZIP(), []int{52, 0} + return file_protobuf_models_proto_rawDescGZIP(), []int{53, 0} } func (x *ProtoUpgradeVotes_ProtoUpgradeVote) GetVoter() []byte { @@ -5850,7 +5984,7 @@ var file_protobuf_models_proto_rawDesc = []byte{ 0x61, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x64, 0x65, 0x48, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, 0x64, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x22, 0xfb, 0x05, 0x0a, 0x12, 0x50, 0x72, + 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x22, 0x99, 0x06, 0x0a, 0x12, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, @@ -5892,271 +6026,290 @@ var file_protobuf_models_proto_rawDesc = []byte{ 0x6c, 0x65, 0x48, 0x61, 0x73, 0x68, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x72, 0x65, - 0x73, 0x1a, 0x2c, 0x0a, 0x04, 0x46, 0x6c, 0x69, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, - 0x61, 0x69, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x61, 0x69, 0x72, 0x1a, - 0x36, 0x0a, 0x06, 0x54, 0x78, 0x41, 0x64, 0x64, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, - 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x18, 0x0a, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xf6, 0x03, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, - 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x65, 0x70, 0x6f, - 0x63, 0x68, 0x12, 0x2e, 0x0a, 0x12, 0x6e, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, - 0x6e, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, - 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x1e, - 0x0a, 0x0a, 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0a, 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, - 0x0a, 0x09, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x53, 0x65, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x09, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x53, 0x65, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x0c, - 0x6c, 0x61, 0x73, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, - 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x09, 0x66, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x32, - 0x0a, 0x14, 0x76, 0x72, 0x66, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x54, 0x68, 0x72, - 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x76, 0x72, - 0x66, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, - 0x6c, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x73, 0x42, 0x69, 0x74, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x65, 0x6d, 0x70, - 0x74, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x42, 0x69, 0x74, 0x73, 0x12, 0x2c, 0x0a, 0x11, - 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, - 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x1d, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x73, 0x43, 0x6e, 0x74, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x43, 0x65, - 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x69, 0x61, 0x6c, 0x54, 0x78, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x1d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x43, 0x6e, 0x74, 0x57, 0x69, 0x74, 0x68, - 0x6f, 0x75, 0x74, 0x43, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x69, 0x61, 0x6c, 0x54, 0x78, 0x73, - 0x22, 0x50, 0x0a, 0x1a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x41, 0x70, - 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1a, - 0x0a, 0x08, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x08, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x6e, - 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6f, 0x6e, 0x6c, 0x69, - 0x6e, 0x65, 0x22, 0x3e, 0x0a, 0x1e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x77, - 0x69, 0x74, 0x63, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x65, 0x73, 0x22, 0xfa, 0x11, 0x0a, 0x14, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, - 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x04, 0x73, 0x65, 0x65, 0x64, 0x12, 0x3b, 0x0a, 0x06, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x06, 0x67, 0x6c, 0x6f, 0x62, - 0x61, 0x6c, 0x12, 0x4d, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x77, 0x69, 0x74, - 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, - 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, - 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x77, 0x69, - 0x74, 0x63, 0x68, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x77, 0x69, 0x74, 0x63, - 0x68, 0x12, 0x40, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, + 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x65, 0x18, 0x13, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x65, 0x1a, + 0x2c, 0x0a, 0x04, 0x46, 0x6c, 0x69, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x69, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x61, 0x69, 0x72, 0x1a, 0x36, 0x0a, + 0x06, 0x54, 0x78, 0x41, 0x64, 0x64, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xf6, 0x03, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x12, 0x2e, 0x0a, 0x12, 0x6e, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x6e, 0x65, + 0x78, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, + 0x12, 0x2a, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, + 0x72, 0x69, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x1e, 0x0a, 0x0a, + 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0a, 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, + 0x77, 0x6f, 0x72, 0x64, 0x73, 0x53, 0x65, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x09, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x53, 0x65, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x6c, 0x61, + 0x73, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x1e, + 0x0a, 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1c, + 0x0a, 0x09, 0x66, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x09, 0x66, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x32, 0x0a, 0x14, + 0x76, 0x72, 0x66, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x54, 0x68, 0x72, 0x65, 0x73, + 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x76, 0x72, 0x66, 0x50, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, + 0x12, 0x28, 0x0a, 0x0f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x42, + 0x69, 0x74, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x65, 0x6d, 0x70, 0x74, 0x79, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x42, 0x69, 0x74, 0x73, 0x12, 0x2c, 0x0a, 0x11, 0x67, 0x6f, + 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x1d, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x73, 0x43, 0x6e, 0x74, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x43, 0x65, 0x72, 0x65, + 0x6d, 0x6f, 0x6e, 0x69, 0x61, 0x6c, 0x54, 0x78, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x1d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x43, 0x6e, 0x74, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, + 0x74, 0x43, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x69, 0x61, 0x6c, 0x54, 0x78, 0x73, 0x22, 0x6e, + 0x0a, 0x1a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x72, + 0x6f, 0x76, 0x65, 0x64, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, + 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, + 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x6e, 0x6c, 0x69, + 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, + 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x65, 0x22, 0x3e, + 0x0a, 0x1e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, + 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0c, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0xb7, + 0x01, 0x0a, 0x1a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x44, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x12, 0x4f, 0x0a, + 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x48, + 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, + 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x64, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x65, 0x22, 0xb6, 0x12, 0x0a, 0x14, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x12, 0x45, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, - 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x65, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x73, 0x65, 0x65, 0x64, 0x12, 0x3b, 0x0a, 0x06, 0x67, + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6d, 0x6f, + 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, + 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, + 0x52, 0x06, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x12, 0x4d, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, + 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, + 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x12, 0x40, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6d, 0x6f, 0x64, 0x65, + 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, + 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x45, 0x0a, 0x0a, 0x69, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, + 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, + 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6d, + 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, + 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, + 0x76, 0x65, 0x64, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x12, 0x61, 0x70, 0x70, + 0x72, 0x6f, 0x76, 0x65, 0x64, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, + 0x55, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0a, - 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x70, - 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, - 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x49, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x12, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x49, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x55, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x2d, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, - 0x1a, 0xec, 0x03, 0x0a, 0x06, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x65, - 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, - 0x68, 0x12, 0x2e, 0x0a, 0x12, 0x6e, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x6e, - 0x65, 0x78, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, - 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, - 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x1e, 0x0a, - 0x0a, 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0a, 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, - 0x09, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x53, 0x65, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x09, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x53, 0x65, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x6c, - 0x61, 0x73, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, - 0x1e, 0x0a, 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, - 0x1c, 0x0a, 0x09, 0x66, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x09, 0x66, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x32, 0x0a, - 0x14, 0x76, 0x72, 0x66, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x54, 0x68, 0x72, 0x65, - 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x76, 0x72, 0x66, - 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, - 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, - 0x42, 0x69, 0x74, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x65, 0x6d, 0x70, 0x74, - 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x42, 0x69, 0x74, 0x73, 0x12, 0x2c, 0x0a, 0x11, 0x67, - 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x1d, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x73, 0x43, 0x6e, 0x74, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x43, 0x65, 0x72, - 0x65, 0x6d, 0x6f, 0x6e, 0x69, 0x61, 0x6c, 0x54, 0x78, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x1d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x43, 0x6e, 0x74, 0x57, 0x69, 0x74, 0x68, 0x6f, - 0x75, 0x74, 0x43, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x69, 0x61, 0x6c, 0x54, 0x78, 0x73, 0x1a, - 0x2c, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x12, - 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0c, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x1a, 0x82, 0x02, - 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, - 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, - 0x18, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x55, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x31, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, - 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, 0x61, - 0x74, 0x61, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, - 0x1a, 0x40, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, - 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x64, 0x65, 0x48, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, 0x64, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, - 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, 0x61, - 0x6b, 0x65, 0x1a, 0xac, 0x06, 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4b, 0x65, + 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x1a, 0xec, 0x03, 0x0a, 0x06, 0x47, 0x6c, 0x6f, 0x62, 0x61, + 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x2e, 0x0a, 0x12, 0x6e, 0x65, 0x78, 0x74, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x12, 0x6e, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, + 0x69, 0x6f, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x53, 0x65, 0x65, 0x64, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x53, 0x65, 0x65, + 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, + 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x6e, 0x61, + 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, + 0x61, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x66, 0x65, 0x65, 0x50, 0x65, 0x72, + 0x47, 0x61, 0x73, 0x12, 0x32, 0x0a, 0x14, 0x76, 0x72, 0x66, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x65, 0x72, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x14, 0x76, 0x72, 0x66, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x54, 0x68, + 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x65, 0x6d, 0x70, 0x74, 0x79, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x42, 0x69, 0x74, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x42, 0x69, 0x74, + 0x73, 0x12, 0x2c, 0x0a, 0x11, 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, + 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x67, 0x6f, + 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x12, + 0x44, 0x0a, 0x1d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x43, 0x6e, 0x74, 0x57, 0x69, 0x74, 0x68, + 0x6f, 0x75, 0x74, 0x43, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x69, 0x61, 0x6c, 0x54, 0x78, 0x73, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x1d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x43, 0x6e, + 0x74, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x43, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x69, + 0x61, 0x6c, 0x54, 0x78, 0x73, 0x1a, 0x2c, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, + 0x77, 0x69, 0x74, 0x63, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x65, 0x73, 0x1a, 0x82, 0x02, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, - 0x6b, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, - 0x18, 0x0a, 0x07, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x07, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x72, - 0x74, 0x68, 0x64, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x62, 0x69, 0x72, - 0x74, 0x68, 0x64, 0x61, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x71, - 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x65, 0x64, 0x46, 0x6c, 0x69, 0x70, 0x73, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x65, 0x64, 0x46, 0x6c, - 0x69, 0x70, 0x73, 0x12, 0x28, 0x0a, 0x0f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x46, 0x6c, 0x69, 0x70, - 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x73, 0x68, - 0x6f, 0x72, 0x74, 0x46, 0x6c, 0x69, 0x70, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x16, 0x0a, - 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, - 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, - 0x64, 0x46, 0x6c, 0x69, 0x70, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x72, 0x65, - 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x46, 0x6c, 0x69, 0x70, 0x73, 0x12, 0x40, 0x0a, 0x05, 0x66, - 0x6c, 0x69, 0x70, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6d, 0x6f, 0x64, - 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, - 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x2e, 0x46, 0x6c, 0x69, 0x70, 0x52, 0x05, 0x66, 0x6c, 0x69, 0x70, 0x73, 0x12, 0x1e, 0x0a, - 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, - 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x63, 0x6f, 0x64, - 0x65, 0x12, 0x48, 0x0a, 0x08, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x65, 0x73, 0x18, 0x0d, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x54, 0x78, 0x41, 0x64, 0x64, - 0x72, 0x52, 0x08, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x65, 0x73, 0x12, 0x46, 0x0a, 0x07, 0x69, - 0x6e, 0x76, 0x69, 0x74, 0x65, 0x72, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6d, - 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, - 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x2e, 0x54, 0x78, 0x41, 0x64, 0x64, 0x72, 0x52, 0x07, 0x69, 0x6e, 0x76, 0x69, - 0x74, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x65, 0x6e, 0x61, 0x6c, 0x74, 0x79, 0x18, 0x0f, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x65, 0x6e, 0x61, 0x6c, 0x74, 0x79, 0x12, 0x26, 0x0a, - 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x18, - 0x10, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x42, 0x69, 0x74, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x48, 0x61, 0x73, 0x68, - 0x18, 0x12, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x48, - 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x13, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x1a, 0x2c, 0x0a, 0x04, 0x46, - 0x6c, 0x69, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x69, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x61, 0x69, 0x72, 0x1a, 0x36, 0x0a, 0x06, 0x54, 0x78, 0x41, - 0x64, 0x64, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x1a, 0x60, 0x0a, 0x10, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x49, 0x64, 0x65, + 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, + 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, + 0x55, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x40, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x64, 0x65, 0x48, 0x61, + 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, 0x64, 0x65, 0x48, 0x61, + 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x1a, 0xca, 0x06, 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x1a, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x08, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, - 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6f, 0x6e, 0x6c, - 0x69, 0x6e, 0x65, 0x1a, 0x3a, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4b, - 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, - 0x49, 0x0a, 0x1b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x43, 0x61, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x22, 0x4f, 0x0a, 0x1d, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x43, - 0x6f, 0x64, 0x65, 0x48, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x43, - 0x6f, 0x64, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x22, 0x36, 0x0a, 0x20, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, - 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x61, - 0x72, 0x67, 0x73, 0x22, 0xa0, 0x03, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x54, 0x78, 0x52, - 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, - 0x70, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6d, 0x6f, 0x64, 0x65, - 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x54, 0x78, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, - 0x74, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x54, 0x78, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, - 0x74, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x1a, 0x90, 0x02, 0x0a, 0x0e, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x54, 0x78, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x1a, - 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x12, - 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x66, 0x72, - 0x6f, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x61, 0x73, 0x43, - 0x6f, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x67, 0x61, 0x73, 0x43, 0x6f, - 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x3a, 0x0a, 0x06, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6d, 0x6f, 0x64, - 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x54, 0x78, 0x52, 0x65, 0x63, 0x65, 0x69, - 0x70, 0x74, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x06, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x1a, 0x36, - 0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, 0x65, - 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, - 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x3d, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x54, - 0x78, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x10, 0x0a, - 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, - 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0xe2, 0x01, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x44, - 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x54, 0x78, 0x73, 0x12, 0x3a, 0x0a, 0x03, 0x54, 0x78, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, - 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x44, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x54, 0x78, - 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x44, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x54, - 0x78, 0x52, 0x03, 0x54, 0x78, 0x73, 0x1a, 0x91, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x44, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x54, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, - 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, - 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x16, - 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x70, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, - 0x74, 0x69, 0x70, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x57, 0x0a, 0x0f, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x53, 0x61, 0x76, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, - 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x76, 0x65, - 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, - 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x61, - 0x72, 0x67, 0x73, 0x22, 0x99, 0x01, 0x0a, 0x11, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x55, 0x70, 0x67, - 0x72, 0x61, 0x64, 0x65, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x40, 0x0a, 0x05, 0x76, 0x6f, 0x74, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, - 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x56, 0x6f, - 0x74, 0x65, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, - 0x56, 0x6f, 0x74, 0x65, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x1a, 0x42, 0x0a, 0x10, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x56, 0x6f, 0x74, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, - 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, + 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x12, + 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x65, 0x64, 0x46, 0x6c, + 0x69, 0x70, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x71, 0x75, 0x61, 0x6c, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x46, 0x6c, 0x69, 0x70, 0x73, 0x12, 0x28, 0x0a, 0x0f, 0x73, 0x68, 0x6f, + 0x72, 0x74, 0x46, 0x6c, 0x69, 0x70, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x0f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x46, 0x6c, 0x69, 0x70, 0x50, 0x6f, 0x69, + 0x6e, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x0d, 0x72, + 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x46, 0x6c, 0x69, 0x70, 0x73, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x46, 0x6c, 0x69, 0x70, + 0x73, 0x12, 0x40, 0x0a, 0x05, 0x66, 0x6c, 0x69, 0x70, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2a, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x49, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x46, 0x6c, 0x69, 0x70, 0x52, 0x05, 0x66, 0x6c, + 0x69, 0x70, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x48, 0x0a, 0x08, 0x69, 0x6e, 0x76, 0x69, 0x74, + 0x65, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6d, 0x6f, 0x64, 0x65, + 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, + 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x2e, 0x54, 0x78, 0x41, 0x64, 0x64, 0x72, 0x52, 0x08, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x65, + 0x73, 0x12, 0x46, 0x0a, 0x07, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x72, 0x18, 0x0e, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x54, 0x78, 0x41, 0x64, 0x64, 0x72, + 0x52, 0x07, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x65, 0x6e, + 0x61, 0x6c, 0x74, 0x79, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x65, 0x6e, 0x61, + 0x6c, 0x74, 0x79, 0x12, 0x26, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x42, 0x69, 0x74, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x11, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x48, 0x61, 0x73, 0x68, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x70, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x6f, + 0x72, 0x65, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x72, 0x65, + 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x65, 0x18, 0x14, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x65, 0x1a, + 0x2c, 0x0a, 0x04, 0x46, 0x6c, 0x69, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x69, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x61, 0x69, 0x72, 0x1a, 0x36, 0x0a, + 0x06, 0x54, 0x78, 0x41, 0x64, 0x64, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x1a, 0x7e, 0x0a, 0x10, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, + 0x64, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x12, + 0x16, 0x0a, 0x06, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x06, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x65, 0x1a, 0x3a, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x22, 0x49, 0x0a, 0x1b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x43, 0x61, 0x6c, 0x6c, 0x43, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, + 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x22, 0x4f, 0x0a, 0x1d, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, + 0x08, 0x43, 0x6f, 0x64, 0x65, 0x48, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x08, 0x43, 0x6f, 0x64, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x22, 0x36, 0x0a, + 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, + 0x04, 0x61, 0x72, 0x67, 0x73, 0x22, 0xa0, 0x03, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x54, + 0x78, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x72, 0x65, 0x63, + 0x65, 0x69, 0x70, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6d, 0x6f, + 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x54, 0x78, 0x52, 0x65, 0x63, 0x65, + 0x69, 0x70, 0x74, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x54, 0x78, 0x52, 0x65, 0x63, 0x65, + 0x69, 0x70, 0x74, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x1a, 0x90, 0x02, + 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x54, 0x78, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, + 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x18, 0x0a, 0x07, + 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, + 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, + 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, + 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x61, + 0x73, 0x43, 0x6f, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x67, 0x61, 0x73, + 0x43, 0x6f, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x3a, 0x0a, 0x06, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6d, + 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x54, 0x78, 0x52, 0x65, 0x63, + 0x65, 0x69, 0x70, 0x74, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x1a, 0x36, 0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x14, + 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x3d, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x54, 0x78, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, + 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x63, 0x69, + 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0xe2, 0x01, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x44, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x54, 0x78, 0x73, 0x12, 0x3a, 0x0a, 0x03, + 0x54, 0x78, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6d, 0x6f, 0x64, 0x65, + 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x44, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, + 0x54, 0x78, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x44, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, + 0x64, 0x54, 0x78, 0x52, 0x03, 0x54, 0x78, 0x73, 0x1a, 0x91, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x44, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x54, 0x78, 0x12, 0x12, 0x0a, 0x04, + 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, + 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x74, 0x6f, + 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x70, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x04, 0x74, 0x69, 0x70, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x57, 0x0a, 0x0f, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x61, 0x76, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, + 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, + 0x04, 0x61, 0x72, 0x67, 0x73, 0x22, 0x99, 0x01, 0x0a, 0x11, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x55, + 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x40, 0x0a, 0x05, 0x76, + 0x6f, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6d, 0x6f, 0x64, + 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, + 0x56, 0x6f, 0x74, 0x65, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x55, 0x70, 0x67, 0x72, 0x61, + 0x64, 0x65, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x1a, 0x42, 0x0a, + 0x10, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x56, 0x6f, 0x74, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x70, 0x67, 0x72, 0x61, + 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, + 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -6171,7 +6324,7 @@ func file_protobuf_models_proto_rawDescGZIP() []byte { return file_protobuf_models_proto_rawDescData } -var file_protobuf_models_proto_msgTypes = make([]protoimpl.MessageInfo, 83) +var file_protobuf_models_proto_msgTypes = make([]protoimpl.MessageInfo, 85) var file_protobuf_models_proto_goTypes = []interface{}{ (*ProtoTransaction)(nil), // 0: models.ProtoTransaction (*ProtoBlockHeader)(nil), // 1: models.ProtoBlockHeader @@ -6217,94 +6370,97 @@ var file_protobuf_models_proto_goTypes = []interface{}{ (*ProtoStateGlobal)(nil), // 41: models.ProtoStateGlobal (*ProtoStateApprovedIdentity)(nil), // 42: models.ProtoStateApprovedIdentity (*ProtoStateIdentityStatusSwitch)(nil), // 43: models.ProtoStateIdentityStatusSwitch - (*ProtoPredefinedState)(nil), // 44: models.ProtoPredefinedState - (*ProtoCallContractAttachment)(nil), // 45: models.ProtoCallContractAttachment - (*ProtoDeployContractAttachment)(nil), // 46: models.ProtoDeployContractAttachment - (*ProtoTerminateContractAttachment)(nil), // 47: models.ProtoTerminateContractAttachment - (*ProtoTxReceipts)(nil), // 48: models.ProtoTxReceipts - (*ProtoTxReceiptIndex)(nil), // 49: models.ProtoTxReceiptIndex - (*ProtoDeferredTxs)(nil), // 50: models.ProtoDeferredTxs - (*ProtoSavedEvent)(nil), // 51: models.ProtoSavedEvent - (*ProtoUpgradeVotes)(nil), // 52: models.ProtoUpgradeVotes - (*ProtoTransaction_Data)(nil), // 53: models.ProtoTransaction.Data - (*ProtoBlockHeader_Proposed)(nil), // 54: models.ProtoBlockHeader.Proposed - (*ProtoBlockHeader_Empty)(nil), // 55: models.ProtoBlockHeader.Empty - (*ProtoBlockProposal_Data)(nil), // 56: models.ProtoBlockProposal.Data - (*ProtoBlockCert_Signature)(nil), // 57: models.ProtoBlockCert.Signature - (*ProtoIdentityStateDiff_IdentityStateDiffValue)(nil), // 58: models.ProtoIdentityStateDiff.IdentityStateDiffValue - (*ProtoSnapshotBlock_KeyValue)(nil), // 59: models.ProtoSnapshotBlock.KeyValue - (*ProtoGossipBlockRange_Block)(nil), // 60: models.ProtoGossipBlockRange.Block - (*ProtoProposeProof_Data)(nil), // 61: models.ProtoProposeProof.Data - (*ProtoVote_Data)(nil), // 62: models.ProtoVote.Data - (*ProtoFlipKey_Data)(nil), // 63: models.ProtoFlipKey.Data - (*ProtoPrivateFlipKeysPackage_Data)(nil), // 64: models.ProtoPrivateFlipKeysPackage.Data - (*ProtoAnswersDb_Answer)(nil), // 65: models.ProtoAnswersDb.Answer - (*ProtoActivityMonitor_Activity)(nil), // 66: models.ProtoActivityMonitor.Activity - (*ProtoStateAccount_ProtoContractData)(nil), // 67: models.ProtoStateAccount.ProtoContractData - (*ProtoStateIdentity_Flip)(nil), // 68: models.ProtoStateIdentity.Flip - (*ProtoStateIdentity_TxAddr)(nil), // 69: models.ProtoStateIdentity.TxAddr - (*ProtoPredefinedState_Global)(nil), // 70: models.ProtoPredefinedState.Global - (*ProtoPredefinedState_StatusSwitch)(nil), // 71: models.ProtoPredefinedState.StatusSwitch - (*ProtoPredefinedState_Account)(nil), // 72: models.ProtoPredefinedState.Account - (*ProtoPredefinedState_Identity)(nil), // 73: models.ProtoPredefinedState.Identity - (*ProtoPredefinedState_ApprovedIdentity)(nil), // 74: models.ProtoPredefinedState.ApprovedIdentity - (*ProtoPredefinedState_ContractKeyValue)(nil), // 75: models.ProtoPredefinedState.ContractKeyValue - (*ProtoPredefinedState_Account_ContractData)(nil), // 76: models.ProtoPredefinedState.Account.ContractData - (*ProtoPredefinedState_Identity_Flip)(nil), // 77: models.ProtoPredefinedState.Identity.Flip - (*ProtoPredefinedState_Identity_TxAddr)(nil), // 78: models.ProtoPredefinedState.Identity.TxAddr - (*ProtoTxReceipts_ProtoTxReceipt)(nil), // 79: models.ProtoTxReceipts.ProtoTxReceipt - (*ProtoTxReceipts_ProtoEvent)(nil), // 80: models.ProtoTxReceipts.ProtoEvent - (*ProtoDeferredTxs_ProtoDeferredTx)(nil), // 81: models.ProtoDeferredTxs.ProtoDeferredTx - (*ProtoUpgradeVotes_ProtoUpgradeVote)(nil), // 82: models.ProtoUpgradeVotes.ProtoUpgradeVote + (*ProtoStateDelegationSwitch)(nil), // 44: models.ProtoStateDelegationSwitch + (*ProtoPredefinedState)(nil), // 45: models.ProtoPredefinedState + (*ProtoCallContractAttachment)(nil), // 46: models.ProtoCallContractAttachment + (*ProtoDeployContractAttachment)(nil), // 47: models.ProtoDeployContractAttachment + (*ProtoTerminateContractAttachment)(nil), // 48: models.ProtoTerminateContractAttachment + (*ProtoTxReceipts)(nil), // 49: models.ProtoTxReceipts + (*ProtoTxReceiptIndex)(nil), // 50: models.ProtoTxReceiptIndex + (*ProtoDeferredTxs)(nil), // 51: models.ProtoDeferredTxs + (*ProtoSavedEvent)(nil), // 52: models.ProtoSavedEvent + (*ProtoUpgradeVotes)(nil), // 53: models.ProtoUpgradeVotes + (*ProtoTransaction_Data)(nil), // 54: models.ProtoTransaction.Data + (*ProtoBlockHeader_Proposed)(nil), // 55: models.ProtoBlockHeader.Proposed + (*ProtoBlockHeader_Empty)(nil), // 56: models.ProtoBlockHeader.Empty + (*ProtoBlockProposal_Data)(nil), // 57: models.ProtoBlockProposal.Data + (*ProtoBlockCert_Signature)(nil), // 58: models.ProtoBlockCert.Signature + (*ProtoIdentityStateDiff_IdentityStateDiffValue)(nil), // 59: models.ProtoIdentityStateDiff.IdentityStateDiffValue + (*ProtoSnapshotBlock_KeyValue)(nil), // 60: models.ProtoSnapshotBlock.KeyValue + (*ProtoGossipBlockRange_Block)(nil), // 61: models.ProtoGossipBlockRange.Block + (*ProtoProposeProof_Data)(nil), // 62: models.ProtoProposeProof.Data + (*ProtoVote_Data)(nil), // 63: models.ProtoVote.Data + (*ProtoFlipKey_Data)(nil), // 64: models.ProtoFlipKey.Data + (*ProtoPrivateFlipKeysPackage_Data)(nil), // 65: models.ProtoPrivateFlipKeysPackage.Data + (*ProtoAnswersDb_Answer)(nil), // 66: models.ProtoAnswersDb.Answer + (*ProtoActivityMonitor_Activity)(nil), // 67: models.ProtoActivityMonitor.Activity + (*ProtoStateAccount_ProtoContractData)(nil), // 68: models.ProtoStateAccount.ProtoContractData + (*ProtoStateIdentity_Flip)(nil), // 69: models.ProtoStateIdentity.Flip + (*ProtoStateIdentity_TxAddr)(nil), // 70: models.ProtoStateIdentity.TxAddr + (*ProtoStateDelegationSwitch_Delegation)(nil), // 71: models.ProtoStateDelegationSwitch.Delegation + (*ProtoPredefinedState_Global)(nil), // 72: models.ProtoPredefinedState.Global + (*ProtoPredefinedState_StatusSwitch)(nil), // 73: models.ProtoPredefinedState.StatusSwitch + (*ProtoPredefinedState_Account)(nil), // 74: models.ProtoPredefinedState.Account + (*ProtoPredefinedState_Identity)(nil), // 75: models.ProtoPredefinedState.Identity + (*ProtoPredefinedState_ApprovedIdentity)(nil), // 76: models.ProtoPredefinedState.ApprovedIdentity + (*ProtoPredefinedState_ContractKeyValue)(nil), // 77: models.ProtoPredefinedState.ContractKeyValue + (*ProtoPredefinedState_Account_ContractData)(nil), // 78: models.ProtoPredefinedState.Account.ContractData + (*ProtoPredefinedState_Identity_Flip)(nil), // 79: models.ProtoPredefinedState.Identity.Flip + (*ProtoPredefinedState_Identity_TxAddr)(nil), // 80: models.ProtoPredefinedState.Identity.TxAddr + (*ProtoTxReceipts_ProtoTxReceipt)(nil), // 81: models.ProtoTxReceipts.ProtoTxReceipt + (*ProtoTxReceipts_ProtoEvent)(nil), // 82: models.ProtoTxReceipts.ProtoEvent + (*ProtoDeferredTxs_ProtoDeferredTx)(nil), // 83: models.ProtoDeferredTxs.ProtoDeferredTx + (*ProtoUpgradeVotes_ProtoUpgradeVote)(nil), // 84: models.ProtoUpgradeVotes.ProtoUpgradeVote } var file_protobuf_models_proto_depIdxs = []int32{ - 53, // 0: models.ProtoTransaction.data:type_name -> models.ProtoTransaction.Data - 54, // 1: models.ProtoBlockHeader.proposedHeader:type_name -> models.ProtoBlockHeader.Proposed - 55, // 2: models.ProtoBlockHeader.emptyHeader:type_name -> models.ProtoBlockHeader.Empty + 54, // 0: models.ProtoTransaction.data:type_name -> models.ProtoTransaction.Data + 55, // 1: models.ProtoBlockHeader.proposedHeader:type_name -> models.ProtoBlockHeader.Proposed + 56, // 2: models.ProtoBlockHeader.emptyHeader:type_name -> models.ProtoBlockHeader.Empty 0, // 3: models.ProtoBlockBody.transactions:type_name -> models.ProtoTransaction 1, // 4: models.ProtoBlock.header:type_name -> models.ProtoBlockHeader 2, // 5: models.ProtoBlock.body:type_name -> models.ProtoBlockBody - 56, // 6: models.ProtoBlockProposal.data:type_name -> models.ProtoBlockProposal.Data - 57, // 7: models.ProtoBlockCert.signatures:type_name -> models.ProtoBlockCert.Signature - 58, // 8: models.ProtoIdentityStateDiff.values:type_name -> models.ProtoIdentityStateDiff.IdentityStateDiffValue - 59, // 9: models.ProtoSnapshotBlock.data:type_name -> models.ProtoSnapshotBlock.KeyValue - 60, // 10: models.ProtoGossipBlockRange.blocks:type_name -> models.ProtoGossipBlockRange.Block - 61, // 11: models.ProtoProposeProof.data:type_name -> models.ProtoProposeProof.Data - 62, // 12: models.ProtoVote.data:type_name -> models.ProtoVote.Data + 57, // 6: models.ProtoBlockProposal.data:type_name -> models.ProtoBlockProposal.Data + 58, // 7: models.ProtoBlockCert.signatures:type_name -> models.ProtoBlockCert.Signature + 59, // 8: models.ProtoIdentityStateDiff.values:type_name -> models.ProtoIdentityStateDiff.IdentityStateDiffValue + 60, // 9: models.ProtoSnapshotBlock.data:type_name -> models.ProtoSnapshotBlock.KeyValue + 61, // 10: models.ProtoGossipBlockRange.blocks:type_name -> models.ProtoGossipBlockRange.Block + 62, // 11: models.ProtoProposeProof.data:type_name -> models.ProtoProposeProof.Data + 63, // 12: models.ProtoVote.data:type_name -> models.ProtoVote.Data 0, // 13: models.ProtoFlip.transaction:type_name -> models.ProtoTransaction - 63, // 14: models.ProtoFlipKey.data:type_name -> models.ProtoFlipKey.Data - 64, // 15: models.ProtoPrivateFlipKeysPackage.data:type_name -> models.ProtoPrivateFlipKeysPackage.Data - 65, // 16: models.ProtoAnswersDb.answers:type_name -> models.ProtoAnswersDb.Answer + 64, // 14: models.ProtoFlipKey.data:type_name -> models.ProtoFlipKey.Data + 65, // 15: models.ProtoPrivateFlipKeysPackage.data:type_name -> models.ProtoPrivateFlipKeysPackage.Data + 66, // 16: models.ProtoAnswersDb.answers:type_name -> models.ProtoAnswersDb.Answer 0, // 17: models.ProtoSavedTransaction.tx:type_name -> models.ProtoTransaction - 66, // 18: models.ProtoActivityMonitor.activities:type_name -> models.ProtoActivityMonitor.Activity - 67, // 19: models.ProtoStateAccount.contractData:type_name -> models.ProtoStateAccount.ProtoContractData - 68, // 20: models.ProtoStateIdentity.flips:type_name -> models.ProtoStateIdentity.Flip - 69, // 21: models.ProtoStateIdentity.invitees:type_name -> models.ProtoStateIdentity.TxAddr - 69, // 22: models.ProtoStateIdentity.inviter:type_name -> models.ProtoStateIdentity.TxAddr - 70, // 23: models.ProtoPredefinedState.global:type_name -> models.ProtoPredefinedState.Global - 71, // 24: models.ProtoPredefinedState.statusSwitch:type_name -> models.ProtoPredefinedState.StatusSwitch - 72, // 25: models.ProtoPredefinedState.accounts:type_name -> models.ProtoPredefinedState.Account - 73, // 26: models.ProtoPredefinedState.identities:type_name -> models.ProtoPredefinedState.Identity - 74, // 27: models.ProtoPredefinedState.approvedIdentities:type_name -> models.ProtoPredefinedState.ApprovedIdentity - 75, // 28: models.ProtoPredefinedState.contractValues:type_name -> models.ProtoPredefinedState.ContractKeyValue - 79, // 29: models.ProtoTxReceipts.receipts:type_name -> models.ProtoTxReceipts.ProtoTxReceipt - 81, // 30: models.ProtoDeferredTxs.Txs:type_name -> models.ProtoDeferredTxs.ProtoDeferredTx - 82, // 31: models.ProtoUpgradeVotes.votes:type_name -> models.ProtoUpgradeVotes.ProtoUpgradeVote - 1, // 32: models.ProtoBlockProposal.Data.header:type_name -> models.ProtoBlockHeader - 2, // 33: models.ProtoBlockProposal.Data.body:type_name -> models.ProtoBlockBody - 1, // 34: models.ProtoGossipBlockRange.Block.header:type_name -> models.ProtoBlockHeader - 6, // 35: models.ProtoGossipBlockRange.Block.cert:type_name -> models.ProtoBlockCert - 13, // 36: models.ProtoGossipBlockRange.Block.diff:type_name -> models.ProtoIdentityStateDiff - 76, // 37: models.ProtoPredefinedState.Account.contractData:type_name -> models.ProtoPredefinedState.Account.ContractData - 77, // 38: models.ProtoPredefinedState.Identity.flips:type_name -> models.ProtoPredefinedState.Identity.Flip - 78, // 39: models.ProtoPredefinedState.Identity.invitees:type_name -> models.ProtoPredefinedState.Identity.TxAddr - 78, // 40: models.ProtoPredefinedState.Identity.inviter:type_name -> models.ProtoPredefinedState.Identity.TxAddr - 80, // 41: models.ProtoTxReceipts.ProtoTxReceipt.events:type_name -> models.ProtoTxReceipts.ProtoEvent - 42, // [42:42] is the sub-list for method output_type - 42, // [42:42] is the sub-list for method input_type - 42, // [42:42] is the sub-list for extension type_name - 42, // [42:42] is the sub-list for extension extendee - 0, // [0:42] is the sub-list for field type_name + 67, // 18: models.ProtoActivityMonitor.activities:type_name -> models.ProtoActivityMonitor.Activity + 68, // 19: models.ProtoStateAccount.contractData:type_name -> models.ProtoStateAccount.ProtoContractData + 69, // 20: models.ProtoStateIdentity.flips:type_name -> models.ProtoStateIdentity.Flip + 70, // 21: models.ProtoStateIdentity.invitees:type_name -> models.ProtoStateIdentity.TxAddr + 70, // 22: models.ProtoStateIdentity.inviter:type_name -> models.ProtoStateIdentity.TxAddr + 71, // 23: models.ProtoStateDelegationSwitch.delegations:type_name -> models.ProtoStateDelegationSwitch.Delegation + 72, // 24: models.ProtoPredefinedState.global:type_name -> models.ProtoPredefinedState.Global + 73, // 25: models.ProtoPredefinedState.statusSwitch:type_name -> models.ProtoPredefinedState.StatusSwitch + 74, // 26: models.ProtoPredefinedState.accounts:type_name -> models.ProtoPredefinedState.Account + 75, // 27: models.ProtoPredefinedState.identities:type_name -> models.ProtoPredefinedState.Identity + 76, // 28: models.ProtoPredefinedState.approvedIdentities:type_name -> models.ProtoPredefinedState.ApprovedIdentity + 77, // 29: models.ProtoPredefinedState.contractValues:type_name -> models.ProtoPredefinedState.ContractKeyValue + 81, // 30: models.ProtoTxReceipts.receipts:type_name -> models.ProtoTxReceipts.ProtoTxReceipt + 83, // 31: models.ProtoDeferredTxs.Txs:type_name -> models.ProtoDeferredTxs.ProtoDeferredTx + 84, // 32: models.ProtoUpgradeVotes.votes:type_name -> models.ProtoUpgradeVotes.ProtoUpgradeVote + 1, // 33: models.ProtoBlockProposal.Data.header:type_name -> models.ProtoBlockHeader + 2, // 34: models.ProtoBlockProposal.Data.body:type_name -> models.ProtoBlockBody + 1, // 35: models.ProtoGossipBlockRange.Block.header:type_name -> models.ProtoBlockHeader + 6, // 36: models.ProtoGossipBlockRange.Block.cert:type_name -> models.ProtoBlockCert + 13, // 37: models.ProtoGossipBlockRange.Block.diff:type_name -> models.ProtoIdentityStateDiff + 78, // 38: models.ProtoPredefinedState.Account.contractData:type_name -> models.ProtoPredefinedState.Account.ContractData + 79, // 39: models.ProtoPredefinedState.Identity.flips:type_name -> models.ProtoPredefinedState.Identity.Flip + 80, // 40: models.ProtoPredefinedState.Identity.invitees:type_name -> models.ProtoPredefinedState.Identity.TxAddr + 80, // 41: models.ProtoPredefinedState.Identity.inviter:type_name -> models.ProtoPredefinedState.Identity.TxAddr + 82, // 42: models.ProtoTxReceipts.ProtoTxReceipt.events:type_name -> models.ProtoTxReceipts.ProtoEvent + 43, // [43:43] is the sub-list for method output_type + 43, // [43:43] is the sub-list for method input_type + 43, // [43:43] is the sub-list for extension type_name + 43, // [43:43] is the sub-list for extension extendee + 0, // [0:43] is the sub-list for field type_name } func init() { file_protobuf_models_proto_init() } @@ -6842,7 +6998,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoPredefinedState); i { + switch v := v.(*ProtoStateDelegationSwitch); i { case 0: return &v.state case 1: @@ -6854,7 +7010,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoCallContractAttachment); i { + switch v := v.(*ProtoPredefinedState); i { case 0: return &v.state case 1: @@ -6866,7 +7022,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoDeployContractAttachment); i { + switch v := v.(*ProtoCallContractAttachment); i { case 0: return &v.state case 1: @@ -6878,7 +7034,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoTerminateContractAttachment); i { + switch v := v.(*ProtoDeployContractAttachment); i { case 0: return &v.state case 1: @@ -6890,7 +7046,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoTxReceipts); i { + switch v := v.(*ProtoTerminateContractAttachment); i { case 0: return &v.state case 1: @@ -6902,7 +7058,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoTxReceiptIndex); i { + switch v := v.(*ProtoTxReceipts); i { case 0: return &v.state case 1: @@ -6914,7 +7070,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoDeferredTxs); i { + switch v := v.(*ProtoTxReceiptIndex); i { case 0: return &v.state case 1: @@ -6926,7 +7082,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoSavedEvent); i { + switch v := v.(*ProtoDeferredTxs); i { case 0: return &v.state case 1: @@ -6938,7 +7094,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoUpgradeVotes); i { + switch v := v.(*ProtoSavedEvent); i { case 0: return &v.state case 1: @@ -6950,7 +7106,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoTransaction_Data); i { + switch v := v.(*ProtoUpgradeVotes); i { case 0: return &v.state case 1: @@ -6962,7 +7118,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoBlockHeader_Proposed); i { + switch v := v.(*ProtoTransaction_Data); i { case 0: return &v.state case 1: @@ -6974,7 +7130,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoBlockHeader_Empty); i { + switch v := v.(*ProtoBlockHeader_Proposed); i { case 0: return &v.state case 1: @@ -6986,7 +7142,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoBlockProposal_Data); i { + switch v := v.(*ProtoBlockHeader_Empty); i { case 0: return &v.state case 1: @@ -6998,7 +7154,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoBlockCert_Signature); i { + switch v := v.(*ProtoBlockProposal_Data); i { case 0: return &v.state case 1: @@ -7010,7 +7166,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoIdentityStateDiff_IdentityStateDiffValue); i { + switch v := v.(*ProtoBlockCert_Signature); i { case 0: return &v.state case 1: @@ -7022,7 +7178,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoSnapshotBlock_KeyValue); i { + switch v := v.(*ProtoIdentityStateDiff_IdentityStateDiffValue); i { case 0: return &v.state case 1: @@ -7034,7 +7190,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoGossipBlockRange_Block); i { + switch v := v.(*ProtoSnapshotBlock_KeyValue); i { case 0: return &v.state case 1: @@ -7046,7 +7202,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoProposeProof_Data); i { + switch v := v.(*ProtoGossipBlockRange_Block); i { case 0: return &v.state case 1: @@ -7058,7 +7214,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoVote_Data); i { + switch v := v.(*ProtoProposeProof_Data); i { case 0: return &v.state case 1: @@ -7070,7 +7226,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoFlipKey_Data); i { + switch v := v.(*ProtoVote_Data); i { case 0: return &v.state case 1: @@ -7082,7 +7238,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoPrivateFlipKeysPackage_Data); i { + switch v := v.(*ProtoFlipKey_Data); i { case 0: return &v.state case 1: @@ -7094,7 +7250,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoAnswersDb_Answer); i { + switch v := v.(*ProtoPrivateFlipKeysPackage_Data); i { case 0: return &v.state case 1: @@ -7106,7 +7262,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoActivityMonitor_Activity); i { + switch v := v.(*ProtoAnswersDb_Answer); i { case 0: return &v.state case 1: @@ -7118,7 +7274,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoStateAccount_ProtoContractData); i { + switch v := v.(*ProtoActivityMonitor_Activity); i { case 0: return &v.state case 1: @@ -7130,7 +7286,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoStateIdentity_Flip); i { + switch v := v.(*ProtoStateAccount_ProtoContractData); i { case 0: return &v.state case 1: @@ -7142,7 +7298,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoStateIdentity_TxAddr); i { + switch v := v.(*ProtoStateIdentity_Flip); i { case 0: return &v.state case 1: @@ -7154,7 +7310,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoPredefinedState_Global); i { + switch v := v.(*ProtoStateIdentity_TxAddr); i { case 0: return &v.state case 1: @@ -7166,7 +7322,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoPredefinedState_StatusSwitch); i { + switch v := v.(*ProtoStateDelegationSwitch_Delegation); i { case 0: return &v.state case 1: @@ -7178,7 +7334,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoPredefinedState_Account); i { + switch v := v.(*ProtoPredefinedState_Global); i { case 0: return &v.state case 1: @@ -7190,7 +7346,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoPredefinedState_Identity); i { + switch v := v.(*ProtoPredefinedState_StatusSwitch); i { case 0: return &v.state case 1: @@ -7202,7 +7358,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[74].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoPredefinedState_ApprovedIdentity); i { + switch v := v.(*ProtoPredefinedState_Account); i { case 0: return &v.state case 1: @@ -7214,7 +7370,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoPredefinedState_ContractKeyValue); i { + switch v := v.(*ProtoPredefinedState_Identity); i { case 0: return &v.state case 1: @@ -7226,7 +7382,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[76].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoPredefinedState_Account_ContractData); i { + switch v := v.(*ProtoPredefinedState_ApprovedIdentity); i { case 0: return &v.state case 1: @@ -7238,7 +7394,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[77].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoPredefinedState_Identity_Flip); i { + switch v := v.(*ProtoPredefinedState_ContractKeyValue); i { case 0: return &v.state case 1: @@ -7250,7 +7406,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[78].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoPredefinedState_Identity_TxAddr); i { + switch v := v.(*ProtoPredefinedState_Account_ContractData); i { case 0: return &v.state case 1: @@ -7262,7 +7418,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[79].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoTxReceipts_ProtoTxReceipt); i { + switch v := v.(*ProtoPredefinedState_Identity_Flip); i { case 0: return &v.state case 1: @@ -7274,7 +7430,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[80].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoTxReceipts_ProtoEvent); i { + switch v := v.(*ProtoPredefinedState_Identity_TxAddr); i { case 0: return &v.state case 1: @@ -7286,7 +7442,7 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[81].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoDeferredTxs_ProtoDeferredTx); i { + switch v := v.(*ProtoTxReceipts_ProtoTxReceipt); i { case 0: return &v.state case 1: @@ -7298,6 +7454,30 @@ func file_protobuf_models_proto_init() { } } file_protobuf_models_proto_msgTypes[82].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProtoTxReceipts_ProtoEvent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protobuf_models_proto_msgTypes[83].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProtoDeferredTxs_ProtoDeferredTx); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protobuf_models_proto_msgTypes[84].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ProtoUpgradeVotes_ProtoUpgradeVote); i { case 0: return &v.state @@ -7316,7 +7496,7 @@ func file_protobuf_models_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_protobuf_models_proto_rawDesc, NumEnums: 0, - NumMessages: 83, + NumMessages: 85, NumExtensions: 0, NumServices: 0, }, diff --git a/protobuf/models.proto b/protobuf/models.proto index cc853fad..81097bc9 100644 --- a/protobuf/models.proto +++ b/protobuf/models.proto @@ -352,6 +352,7 @@ message ProtoStateIdentity { uint32 validationStatus = 16; bytes profileHash = 17; bytes scores = 18; + bytes delegatee = 19; } message ProtoStateGlobal { @@ -372,12 +373,22 @@ message ProtoStateGlobal { message ProtoStateApprovedIdentity { bool approved = 1; bool online = 2; + bytes delegatee = 3; } message ProtoStateIdentityStatusSwitch { repeated bytes addresses = 1; } +message ProtoStateDelegationSwitch { + + message Delegation { + bytes delegator = 1; + bytes delegatee = 2; + } + repeated Delegation delegations = 1; +} + message ProtoPredefinedState { message Global { @@ -442,12 +453,14 @@ message ProtoPredefinedState { uint32 validationStatus = 17; bytes profileHash = 18; bytes scores = 19; + bytes delegatee = 20; } message ApprovedIdentity { bytes address = 1; bool approved = 2; bool online = 3; + bytes delegatee = 4; } message ContractKeyValue{ From 41175eded57aa5979b9fc2c4cfa9b04fa16e5533 Mon Sep 17 00:00:00 2001 From: sidenaio Date: Tue, 16 Feb 2021 13:11:26 +0500 Subject: [PATCH 03/15] WIP: introduce pools --- blockchain/blockchain.go | 22 +- blockchain/rewards.go | 24 +- blockchain/types/types.go | 3 +- blockchain/validation/validation.go | 37 +- core/state/state_object.go | 19 +- core/state/statedb.go | 12 + core/validators/validators.go | 4 + protobuf/models.pb.go | 599 +++++++++++++++------------- protobuf/models.proto | 4 + 9 files changed, 431 insertions(+), 293 deletions(-) diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index 54c2d204..b9f16f61 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -700,9 +700,15 @@ func setNewIdentitiesAttributes(appState *appstate.AppState, totalInvitesCount f }) appState.State.SetRequiredFlips(addr, uint8(flips)) appState.IdentityState.Add(addr) + if identity.Delegatee != nil { + appState.IdentityState.SetDelegatee(addr, *identity.Delegatee) + } case state.Newbie: appState.State.SetRequiredFlips(addr, uint8(flips)) appState.IdentityState.Add(addr) + if identity.Delegatee != nil { + appState.IdentityState.SetDelegatee(addr, *identity.Delegatee) + } case state.Killed, state.Undefined: removeLinksWithInviterAndInvitees(appState.State, addr) appState.State.SetRequiredFlips(addr, 0) @@ -865,7 +871,7 @@ func (chain *Blockchain) rewardFinalCommittee(appState *appstate.AppState, block penaltySource := addr balanceDest := addr - if delegator := appState.ValidatorsCache.Delegator(addr);!delegator.IsEmpty(){ + if delegator := appState.ValidatorsCache.Delegator(addr); !delegator.IsEmpty() { penaltySource = delegator balanceDest = delegator } @@ -1041,6 +1047,15 @@ func (chain *Blockchain) ApplyTxOnState(appState *appstate.AppState, vm vm.VM, t (inviteePrevState == state.Invite || inviteePrevState == state.Candidate) { stateDB.AddInvite(sender, 1) } + case types.KillDelegatorTx: + collector.BeginTxBalanceUpdate(statsCollector, tx, appState) + defer collector.CompleteBalanceUpdate(statsCollector, appState) + stateDB.SetState(*tx.To, state.Killed) + appState.IdentityState.Remove(*tx.To) + stake := stateDB.GetStakeBalance(*tx.To) + stateDB.SubStake(*tx.To, stake) + stateDB.AddBalance(sender, stake) + case types.SubmitFlipTx: collector.BeginTxBalanceUpdate(statsCollector, tx, appState) defer collector.CompleteBalanceUpdate(statsCollector, appState) @@ -1172,7 +1187,7 @@ func (chain *Blockchain) applyVrfProposerThreshold(appState *appstate.AppState, appState.State.AddBlockBit(block.IsEmpty()) currentThreshold := appState.State.VrfProposerThreshold() - online := float64(appState.ValidatorsCache.OnlineSize()) + online := float64(appState.ValidatorsCache.ValidatorsSize()) if online == 0 { online = 1 } @@ -1220,6 +1235,7 @@ func (chain *Blockchain) applyDelegationSwitch(appState *appstate.AppState, bloc } else { appState.IdentityState.SetDelegatee(delegation.Delegator, delegation.Delegatee) appState.State.SetDelegatee(delegation.Delegator, delegation.Delegatee) + appState.State.SetDelegationEpoch(delegation.Delegator, appState.State.Epoch()) appState.IdentityState.SetOnline(delegation.Delegator, false) } } @@ -1647,7 +1663,7 @@ func (chain *Blockchain) ValidateBlockCert(prevBlock *types.Header, block *types Signature: signature.Signature, } - if !validators.Addresses.Contains(vote.VoterAddr()) { + if !validators.Contains(vote.VoterAddr()) { return errors.New("invalid voter") } if vote.Header.Round != block.Height() { diff --git a/blockchain/rewards.go b/blockchain/rewards.go index 7710a034..68a76ec8 100644 --- a/blockchain/rewards.go +++ b/blockchain/rewards.go @@ -69,7 +69,11 @@ func addSuccessfulValidationReward(appState *appstate.AppState, config *config.C totalReward := successfulValidationRewardShare.Mul(decimal.NewFromFloat32(normalAge)) reward, stake := splitReward(math.ToInt(totalReward), identity.State == state.Newbie, config) collector.BeginEpochRewardBalanceUpdate(statsCollector, addr, appState) - appState.State.AddBalance(addr, reward) + rewardDest := addr + if identity.Delegatee != nil { + rewardDest = *identity.Delegatee + } + appState.State.AddBalance(rewardDest, reward) appState.State.AddStake(addr, stake) collector.CompleteBalanceUpdate(statsCollector, appState) collector.AddMintedCoins(statsCollector, reward) @@ -133,7 +137,11 @@ func addFlipReward(appState *appstate.AppState, config *config.ConsensusConf, va totalReward := flipRewardShare.Mul(decimal.NewFromFloat32(weight)) reward, stake := splitReward(math.ToInt(totalReward), author.NewIdentityState == uint8(state.Newbie), config) collector.BeginEpochRewardBalanceUpdate(statsCollector, addr, appState) - appState.State.AddBalance(addr, reward) + rewardDest := addr + if delegatee := appState.State.Delegatee(addr); delegatee != nil { + rewardDest = *delegatee + } + appState.State.AddBalance(rewardDest, reward) appState.State.AddStake(addr, stake) collector.CompleteBalanceUpdate(statsCollector, appState) collector.AddMintedCoins(statsCollector, reward) @@ -149,7 +157,11 @@ func addFlipReward(appState *appstate.AppState, config *config.ConsensusConf, va for _, reporter := range reporters { reward, stake := splitReward(math.ToInt(totalReward), reporter.NewIdentityState == uint8(state.Newbie), config) collector.BeginEpochRewardBalanceUpdate(statsCollector, reporter.Address, appState) - appState.State.AddBalance(reporter.Address, reward) + rewardDest := reporter.Address + if delegatee := appState.State.Delegatee(reporter.Address); delegatee != nil { + rewardDest = *delegatee + } + appState.State.AddBalance(rewardDest, reward) appState.State.AddStake(reporter.Address, stake) collector.CompleteBalanceUpdate(statsCollector, appState) collector.AddMintedCoins(statsCollector, reward) @@ -218,7 +230,11 @@ func addInvitationReward(appState *appstate.AppState, config *config.ConsensusCo isSavedInviteWinner bool) { reward, stake := splitReward(math.ToInt(totalReward), isNewbie, config) collector.BeginEpochRewardBalanceUpdate(statsCollector, addr, appState) - appState.State.AddBalance(addr, reward) + rewardDest := addr + if delegatee := appState.State.Delegatee(addr); delegatee != nil { + rewardDest = *delegatee + } + appState.State.AddBalance(rewardDest, reward) appState.State.AddStake(addr, stake) collector.CompleteBalanceUpdate(statsCollector, appState) collector.AddMintedCoins(statsCollector, reward) diff --git a/blockchain/types/types.go b/blockchain/types/types.go index da29a07b..508dd9a8 100644 --- a/blockchain/types/types.go +++ b/blockchain/types/types.go @@ -31,8 +31,9 @@ const ( DeployContract uint16 = 0xF CallContract uint16 = 0x10 TerminateContract uint16 = 0x11 - DelegateTx uint16 = 0x12 + DelegateTx uint16 = 0x12 UndelegateTx uint16 = 0x13 + KillDelegatorTx uint16 = 0x14 ) const ( diff --git a/blockchain/validation/validation.go b/blockchain/validation/validation.go index fc0a1fb1..29e639ef 100644 --- a/blockchain/validation/validation.go +++ b/blockchain/validation/validation.go @@ -61,7 +61,7 @@ var ( NegativeValue = errors.New("value must be non-negative") SenderHasDelegatee = errors.New("sender has delegatee already") SenderHasNoDelegatee = errors.New("sender has no delegatee") - PoolIsTooBig = errors.New("pool is too big") + WrongEpoch = errors.New("wrong epoch") validators map[types.TxType]validator ) @@ -120,9 +120,11 @@ func getValidator(txType types.TxType) (validator, bool) { if appCfg.Consensus.EnablePools { validators[types.DelegateTx] = validateDelegateTx validators[types.UndelegateTx] = validateUndelegateTx + validators[types.KillDelegatorTx] = validateKillDelegatorTx } else { delete(validators, types.DelegateTx) delete(validators, types.UndelegateTx) + delete(validators, types.KillDelegatorTx) } } v, ok := validators[txType] @@ -730,7 +732,11 @@ func validateDelegateTx(appState *appstate.AppState, tx *types.Transaction, txTy return LateTx } - delegatee := appState.IdentityState.Delegatee(sender) + if appState.ValidatorsCache.IsPool(sender) { + return InvalidSender + } + + delegatee := appState.State.Delegatee(sender) delegationSwitch := appState.State.DelegationSwitch(sender) if delegatee == nil { @@ -761,7 +767,7 @@ func validateUndelegateTx(appState *appstate.AppState, tx *types.Transaction, tx return LateTx } - delegatee := appState.IdentityState.Delegatee(sender) + delegatee := appState.State.Delegatee(sender) delegationSwitch := appState.State.DelegationSwitch(sender) if delegatee != nil { @@ -774,10 +780,29 @@ func validateUndelegateTx(appState *appstate.AppState, tx *types.Transaction, tx } } - const maxFamilyPoolSize = 20 - if delegatee != nil && appState.ValidatorsCache.PoolSize(*delegatee) > maxFamilyPoolSize { - return PoolIsTooBig + if appState.State.DelegationEpoch(sender) == appState.State.Epoch() { + return WrongEpoch + } + + return nil +} + +func validateKillDelegatorTx(appState *appstate.AppState, tx *types.Transaction, txType TxType) error { + sender, _ := types.Sender(tx) + + if tx.To == nil || *tx.To == (common.Address{}) { + return RecipientRequired } + if !common.ZeroOrNil(tx.AmountOrZero()) { + return InvalidAmount + } + if appState.State.ValidationPeriod() >= state.FlipLotteryPeriod { + return LateTx + } + delegatee := appState.State.Delegatee(*tx.To) + if delegatee == nil || *delegatee != sender { + return InvalidSender + } return nil } diff --git a/core/state/state_object.go b/core/state/state_object.go index 06e89fa0..e9622fa0 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -298,6 +298,7 @@ type Identity struct { Scores []byte Delegatee *common.Address DelegationNonce uint32 + DelegationEpoch uint16 } type TxAddr struct { @@ -322,6 +323,8 @@ func (i *Identity) ToBytes() ([]byte, error) { ValidationStatus: uint32(i.LastValidationStatus), ProfileHash: i.ProfileHash, Scores: i.Scores, + DelegationNonce: i.DelegationNonce, + DelegationEpoch: uint32(i.DelegationEpoch), } if i.Delegatee != nil { protoIdentity.Delegatee = i.Delegatee.Bytes() @@ -367,7 +370,8 @@ func (i *Identity) FromBytes(data []byte) error { i.LastValidationStatus = ValidationStatusFlag(protoIdentity.ValidationStatus) i.ProfileHash = protoIdentity.ProfileHash i.Scores = protoIdentity.Scores - + i.DelegationEpoch = uint16(protoIdentity.DelegationEpoch) + i.DelegationNonce = protoIdentity.DelegationNonce for idx := range protoIdentity.Flips { i.Flips = append(i.Flips, IdentityFlip{ Cid: protoIdentity.Flips[idx].Cid, @@ -888,6 +892,19 @@ func (s *stateIdentity) SetDelegationNonce(nonce uint32) { s.touch() } +func (s *stateIdentity) Delegatee() *common.Address { + return s.data.Delegatee +} + +func (s *stateIdentity) SetDelegationEpoch(epoch uint16) { + s.data.DelegationEpoch = epoch + s.touch() +} + +func (s *stateIdentity) DelegationEpoch() uint16 { + return s.data.DelegationEpoch +} + func (s *stateGlobal) Epoch() uint16 { return s.data.Epoch } diff --git a/core/state/statedb.go b/core/state/statedb.go index c87438b2..c0d285d8 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -1384,6 +1384,18 @@ func (s *StateDB) SetDelegationNonce(addr common.Address, nonce uint32) { s.GetOrNewIdentityObject(addr).SetDelegationNonce(nonce) } +func (s *StateDB) Delegatee(addr common.Address) *common.Address { + return s.GetOrNewIdentityObject(addr).Delegatee() +} + +func (s *StateDB) SetDelegationEpoch(addr common.Address, epoch uint16) { + s.GetOrNewIdentityObject(addr).SetDelegationEpoch(epoch) +} + +func (s *StateDB) DelegationEpoch(addr common.Address) uint16 { + return s.GetOrNewIdentityObject(addr).DelegationEpoch() +} + type readCloser struct { r io.Reader } diff --git a/core/validators/validators.go b/core/validators/validators.go index 47c3e479..eecfad1c 100644 --- a/core/validators/validators.go +++ b/core/validators/validators.go @@ -110,6 +110,10 @@ func (v *ValidatorsCache) OnlineSize() int { return v.onlineNodesSet.Cardinality() } +func (v *ValidatorsCache) ValidatorsSize() int { + return len(v.sortedValidators) +} + func (v *ValidatorsCache) Contains(addr common.Address) bool { return v.nodesSet.Contains(addr) } diff --git a/protobuf/models.pb.go b/protobuf/models.pb.go index b22172b9..01573f66 100644 --- a/protobuf/models.pb.go +++ b/protobuf/models.pb.go @@ -2329,6 +2329,8 @@ type ProtoStateIdentity struct { ProfileHash []byte `protobuf:"bytes,17,opt,name=profileHash,proto3" json:"profileHash,omitempty"` Scores []byte `protobuf:"bytes,18,opt,name=scores,proto3" json:"scores,omitempty"` Delegatee []byte `protobuf:"bytes,19,opt,name=delegatee,proto3" json:"delegatee,omitempty"` + DelegationNonce uint32 `protobuf:"varint,20,opt,name=delegationNonce,proto3" json:"delegationNonce,omitempty"` + DelegationEpoch uint32 `protobuf:"varint,21,opt,name=delegationEpoch,proto3" json:"delegationEpoch,omitempty"` } func (x *ProtoStateIdentity) Reset() { @@ -2496,6 +2498,20 @@ func (x *ProtoStateIdentity) GetDelegatee() []byte { return nil } +func (x *ProtoStateIdentity) GetDelegationNonce() uint32 { + if x != nil { + return x.DelegationNonce + } + return 0 +} + +func (x *ProtoStateIdentity) GetDelegationEpoch() uint32 { + if x != nil { + return x.DelegationEpoch + } + return 0 +} + type ProtoStateGlobal struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4847,6 +4863,8 @@ type ProtoPredefinedState_Identity struct { ProfileHash []byte `protobuf:"bytes,18,opt,name=profileHash,proto3" json:"profileHash,omitempty"` Scores []byte `protobuf:"bytes,19,opt,name=scores,proto3" json:"scores,omitempty"` Delegatee []byte `protobuf:"bytes,20,opt,name=delegatee,proto3" json:"delegatee,omitempty"` + DelegationNonce uint32 `protobuf:"varint,21,opt,name=delegationNonce,proto3" json:"delegationNonce,omitempty"` + DelegationEpoch uint32 `protobuf:"varint,22,opt,name=delegationEpoch,proto3" json:"delegationEpoch,omitempty"` } func (x *ProtoPredefinedState_Identity) Reset() { @@ -5021,6 +5039,20 @@ func (x *ProtoPredefinedState_Identity) GetDelegatee() []byte { return nil } +func (x *ProtoPredefinedState_Identity) GetDelegationNonce() uint32 { + if x != nil { + return x.DelegationNonce + } + return 0 +} + +func (x *ProtoPredefinedState_Identity) GetDelegationEpoch() uint32 { + if x != nil { + return x.DelegationEpoch + } + return 0 +} + type ProtoPredefinedState_ApprovedIdentity struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -5984,7 +6016,7 @@ var file_protobuf_models_proto_rawDesc = []byte{ 0x61, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x64, 0x65, 0x48, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, 0x64, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x22, 0x99, 0x06, 0x0a, 0x12, 0x50, 0x72, + 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x22, 0xed, 0x06, 0x0a, 0x12, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, @@ -6027,289 +6059,300 @@ var file_protobuf_models_proto_rawDesc = []byte{ 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x65, 0x18, 0x13, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x65, 0x1a, - 0x2c, 0x0a, 0x04, 0x46, 0x6c, 0x69, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x69, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x61, 0x69, 0x72, 0x1a, 0x36, 0x0a, - 0x06, 0x54, 0x78, 0x41, 0x64, 0x64, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xf6, 0x03, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, - 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, - 0x12, 0x2e, 0x0a, 0x12, 0x6e, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x6e, 0x65, - 0x78, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, - 0x12, 0x2a, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, - 0x72, 0x69, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x1e, 0x0a, 0x0a, - 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x0a, 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, - 0x77, 0x6f, 0x72, 0x64, 0x73, 0x53, 0x65, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x09, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x53, 0x65, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x6c, 0x61, - 0x73, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x1e, - 0x0a, 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1c, - 0x0a, 0x09, 0x66, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x09, 0x66, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x32, 0x0a, 0x14, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x65, 0x12, + 0x28, 0x0a, 0x0f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x6e, + 0x63, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x64, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x15, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x0f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x1a, 0x2c, 0x0a, 0x04, 0x46, 0x6c, 0x69, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x63, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x70, 0x61, 0x69, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x61, 0x69, + 0x72, 0x1a, 0x36, 0x0a, 0x06, 0x54, 0x78, 0x41, 0x64, 0x64, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x68, + 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, + 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xf6, 0x03, 0x0a, 0x10, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x12, 0x14, + 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x12, 0x2e, 0x0a, 0x12, 0x6e, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x12, 0x6e, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, + 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x1c, 0x0a, 0x09, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x53, 0x65, 0x65, 0x64, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x09, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x53, 0x65, 0x65, 0x64, 0x12, 0x22, + 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, + 0x6f, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x66, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, + 0x12, 0x32, 0x0a, 0x14, 0x76, 0x72, 0x66, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x54, + 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x76, 0x72, 0x66, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x54, 0x68, 0x72, 0x65, 0x73, - 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x76, 0x72, 0x66, 0x50, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, - 0x12, 0x28, 0x0a, 0x0f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x42, - 0x69, 0x74, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x65, 0x6d, 0x70, 0x74, 0x79, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x42, 0x69, 0x74, 0x73, 0x12, 0x2c, 0x0a, 0x11, 0x67, 0x6f, - 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x18, - 0x0b, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x1d, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x73, 0x43, 0x6e, 0x74, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x43, 0x65, 0x72, 0x65, - 0x6d, 0x6f, 0x6e, 0x69, 0x61, 0x6c, 0x54, 0x78, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x1d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x43, 0x6e, 0x74, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, - 0x74, 0x43, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x69, 0x61, 0x6c, 0x54, 0x78, 0x73, 0x22, 0x6e, - 0x0a, 0x1a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x72, - 0x6f, 0x76, 0x65, 0x64, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, - 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, - 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x6e, 0x6c, 0x69, - 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, - 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x65, 0x22, 0x3e, - 0x0a, 0x1e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, - 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0c, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0xb7, - 0x01, 0x0a, 0x1a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x44, 0x65, 0x6c, - 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x12, 0x4f, 0x0a, - 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x48, - 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, - 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, - 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x64, - 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x65, 0x22, 0xb6, 0x12, 0x0a, 0x14, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x65, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x73, 0x65, 0x65, 0x64, 0x12, 0x3b, 0x0a, 0x06, 0x67, - 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6d, 0x6f, + 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x73, 0x42, 0x69, 0x74, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x65, + 0x6d, 0x70, 0x74, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x42, 0x69, 0x74, 0x73, 0x12, 0x2c, + 0x0a, 0x11, 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x76, 0x69, + 0x74, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x67, 0x6f, 0x64, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x1d, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x43, 0x6e, 0x74, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, + 0x43, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x69, 0x61, 0x6c, 0x54, 0x78, 0x73, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x1d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x43, 0x6e, 0x74, 0x57, 0x69, + 0x74, 0x68, 0x6f, 0x75, 0x74, 0x43, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x69, 0x61, 0x6c, 0x54, + 0x78, 0x73, 0x22, 0x6e, 0x0a, 0x1a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x08, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, + 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6f, 0x6e, + 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x65, 0x22, 0x3e, 0x0a, 0x1e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x77, + 0x69, 0x74, 0x63, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x65, 0x73, 0x22, 0xb7, 0x01, 0x0a, 0x1a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x77, 0x69, 0x74, 0x63, + 0x68, 0x12, 0x4f, 0x0a, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x1a, 0x48, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1c, + 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x65, 0x22, 0x8a, 0x13, 0x0a, + 0x14, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x73, + 0x65, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x73, 0x65, 0x65, 0x64, 0x12, + 0x3b, 0x0a, 0x06, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x23, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, + 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x47, 0x6c, + 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x06, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x12, 0x4d, 0x0a, 0x0c, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x52, 0x0c, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x12, 0x40, 0x0a, 0x08, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, + 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x45, 0x0a, + 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x25, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, + 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x69, 0x65, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, + 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2d, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x41, + 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, + 0x12, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x69, 0x65, 0x73, 0x12, 0x55, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, - 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, - 0x52, 0x06, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x12, 0x4d, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, - 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, - 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x12, 0x40, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6d, 0x6f, 0x64, 0x65, + 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x1a, 0xec, 0x03, 0x0a, 0x06, 0x47, + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x2e, 0x0a, 0x12, 0x6e, + 0x65, 0x78, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x6e, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x6f, 0x64, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x67, 0x6f, 0x64, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x77, 0x6f, 0x72, 0x64, 0x73, + 0x53, 0x65, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x77, 0x6f, 0x72, 0x64, + 0x73, 0x53, 0x65, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x6e, 0x61, + 0x70, 0x73, 0x68, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x6c, 0x61, 0x73, + 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x65, 0x65, + 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x66, 0x65, + 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x32, 0x0a, 0x14, 0x76, 0x72, 0x66, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x76, 0x72, 0x66, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x65, 0x72, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x65, + 0x6d, 0x70, 0x74, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x42, 0x69, 0x74, 0x73, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x73, 0x42, 0x69, 0x74, 0x73, 0x12, 0x2c, 0x0a, 0x11, 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x11, 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x76, 0x69, + 0x74, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x1d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x43, 0x6e, 0x74, + 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x43, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x69, 0x61, + 0x6c, 0x54, 0x78, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x1d, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x73, 0x43, 0x6e, 0x74, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x43, 0x65, 0x72, 0x65, + 0x6d, 0x6f, 0x6e, 0x69, 0x61, 0x6c, 0x54, 0x78, 0x73, 0x1a, 0x2c, 0x0a, 0x0c, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x1a, 0x82, 0x02, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, + 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6e, 0x6f, + 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x6c, + 0x61, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x12, 0x55, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, + 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, - 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, - 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x45, 0x0a, 0x0a, 0x69, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, + 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0c, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x40, 0x0a, 0x0c, 0x43, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, + 0x64, 0x65, 0x48, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, + 0x64, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x1a, 0x9e, 0x07, 0x0a, + 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x6e, 0x76, + 0x69, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x69, 0x6e, 0x76, 0x69, + 0x74, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, + 0x65, 0x64, 0x46, 0x6c, 0x69, 0x70, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x71, + 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x65, 0x64, 0x46, 0x6c, 0x69, 0x70, 0x73, 0x12, 0x28, 0x0a, + 0x0f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x46, 0x6c, 0x69, 0x70, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x46, 0x6c, 0x69, + 0x70, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, + 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, + 0x24, 0x0a, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x46, 0x6c, 0x69, 0x70, 0x73, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, + 0x46, 0x6c, 0x69, 0x70, 0x73, 0x12, 0x40, 0x0a, 0x05, 0x66, 0x6c, 0x69, 0x70, 0x73, 0x18, 0x0a, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x46, 0x6c, 0x69, 0x70, + 0x52, 0x05, 0x66, 0x6c, 0x69, 0x70, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x48, 0x0a, 0x08, 0x69, + 0x6e, 0x76, 0x69, 0x74, 0x65, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x49, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, - 0x12, 0x5d, 0x0a, 0x12, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x49, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6d, - 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, - 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, - 0x76, 0x65, 0x64, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x12, 0x61, 0x70, 0x70, - 0x72, 0x6f, 0x76, 0x65, 0x64, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, - 0x55, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, - 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4b, 0x65, - 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x1a, 0xec, 0x03, 0x0a, 0x06, 0x47, 0x6c, 0x6f, 0x62, 0x61, - 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x2e, 0x0a, 0x12, 0x6e, 0x65, 0x78, 0x74, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x12, 0x6e, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, - 0x69, 0x6f, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x53, 0x65, 0x65, 0x64, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x53, 0x65, 0x65, - 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, - 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x6e, 0x61, - 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, - 0x61, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x66, 0x65, 0x65, 0x50, 0x65, 0x72, - 0x47, 0x61, 0x73, 0x12, 0x32, 0x0a, 0x14, 0x76, 0x72, 0x66, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x65, 0x72, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x14, 0x76, 0x72, 0x66, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x54, 0x68, - 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x65, 0x6d, 0x70, 0x74, 0x79, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x42, 0x69, 0x74, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x0f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x42, 0x69, 0x74, - 0x73, 0x12, 0x2c, 0x0a, 0x11, 0x67, 0x6f, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, - 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x67, 0x6f, - 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x12, - 0x44, 0x0a, 0x1d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x43, 0x6e, 0x74, 0x57, 0x69, 0x74, 0x68, - 0x6f, 0x75, 0x74, 0x43, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x69, 0x61, 0x6c, 0x54, 0x78, 0x73, - 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x1d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x43, 0x6e, - 0x74, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x43, 0x65, 0x72, 0x65, 0x6d, 0x6f, 0x6e, 0x69, - 0x61, 0x6c, 0x54, 0x78, 0x73, 0x1a, 0x2c, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, - 0x77, 0x69, 0x74, 0x63, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x65, 0x73, 0x1a, 0x82, 0x02, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, - 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, - 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, - 0x55, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x40, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x64, 0x65, 0x48, 0x61, - 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, 0x64, 0x65, 0x48, 0x61, - 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x1a, 0xca, 0x06, 0x0a, 0x08, 0x49, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, - 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x12, - 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x65, 0x64, 0x46, 0x6c, - 0x69, 0x70, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x71, 0x75, 0x61, 0x6c, 0x69, - 0x66, 0x69, 0x65, 0x64, 0x46, 0x6c, 0x69, 0x70, 0x73, 0x12, 0x28, 0x0a, 0x0f, 0x73, 0x68, 0x6f, - 0x72, 0x74, 0x46, 0x6c, 0x69, 0x70, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x0f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x46, 0x6c, 0x69, 0x70, 0x50, 0x6f, 0x69, - 0x6e, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x0d, 0x72, - 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x46, 0x6c, 0x69, 0x70, 0x73, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x46, 0x6c, 0x69, 0x70, - 0x73, 0x12, 0x40, 0x0a, 0x05, 0x66, 0x6c, 0x69, 0x70, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x2a, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x49, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x46, 0x6c, 0x69, 0x70, 0x52, 0x05, 0x66, 0x6c, - 0x69, 0x70, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x48, 0x0a, 0x08, 0x69, 0x6e, 0x76, 0x69, 0x74, - 0x65, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6d, 0x6f, 0x64, 0x65, - 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, - 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x2e, 0x54, 0x78, 0x41, 0x64, 0x64, 0x72, 0x52, 0x08, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x65, - 0x73, 0x12, 0x46, 0x0a, 0x07, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x72, 0x18, 0x0e, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x54, 0x78, 0x41, 0x64, 0x64, 0x72, - 0x52, 0x07, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x65, 0x6e, - 0x61, 0x6c, 0x74, 0x79, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x65, 0x6e, 0x61, - 0x6c, 0x74, 0x79, 0x12, 0x26, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x42, 0x69, 0x74, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x11, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x66, 0x69, - 0x6c, 0x65, 0x48, 0x61, 0x73, 0x68, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x70, 0x72, - 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x6f, - 0x72, 0x65, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x72, 0x65, - 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x65, 0x18, 0x14, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x65, 0x1a, - 0x2c, 0x0a, 0x04, 0x46, 0x6c, 0x69, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x69, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x61, 0x69, 0x72, 0x1a, 0x36, 0x0a, - 0x06, 0x54, 0x78, 0x41, 0x64, 0x64, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x1a, 0x7e, 0x0a, 0x10, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, - 0x64, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x12, - 0x16, 0x0a, 0x06, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x06, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, - 0x61, 0x74, 0x65, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x65, 0x1a, 0x3a, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x22, 0x49, 0x0a, 0x1b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x43, 0x61, 0x6c, 0x6c, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, - 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x22, 0x4f, 0x0a, 0x1d, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x61, 0x63, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, - 0x08, 0x43, 0x6f, 0x64, 0x65, 0x48, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x08, 0x43, 0x6f, 0x64, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x22, 0x36, 0x0a, - 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, - 0x04, 0x61, 0x72, 0x67, 0x73, 0x22, 0xa0, 0x03, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x54, - 0x78, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x12, 0x42, 0x0a, 0x08, 0x72, 0x65, 0x63, - 0x65, 0x69, 0x70, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6d, 0x6f, - 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x54, 0x78, 0x52, 0x65, 0x63, 0x65, - 0x69, 0x70, 0x74, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x54, 0x78, 0x52, 0x65, 0x63, 0x65, - 0x69, 0x70, 0x74, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x1a, 0x90, 0x02, - 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x54, 0x78, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, - 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x18, 0x0a, 0x07, - 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, - 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, - 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, - 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x61, - 0x73, 0x43, 0x6f, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x67, 0x61, 0x73, - 0x43, 0x6f, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x3a, 0x0a, 0x06, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6d, - 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x54, 0x78, 0x52, 0x65, 0x63, - 0x65, 0x69, 0x70, 0x74, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x1a, 0x36, 0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x14, - 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x3d, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x54, 0x78, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, + 0x74, 0x69, 0x74, 0x79, 0x2e, 0x54, 0x78, 0x41, 0x64, 0x64, 0x72, 0x52, 0x08, 0x69, 0x6e, 0x76, + 0x69, 0x74, 0x65, 0x65, 0x73, 0x12, 0x46, 0x0a, 0x07, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x72, + 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x54, 0x78, + 0x41, 0x64, 0x64, 0x72, 0x52, 0x07, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x72, 0x12, 0x18, 0x0a, + 0x07, 0x70, 0x65, 0x6e, 0x61, 0x6c, 0x74, 0x79, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, + 0x70, 0x65, 0x6e, 0x61, 0x6c, 0x74, 0x79, 0x12, 0x26, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x12, + 0x2a, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x70, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x48, 0x61, 0x73, 0x68, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, + 0x63, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x64, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x28, 0x0a, + 0x0f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x70, 0x6f, 0x63, 0x68, + 0x18, 0x16, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x1a, 0x2c, 0x0a, 0x04, 0x46, 0x6c, 0x69, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x63, 0x69, - 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0xe2, 0x01, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x44, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x54, 0x78, 0x73, 0x12, 0x3a, 0x0a, 0x03, - 0x54, 0x78, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6d, 0x6f, 0x64, 0x65, - 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x44, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, - 0x54, 0x78, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x44, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, - 0x64, 0x54, 0x78, 0x52, 0x03, 0x54, 0x78, 0x73, 0x1a, 0x91, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x44, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x54, 0x78, 0x12, 0x12, 0x0a, 0x04, - 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, - 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x74, 0x6f, - 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x70, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x04, 0x74, 0x69, 0x70, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x57, 0x0a, 0x0f, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x61, 0x76, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, - 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, - 0x04, 0x61, 0x72, 0x67, 0x73, 0x22, 0x99, 0x01, 0x0a, 0x11, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x55, - 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x40, 0x0a, 0x05, 0x76, - 0x6f, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6d, 0x6f, 0x64, - 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, - 0x56, 0x6f, 0x74, 0x65, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x55, 0x70, 0x67, 0x72, 0x61, - 0x64, 0x65, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x1a, 0x42, 0x0a, - 0x10, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x56, 0x6f, 0x74, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x70, 0x67, 0x72, 0x61, - 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, - 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x69, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x04, 0x70, 0x61, 0x69, 0x72, 0x1a, 0x36, 0x0a, 0x06, 0x54, 0x78, 0x41, 0x64, 0x64, 0x72, 0x12, + 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, + 0x61, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x1a, 0x7e, 0x0a, + 0x10, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x61, + 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x61, + 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x12, + 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x65, 0x1a, 0x3a, 0x0a, + 0x10, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x49, 0x0a, 0x1b, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x43, 0x61, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x74, + 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, + 0x61, 0x72, 0x67, 0x73, 0x22, 0x4f, 0x0a, 0x1d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x44, 0x65, 0x70, + 0x6c, 0x6f, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, + 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x6f, 0x64, 0x65, 0x48, 0x61, 0x73, + 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x43, 0x6f, 0x64, 0x65, 0x48, 0x61, 0x73, + 0x68, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, + 0x04, 0x61, 0x72, 0x67, 0x73, 0x22, 0x36, 0x0a, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x54, 0x65, + 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, + 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x22, 0xa0, 0x03, + 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x54, 0x78, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, + 0x73, 0x12, 0x42, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x54, 0x78, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x2e, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x54, 0x78, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x52, 0x08, 0x72, 0x65, 0x63, + 0x65, 0x69, 0x70, 0x74, 0x73, 0x1a, 0x90, 0x02, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x54, + 0x78, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, + 0x0a, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x14, 0x0a, 0x05, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x61, 0x73, 0x43, 0x6f, 0x73, 0x74, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x07, 0x67, 0x61, 0x73, 0x43, 0x6f, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x74, 0x78, + 0x48, 0x61, 0x73, 0x68, 0x12, 0x3a, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x08, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x54, 0x78, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x2e, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x1a, 0x36, 0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x22, 0x3d, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x54, 0x78, 0x52, 0x65, 0x63, 0x65, 0x69, + 0x70, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, + 0xe2, 0x01, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x44, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, + 0x64, 0x54, 0x78, 0x73, 0x12, 0x3a, 0x0a, 0x03, 0x54, 0x78, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x28, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x44, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x54, 0x78, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x44, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x54, 0x78, 0x52, 0x03, 0x54, 0x78, 0x73, + 0x1a, 0x91, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x44, 0x65, 0x66, 0x65, 0x72, 0x72, + 0x65, 0x64, 0x54, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, + 0x70, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x74, 0x69, 0x70, 0x73, 0x12, 0x14, + 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x57, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x61, 0x76, + 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x22, 0x99, 0x01, + 0x0a, 0x11, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x56, 0x6f, + 0x74, 0x65, 0x73, 0x12, 0x40, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x2e, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x05, + 0x76, 0x6f, 0x74, 0x65, 0x73, 0x1a, 0x42, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x55, 0x70, + 0x67, 0x72, 0x61, 0x64, 0x65, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x6f, 0x74, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, + 0x18, 0x0a, 0x07, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x07, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/protobuf/models.proto b/protobuf/models.proto index 81097bc9..1c6d36e6 100644 --- a/protobuf/models.proto +++ b/protobuf/models.proto @@ -353,6 +353,8 @@ message ProtoStateIdentity { bytes profileHash = 17; bytes scores = 18; bytes delegatee = 19; + uint32 delegationNonce = 20; + uint32 delegationEpoch = 21; } message ProtoStateGlobal { @@ -454,6 +456,8 @@ message ProtoPredefinedState { bytes profileHash = 18; bytes scores = 19; bytes delegatee = 20; + uint32 delegationNonce = 21; + uint32 delegationEpoch = 22; } message ApprovedIdentity { From 4a103197c2fcaac40bb601722569b609d5f184d9 Mon Sep 17 00:00:00 2001 From: sidenaio Date: Tue, 16 Feb 2021 14:47:19 +0500 Subject: [PATCH 04/15] Add APIs --- api/blockchain_api.go | 3 +++ api/dna_api.go | 41 +++++++++++++++++++++++++++++++++++ core/upgrade/upgrader_test.go | 16 +++++++------- 3 files changed, 52 insertions(+), 8 deletions(-) diff --git a/api/blockchain_api.go b/api/blockchain_api.go index 71bd9587..0facb086 100644 --- a/api/blockchain_api.go +++ b/api/blockchain_api.go @@ -37,6 +37,9 @@ var ( types.DeployContract: "deployContract", types.CallContract: "callContract", types.TerminateContract: "terminateContract", + types.DelegateTx: "delegate", + types.UndelegateTx: "undelegate", + types.KillDelegatorTx: "killDelegator", } ) diff --git a/api/dna_api.go b/api/dna_api.go index ea02c84d..29ec2088 100644 --- a/api/dna_api.go +++ b/api/dna_api.go @@ -96,6 +96,16 @@ type ActivateInviteArgs struct { BaseTxArgs } +type DelegateTxArgs struct { + To *common.Address `json:"to"` + BaseTxArgs +} + +type KillDelegatorTxArgs struct { + To *common.Address `json:"to"` + BaseTxArgs +} + type Invite struct { Hash common.Hash `json:"hash"` Receiver common.Address `json:"receiver"` @@ -186,6 +196,37 @@ func (api *DnaApi) BecomeOffline(ctx context.Context, args BaseTxArgs) (common.H return hash, nil } +func (api *DnaApi) Delegate(ctx context.Context, args DelegateTxArgs) (common.Hash, error) { + from := api.baseApi.getCurrentCoinbase() + hash, err := api.baseApi.sendTx(ctx, from, args.To, types.DelegateTx, decimal.Zero, decimal.Zero, decimal.Zero, args.Nonce, args.Epoch, nil, nil) + + if err != nil { + return common.Hash{}, err + } + + return hash, nil +} + +func (api *DnaApi) Undelegate(ctx context.Context, args BaseTxArgs) (common.Hash, error) { + from := api.baseApi.getCurrentCoinbase() + hash, err := api.baseApi.sendTx(ctx, from, nil, types.UndelegateTx, decimal.Zero, decimal.Zero, decimal.Zero, args.Nonce, args.Epoch, nil, nil) + + if err != nil { + return common.Hash{}, err + } + return hash, nil +} + +func (api *DnaApi) KillDelegator(ctx context.Context, args KillDelegatorTxArgs) (common.Hash, error) { + from := api.baseApi.getCurrentCoinbase() + hash, err := api.baseApi.sendTx(ctx, from, args.To, types.KillDelegatorTx, decimal.Zero, decimal.Zero, decimal.Zero, args.Nonce, args.Epoch, nil, nil) + + if err != nil { + return common.Hash{}, err + } + return hash, nil +} + func (api *DnaApi) SendTransaction(ctx context.Context, args SendTxArgs) (common.Hash, error) { var payload []byte diff --git a/core/upgrade/upgrader_test.go b/core/upgrade/upgrader_test.go index 5f39dd09..10309893 100644 --- a/core/upgrade/upgrader_test.go +++ b/core/upgrade/upgrader_test.go @@ -9,17 +9,17 @@ import ( func TestUpgrader_RevertConfig(t *testing.T) { cfg := &config.Config{ - Consensus: config.ConsensusVersions[config.ConsensusV1], + Consensus: config.ConsensusVersions[config.ConsensusV3], } upgrader := NewUpgrader(cfg, nil, nil) - prevConfig := upgrader.UpgradeConfigTo(uint32(config.ConsensusV2)) - require.Equal(t, config.ConsensusV2, cfg.Consensus.Version) - require.Equal(t, config.ConsensusV1, prevConfig.Version) - require.True(t, cfg.Consensus.HumanCanFailLongSession) - require.False(t, prevConfig.HumanCanFailLongSession) + prevConfig := upgrader.UpgradeConfigTo(uint32(config.ConsensusV4)) + require.Equal(t, config.ConsensusV4, cfg.Consensus.Version) + require.Equal(t, config.ConsensusV3, prevConfig.Version) + require.True(t, cfg.Consensus.EnablePools) + require.False(t, prevConfig.EnablePools) upgrader.RevertConfig(prevConfig) - require.Equal(t, config.ConsensusV1, cfg.Consensus.Version) - require.False(t, cfg.Consensus.HumanCanFailLongSession) + require.Equal(t, config.ConsensusV3, cfg.Consensus.Version) + require.False(t, cfg.Consensus.EnablePools) } From ba75108fd4518155793d31c2d543179192fbe0bd Mon Sep 17 00:00:00 2001 From: sidenaio Date: Thu, 25 Feb 2021 19:10:49 +0500 Subject: [PATCH 05/15] add fixes and tests --- api/dna_api.go | 6 +++ blockchain/blockchain.go | 4 +- blockchain/blockchain_test.go | 38 +++++++++++++ config/consensus.go | 2 +- core/ceremony/ceremony.go | 10 +++- core/ceremony/ceremony_test.go | 6 ++- core/state/state_object.go | 4 ++ core/state/statedb.go | 32 +++++++++-- core/state/statedb_test.go | 12 +++++ core/validators/validators.go | 86 +++++++++++++++++------------- core/validators/validators_test.go | 81 +++++++++++++++++++++++++--- 11 files changed, 225 insertions(+), 56 deletions(-) diff --git a/api/dna_api.go b/api/dna_api.go index 29ec2088..c945e67b 100644 --- a/api/dna_api.go +++ b/api/dna_api.go @@ -269,6 +269,9 @@ type Identity struct { Invitees []state.TxAddr `json:"invitees"` Penalty decimal.Decimal `json:"penalty"` LastValidationFlags []string `json:"lastValidationFlags"` + Delegatee *common.Address `json:"delegatee"` + DelegationEpoch uint16 `json:"delegationEpoch"` + DelegationNonce uint32 `json:"delegationNonce"` } func (api *DnaApi) Identities() []Identity { @@ -414,6 +417,9 @@ func convertIdentity(currentEpoch uint16, address common.Address, data state.Ide Invitees: invitees, Penalty: blockchain.ConvertToFloat(data.Penalty), LastValidationFlags: flags, + Delegatee: data.Delegatee, + DelegationEpoch: data.DelegationEpoch, + DelegationNonce: data.DelegationNonce, } } diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index b9f16f61..aa2d7cd2 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -465,10 +465,10 @@ func (chain *Blockchain) applyBlockAndTxsOnState( func (chain *Blockchain) applyBlockOnState(appState *appstate.AppState, block *types.Block, prevBlock *types.Header, totalFee, totalTips *big.Int, usedGas uint64, statsCollector collector.StatsCollector) (root, identityRoot common.Hash, diff *state.IdentityStateDiff) { - chain.applyNewEpoch(appState, block, statsCollector) - chain.applyBlockRewards(totalFee, totalTips, appState, block, prevBlock, statsCollector) chain.applyStatusSwitch(appState, block) chain.applyDelegationSwitch(appState, block) + chain.applyNewEpoch(appState, block, statsCollector) + chain.applyBlockRewards(totalFee, totalTips, appState, block, prevBlock, statsCollector) chain.applyGlobalParams(appState, block, statsCollector) chain.applyNextBlockFee(appState, block, usedGas) chain.applyVrfProposerThreshold(appState, block) diff --git a/blockchain/blockchain_test.go b/blockchain/blockchain_test.go index 884d8351..7613f6fe 100644 --- a/blockchain/blockchain_test.go +++ b/blockchain/blockchain_test.go @@ -6,13 +6,16 @@ import ( "github.com/idena-network/idena-go/blockchain/types" "github.com/idena-network/idena-go/blockchain/validation" "github.com/idena-network/idena-go/common" + "github.com/idena-network/idena-go/common/eventbus" "github.com/idena-network/idena-go/common/math" "github.com/idena-network/idena-go/config" + "github.com/idena-network/idena-go/core/appstate" "github.com/idena-network/idena-go/core/state" "github.com/idena-network/idena-go/crypto" "github.com/idena-network/idena-go/tests" "github.com/shopspring/decimal" "github.com/stretchr/testify/require" + dbm "github.com/tendermint/tm-db" "math/big" "testing" "time" @@ -842,3 +845,38 @@ func Test_ClearDustAccounts(t *testing.T) { require.False(s.State.AccountExists(common.Address{0x7})) require.True(s.State.AccountExists(common.Address{0x8})) } + +func TestBlockchain_applyOfflinePenalty(t *testing.T) { + chain := &Blockchain{ + config: &config.Config{ + Consensus: config.GetDefaultConsensusConfig(), + }, + } + + chain.config.Consensus.FinalCommitteeReward = big.NewInt(1) + chain.config.Consensus.BlockReward = big.NewInt(3) + + db := dbm.NewMemDB() + bus := eventbus.New() + appState, _ := appstate.NewAppState(db, bus) + + count := byte(10) + pool1 := common.Address{0x11} + + for i := byte(1); i <= count; i++ { + addr := common.Address{i} + appState.IdentityState.Add(addr) + appState.IdentityState.SetOnline(addr, true) + if i % 3 == 0 { // 3, 6, 9 + appState.IdentityState.SetDelegatee(addr, pool1) + } + } + appState.Commit(nil) + appState.Initialize(1) + + require.True(t, appState.ValidatorsCache.IsPool(pool1)) + + chain.applyOfflinePenalty(appState, pool1, nil) + + require.Equal(t, big.NewInt(4 * 3 * 1800 / int64(count)).Bytes(), appState.State.GetPenalty(pool1).Bytes()) +} diff --git a/config/consensus.go b/config/consensus.go index 5a1493f0..18823bfd 100644 --- a/config/consensus.go +++ b/config/consensus.go @@ -122,5 +122,5 @@ func ApplyConsensusVersion(ver ConsensusVerson, cfg *ConsensusConf) { } func GetDefaultConsensusConfig() *ConsensusConf { - return &v3 + return &v4 } diff --git a/core/ceremony/ceremony.go b/core/ceremony/ceremony.go index 30dada10..21c89d59 100644 --- a/core/ceremony/ceremony.go +++ b/core/ceremony/ceremony.go @@ -105,6 +105,7 @@ type cacheValue struct { shortFlipPoint float32 birthday uint16 missed bool + delegatee *common.Address } type lottery struct { @@ -837,8 +838,13 @@ func applyOnState(appState *appstate.AppState, statsCollector collector.StatsCol appState.State.SetBirthday(addr, value.birthday) if value.state == state.Verified && value.prevState == state.Newbie { addToBalance := math.ToInt(decimal.NewFromBigInt(appState.State.GetStakeBalance(addr), 0).Mul(decimal.NewFromFloat(common.StakeToBalanceCoef))) + //TODO :fix indexing collector.BeginVerifiedStakeTransferBalanceUpdate(statsCollector, addr, appState) - appState.State.AddBalance(addr, addToBalance) + addTo := addr + if value.delegatee != nil { + addTo = *value.delegatee + } + appState.State.AddBalance(addTo, addToBalance) appState.State.SubStake(addr, addToBalance) collector.CompleteBalanceUpdate(statsCollector, appState) } @@ -957,6 +963,7 @@ func (vc *ValidationCeremony) ApplyNewEpoch(height uint64, appState *appstate.Ap shortFlipPoint: shortFlipPoint, birthday: identityBirthday, missed: missed, + delegatee: identity.Delegatee, } epochApplyingValues[addr] = value @@ -1009,6 +1016,7 @@ func (vc *ValidationCeremony) ApplyNewEpoch(height uint64, appState *appstate.Ap shortQualifiedFlipsCount: 0, shortFlipPoint: 0, birthday: identityBirthday, + delegatee: identity.Delegatee, } epochApplyingValues[addr] = value identitiesCount += applyOnState(appState, statsCollector, addr, value) diff --git a/core/ceremony/ceremony_test.go b/core/ceremony/ceremony_test.go index 8624d8de..cc901e02 100644 --- a/core/ceremony/ceremony_test.go +++ b/core/ceremony/ceremony_test.go @@ -659,7 +659,7 @@ func Test_applyOnState(t *testing.T) { appstate, _ := appstate.NewAppState(db, eventbus.New()) addr1 := common.Address{0x1} - + delegatee := common.Address{0x2} appstate.State.SetState(addr1, state.Newbie) appstate.State.AddStake(addr1, big.NewInt(100)) appstate.State.AddBalance(addr1, big.NewInt(10)) @@ -671,13 +671,15 @@ func Test_applyOnState(t *testing.T) { shortFlipPoint: 1, shortQualifiedFlipsCount: 2, state: state.Verified, + delegatee: &delegatee, }) identity := appstate.State.GetIdentity(addr1) require.Equal(t, 1, identities) require.Equal(t, state.Verified, identity.State) require.Equal(t, uint16(3), identity.Birthday) require.Equal(t, []byte{common.EncodeScore(5, 6), common.EncodeScore(1, 2)}, identity.Scores) - require.True(t, appstate.State.GetBalance(addr1).Cmp(big.NewInt(85)) == 0) + require.True(t, appstate.State.GetBalance(delegatee).Cmp(big.NewInt(75)) == 0) + require.True(t, appstate.State.GetBalance(addr1).Cmp(big.NewInt(10)) == 0) require.True(t, appstate.State.GetStakeBalance(addr1).Cmp(big.NewInt(25)) == 0) applyOnState(appstate, collector.NewStatsCollector(), addr1, cacheValue{ diff --git a/core/state/state_object.go b/core/state/state_object.go index e9622fa0..02a2af40 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -1180,6 +1180,10 @@ func (s *stateDelegationSwitch) DelegationSwitch(sender common.Address) *Delegat return nil } +func (s *stateDelegationSwitch) empty() bool { + return len(s.data.Delegations) == 0 +} + func (f ValidationStatusFlag) HasFlag(flag ValidationStatusFlag) bool { return f&flag != 0 } diff --git a/core/state/statedb.go b/core/state/statedb.go index c0d285d8..ae71bd33 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -168,6 +168,8 @@ func (s *StateDB) Clear() { s.stateGlobalDirty = false s.stateStatusSwitch = nil s.stateStatusSwitchDirty = false + s.stateDelegationSwitch = nil + s.stateDelegationSwitchDirty = false } func (s *StateDB) Version() int64 { @@ -551,6 +553,15 @@ func (s *StateDB) updateStateStatusSwitchObject(stateObject *stateStatusSwitch) s.tree.Set(StateDbKeys.StatusSwitchKey(), data) } +func (s *StateDB) updateStateDelegationSwitchObject(stateObject *stateDelegationSwitch) { + data, err := stateObject.data.ToBytes() + if err != nil { + panic(fmt.Errorf("can't encode state delegation switch object, %v", err)) + } + + s.tree.Set(StateDbKeys.DelegationSwitchKey(), data) +} + // deleteStateAccountObject removes the given object from the state trie. func (s *StateDB) deleteStateAccountObject(stateObject *stateAccount) { stateObject.deleted = true @@ -573,6 +584,12 @@ func (s *StateDB) deleteStateStatusSwitchObject(stateObject *stateStatusSwitch) s.tree.Remove(StateDbKeys.StatusSwitchKey()) } +func (s *StateDB) deleteStateDelegationSwitchObject(stateObject *stateDelegationSwitch) { + stateObject.deleted = true + + s.tree.Remove(StateDbKeys.DelegationSwitchKey()) +} + // Retrieve a state account given my the address. Returns nil if not found. func (s *StateDB) getStateAccount(addr common.Address) (stateObject *stateAccount) { // Prefer 'live' objects. @@ -949,6 +966,14 @@ func (s *StateDB) Precommit(deleteEmptyObjects bool) { } s.stateStatusSwitchDirty = false } + if s.stateDelegationSwitchDirty { + if s.stateDelegationSwitch.empty() { + s.deleteStateDelegationSwitchObject(s.stateDelegationSwitch) + } else { + s.updateStateDelegationSwitchObject(s.stateDelegationSwitch) + } + s.stateDelegationSwitchDirty = false + } } func (s *StateDB) Reset() { @@ -1208,7 +1233,7 @@ func (s *StateDB) SetPredefinedIdentities(state *models.ProtoPredefinedState) { Address: common.BytesToAddress(identity.Inviter.Address), } } - if identity.Delegatee !=nil { + if identity.Delegatee != nil { addr := common.BytesToAddress(identity.Delegatee) stateObject.data.Delegatee = &addr } @@ -1234,8 +1259,6 @@ func (s *StateDB) HasStatusSwitchAddresses(addr common.Address) bool { return statusSwitch.HasAddress(addr) } - - func (s *StateDB) StatusSwitchAddresses() []common.Address { statusSwitch := s.GetOrNewStatusSwitchObject() return statusSwitch.Addresses() @@ -1256,12 +1279,11 @@ func (s *StateDB) ToggleDelegationAddress(sender common.Address, delegatee commo delegationSwitch.ToggleDelegation(sender, delegatee) } -func (s *StateDB) DelegationSwitch(sender common.Address) *Delegation{ +func (s *StateDB) DelegationSwitch(sender common.Address) *Delegation { delegationSwitch := s.GetOrNewDelegationSwitchObject() return delegationSwitch.DelegationSwitch(sender) } - func (s *StateDB) ClearDelegations() { statusSwitch := s.GetOrNewDelegationSwitchObject() statusSwitch.Clear() diff --git a/core/state/statedb_test.go b/core/state/statedb_test.go index ca5768c2..175b8629 100644 --- a/core/state/statedb_test.go +++ b/core/state/statedb_test.go @@ -486,3 +486,15 @@ func TestStateDB_IterateContractStore(t *testing.T) { require.Equal(t, len(addr1Values), len(iterated)) require.Equal(t, addr1Values, iterated) } + + +func TestAAA(t *testing.T) { + data1 := []byte{10, 9, 10, 147, 247, 153, 91, 236, 16, 0, 0, 32, 7, 58, 65, 4, 218, 240, 136, 202, 167, 186, 132, 61, 191, 176, 72, 35, 197, 54, 195, 147, 183, 42, 27, 152, 176, 18, 178, 174, 40, 186, 71, 205, 184, 152, 123, 160, 166, 17, 88, 152, 71, 63, 7, 50, 219, 125, 150, 192, 29, 215, 39, 151, 214, 44, 245, 104, 15, 19, 78, 229, 36, 26, 19, 100, 134, 174, 149, 4, 64, 3, 74, 38, 10, 36, 1, 85, 18, 32, 54, 125, 26, 57, 207, 98, 50, 198, 182, 40, 9, 114, 14, 244, 92, 176, 23, 114, 28, 54, 21, 99, 93, 245, 111, 241, 245, 230, 36, 153, 217, 28, 80, 1, 90, 12, 2, 141, 60, 249, 54, 26, 72, 38, 107, 172, 50, 53, 98, 56, 10, 32, 151, 245, 123, 138, 228, 101, 76, 180, 227, 55, 228, 250, 36, 52, 180, 42, 194, 92, 235, 248, 233, 37, 53, 116, 217, 119, 232, 21, 83, 176, 242, 232, 18, 20, 47, 62, 202, 28, 183, 32, 48, 137, 213, 70, 242, 188, 238, 215, 223, 169, 194, 69, 163, 30, 98, 56, 10, 32, 197, 159, 60, 133, 40, 212, 208, 67, 141, 40, 144, 249, 133, 133, 231, 234, 209, 6, 144, 41, 103, 1, 78, 83, 208, 97, 5, 224, 45, 217, 237, 226, 18, 20, 92, 49, 101, 43, 69, 175, 78, 114, 49, 103, 53, 116, 71, 98, 4, 255, 173, 235, 146, 32, 98, 56, 10, 32, 219, 219, 54, 83, 123, 78, 187, 191, 37, 25, 116, 53, 208, 190, 184, 142, 246, 130, 117, 120, 181, 195, 239, 216, 140, 186, 189, 44, 77, 72, 228, 167, 18, 20, 169, 94, 143, 234, 188, 112, 211, 61, 126, 0, 4, 105, 92, 27, 252, 30, 83, 114, 220, 129, 98, 56, 10, 32, 131, 157, 184, 227, 184, 46, 13, 253, 171, 165, 236, 42, 81, 55, 80, 116, 106, 247, 134, 104, 244, 61, 70, 103, 105, 59, 25, 118, 114, 85, 177, 221, 18, 20, 98, 94, 177, 64, 21, 47, 109, 111, 62, 160, 101, 170, 194, 207, 228, 30, 213, 103, 72, 139, 98, 56, 10, 32, 193, 180, 72, 15, 29, 28, 127, 212, 196, 223, 233, 233, 219, 143, 223, 224, 116, 135, 169, 224, 151, 245, 191, 125, 191, 33, 132, 196, 46, 6, 83, 34, 18, 20, 125, 206, 53, 134, 93, 159, 40, 37, 221, 92, 175, 66, 114, 206, 183, 148, 41, 42, 55, 23, 98, 56, 10, 32, 158, 151, 174, 104, 126, 40, 192, 211, 183, 210, 201, 108, 237, 34, 209, 39, 233, 57, 183, 78, 181, 211, 212, 12, 238, 26, 216, 120, 89, 135, 67, 201, 18, 20, 86, 69, 58, 228, 189, 33, 228, 112, 240, 241, 9, 8, 86, 23, 120, 21, 203, 44, 158, 154, 98, 56, 10, 32, 83, 141, 194, 129, 115, 175, 100, 132, 150, 137, 178, 252, 112, 124, 169, 217, 207, 29, 128, 38, 31, 56, 185, 19, 114, 131, 219, 142, 74, 47, 168, 101, 18, 20, 148, 120, 187, 126, 160, 30, 126, 201, 131, 179, 147, 190, 101, 62, 153, 253, 1, 34, 186, 210, 98, 56, 10, 32, 151, 33, 187, 16, 129, 50, 185, 246, 119, 233, 124, 116, 149, 111, 206, 54, 15, 81, 51, 110, 240, 129, 170, 205, 83, 242, 30, 215, 48, 254, 180, 20, 18, 20, 167, 32, 158, 184, 92, 207, 154, 1, 166, 146, 243, 122, 203, 238, 101, 97, 93, 119, 236, 178, 98, 56, 10, 32, 193, 188, 39, 87, 56, 252, 198, 239, 55, 232, 203, 30, 138, 247, 201, 36, 77, 111, 159, 50, 167, 23, 70, 10, 55, 111, 97, 114, 162, 2, 154, 65, 18, 20, 11, 253, 110, 58, 97, 138, 168, 29, 139, 21, 157, 161, 103, 244, 145, 124, 69, 129, 229, 37, 98, 56, 10, 32, 82, 247, 199, 179, 124, 77, 126, 40, 7, 214, 108, 62, 142, 242, 245, 100, 58, 127, 251, 102, 67, 192, 210, 37, 94, 223, 193, 4, 90, 102, 100, 220, 18, 20, 53, 2, 141, 60, 249, 54, 26, 72, 38, 107, 172, 50, 98, 14, 86, 206, 141, 161, 231, 155, 106, 56, 10, 32, 82, 247, 199, 179, 124, 77, 126, 40, 7, 214, 108, 62, 142, 242, 245, 100, 58, 127, 251, 102, 67, 192, 210, 37, 94, 223, 193, 4, 90, 102, 100, 220, 18, 20, 53, 2, 141, 60, 249, 54, 26, 72, 38, 107, 172, 50, 98, 14, 86, 206, 141, 161, 231, 155, 146, 1, 1, 33} + data2 := []byte{10, 9, 10, 147, 247, 153, 91, 236, 16, 0, 0, 32, 7, 58, 65, 4, 218, 240, 136, 202, 167, 186, 132, 61, 191, 176, 72, 35, 197, 54, 195, 147, 183, 42, 27, 152, 176, 18, 178, 174, 40, 186, 71, 205, 184, 152, 123, 160, 166, 17, 88, 152, 71, 63, 7, 50, 219, 125, 150, 192, 29, 215, 39, 151, 214, 44, 245, 104, 15, 19, 78, 229, 36, 26, 19, 100, 134, 174, 149, 4, 64, 3, 74, 38, 10, 36, 1, 85, 18, 32, 54, 125, 26, 57, 207, 98, 50, 198, 182, 40, 9, 114, 14, 244, 92, 176, 23, 114, 28, 54, 21, 99, 93, 245, 111, 241, 245, 230, 36, 153, 217, 28, 80, 1, 90, 12, 2, 141, 60, 249, 54, 26, 72, 38, 107, 172, 50, 53, 98, 56, 10, 32, 151, 245, 123, 138, 228, 101, 76, 180, 227, 55, 228, 250, 36, 52, 180, 42, 194, 92, 235, 248, 233, 37, 53, 116, 217, 119, 232, 21, 83, 176, 242, 232, 18, 20, 47, 62, 202, 28, 183, 32, 48, 137, 213, 70, 242, 188, 238, 215, 223, 169, 194, 69, 163, 30, 98, 56, 10, 32, 197, 159, 60, 133, 40, 212, 208, 67, 141, 40, 144, 249, 133, 133, 231, 234, 209, 6, 144, 41, 103, 1, 78, 83, 208, 97, 5, 224, 45, 217, 237, 226, 18, 20, 92, 49, 101, 43, 69, 175, 78, 114, 49, 103, 53, 116, 71, 98, 4, 255, 173, 235, 146, 32, 98, 56, 10, 32, 219, 219, 54, 83, 123, 78, 187, 191, 37, 25, 116, 53, 208, 190, 184, 142, 246, 130, 117, 120, 181, 195, 239, 216, 140, 186, 189, 44, 77, 72, 228, 167, 18, 20, 169, 94, 143, 234, 188, 112, 211, 61, 126, 0, 4, 105, 92, 27, 252, 30, 83, 114, 220, 129, 98, 56, 10, 32, 131, 157, 184, 227, 184, 46, 13, 253, 171, 165, 236, 42, 81, 55, 80, 116, 106, 247, 134, 104, 244, 61, 70, 103, 105, 59, 25, 118, 114, 85, 177, 221, 18, 20, 98, 94, 177, 64, 21, 47, 109, 111, 62, 160, 101, 170, 194, 207, 228, 30, 213, 103, 72, 139, 98, 56, 10, 32, 193, 180, 72, 15, 29, 28, 127, 212, 196, 223, 233, 233, 219, 143, 223, 224, 116, 135, 169, 224, 151, 245, 191, 125, 191, 33, 132, 196, 46, 6, 83, 34, 18, 20, 125, 206, 53, 134, 93, 159, 40, 37, 221, 92, 175, 66, 114, 206, 183, 148, 41, 42, 55, 23, 98, 56, 10, 32, 158, 151, 174, 104, 126, 40, 192, 211, 183, 210, 201, 108, 237, 34, 209, 39, 233, 57, 183, 78, 181, 211, 212, 12, 238, 26, 216, 120, 89, 135, 67, 201, 18, 20, 86, 69, 58, 228, 189, 33, 228, 112, 240, 241, 9, 8, 86, 23, 120, 21, 203, 44, 158, 154, 98, 56, 10, 32, 83, 141, 194, 129, 115, 175, 100, 132, 150, 137, 178, 252, 112, 124, 169, 217, 207, 29, 128, 38, 31, 56, 185, 19, 114, 131, 219, 142, 74, 47, 168, 101, 18, 20, 148, 120, 187, 126, 160, 30, 126, 201, 131, 179, 147, 190, 101, 62, 153, 253, 1, 34, 186, 210, 98, 56, 10, 32, 151, 33, 187, 16, 129, 50, 185, 246, 119, 233, 124, 116, 149, 111, 206, 54, 15, 81, 51, 110, 240, 129, 170, 205, 83, 242, 30, 215, 48, 254, 180, 20, 18, 20, 167, 32, 158, 184, 92, 207, 154, 1, 166, 146, 243, 122, 203, 238, 101, 97, 93, 119, 236, 178, 98, 56, 10, 32, 193, 188, 39, 87, 56, 252, 198, 239, 55, 232, 203, 30, 138, 247, 201, 36, 77, 111, 159, 50, 167, 23, 70, 10, 55, 111, 97, 114, 162, 2, 154, 65, 18, 20, 11, 253, 110, 58, 97, 138, 168, 29, 139, 21, 157, 161, 103, 244, 145, 124, 69, 129, 229, 37, 98, 56, 10, 32, 82, 247, 199, 179, 124, 77, 126, 40, 7, 214, 108, 62, 142, 242, 245, 100, 58, 127, 251, 102, 67, 192, 210, 37, 94, 223, 193, 4, 90, 102, 100, 220, 18, 20, 53, 2, 141, 60, 249, 54, 26, 72, 38, 107, 172, 50, 98, 14, 86, 206, 141, 161, 231, 155, 106, 56, 10, 32, 82, 247, 199, 179, 124, 77, 126, 40, 7, 214, 108, 62, 142, 242, 245, 100, 58, 127, 251, 102, 67, 192, 210, 37, 94, 223, 193, 4, 90, 102, 100, 220, 18, 20, 53, 2, 141, 60, 249, 54, 26, 72, 38, 107, 172, 50, 98, 14, 86, 206, 141, 161, 231, 155, 146, 1, 1, 33, 160, 1, 1} + + identity1 := Identity{} + identity1.FromBytes(data1) + + identity2 := Identity{} + identity2.FromBytes(data2) +} diff --git a/core/validators/validators.go b/core/validators/validators.go index eecfad1c..e39f1e53 100644 --- a/core/validators/validators.go +++ b/core/validators/validators.go @@ -19,7 +19,7 @@ type ValidatorsCache struct { identityState *state.IdentityStateDB sortedValidators []common.Address - pools map[common.Address][]common.Address + pools map[common.Address]*sortedAddresses delegations map[common.Address]common.Address nodesSet mapset.Set @@ -37,7 +37,7 @@ func NewValidatorsCache(identityState *state.IdentityStateDB, godAddress common. onlineNodesSet: mapset.NewSet(), log: log.New(), god: godAddress, - pools: map[common.Address][]common.Address{}, + pools: map[common.Address]*sortedAddresses{}, delegations: map[common.Address]common.Address{}, } } @@ -49,25 +49,17 @@ func (v *ValidatorsCache) Load() { v.loadValidNodes() } -func (v *ValidatorsCache) replaceByDelegatee(set mapset.Set) (netSet mapset.Set, votePowers map[common.Address]int) { +func (v *ValidatorsCache) replaceByDelegatee(set mapset.Set) (netSet mapset.Set) { mapped := mapset.NewSet() - votePowers = make(map[common.Address]int) for _, item := range set.ToSlice() { addr := item.(common.Address) if d, ok := v.delegations[addr]; ok { mapped.Add(d) - votePowers[d] ++ } else { mapped.Add(addr) } } - // increment votePowers for pools which address is in original set, those pools are approved identities - for addr := range votePowers { - if set.Contains(addr) { - votePowers[addr] ++ - } - } - return mapped, votePowers + return mapped } func (v *ValidatorsCache) GetOnlineValidators(seed types.Seed, round uint64, step uint8, limit int) *StepValidators { @@ -81,8 +73,8 @@ func (v *ValidatorsCache) GetOnlineValidators(seed types.Seed, round uint64, ste for _, n := range v.sortedValidators { set.Add(n) } - newSet, votePowers := v.replaceByDelegatee(set) - return &StepValidators{Original: set, Addresses: newSet, ExtraVotePowers: votePowers, Size: newSet.Cardinality()} + newSet := v.replaceByDelegatee(set) + return &StepValidators{Original: set, Addresses: newSet, Size: newSet.Cardinality()} } if len(v.sortedValidators) < limit { @@ -98,8 +90,8 @@ func (v *ValidatorsCache) GetOnlineValidators(seed types.Seed, round uint64, ste for i := 0; i < limit; i++ { set.Add(v.sortedValidators[indexes[i]]) } - newSet, votePowers := v.replaceByDelegatee(set) - return &StepValidators{Original: set, Addresses: newSet, ExtraVotePowers: votePowers, Size: newSet.Cardinality()} + newSet := v.replaceByDelegatee(set) + return &StepValidators{Original: set, Addresses: newSet, Size: newSet.Cardinality()} } func (v *ValidatorsCache) NetworkSize() int { @@ -143,7 +135,8 @@ func (v *ValidatorsCache) loadValidNodes() { var onlineNodes []common.Address v.nodesSet.Clear() v.onlineNodesSet.Clear() - + v.delegations = map[common.Address]common.Address{} + v.pools = map[common.Address]*sortedAddresses{} var delegators []common.Address v.identityState.IterateIdentities(func(key []byte, value []byte) bool { @@ -165,10 +158,10 @@ func (v *ValidatorsCache) loadValidNodes() { if data.Delegatee != nil { list, ok := v.pools[*data.Delegatee] if !ok { - list = []common.Address{} + list = &sortedAddresses{list: []common.Address{}} v.pools[*data.Delegatee] = list } - addToSortList(list, addr) + list.add(addr) delegators = append(delegators, addr) v.delegations[addr] = *data.Delegatee } @@ -185,7 +178,7 @@ func (v *ValidatorsCache) loadValidNodes() { validators = append(validators, n) } if delegators, ok := v.pools[n]; ok { - validators = append(validators, delegators...) + validators = append(validators, delegators.list...) } } @@ -205,6 +198,8 @@ func (v *ValidatorsCache) Clone() *ValidatorsCache { sortedValidators: append(v.sortedValidators[:0:0], v.sortedValidators...), nodesSet: v.nodesSet.Clone(), onlineNodesSet: v.onlineNodesSet.Clone(), + pools: clonePools(v.pools), + delegations: cloneDelegations(v.delegations), } } @@ -214,7 +209,7 @@ func (v *ValidatorsCache) Height() uint64 { func (v *ValidatorsCache) PoolSize(pool common.Address) int { if set, ok := v.pools[pool]; ok { - size := len(set) + size := len(set.list) if v.nodesSet.Contains(pool) { size++ } @@ -229,7 +224,7 @@ func (v *ValidatorsCache) IsPool(pool common.Address) bool { } func (v *ValidatorsCache) FindSubIdentity(pool common.Address, nonce uint32) (common.Address, uint32) { - set := v.pools[pool] + set := v.pools[pool].list if v.nodesSet.Contains(pool) { set = append([]common.Address{pool}, set...) } @@ -250,20 +245,26 @@ func sortValidNodes(nodes []common.Address) []common.Address { return nodes } -func addToSortList(list []common.Address, e common.Address) { - i := sort.Search(len(list), func(i int) bool { - return bytes.Compare(list[i].Bytes(), e.Bytes()) > 0 - }) - list = append(list, common.Address{}) - copy(list[i+1:], list[i:]) - list[i] = e +func clonePools(source map[common.Address]*sortedAddresses) map[common.Address]*sortedAddresses { + result := map[common.Address]*sortedAddresses{} + for k, v := range source { + result[k] = v + } + return result +} + +func cloneDelegations(source map[common.Address]common.Address) map[common.Address]common.Address { + result := map[common.Address]common.Address{} + for k, v := range source { + result[k] = v + } + return result } type StepValidators struct { - Original mapset.Set - Addresses mapset.Set - Size int - ExtraVotePowers map[common.Address]int + Original mapset.Set + Addresses mapset.Set + Size int } func (sv *StepValidators) Contains(addr common.Address) bool { @@ -271,9 +272,18 @@ func (sv *StepValidators) Contains(addr common.Address) bool { } func (sv *StepValidators) VotesCountSubtrahend() int { - sum := 0 - for _, v := range sv.ExtraVotePowers { - sum += v - } - return sum - len(sv.ExtraVotePowers) + return sv.Original.Cardinality() - sv.Size +} + +type sortedAddresses struct { + list []common.Address +} + +func (s *sortedAddresses) add(addr common.Address) { + i := sort.Search(len(s.list), func(i int) bool { + return bytes.Compare(s.list[i].Bytes(), addr.Bytes()) > 0 + }) + s.list = append(s.list, common.Address{}) + copy(s.list[i+1:], s.list[i:]) + s.list[i] = addr } diff --git a/core/validators/validators_test.go b/core/validators/validators_test.go index 03a4d207..4ae429c8 100644 --- a/core/validators/validators_test.go +++ b/core/validators/validators_test.go @@ -48,14 +48,16 @@ func TestValidatorsCache_Contains(t *testing.T) { require.Equal(countAll, vCache.NetworkSize()) } -func TestValidatorsCache_Clone(t *testing.T) { +func TestValidatorsCache_Load(t *testing.T) { require := require.New(t) database := db.NewMemDB() identityStateDB, _ := state.NewLazyIdentityState(database) - m := make(map[common.Address]bool) + countAll := 12 - countOnline, countAll := 0, 100 + pool1 := common.Address{1} + pool2 := common.Address{2} + pool3 := common.Address{3} for j := 0; j < countAll; j++ { key, _ := crypto.GenerateKey() @@ -63,13 +65,76 @@ func TestValidatorsCache_Clone(t *testing.T) { obj := identityStateDB.GetOrNewIdentityObject(addr) obj.SetState(true) + obj.SetOnline(true) + if j%3 == 0 { // identities 0,3,6,9 + obj.SetDelegatee(pool1) + obj.SetOnline(false) + } else if j%4 == 0 { // identities 4,8 + obj.SetDelegatee(pool2) + obj.SetOnline(false) + } else if j%11 == 0 { // identities 11 + obj.SetDelegatee(pool3) + obj.SetOnline(false) + } + } + identityStateDB.SetOnline(pool1, true) + identityStateDB.SetOnline(pool2, true) + identityStateDB.Add(pool2) + identityStateDB.SetOnline(pool3, false) - isOnline := rand.Int31()%2 == 0 - m[addr] = isOnline + identityStateDB.Commit(false) - if isOnline { + vCache := NewValidatorsCache(identityStateDB, common.Address{0x11}) + vCache.Load() + + require.Equal(4, vCache.PoolSize(pool1)) + require.Equal(3, vCache.PoolSize(pool2)) + require.Equal(1, vCache.PoolSize(pool3)) + require.True(vCache.IsPool(pool1)) + require.True(vCache.IsPool(pool2)) + require.True(vCache.IsPool(pool3)) + require.False(vCache.IsPool(common.Address{0x4})) + require.Len(vCache.delegations, 7) + + require.Len(vCache.sortedValidators, 12) + + require.NotContains(vCache.sortedValidators, pool1) + require.Contains(vCache.sortedValidators, pool2) + require.NotContains(vCache.sortedValidators, pool3) + + stepValidators := vCache.GetOnlineValidators([32]byte{0x1}, 1, 1, 12) + require.Equal(12, stepValidators.Original.Cardinality()) + + require.True(stepValidators.Addresses.Contains(pool1)) + require.True(stepValidators.Addresses.Contains(pool2)) + + require.False(stepValidators.Original.Contains(pool1)) + require.True(stepValidators.Original.Contains(pool2)) + + require.False(stepValidators.Addresses.Contains(pool3)) + require.Equal(7, stepValidators.Size) + require.Equal(5, stepValidators.VotesCountSubtrahend()) +} + +func TestValidatorsCache_Clone(t *testing.T) { + require := require.New(t) + database := db.NewMemDB() + identityStateDB, _ := state.NewLazyIdentityState(database) + + countAll := 100 + + for j := 0; j < countAll; j++ { + key, _ := crypto.GenerateKey() + addr := crypto.PubkeyToAddress(key.PublicKey) + + obj := identityStateDB.GetOrNewIdentityObject(addr) + obj.SetState(true) + + if rand.Int31()%2 == 0 { obj.SetOnline(true) - countOnline++ + } + if rand.Int31()%3 == 0 { + obj.SetDelegatee(common.Address{0x1}) } } identityStateDB.Commit(false) @@ -86,4 +151,6 @@ func TestValidatorsCache_Clone(t *testing.T) { require.Equal(vCache.nodesSet, clone.nodesSet) require.False(vCache.onlineNodesSet == clone.onlineNodesSet) require.False(vCache.nodesSet == clone.nodesSet) + require.Equal(vCache.pools, clone.pools) + require.Equal(vCache.delegations, clone.delegations) } From ebdb342178483fcac91b9c8b98ef1ef4ffef4233 Mon Sep 17 00:00:00 2001 From: sidenaio Date: Tue, 9 Mar 2021 14:59:21 +0500 Subject: [PATCH 06/15] Remove apd --- blockchain/blockchain.go | 60 ++++------------- common/big.go | 2 +- common/decimal/decimal.go | 38 ----------- common/math/big_test.go | 9 --- go.sum | 137 ++------------------------------------ 5 files changed, 21 insertions(+), 225 deletions(-) delete mode 100644 common/decimal/decimal.go diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index aa2d7cd2..8894019a 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -4,7 +4,6 @@ import ( "bytes" "crypto/ecdsa" "fmt" - "github.com/cockroachdb/apd" mapset "github.com/deckarep/golang-set" "github.com/golang/protobuf/proto" "github.com/idena-network/idena-go/blockchain/attachments" @@ -56,17 +55,9 @@ const ( ) var ( - MaxHash *apd.Decimal + MaxHash *big.Float ParentHashIsInvalid = errors.New("parentHash is invalid") BlockInsertionErr = errors.New("can't insert block") - - apdContext = apd.Context{ - MaxExponent: apd.BaseContext.MaxExponent, - MinExponent: apd.MinExponent, - Precision: 53, - Rounding: apd.BaseContext.Rounding, - Traps: apd.BaseContext.Traps, - } ) type Blockchain struct { @@ -100,7 +91,8 @@ func init() { } i := new(big.Int) i.SetBytes(max[:]) - MaxHash = apd.NewWithBigInt(i, 0) + MaxHash = new(big.Float) + MaxHash.SetInt(i) } func NewBlockchain(config *config.Config, db dbm.DB, txpool *mempool.TxPool, appState *appstate.AppState, @@ -1535,29 +1527,18 @@ func (chain *Blockchain) getProposerData() []byte { } func (chain *Blockchain) getSortition(data []byte, threshold float64, modifier int64) (bool, []byte) { + hash, proof := chain.secStore.VrfEvaluate(data) - v := apd.NewWithBigInt(new(big.Int).SetBytes(hash[:]), 0) + v := new(big.Float).SetInt(new(big.Int).SetBytes(hash[:])) - q := new(apd.Decimal) + q := new(big.Float).Quo(v, MaxHash) + vrfThreshold := new(big.Float).SetFloat64(threshold) - _, err := apdContext.Quo(q, v, MaxHash) - if err != nil { - panic(err) - } if modifier > 1 { - modifiedQ := new(apd.Decimal) - exp := new(apd.Decimal) - apdContext.Quo(exp, apd.New(1, 0), apd.New(modifier, 0)) - _, err := apdContext.Pow(modifiedQ, q, exp) - if err != nil { - panic(err) - } - q = modifiedQ + q = math.Root(q, uint64(modifier)) } - vrfThreshold := new(apd.Decimal) - vrfThreshold.SetFloat64(threshold) if q.Cmp(vrfThreshold) >= 0 { return true, proof } @@ -1734,30 +1715,15 @@ func (chain *Blockchain) ValidateProposerProof(proof []byte, pubKeyData []byte) h, err := verifier.ProofToHash(chain.getProposerData(), proof) - v := apd.NewWithBigInt(new(big.Int).SetBytes(h[:]), 0) - - vrfThreshold := new(apd.Decimal) - vrfThreshold.SetFloat64(chain.appState.State.VrfProposerThreshold()) - - q := new(apd.Decimal) - - _, err = apdContext.Quo(q, v, MaxHash) - if err != nil { - panic(err) - } + v := new(big.Float).SetInt(new(big.Int).SetBytes(h[:])) + vrfThreshold := new(big.Float).SetFloat64(chain.appState.State.VrfProposerThreshold()) + q := new(big.Float).Quo(v, MaxHash) proposerAddr := crypto.PubkeyToAddress(*pubKey) - modifier := chain.appState.ValidatorsCache.PoolSize(proposerAddr) + if modifier > 1 { - modifiedQ := new(apd.Decimal) - exp := new(apd.Decimal) - apdContext.Quo(exp, apd.New(1, 0), apd.New(int64(modifier), 0)) - _, err := apdContext.Pow(modifiedQ, q, exp) - if err != nil { - panic(err) - } - q = modifiedQ + q = math.Root(q, uint64(modifier)) } if q.Cmp(vrfThreshold) == -1 { diff --git a/common/big.go b/common/big.go index 109818d2..cb03006e 100644 --- a/common/big.go +++ b/common/big.go @@ -47,4 +47,4 @@ func BigIntOrNil(a []byte) *big.Int { func ZeroOrNil(a *big.Int) bool { return a == nil || a.Sign() == 0 -} +} \ No newline at end of file diff --git a/common/decimal/decimal.go b/common/decimal/decimal.go deleted file mode 100644 index e27925c9..00000000 --- a/common/decimal/decimal.go +++ /dev/null @@ -1,38 +0,0 @@ -package decimal - -import "github.com/cockroachdb/apd" - -type Decimal struct { - underlined *apd.Decimal -} - -var apdContext = apd.Context{ - MaxExponent: apd.BaseContext.MaxExponent, - MinExponent: apd.MinExponent, - Precision: 16, - Rounding: apd.BaseContext.Rounding, - Traps: apd.BaseContext.Traps, -} - -func New(m int64, e int32) *Decimal { - return &Decimal{apd.New(m, e)} -} - -func (d *Decimal) Div(d2 *Decimal) *Decimal { - r := new(apd.Decimal) - apdContext.Quo(r, d.underlined, d2.underlined) - return &Decimal{r} -} - -func (d *Decimal) DivWithPrecision(d2 *Decimal, precision uint32) *Decimal { - apdContext := apd.Context{ - MaxExponent: apd.BaseContext.MaxExponent, - MinExponent: apd.MinExponent, - Precision: precision, - Rounding: apd.BaseContext.Rounding, - Traps: apd.BaseContext.Traps, - } - r := new(apd.Decimal) - apdContext.Quo(r, d.underlined, d2.underlined) - return &Decimal{r} -} diff --git a/common/math/big_test.go b/common/math/big_test.go index cd3de4a3..5e2483a9 100644 --- a/common/math/big_test.go +++ b/common/math/big_test.go @@ -19,7 +19,6 @@ package math import ( "bytes" "encoding/hex" - "github.com/cockroachdb/apd" "github.com/stretchr/testify/require" "math/big" "testing" @@ -381,14 +380,6 @@ func TestRoot(t *testing.T) { 3457395871232236, 2, 58799624.75417879739515291423973129368246, }, } - - d := new(apd.Decimal) - - x, _, _ := apd.NewFromString("3457395871232236") - y, _, _ := apd.NewFromString(Div(big.NewFloat(1), big.NewFloat(43)).Text('g', 40)) - c, err := apd.BaseContext.Pow(d, x, y) - t.Log(c, err) - t.Log(d.String()) for _, c := range cases { r, _ := Root(big.NewFloat(c.num), c.n).Float64() require.Equal(t, c.expected, r) diff --git a/go.sum b/go.sum index 7a70130e..bd12f439 100644 --- a/go.sum +++ b/go.sum @@ -45,7 +45,6 @@ github.com/RoaringBitmap/roaring v0.5.5 h1:naNqvO1mNnghk2UvcsqnzHDBn9DRbCIRy94Gm github.com/RoaringBitmap/roaring v0.5.5/go.mod h1:puNo5VdzwbaIQxSiDIwfXl4Hnc+fbovcX4IW/dSTtUk= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/Stebalien/go-bitfield v0.0.0-20180330043415-076a62f9ce6e/go.mod h1:3oM7gXIttpYDAJXpVNnSCiUMYBLIZ6cb1t+Ip982MRo= github.com/Stebalien/go-bitfield v0.0.1 h1:X3kbSSPUaJK60wV2hjOPZwmpljr6VGCqdq4cBLhbQBo= github.com/Stebalien/go-bitfield v0.0.1/go.mod h1:GNjFpasyUVkHMsfEOk8EFLJ9syQ6SI+XWrX9Wf2XH0s= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= @@ -220,7 +219,6 @@ github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 h1:E2s37DuLxFhQD github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fd/go-nat v1.0.0/go.mod h1:BTBu/CKvMmOMUPkKVef1pngt2WFH/lg7E6yQnulfp6E= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6 h1:u/UEqS66A5ckRmS4yNpjmVH56sVtS/RfclBAYocb4as= github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:1i71OnUq3iUe1ma7Lr6yG6/rjvM3emb6yoL7xLFzcVQ= @@ -235,7 +233,6 @@ github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/gabriel-vasile/mimetype v1.1.1/go.mod h1:6CDPel/o/3/s4+bp6kIbsWATq8pmgOisOPG40CJa6To= github.com/gabriel-vasile/mimetype v1.1.2/go.mod h1:6CDPel/o/3/s4+bp6kIbsWATq8pmgOisOPG40CJa6To= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= @@ -385,7 +382,6 @@ github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/b github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= github.com/gxed/hashland/keccakpg v0.0.1/go.mod h1:kRzw3HkwxFU1mpmPP8v1WyQzwdGfmKFJ6tItnhQ67kU= github.com/gxed/hashland/murmur3 v0.0.1/go.mod h1:KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48= -github.com/gxed/pubsub v0.0.0-20180201040156-26ebdf44f824/go.mod h1:OiEWyHgK+CWrmOlVquHaIK1vhpUJydC9m0Je6mhaiNE= github.com/hannahhoward/cbor-gen-for v0.0.0-20200817222906-ea96cece81f1/go.mod h1:jvfsLIxk0fY/2BKSQ1xf2406AKA5dwMmKKv0ADcOfN8= github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e h1:3YKHER4nmd7b5qy5t0GWDTwSn4OyRgfAXSmo6VnryBY= github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e/go.mod h1:I8h3MITA53gN9OnWGCgaMa0JWVRdXthWw4M3CPM54OY= @@ -421,7 +417,6 @@ github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/J github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/huin/goupnp v0.0.0-20180415215157-1395d1447324/go.mod h1:MZ2ZmwcBpvOoJ22IJsc7va19ZwoheaBk43rKg12SKag= github.com/huin/goupnp v1.0.0 h1:wg75sLpL6DZqwHQN6E1Cfk6mtfzS45z8OV+ic+DtHRo= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= @@ -436,12 +431,8 @@ github.com/ipfs/bbloom v0.0.1 h1:s7KkiBPfxCeDVo47KySjK0ACPc5GJRUxFpdyWEuDjhw= github.com/ipfs/bbloom v0.0.1/go.mod h1:oqo8CVWsJFMOZqTglBG4wydCE4IQA/G2/SEofB0rjUI= github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs= github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0= -github.com/ipfs/fs-repo-migrations v1.6.4 h1:6eYiCIZz/Oh0FfnCmrl8BAc65v5XbhmE+lFQg4hDzRQ= -github.com/ipfs/fs-repo-migrations v1.6.4 h1:6eYiCIZz/Oh0FfnCmrl8BAc65v5XbhmE+lFQg4hDzRQ= -github.com/ipfs/fs-repo-migrations v1.6.4/go.mod h1:SIcVc10SBVJDcBfN8sCbREmH0Q1+SWUzgGLInbH+dMQ= github.com/ipfs/fs-repo-migrations v1.7.1 h1:OQhSJQZiB/fXtyqEeUzXXb1Sz9xyA9vGkxd/zffeRhA= github.com/ipfs/fs-repo-migrations v1.7.1/go.mod h1:AQI+fJEXvPeJg+DMqwEmt7SMGR9nHLnXuEb0kt479ZE= -github.com/ipfs/go-bitswap v0.0.3/go.mod h1:jadAZYsP/tcRMl47ZhFxhaNuDQoXawT8iHMg+iFoQbg= github.com/ipfs/go-bitswap v0.0.9/go.mod h1:kAPf5qgn2W2DrgAcscZ3HrM9qh4pH+X8Fkk3UPrwvis= github.com/ipfs/go-bitswap v0.1.0 h1:28YsHYw9ut6wootnImPXH0WpnU5Dbo3qm6cvQ6e6wYY= github.com/ipfs/go-bitswap v0.1.0/go.mod h1:FFJEf18E9izuCqUtHxbWEvq+reg7o4CW5wSAE1wsxj0= @@ -450,15 +441,11 @@ github.com/ipfs/go-bitswap v0.1.2/go.mod h1:qxSWS4NXGs7jQ6zQvoPY3+NmOfHHG47mhkiL github.com/ipfs/go-bitswap v0.1.3/go.mod h1:YEQlFy0kkxops5Vy+OxWdRSEZIoS7I7KDIwoa5Chkps= github.com/ipfs/go-bitswap v0.1.8 h1:38X1mKXkiU6Nzw4TOSWD8eTVY5eX3slQunv3QEWfXKg= github.com/ipfs/go-bitswap v0.1.8/go.mod h1:TOWoxllhccevbWFUR2N7B1MTSVVge1s6XSMiCSA4MzM= -github.com/ipfs/go-bitswap v0.2.20 h1:Zfi5jDUoqxDThORUznqdeL77DdGniAzlccNJ4vr+Itc= -github.com/ipfs/go-bitswap v0.2.20/go.mod h1:C7TwBgHnu89Q8sHsTJP7IhUqF9XYLe71P4tT5adgmYo= github.com/ipfs/go-bitswap v0.3.3 h1:CrTO3OiOYFBcdliw074/C7T2QYHEOsPClgvR6RIYcO4= github.com/ipfs/go-bitswap v0.3.3/go.mod h1:AyWWfN3moBzQX0banEtfKOfbXb3ZeoOeXnZGNPV9S6w= github.com/ipfs/go-block-format v0.0.1/go.mod h1:DK/YYcsSUIVAFNwo/KZCdIIbpN0ROH/baNLgayt4pFc= github.com/ipfs/go-block-format v0.0.2 h1:qPDvcP19izTjU8rgo6p7gTXZlkMkF5bz5G3fqIsSCPE= github.com/ipfs/go-block-format v0.0.2/go.mod h1:AWR46JfpcObNfg3ok2JHDUfdiHRgWhJgCQF+KIgOPJY= -github.com/ipfs/go-blockservice v0.0.3 h1:40OvwrxeudTAlUGUAKNYnNPcwQeLtXedjzTWecnUinQ= -github.com/ipfs/go-blockservice v0.0.3/go.mod h1:/NNihwTi6V2Yr6g8wBI+BSwPuURpBRMtYNGrlxZ8KuI= github.com/ipfs/go-blockservice v0.0.7/go.mod h1:EOfb9k/Y878ZTRY/CH0x5+ATtaipfbRhbvNSdgc/7So= github.com/ipfs/go-blockservice v0.1.0 h1:dh2i7xjMbCtf0ZSMyQAF2qpV/pEEmM7yVpQ00+gik6U= github.com/ipfs/go-blockservice v0.1.0/go.mod h1:hzmMScl1kXHg3M2BjTymbVPjv627N7sYcvYaKbop39M= @@ -507,8 +494,6 @@ github.com/ipfs/go-ds-badger v0.0.5/go.mod h1:g5AuuCGmr7efyzQhLL8MzwqcauPojGPUaH github.com/ipfs/go-ds-badger v0.0.7/go.mod h1:qt0/fWzZDoPW6jpQeqUjR5kBfhDNB65jd9YlmAvpQBk= github.com/ipfs/go-ds-badger v0.2.1/go.mod h1:Tx7l3aTph3FMFrRS838dcSJh+jjA7cX9DrGVwx/NOwE= github.com/ipfs/go-ds-badger v0.2.3/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBRn4FS6UHUk= -github.com/ipfs/go-ds-badger v0.2.4 h1:UPGB0y7luFHk+mY/tUZrif/272M8o+hFsW+avLUeWrM= -github.com/ipfs/go-ds-badger v0.2.4/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBRn4FS6UHUk= github.com/ipfs/go-ds-badger v0.2.6 h1:Hy8jw4rifxtRDrqpvC1yh36oIyE37KDzsUzlHUPOFiU= github.com/ipfs/go-ds-badger v0.2.6/go.mod h1:02rnztVKA4aZwDuaRPTf8mpqcKmXP7mLl6JPxd14JHA= github.com/ipfs/go-ds-flatfs v0.4.5 h1:4QceuKEbH+HVZ2ZommstJMi3o3II+dWS3IhLaD7IGHs= @@ -524,12 +509,8 @@ github.com/ipfs/go-filestore v0.0.3 h1:MhZ1jT5K3NewZwim6rS/akcJLm1xM+r6nz6foeB9E github.com/ipfs/go-filestore v0.0.3/go.mod h1:dvXRykFzyyXN2CdNlRGzDAkXMDPyI+D7JE066SiKLSE= github.com/ipfs/go-fs-lock v0.0.6 h1:sn3TWwNVQqSeNjlWy6zQ1uUGAZrV3hPOyEA6y1/N2a0= github.com/ipfs/go-fs-lock v0.0.6/go.mod h1:OTR+Rj9sHiRubJh3dRhD15Juhd/+w6VPOY28L7zESmM= -github.com/ipfs/go-graphsync v0.1.1 h1:bFDAYS0Z48yd8ROPI6f/zIVmJxaDLA6m8cVuJPKC5fE= -github.com/ipfs/go-graphsync v0.1.1/go.mod h1:jMXfqIEDFukLPZHqDPp8tJMbHO9Rmeb9CEGevngQbmE= github.com/ipfs/go-graphsync v0.6.0 h1:x6UvDUGA7wjaKNqx5Vbo7FGT8aJ5ryYA0dMQ5jN3dF0= github.com/ipfs/go-graphsync v0.6.0/go.mod h1:e2ZxnClqBBYAtd901g9vXMJzS47labjAtOzsWtOzKNk= -github.com/ipfs/go-ipfs v0.7.0 h1:8qJkP8PounMHhbWJ+sOij5FV3mlJhP+mhCg2JeDV1mg= -github.com/ipfs/go-ipfs v0.7.0/go.mod h1:4UNBZMgbAZ6/+xUZDlMkGxMFPiu1RB67+TaNVvKV7ZQ= github.com/ipfs/go-ipfs v0.8.0 h1:hQmPWBpnFpKeGUovpDV/XPFAzQ3fGj51OTP+fd7B/yw= github.com/ipfs/go-ipfs v0.8.0/go.mod h1:iU9jeKJrinNYdWSNZyTjpfcmGHH4oflEySOUboEQsoQ= github.com/ipfs/go-ipfs-blockstore v0.0.1 h1:O9n3PbmTYZoNhkgkEyrXTznbmktIXif62xLX+8dPHzc= @@ -544,13 +525,8 @@ github.com/ipfs/go-ipfs-chunker v0.0.1 h1:cHUUxKFQ99pozdahi+uSC/3Y6HeRpi9oTeUHbE github.com/ipfs/go-ipfs-chunker v0.0.1/go.mod h1:tWewYK0we3+rMbOh7pPFGDyypCtvGcBFymgY4rSDLAw= github.com/ipfs/go-ipfs-chunker v0.0.5 h1:ojCf7HV/m+uS2vhUGWcogIIxiO5ubl5O57Q7NapWLY8= github.com/ipfs/go-ipfs-chunker v0.0.5/go.mod h1:jhgdF8vxRHycr00k13FM8Y0E+6BoalYeobXmUyTreP8= -github.com/ipfs/go-ipfs-cmds v0.4.0 h1:xUavIxA9Ts8U6PAHmQBvDGMlGfUrQ13Rymd+5t8LIF4= -github.com/ipfs/go-ipfs-cmds v0.4.0/go.mod h1:ZgYiWVnCk43ChwoH8hAmI1IRbuVtq3GSTHwtRB/Kqhk= +github.com/ipfs/go-ipfs-cmds v0.6.0 h1:yAxdowQZzoFKjcLI08sXVNnqVj3jnABbf9smrPQmBsw= github.com/ipfs/go-ipfs-cmds v0.6.0/go.mod h1:ZgYiWVnCk43ChwoH8hAmI1IRbuVtq3GSTHwtRB/Kqhk= -github.com/ipfs/go-ipfs-config v0.9.0 h1:qTXJ9CyOyQv1LFJUMysxz8fi6RxxnP9QqcmiobuANvw= -github.com/ipfs/go-ipfs-config v0.9.0/go.mod h1:GQUxqb0NfkZmEU92PxqqqLVVFTLpoGGUlBaTyDaAqrE= -github.com/ipfs/go-ipfs-config v0.10.0 h1:QdTFdqCg3Zpvpz6wHc6B7UGwSnierqq0h8BwyUntjGA= -github.com/ipfs/go-ipfs-config v0.10.0/go.mod h1:Ei/FLgHGTdPyqCPK0oPCwGTe8VSnsjJjx7HZqUb6Ry0= github.com/ipfs/go-ipfs-config v0.12.0 h1:wxqN3ohBlis1EkhkzIKuF+XLx4YNn9rNpiSOYw3DFZc= github.com/ipfs/go-ipfs-config v0.12.0/go.mod h1:Ei/FLgHGTdPyqCPK0oPCwGTe8VSnsjJjx7HZqUb6Ry0= github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= @@ -564,14 +540,10 @@ github.com/ipfs/go-ipfs-exchange-interface v0.0.1 h1:LJXIo9W7CAmugqI+uofioIpRb6r github.com/ipfs/go-ipfs-exchange-interface v0.0.1/go.mod h1:c8MwfHjtQjPoDyiy9cFquVtVHkO9b9Ob3FG91qJnWCM= github.com/ipfs/go-ipfs-exchange-offline v0.0.1 h1:P56jYKZF7lDDOLx5SotVh5KFxoY6C81I1NSHW1FxGew= github.com/ipfs/go-ipfs-exchange-offline v0.0.1/go.mod h1:WhHSFCVYX36H/anEKQboAzpUws3x7UeEGkzQc3iNkM0= -github.com/ipfs/go-ipfs-files v0.0.2/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4= github.com/ipfs/go-ipfs-files v0.0.3 h1:ME+QnC3uOyla1ciRPezDW0ynQYK2ikOh9OCKAEg4uUA= github.com/ipfs/go-ipfs-files v0.0.3/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4= github.com/ipfs/go-ipfs-files v0.0.8 h1:8o0oFJkJ8UkO/ABl8T6ac6tKF3+NIpj67aAB6ZpusRg= github.com/ipfs/go-ipfs-files v0.0.8/go.mod h1:wiN/jSG8FKyk7N0WyctKSvq3ljIa2NNTiZB55kpTdOs= -github.com/ipfs/go-ipfs-flags v0.0.1/go.mod h1:RnXBb9WV53GSfTrSDVK61NLTFKvWc60n+K9EgCDh+rA= -github.com/ipfs/go-ipfs-pinner v0.0.4 h1:EmxhS3vDsCK/rZrsgxX0Le9m2drBcGlUd7ah/VyFYVE= -github.com/ipfs/go-ipfs-pinner v0.0.4/go.mod h1:s4kFZWLWGDudN8Jyd/GTpt222A12C2snA2+OTdy/7p8= github.com/ipfs/go-ipfs-pinner v0.1.1 h1:iJd1gwILGQJSZhhI0jn6yFOLg34Ua7fdKcB6mXp6k/M= github.com/ipfs/go-ipfs-pinner v0.1.1/go.mod h1:EzyyaWCWeZJ/he9cDBH6QrEkSuRqTRWMmCoyNkylTTg= github.com/ipfs/go-ipfs-posinfo v0.0.1 h1:Esoxj+1JgSjX0+ylc0hUmJCOv6V2vFoZiETLR6OtpRs= @@ -590,7 +562,6 @@ github.com/ipfs/go-ipfs-util v0.0.1 h1:Wz9bL2wB2YBJqggkA4dD7oSmqB4cAnpNbGrlHJulv github.com/ipfs/go-ipfs-util v0.0.1/go.mod h1:spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc= github.com/ipfs/go-ipfs-util v0.0.2 h1:59Sswnk1MFaiq+VcaknX7aYEyGyGDAA73ilhEK2POp8= github.com/ipfs/go-ipfs-util v0.0.2/go.mod h1:CbPtkWJzjLdEcezDns2XYaehFVNXG9zrdrtMecczcsQ= -github.com/ipfs/go-ipld-cbor v0.0.1/go.mod h1:RXHr8s4k0NE0TKhnrxqZC9M888QfsBN9rhS5NjfKzY8= github.com/ipfs/go-ipld-cbor v0.0.2 h1:amzFztBQQQ69UA5+f7JRfoXF/z2l//MGfEDHVkS20+s= github.com/ipfs/go-ipld-cbor v0.0.2/go.mod h1:wTBtrQZA3SoFKMVkp6cn6HMRteIB1VsmHA0AQFOn7Nc= github.com/ipfs/go-ipld-cbor v0.0.3 h1:ENsxvybwkmke7Z/QJOmeJfoguj6GH3Y0YOaGrfy9Q0I= @@ -624,8 +595,6 @@ github.com/ipfs/go-log/v2 v2.0.5 h1:fL4YI+1g5V/b1Yxr1qAiXTMg1H8z9vx/VmJxBuQMHvU= github.com/ipfs/go-log/v2 v2.0.5/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscwkWG+dw= github.com/ipfs/go-log/v2 v2.1.1 h1:G4TtqN+V9y9HY9TA6BwbCVyyBZ2B9MbCjR2MtGx8FR0= github.com/ipfs/go-log/v2 v2.1.1/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= -github.com/ipfs/go-merkledag v0.0.3 h1:A5DlOMzqTRDVmdgkf3dzCKCFmVWH4Zqwb0cbYXUs+Ro= -github.com/ipfs/go-merkledag v0.0.3/go.mod h1:Oc5kIXLHokkE1hWGMBHw+oxehkAaTOqtEb7Zbh6BhLA= github.com/ipfs/go-merkledag v0.0.6/go.mod h1:QYPdnlvkOg7GnQRofu9XZimC5ZW5Wi3bKys/4GQQfto= github.com/ipfs/go-merkledag v0.1.0/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB3ClKnBAlk= github.com/ipfs/go-merkledag v0.2.3 h1:aMdkK9G1hEeNvn3VXfiEMLY0iJnbiQQUHnM0HFJREsE= @@ -640,11 +609,8 @@ github.com/ipfs/go-metrics-interface v0.0.1/go.mod h1:6s6euYU4zowdslK0GKHmqaIZ3j github.com/ipfs/go-metrics-prometheus v0.0.2/go.mod h1:ELLU99AQQNi+zX6GCGm2lAgnzdSH3u5UVlCdqSXnEks= github.com/ipfs/go-mfs v0.1.2 h1:DlelNSmH+yz/Riy0RjPKlooPg0KML4lXGdLw7uZkfAg= github.com/ipfs/go-mfs v0.1.2/go.mod h1:T1QBiZPEpkPLzDqEJLNnbK55BVKVlNi2a+gVm4diFo0= -github.com/ipfs/go-path v0.0.3/go.mod h1:zIRQUez3LuQIU25zFjC2hpBTHimWx7VK5bjZgRLbbdo= github.com/ipfs/go-path v0.0.7 h1:H06hKMquQ0aYtHiHryOMLpQC1qC3QwXwkahcEVD51Ho= github.com/ipfs/go-path v0.0.7/go.mod h1:6KTKmeRnBXgqrTvzFrPV3CamxcgvXX/4z79tfAd2Sno= -github.com/ipfs/go-path v0.0.8 h1:R0k6t9x/pa+g8qzl5apQIPurJFozXhopks3iw3MX+jU= -github.com/ipfs/go-path v0.0.8/go.mod h1:VpDkSBKQ9EFQOUgi54Tq/O/tGi8n1RfYNks13M3DEs8= github.com/ipfs/go-path v0.0.9 h1:BIi831cNED8YnIlIKo9y1SI3u+E+FwQQD+rIIw8PwFA= github.com/ipfs/go-path v0.0.9/go.mod h1:VpDkSBKQ9EFQOUgi54Tq/O/tGi8n1RfYNks13M3DEs8= github.com/ipfs/go-peertaskqueue v0.0.4/go.mod h1:03H8fhyeMfKNFWqzYEVyMbcPUeYrqP1MX6Kd+aN+rMQ= @@ -655,29 +621,20 @@ github.com/ipfs/go-peertaskqueue v0.1.1/go.mod h1:Jmk3IyCcfl1W3jTW3YpghSwSEC6IJ3 github.com/ipfs/go-peertaskqueue v0.2.0 h1:2cSr7exUGKYyDeUyQ7P/nHPs9P7Ht/B+ROrpN1EJOjc= github.com/ipfs/go-peertaskqueue v0.2.0/go.mod h1:5/eNrBEbtSKWCG+kQK8K8fGNixoYUnr+P7jivavs9lY= github.com/ipfs/go-pinning-service-http-client v0.1.0/go.mod h1:tcCKmlkWWH9JUUkKs8CrOZBanacNc1dmKLfjlyXAMu4= -github.com/ipfs/go-unixfs v0.0.4/go.mod h1:eIo/p9ADu/MFOuyxzwU+Th8D6xoxU//r590vUpWyfz8= github.com/ipfs/go-unixfs v0.1.0/go.mod h1:lysk5ELhOso8+Fed9U1QTGey2ocsfaZ18h0NCO2Fj9s= github.com/ipfs/go-unixfs v0.2.4 h1:6NwppOXefWIyysZ4LR/qUBPvXd5//8J3jiMdvpbw6Lo= github.com/ipfs/go-unixfs v0.2.4/go.mod h1:SUdisfUjNoSDzzhGVxvCL9QO/nKdwXdr+gbMUdqcbYw= github.com/ipfs/go-verifcid v0.0.1 h1:m2HI7zIuR5TFyQ1b79Da5N9dnnCP1vcu2QqawmWlK2E= github.com/ipfs/go-verifcid v0.0.1/go.mod h1:5Hrva5KBeIog4A+UpqlaIU+DEstipcJYQQZc0g37pY0= -github.com/ipfs/interface-go-ipfs-core v0.3.0 h1:oZdLLfh256gPGcYPURjivj/lv296GIcr8mUqZUnXOEI= -github.com/ipfs/interface-go-ipfs-core v0.3.0/go.mod h1:Tihp8zxGpUeE3Tokr94L6zWZZdkRQvG5TL6i9MuNE+s= github.com/ipfs/interface-go-ipfs-core v0.4.0 h1:+mUiamyHIwedqP8ZgbCIwpy40oX7QcXUbo4CZOeJVJg= github.com/ipfs/interface-go-ipfs-core v0.4.0/go.mod h1:UJBcU6iNennuI05amq3FQ7g0JHUkibHFAfhfUIy927o= -github.com/ipld/go-car v0.1.1-0.20200429200904-c222d793c339/go.mod h1:eajxljm6I8o3LitnFeVEmucwZmz7+yLSiKce9yYMefg= github.com/ipld/go-car v0.1.1-0.20201015032735-ff6ccdc46acc/go.mod h1:WdIgzcEjFqydQ7jH+BXzGYxVCmLeAs5nP8Vu3Rege2Y= -github.com/ipld/go-ipld-prime v0.0.2-0.20200428162820-8b59dc292b8e h1:ZISbJlM0urTANR9KRfRaqlBmyOj5uUtxs2r4Up9IXsA= -github.com/ipld/go-ipld-prime v0.0.2-0.20200428162820-8b59dc292b8e/go.mod h1:uVIwe/u0H4VdKv3kaN1ck7uCb6yD9cFLS9/ELyXbsw8= github.com/ipld/go-ipld-prime v0.5.1-0.20200828233916-988837377a7f/go.mod h1:0xEgdD6MKbZ1vF0GC+YcR/C4SQCAlRuOjIJ2i0HxqzM= github.com/ipld/go-ipld-prime v0.5.1-0.20201021195245-109253e8a018 h1:RbRHv8epkmvBYA5cGfz68GUSbOgx5j/7ObLIl4Rsif0= github.com/ipld/go-ipld-prime v0.5.1-0.20201021195245-109253e8a018/go.mod h1:0xEgdD6MKbZ1vF0GC+YcR/C4SQCAlRuOjIJ2i0HxqzM= -github.com/ipld/go-ipld-prime-proto v0.0.0-20200428191222-c1ffdadc01e1 h1:K1Ysr7kgIlo7YQkPqdkA6H7BVdIugvuAz7OQUTJxLdE= -github.com/ipld/go-ipld-prime-proto v0.0.0-20200428191222-c1ffdadc01e1/go.mod h1:OAV6xBmuTLsPZ+epzKkPB1e25FHk/vCtyatkdHcArLs= github.com/ipld/go-ipld-prime-proto v0.0.0-20200922192210-9a2bfd4440a6/go.mod h1:3pHYooM9Ea65jewRwrb2u5uHZCNkNTe9ABsVB+SrkH0= github.com/ipld/go-ipld-prime-proto v0.1.0 h1:j7gjqrfwbT4+gXpHwEx5iMssma3mnctC7YaCimsFP70= github.com/ipld/go-ipld-prime-proto v0.1.0/go.mod h1:11zp8f3sHVgIqtb/c9Kr5ZGqpnCLF1IVTNOez9TopzE= -github.com/jackpal/gateway v1.0.4/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= github.com/jackpal/gateway v1.0.5 h1:qzXWUJfuMdlLMtt0a3Dgt+xkWQiA5itDEITVJtuSwMc= github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= github.com/jackpal/go-nat-pmp v1.0.1 h1:i0LektDkO1QlrTm/cSuP+PyBCDnYvjPLGl4LdWEMiaA= @@ -724,15 +681,12 @@ github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d/go.mod h1:P2vi github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0 h1:reN85Pxc5larApoH1keMBiu2GWtPqXQ1nc9gx+jOU+E= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/compress v1.4.1 h1:8VMb5+0wMgdBykOV96DwNwKFQ+WTI4pzYURP99CcB9E= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.11.4 h1:kz40R/YWls3iqT9zX9AHN3WoVsrAWVyui5sxuLqiXqU= -github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.11.7 h1:0hzRabrMN4tSTvMfnL3SCv1ZGeAP23ynzodBgaHeMeg= -github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.8 h1:difgzQsp5mdAz9v8lm3P/I+EpDKMU/6uTMw1y1FObuo= github.com/klauspost/compress v1.11.8/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= @@ -765,7 +719,6 @@ github.com/libp2p/go-cidranger v1.1.0 h1:ewPN8EZ0dd1LSnrtuwd4709PXVcITVeuwbag38y github.com/libp2p/go-cidranger v1.1.0/go.mod h1:KWZTfSr+r9qEo9OkI9/SIEeAtw+NNoU0dXIXt15Okic= github.com/libp2p/go-conn-security v0.0.1 h1:4kMMrqrt9EUNCNjX1xagSJC+bq16uqjMe9lk1KBMVNs= github.com/libp2p/go-conn-security v0.0.1/go.mod h1:bGmu51N0KU9IEjX7kl2PQjgZa40JQWnayTvNMgD/vyk= -github.com/libp2p/go-conn-security-multistream v0.0.1/go.mod h1:nc9vud7inQ+d6SO0I/6dSWrdMnHnzZNHeyUQqrAJulE= github.com/libp2p/go-conn-security-multistream v0.0.2 h1:Ykz0lnNjxk+0SdslUmlLNyrleqdpS1S/VW+dxFdt74Y= github.com/libp2p/go-conn-security-multistream v0.0.2/go.mod h1:nc9vud7inQ+d6SO0I/6dSWrdMnHnzZNHeyUQqrAJulE= github.com/libp2p/go-conn-security-multistream v0.1.0 h1:aqGmto+ttL/uJgX0JtQI0tD21CIEy5eYd1Hlp0juHY0= @@ -781,26 +734,19 @@ github.com/libp2p/go-flow-metrics v0.0.1/go.mod h1:Iv1GH0sG8DtYN3SVJ2eG221wMiNpZ github.com/libp2p/go-flow-metrics v0.0.2/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs= github.com/libp2p/go-flow-metrics v0.0.3 h1:8tAs/hSdNvUiLgtlSy3mxwxWP4I9y/jlkPFT7epKdeM= github.com/libp2p/go-flow-metrics v0.0.3/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs= -github.com/libp2p/go-libp2p v0.0.2/go.mod h1:Qu8bWqFXiocPloabFGUcVG4kk94fLvfC8mWTDdFC9wE= github.com/libp2p/go-libp2p v0.0.30/go.mod h1:XWT8FGHlhptAv1+3V/+J5mEpzyui/5bvFsNuWYs611A= github.com/libp2p/go-libp2p v0.1.0/go.mod h1:6D/2OBauqLUoqcADOJpn9WbKqvaM07tDw68qHM0BxUM= github.com/libp2p/go-libp2p v0.1.1 h1:52sB0TJuDk2nYMcMfHOKaPoaayDZjaYVCq6Vk1ejUTk= github.com/libp2p/go-libp2p v0.1.1/go.mod h1:I00BRo1UuUSdpuc8Q2mN7yDF/oTUTRAX6JWpTiK9Rp8= -github.com/libp2p/go-libp2p v0.6.0/go.mod h1:mfKWI7Soz3ABX+XEBR61lGbg+ewyMtJHVt043oWeqwg= github.com/libp2p/go-libp2p v0.6.1/go.mod h1:CTFnWXogryAHjXAKEbOf1OWY+VeAP3lDMZkfEI5sT54= github.com/libp2p/go-libp2p v0.7.0/go.mod h1:hZJf8txWeCduQRDC/WSqBGMxaTHCOYHt2xSU1ivxn0k= github.com/libp2p/go-libp2p v0.7.4/go.mod h1:oXsBlTLF1q7pxr+9w6lqzS1ILpyHsaBPniVO7zIHGMw= github.com/libp2p/go-libp2p v0.8.1/go.mod h1:QRNH9pwdbEBpx5DTJYg+qxcVaDMAz3Ee/qDKwXujH5o= -github.com/libp2p/go-libp2p v0.8.3 h1:IFWeNzxkBaNO1N8stN9ayFGdC6RmVuSsKd5bou7qpK0= -github.com/libp2p/go-libp2p v0.8.3/go.mod h1:EsH1A+8yoWK+L4iKcbPYu6MPluZ+CHWI9El8cTaefiM= -github.com/libp2p/go-libp2p v0.11.0 h1:jb5mqdqYEBAybTEhD8io43Cz5LzVKuWxOK7znSN69jE= -github.com/libp2p/go-libp2p v0.11.0/go.mod h1:3/ogJDXsbbepEfqtZKBR/DedzxJXCeK17t2Z9RE9bEE= github.com/libp2p/go-libp2p v0.12.0/go.mod h1:FpHZrfC1q7nA8jitvdjKBDF31hguaC676g/nT9PgQM0= github.com/libp2p/go-libp2p v0.13.0 h1:tDdrXARSghmusdm0nf1U/4M8aj8Rr0V2IzQOXmbzQ3s= github.com/libp2p/go-libp2p v0.13.0/go.mod h1:pM0beYdACRfHO1WcJlp65WXyG2A6NqYM+t2DTVAJxMo= github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052 h1:BM7aaOF7RpmNn9+9g6uTjGJ0cTzWr5j9i9IKeun2M8U= github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052/go.mod h1:nRMRTab+kZuk0LnKZpxhOVH/ndsdr2Nr//Zltc/vwgo= -github.com/libp2p/go-libp2p-autonat v0.0.2/go.mod h1:fs71q5Xk+pdnKU014o2iq1RhMs9/PMaG5zXRFNnIIT4= github.com/libp2p/go-libp2p-autonat v0.0.6 h1:OCStANLLpeyQeWFUuqZJ7aS9+Bx0/uoVb1PtLA9fGTQ= github.com/libp2p/go-libp2p-autonat v0.0.6/go.mod h1:uZneLdOkZHro35xIhpbtTzLlgYturpu4J5+0cZK3MqE= github.com/libp2p/go-libp2p-autonat v0.1.0 h1:aCWAu43Ri4nU0ZPO7NyLzUvvfqd0nE3dX0R/ZGYVgOU= @@ -811,8 +757,6 @@ github.com/libp2p/go-libp2p-autonat v0.2.1 h1:T0CRQhrvTBKfBSYw6Xo2K3ixtNpAnRCrax github.com/libp2p/go-libp2p-autonat v0.2.1/go.mod h1:MWtAhV5Ko1l6QBsHQNSuM6b1sRkXrpk0/LqCr+vCVxI= github.com/libp2p/go-libp2p-autonat v0.2.2 h1:4dlgcEEugTFWSvdG2UIFxhnOMpX76QaZSRAtXmYB8n4= github.com/libp2p/go-libp2p-autonat v0.2.2/go.mod h1:HsM62HkqZmHR2k1xgX34WuWDzk/nBwNHoeyyT4IWV6A= -github.com/libp2p/go-libp2p-autonat v0.3.2 h1:OhDSwVVaq7liTaRIsFFYvsaPp0pn2yi0WazejZ4DUmo= -github.com/libp2p/go-libp2p-autonat v0.3.2/go.mod h1:0OzOi1/cVc7UcxfOddemYD5vzEqi4fwRbnZcJGLi68U= github.com/libp2p/go-libp2p-autonat v0.4.0 h1:3y8XQbpr+ssX8QfZUHekjHCYK64sj6/4hnf/awD4+Ug= github.com/libp2p/go-libp2p-autonat v0.4.0/go.mod h1:YxaJlpr81FhdOv3W3BTconZPfhaYivRdf53g+S2wobk= github.com/libp2p/go-libp2p-blankhost v0.0.1 h1:/mZuuiwntNR8RywnCFlGHLKrKLYne+qciBpQXWqp5fk= @@ -821,21 +765,14 @@ github.com/libp2p/go-libp2p-blankhost v0.1.1 h1:X919sCh+KLqJcNRApj43xCSiQRYqOSI8 github.com/libp2p/go-libp2p-blankhost v0.1.1/go.mod h1:pf2fvdLJPsC1FsVrNP3DUUvMzUts2dsLLBEpo1vW1ro= github.com/libp2p/go-libp2p-blankhost v0.1.4 h1:I96SWjR4rK9irDHcHq3XHN6hawCRTPUADzkJacgZLvk= github.com/libp2p/go-libp2p-blankhost v0.1.4/go.mod h1:oJF0saYsAXQCSfDq254GMNmLNz6ZTHTOvtF4ZydUvwU= -github.com/libp2p/go-libp2p-blankhost v0.1.6 h1:CkPp1/zaCrCnBo0AdsQA0O1VkUYoUOtyHOnoa8gKIcE= -github.com/libp2p/go-libp2p-blankhost v0.1.6/go.mod h1:jONCAJqEP+Z8T6EQviGL4JsQcLx1LgTGtVqFNY8EMfQ= github.com/libp2p/go-libp2p-blankhost v0.2.0 h1:3EsGAi0CBGcZ33GwRuXEYJLLPoVWyXJ1bcJzAJjINkk= github.com/libp2p/go-libp2p-blankhost v0.2.0/go.mod h1:eduNKXGTioTuQAUcZ5epXi9vMl+t4d8ugUBRQ4SqaNQ= -github.com/libp2p/go-libp2p-circuit v0.0.1/go.mod h1:Dqm0s/BiV63j8EEAs8hr1H5HudqvCAeXxDyic59lCwE= github.com/libp2p/go-libp2p-circuit v0.0.9/go.mod h1:uU+IBvEQzCu953/ps7bYzC/D/R0Ho2A9LfKVVCatlqU= github.com/libp2p/go-libp2p-circuit v0.1.0 h1:eniLL3Y9aq/sryfyV1IAHj5rlvuyj3b7iz8tSiZpdhY= github.com/libp2p/go-libp2p-circuit v0.1.0/go.mod h1:Ahq4cY3V9VJcHcn1SBXjr78AbFkZeIRmfunbA7pmFh8= github.com/libp2p/go-libp2p-circuit v0.1.4 h1:Phzbmrg3BkVzbqd4ZZ149JxCuUWu2wZcXf/Kr6hZJj8= github.com/libp2p/go-libp2p-circuit v0.1.4/go.mod h1:CY67BrEjKNDhdTk8UgBX1Y/H5c3xkAcs3gnksxY7osU= github.com/libp2p/go-libp2p-circuit v0.2.1/go.mod h1:BXPwYDN5A8z4OEY9sOfr2DUQMLQvKt/6oku45YUmjIo= -github.com/libp2p/go-libp2p-circuit v0.2.2 h1:87RLabJ9lrhoiSDDZyCJ80ZlI5TLJMwfyoGAaWXzWqA= -github.com/libp2p/go-libp2p-circuit v0.2.2/go.mod h1:nkG3iE01tR3FoQ2nMm06IUrCpCyJp1Eo4A1xYdpjfs4= -github.com/libp2p/go-libp2p-circuit v0.3.1 h1:69ENDoGnNN45BNDnBd+8SXSetDuw0eJFcGmOvvtOgBw= -github.com/libp2p/go-libp2p-circuit v0.3.1/go.mod h1:8RMIlivu1+RxhebipJwFDA45DasLx+kkrp4IlJj53F4= github.com/libp2p/go-libp2p-circuit v0.4.0 h1:eqQ3sEYkGTtybWgr6JLqJY6QLtPWRErvFjFDfAOO1wc= github.com/libp2p/go-libp2p-circuit v0.4.0/go.mod h1:t/ktoFIUzM6uLQ+o1G6NuBl2ANhBKN9Bc8jRIk31MoA= github.com/libp2p/go-libp2p-connmgr v0.2.4 h1:TMS0vc0TCBomtQJyWr7fYxcVYYhx+q/2gF++G5Jkl/w= @@ -856,8 +793,6 @@ github.com/libp2p/go-libp2p-core v0.5.0 h1:FBQ1fpq2Fo/ClyjojVJ5AKXlKhvNc/B6U0O+7 github.com/libp2p/go-libp2p-core v0.5.0/go.mod h1:49XGI+kc38oGVwqSBhDEwytaAxgZasHhFfQKibzTls0= github.com/libp2p/go-libp2p-core v0.5.1 h1:6Cu7WljPQtGY2krBlMoD8L/zH3tMUsCbqNFH7cZwCoI= github.com/libp2p/go-libp2p-core v0.5.1/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= -github.com/libp2p/go-libp2p-core v0.5.2 h1:hevsCcdLiazurKBoeNn64aPYTVOPdY4phaEGeLtHOAs= -github.com/libp2p/go-libp2p-core v0.5.2/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= github.com/libp2p/go-libp2p-core v0.5.3 h1:b9W3w7AZR2n/YJhG8d0qPFGhGhCWKIvPuJgp4hhc4MM= github.com/libp2p/go-libp2p-core v0.5.3/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= github.com/libp2p/go-libp2p-core v0.5.4/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= @@ -878,23 +813,18 @@ github.com/libp2p/go-libp2p-crypto v0.0.2 h1:TTdJ4y6Uoa6NxQcuEaVkQfFRcQeCE2ReDk8 github.com/libp2p/go-libp2p-crypto v0.0.2/go.mod h1:eETI5OUfBnvARGOHrJz2eWNyTUxEGZnBxMcbUjfIj4I= github.com/libp2p/go-libp2p-crypto v0.1.0 h1:k9MFy+o2zGDNGsaoZl0MA3iZ75qXxr9OOoAZF+sD5OQ= github.com/libp2p/go-libp2p-crypto v0.1.0/go.mod h1:sPUokVISZiy+nNuTTH/TY+leRSxnFj/2GLjtOTW90hI= -github.com/libp2p/go-libp2p-discovery v0.0.1/go.mod h1:ZkkF9xIFRLA1xCc7bstYFkd80gBGK8Fc1JqGoU2i+zI= github.com/libp2p/go-libp2p-discovery v0.0.5/go.mod h1:YtF20GUxjgoKZ4zmXj8j3Nb2TUSBHFlOCetzYdbZL5I= github.com/libp2p/go-libp2p-discovery v0.1.0 h1:j+R6cokKcGbnZLf4kcNwpx6mDEUPF3N6SrqMymQhmvs= github.com/libp2p/go-libp2p-discovery v0.1.0/go.mod h1:4F/x+aldVHjHDHuX85x1zWoFTGElt8HnoDzwkFZm29g= github.com/libp2p/go-libp2p-discovery v0.2.0 h1:1p3YSOq7VsgaL+xVHPi8XAmtGyas6D2J6rWBEfz/aiY= github.com/libp2p/go-libp2p-discovery v0.2.0/go.mod h1:s4VGaxYMbw4+4+tsoQTqh7wfxg97AEdo4GYBt6BadWg= github.com/libp2p/go-libp2p-discovery v0.3.0/go.mod h1:o03drFnz9BVAZdzC/QUQ+NeQOu38Fu7LJGEOK2gQltw= -github.com/libp2p/go-libp2p-discovery v0.4.0 h1:dK78UhopBk48mlHtRCzbdLm3q/81g77FahEBTjcqQT8= -github.com/libp2p/go-libp2p-discovery v0.4.0/go.mod h1:bZ0aJSrFc/eX2llP0ryhb1kpgkPyTo23SJ5b7UQCMh4= github.com/libp2p/go-libp2p-discovery v0.5.0 h1:Qfl+e5+lfDgwdrXdu4YNCWyEo3fWuP+WgN9mN0iWviQ= github.com/libp2p/go-libp2p-discovery v0.5.0/go.mod h1:+srtPIU9gDaBNu//UHvcdliKBIcr4SfDcm0/PfPJLug= -github.com/libp2p/go-libp2p-gostream v0.2.1/go.mod h1:1Mjp3LDmkqICe5tH9yLVNCqFaRTy6OwBvuJV6j1b9Nk= github.com/libp2p/go-libp2p-gostream v0.3.0/go.mod h1:pLBQu8db7vBMNINGsAwLL/ZCE8wng5V1FThoaE5rNjc= github.com/libp2p/go-libp2p-host v0.0.1/go.mod h1:qWd+H1yuU0m5CwzAkvbSjqKairayEHdR5MMl7Cwa7Go= github.com/libp2p/go-libp2p-host v0.0.3 h1:BB/1Z+4X0rjKP5lbQTmjEjLbDVbrcmLOlA6QDsN5/j4= github.com/libp2p/go-libp2p-host v0.0.3/go.mod h1:Y/qPyA6C8j2coYyos1dfRm0I8+nvd4TGrDGt4tA7JR8= -github.com/libp2p/go-libp2p-http v0.1.5/go.mod h1:2YfPjsQxUlBGFQl2u461unkQ7ukwiSs7NX2eSslOJiU= github.com/libp2p/go-libp2p-http v0.2.0/go.mod h1:GlNKFqDZHe25LVy2CvnZKx75/jLtMaD3VxZV6N39X7E= github.com/libp2p/go-libp2p-interface-connmgr v0.0.1/go.mod h1:GarlRLH0LdeWcLnYM/SaBykKFl9U5JFnbBGruAk/D5k= github.com/libp2p/go-libp2p-interface-connmgr v0.0.4/go.mod h1:GarlRLH0LdeWcLnYM/SaBykKFl9U5JFnbBGruAk/D5k= @@ -902,8 +832,6 @@ github.com/libp2p/go-libp2p-interface-connmgr v0.0.5 h1:KG/KNYL2tYzXAfMvQN5K1aAG github.com/libp2p/go-libp2p-interface-connmgr v0.0.5/go.mod h1:GarlRLH0LdeWcLnYM/SaBykKFl9U5JFnbBGruAk/D5k= github.com/libp2p/go-libp2p-interface-pnet v0.0.1 h1:7GnzRrBTJHEsofi1ahFdPN9Si6skwXQE9UqR2S+Pkh8= github.com/libp2p/go-libp2p-interface-pnet v0.0.1/go.mod h1:el9jHpQAXK5dnTpKA4yfCNBZXvrzdOU75zz+C6ryp3k= -github.com/libp2p/go-libp2p-kad-dht v0.9.0 h1:AKeFYZvfAa/32Sgm0LrPDxGXB62AUtU8MRqqMobBfUM= -github.com/libp2p/go-libp2p-kad-dht v0.9.0/go.mod h1:LEKcCFHxnvypOPaqZ0m6h0fLQ9Y8t1iZMOg7a0aQDD4= github.com/libp2p/go-libp2p-kad-dht v0.11.1 h1:FsriVQhOUZpCotWIjyFSjEDNJmUzuMma/RyyTDZanwc= github.com/libp2p/go-libp2p-kad-dht v0.11.1/go.mod h1:5ojtR2acDPqh/jXf5orWy8YGb8bHQDS+qeDcoscL/PI= github.com/libp2p/go-libp2p-kbucket v0.4.7 h1:spZAcgxifvFZHBD8tErvppbnNiKA5uokDu3CV7axu70= @@ -923,13 +851,10 @@ github.com/libp2p/go-libp2p-mplex v0.2.2 h1:+Ld7YDAfVERQ0E+qqjE7o6fHwKuM0SqTzYiw github.com/libp2p/go-libp2p-mplex v0.2.2/go.mod h1:74S9eum0tVQdAfFiKxAyKzNdSuLqw5oadDq7+L/FELo= github.com/libp2p/go-libp2p-mplex v0.2.3 h1:2zijwaJvpdesST2MXpI5w9wWFRgYtMcpRX7rrw0jmOo= github.com/libp2p/go-libp2p-mplex v0.2.3/go.mod h1:CK3p2+9qH9x+7ER/gWWDYJ3QW5ZxWDkm+dVvjfuG3ek= -github.com/libp2p/go-libp2p-mplex v0.2.4 h1:XFFXaN4jhqnIuJVjYOR3k6bnRj0mFfJOlIuDVww+4Zo= -github.com/libp2p/go-libp2p-mplex v0.2.4/go.mod h1:mI7iOezdWFOisvUwaYd3IDrJ4oVmgoXK8H331ui39CE= github.com/libp2p/go-libp2p-mplex v0.3.0/go.mod h1:l9QWxRbbb5/hQMECEb908GbS9Sm2UAR2KFZKUJEynEs= github.com/libp2p/go-libp2p-mplex v0.4.0/go.mod h1:yCyWJE2sc6TBTnFpjvLuEJgTSw/u+MamvzILKdX7asw= github.com/libp2p/go-libp2p-mplex v0.4.1 h1:/pyhkP1nLwjG3OM+VuaNJkQT/Pqq73WzB3aDN3Fx1sc= github.com/libp2p/go-libp2p-mplex v0.4.1/go.mod h1:cmy+3GfqfM1PceHTLL7zQzAAYaryDu6iPSC+CIb094g= -github.com/libp2p/go-libp2p-nat v0.0.2/go.mod h1:QrjXQSD5Dj4IJOdEcjHRkWTSomyxRo6HnUkf/TfQpLQ= github.com/libp2p/go-libp2p-nat v0.0.4 h1:+KXK324yaY701On8a0aGjTnw8467kW3ExKcqW2wwmyw= github.com/libp2p/go-libp2p-nat v0.0.4/go.mod h1:N9Js/zVtAXqaeT99cXgTV9e75KpnWCvVOiGzlcHmBbY= github.com/libp2p/go-libp2p-nat v0.0.5 h1:/mH8pXFVKleflDL1YwqMg27W9GD8kjEx7NY0P6eGc98= @@ -963,27 +888,17 @@ github.com/libp2p/go-libp2p-peerstore v0.2.0/go.mod h1:N2l3eVIeAitSg3Pi2ipSrJYnq github.com/libp2p/go-libp2p-peerstore v0.2.1/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRjwRLBr4TYKfNgrUkOPA= github.com/libp2p/go-libp2p-peerstore v0.2.2 h1:iqc/m03jHn5doXN3+kS6JKvqQRHEltiXljQB85iVHWE= github.com/libp2p/go-libp2p-peerstore v0.2.2/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRjwRLBr4TYKfNgrUkOPA= -github.com/libp2p/go-libp2p-peerstore v0.2.3 h1:MofRq2l3c15vQpEygTetV+zRRrncz+ktiXW7H2EKoEQ= -github.com/libp2p/go-libp2p-peerstore v0.2.3/go.mod h1:K8ljLdFn590GMttg/luh4caB/3g0vKuY01psze0upRw= -github.com/libp2p/go-libp2p-peerstore v0.2.4/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= github.com/libp2p/go-libp2p-peerstore v0.2.6 h1:2ACefBX23iMdJU9Ke+dcXt3w86MIryes9v7In4+Qq3U= github.com/libp2p/go-libp2p-peerstore v0.2.6/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= github.com/libp2p/go-libp2p-protocol v0.0.1 h1:+zkEmZ2yFDi5adpVE3t9dqh/N9TbpFWywowzeEzBbLM= github.com/libp2p/go-libp2p-protocol v0.0.1/go.mod h1:Af9n4PiruirSDjHycM1QuiMi/1VZNHYcK8cLgFJLZ4s= github.com/libp2p/go-libp2p-protocol v0.1.0 h1:HdqhEyhg0ToCaxgMhnOmUO8snQtt/kQlcjVk3UoJU3c= github.com/libp2p/go-libp2p-protocol v0.1.0/go.mod h1:KQPHpAabB57XQxGrXCNvbL6UEXfQqUgC/1adR2Xtflk= -github.com/libp2p/go-libp2p-pubsub v0.3.2/go.mod h1:Uss7/Cfz872KggNb+doCVPHeCDmXB7z500m/R8DaAUk= -github.com/libp2p/go-libp2p-pubsub v0.3.5 h1:iF75GWpcxKEUQU8tTkgLy69qIQvfhL+t6U6ndQrB6ho= -github.com/libp2p/go-libp2p-pubsub v0.3.5/go.mod h1:DTMSVmZZfXodB/pvdTGrY2eHPZ9W2ev7hzTH83OKHrI= github.com/libp2p/go-libp2p-pubsub v0.4.0/go.mod h1:izkeMLvz6Ht8yAISXjx60XUQZMq9ZMe5h2ih4dLIBIQ= github.com/libp2p/go-libp2p-pubsub v0.4.1 h1:j4umIg5nyus+sqNfU+FWvb9aeYFQH/A+nDFhWj+8yy8= github.com/libp2p/go-libp2p-pubsub v0.4.1/go.mod h1:izkeMLvz6Ht8yAISXjx60XUQZMq9ZMe5h2ih4dLIBIQ= -github.com/libp2p/go-libp2p-pubsub-router v0.3.2 h1:BGC4irCUXlwmlCSxnA2DVDNY8JqhfAUUaiq3CZvcddw= -github.com/libp2p/go-libp2p-pubsub-router v0.3.2/go.mod h1:G4MAvYzPxhoR0LEBluS9Ow+Nnr/8iDalUN+RNwVgNkY= github.com/libp2p/go-libp2p-pubsub-router v0.4.0 h1:KjzTLIOBCt0+/4wH6epTxD/Qu4Up/IyeKHlj9MhWRJI= github.com/libp2p/go-libp2p-pubsub-router v0.4.0/go.mod h1:hs0j0ugcBjMOMgJ6diOlZM2rZEId/w5Gg86E+ac4SmQ= -github.com/libp2p/go-libp2p-quic-transport v0.8.0 h1:mHA94K2+TD0e9XtjWx/P5jGGZn0GdQ4OFYwNllagv4E= -github.com/libp2p/go-libp2p-quic-transport v0.8.0/go.mod h1:F2FG/6Bzz0U6essUVxDzE0s9CrY4XGLbl7QEmDNvU7A= github.com/libp2p/go-libp2p-quic-transport v0.10.0 h1:koDCbWD9CCHwcHZL3/WEvP2A+e/o5/W5L3QS/2SPMA0= github.com/libp2p/go-libp2p-quic-transport v0.10.0/go.mod h1:RfJbZ8IqXIhxBRm5hqUEJqjiiY8xmEuq3HUDS993MkA= github.com/libp2p/go-libp2p-record v0.0.1 h1:zN7AS3X46qmwsw5JLxdDuI43cH5UYwovKxHPjKBYQxw= @@ -999,7 +914,6 @@ github.com/libp2p/go-libp2p-routing v0.0.1 h1:hPMAWktf9rYi3ME4MG48qE7dq1ofJxiQbf github.com/libp2p/go-libp2p-routing v0.0.1/go.mod h1:N51q3yTr4Zdr7V8Jt2JIktVU+3xBBylx1MZeVA6t1Ys= github.com/libp2p/go-libp2p-routing-helpers v0.2.3 h1:xY61alxJ6PurSi+MXbywZpelvuU4U4p/gPTxjqCqTzY= github.com/libp2p/go-libp2p-routing-helpers v0.2.3/go.mod h1:795bh+9YeoFl99rMASoiVgHdi5bjack0N1+AFAdbvBw= -github.com/libp2p/go-libp2p-secio v0.0.1/go.mod h1:IdG6iQybdcYmbTzxp4J5dwtUEDTOvZrT0opIDVNPrJs= github.com/libp2p/go-libp2p-secio v0.0.3 h1:h3fPeDrej7bvvARnC2oSjAfcLZOaS4REZKgWCRQNpE4= github.com/libp2p/go-libp2p-secio v0.0.3/go.mod h1:hS7HQ00MgLhRO/Wyu1bTX6ctJKhVpm+j2/S2A5UqYb0= github.com/libp2p/go-libp2p-secio v0.1.0 h1:NNP5KLxuP97sE5Bu3iuwOWyT/dKEGMN5zSLMWdB7GTQ= @@ -1009,7 +923,6 @@ github.com/libp2p/go-libp2p-secio v0.2.1 h1:eNWbJTdyPA7NxhP7J3c5lT97DC5d+u+Ildkg github.com/libp2p/go-libp2p-secio v0.2.1/go.mod h1:cWtZpILJqkqrSkiYcDBh5lA3wbT2Q+hz3rJQq3iftD8= github.com/libp2p/go-libp2p-secio v0.2.2 h1:rLLPvShPQAcY6eNurKNZq3eZjPWfU9kXF2eI9jIYdrg= github.com/libp2p/go-libp2p-secio v0.2.2/go.mod h1:wP3bS+m5AUnFA+OFO7Er03uO1mncHG0uVwGrwvjYlNY= -github.com/libp2p/go-libp2p-swarm v0.0.1/go.mod h1:mh+KZxkbd3lQnveQ3j2q60BM1Cw2mX36XXQqwfPOShs= github.com/libp2p/go-libp2p-swarm v0.0.6 h1:gE0P/v2h+KEXtAi9YTw2UBOSODJ4m9VuuJ+ktc2LVUo= github.com/libp2p/go-libp2p-swarm v0.0.6/go.mod h1:s5GZvzg9xXe8sbeESuFpjt8CJPTCa8mhEusweJqyFy8= github.com/libp2p/go-libp2p-swarm v0.1.0 h1:HrFk2p0awrGEgch9JXK/qp/hfjqQfgNxpLWnCiWPg5s= @@ -1018,7 +931,6 @@ github.com/libp2p/go-libp2p-swarm v0.2.2 h1:T4hUpgEs2r371PweU3DuH7EOmBIdTBCwWs+F github.com/libp2p/go-libp2p-swarm v0.2.2/go.mod h1:fvmtQ0T1nErXym1/aa1uJEyN7JzaTNyBcHImCxRpPKU= github.com/libp2p/go-libp2p-swarm v0.2.3 h1:uVkCb8Blfg7HQ/f30TyHn1g/uCwXsAET7pU0U59gx/A= github.com/libp2p/go-libp2p-swarm v0.2.3/go.mod h1:P2VO/EpxRyDxtChXz/VPVXyTnszHvokHKRhfkEgFKNM= -github.com/libp2p/go-libp2p-swarm v0.2.4/go.mod h1:/xIpHFPPh3wmSthtxdGbkHZ0OET1h/GGZes8Wku/M5Y= github.com/libp2p/go-libp2p-swarm v0.2.8 h1:cIUUvytBzNQmGSjnXFlI6UpoBGsaud82mJPIJVfkDlg= github.com/libp2p/go-libp2p-swarm v0.2.8/go.mod h1:JQKMGSth4SMqonruY0a8yjlPVIkb0mdNSwckW7OYziM= github.com/libp2p/go-libp2p-swarm v0.3.0/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= @@ -1034,17 +946,14 @@ github.com/libp2p/go-libp2p-testing v0.1.0/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eq github.com/libp2p/go-libp2p-testing v0.1.1 h1:U03z3HnGI7Ni8Xx6ONVZvUFOAzWYmolWf5W5jAOPNmU= github.com/libp2p/go-libp2p-testing v0.1.1/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0= github.com/libp2p/go-libp2p-testing v0.1.2-0.20200422005655-8775583591d8/go.mod h1:Qy8sAncLKpwXtS2dSnDOP8ktexIAHKu+J+pnZOFZLTc= -github.com/libp2p/go-libp2p-testing v0.2.0 h1:DdC8Dthjf97Hz3t3siZCRD1U3nuNxQgEyTWvLh6ayvw= -github.com/libp2p/go-libp2p-testing v0.2.0/go.mod h1:Qy8sAncLKpwXtS2dSnDOP8ktexIAHKu+J+pnZOFZLTc= github.com/libp2p/go-libp2p-testing v0.3.0/go.mod h1:efZkql4UZ7OVsEfaxNHZPzIehtsBXMrXnCfJIgDti5g= +github.com/libp2p/go-libp2p-testing v0.4.0 h1:PrwHRi0IGqOwVQWR3xzgigSlhlLfxgfXgkHxr77EghQ= github.com/libp2p/go-libp2p-testing v0.4.0/go.mod h1:Q+PFXYoiYFN5CAEG2w3gLPEzotlKsNSbKQ/lImlOWF0= github.com/libp2p/go-libp2p-tls v0.1.3 h1:twKMhMu44jQO+HgQK9X8NHO5HkeJu2QbhLzLJpa8oNM= github.com/libp2p/go-libp2p-tls v0.1.3/go.mod h1:wZfuewxOndz5RTnCAxFliGjvYSDA40sKitV4c50uI1M= github.com/libp2p/go-libp2p-transport v0.0.1/go.mod h1:UzbUs9X+PHOSw7S3ZmeOxfnwaQY5vGDzZmKPod3N3tk= -github.com/libp2p/go-libp2p-transport v0.0.4/go.mod h1:StoY3sx6IqsP6XKoabsPnHCwqKXWUMWU7Rfcsubee/A= github.com/libp2p/go-libp2p-transport v0.0.5 h1:pV6+UlRxyDpASSGD+60vMvdifSCby6JkJDfi+yUMHac= github.com/libp2p/go-libp2p-transport v0.0.5/go.mod h1:StoY3sx6IqsP6XKoabsPnHCwqKXWUMWU7Rfcsubee/A= -github.com/libp2p/go-libp2p-transport-upgrader v0.0.1/go.mod h1:NJpUAgQab/8K6K0m+JmZCe5RUXG10UMEx4kWe9Ipj5c= github.com/libp2p/go-libp2p-transport-upgrader v0.0.4 h1:uGMOd14BL1oFlfb/cGfOxPjiTKBhzWV4aMjjoCF1Z1o= github.com/libp2p/go-libp2p-transport-upgrader v0.0.4/go.mod h1:RGq+tupk+oj7PzL2kn/m1w6YXxcIAYJYeI90h6BGgUc= github.com/libp2p/go-libp2p-transport-upgrader v0.1.1 h1:PZMS9lhjK9VytzMCW3tWHAXtKXmlURSc3ZdvwEcKCzw= @@ -1077,7 +986,6 @@ github.com/libp2p/go-maddr-filter v0.0.4/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9 github.com/libp2p/go-maddr-filter v0.0.5 h1:CW3AgbMO6vUvT4kf87y4N+0P8KUl2aqLYhrGyDUbLSg= github.com/libp2p/go-maddr-filter v0.0.5/go.mod h1:Jk+36PMfIqCJhAnaASRH83bdAvfDRp/w6ENFaC9bG+M= github.com/libp2p/go-maddr-filter v0.1.0/go.mod h1:VzZhTXkMucEGGEOSKddrwGiOv0tUhgnKqNEmIAz/bPU= -github.com/libp2p/go-mplex v0.0.1/go.mod h1:pK5yMLmOoBR1pNCqDlA2GQrdAVTMkqFalaTWe7l4Yd0= github.com/libp2p/go-mplex v0.0.3/go.mod h1:pK5yMLmOoBR1pNCqDlA2GQrdAVTMkqFalaTWe7l4Yd0= github.com/libp2p/go-mplex v0.0.4 h1:043XJ3Zr7/Oz5cfyUaJwxUZyP02TngTpt4oq8R5UizQ= github.com/libp2p/go-mplex v0.0.4/go.mod h1:pK5yMLmOoBR1pNCqDlA2GQrdAVTMkqFalaTWe7l4Yd0= @@ -1090,7 +998,6 @@ github.com/libp2p/go-mplex v0.1.2/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3 github.com/libp2p/go-mplex v0.2.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ6msjvYQ= github.com/libp2p/go-mplex v0.3.0 h1:U1T+vmCYJaEoDJPV1aq31N56hS+lJgb397GsylNSgrU= github.com/libp2p/go-mplex v0.3.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ6msjvYQ= -github.com/libp2p/go-msgio v0.0.1/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.2 h1:ivPvEKHxmVkTClHzg6RXTYHqaJQ0V9cDbq+6lKb3UV0= github.com/libp2p/go-msgio v0.0.2/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.3/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= @@ -1121,7 +1028,6 @@ github.com/libp2p/go-reuseport v0.0.1 h1:7PhkfH73VXfPJYKQ6JwS5I/eVcoyYi9IMNGc6FW github.com/libp2p/go-reuseport v0.0.1/go.mod h1:jn6RmB1ufnQwl0Q1f+YxAj8isJgDCQzaaxIFYDhcYEA= github.com/libp2p/go-reuseport v0.0.2 h1:XSG94b1FJfGA01BUrT82imejHQyTxO4jEWqheyCXYvU= github.com/libp2p/go-reuseport v0.0.2/go.mod h1:SPD+5RwGC7rcnzngoYC86GjPzjSywuQyMVAheVBD9nQ= -github.com/libp2p/go-reuseport-transport v0.0.1/go.mod h1:YkbSDrvjUVDL6b8XqriyA20obEtsW9BLkuOUyQAOCbs= github.com/libp2p/go-reuseport-transport v0.0.2 h1:WglMwyXyBu61CMkjCCtnmqNqnjib0GIEjMiHTwR/KN4= github.com/libp2p/go-reuseport-transport v0.0.2/go.mod h1:YkbSDrvjUVDL6b8XqriyA20obEtsW9BLkuOUyQAOCbs= github.com/libp2p/go-reuseport-transport v0.0.3 h1:zzOeXnTooCkRvoH+bSXEfXhn76+LAiwoneM0gnXjF2M= @@ -1142,7 +1048,6 @@ github.com/libp2p/go-stream-muxer-multistream v0.2.0 h1:714bRJ4Zy9mdhyTLJ+ZKiROm github.com/libp2p/go-stream-muxer-multistream v0.2.0/go.mod h1:j9eyPol/LLRqT+GPLSxvimPhNph4sfYfMoDPd7HkzIc= github.com/libp2p/go-stream-muxer-multistream v0.3.0 h1:TqnSHPJEIqDEO7h1wZZ0p3DXdvDSiLHQidKKUGZtiOY= github.com/libp2p/go-stream-muxer-multistream v0.3.0/go.mod h1:yDh8abSIzmZtqtOt64gFJUXEryejzNb0lisTt+fAMJA= -github.com/libp2p/go-tcp-transport v0.0.1/go.mod h1:mnjg0o0O5TmXUaUIanYPUqkW4+u6mK0en8rlpA6BBTs= github.com/libp2p/go-tcp-transport v0.0.4 h1:2iRu994wCT/iEz62F+c60FUoSkijNEQ0q2Itc+79XlQ= github.com/libp2p/go-tcp-transport v0.0.4/go.mod h1:+E8HvC8ezEVOxIo3V5vCK9l1y/19K427vCzQ+xHKH/o= github.com/libp2p/go-tcp-transport v0.1.0 h1:IGhowvEqyMFknOar4FWCKSWE0zL36UFKQtiRQD60/8o= @@ -1157,7 +1062,6 @@ github.com/libp2p/go-testutil v0.0.1 h1:Xg+O0G2HIMfHqBOBDcMS1iSZJ3GEcId4qOxCQvsG github.com/libp2p/go-testutil v0.0.1/go.mod h1:iAcJc/DKJQanJ5ws2V+u5ywdL2n12X1WbbEG+Jjy69I= github.com/libp2p/go-testutil v0.1.0 h1:4QhjaWGO89udplblLVpgGDOQjzFlRavZOjuEnz2rLMc= github.com/libp2p/go-testutil v0.1.0/go.mod h1:81b2n5HypcVyrCg/MJx4Wgfp/VHojytjVe/gLzZ2Ehc= -github.com/libp2p/go-ws-transport v0.0.1/go.mod h1:p3bKjDWHEgtuKKj+2OdPYs5dAPIjtpQGHF2tJfGz7Ww= github.com/libp2p/go-ws-transport v0.0.5/go.mod h1:Qbl4BxPfXXhhd/o0wcrgoaItHqA9tnZjoFZnxykuaXU= github.com/libp2p/go-ws-transport v0.1.0 h1:F+0OvvdmPTDsVc4AjPHjV7L7Pk1B7D5QwtDcKE2oag4= github.com/libp2p/go-ws-transport v0.1.0/go.mod h1:rjw1MG1LU9YDC6gzmwObkPd/Sqwhw7yT74kj3raBFuo= @@ -1185,8 +1089,6 @@ github.com/libp2p/go-yamux/v2 v2.0.0 h1:vSGhAy5u6iHBq11ZDcyHH4Blcf9xlBhT4WQDoOE9 github.com/libp2p/go-yamux/v2 v2.0.0/go.mod h1:NVWira5+sVUIU6tu1JWvaRn1dRnG+cawOJiflsAM+7U= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/lucas-clemente/quic-go v0.18.0 h1:JhQDdqxdwdmGdKsKgXi1+coHRoGhvU6z0rNzOJqZ/4o= -github.com/lucas-clemente/quic-go v0.18.0/go.mod h1:yXttHsSNxQi8AWijC/vLP+OJczXqzHSOcJrM5ITUlCg= github.com/lucas-clemente/quic-go v0.19.3 h1:eCDQqvGBB+kCTkA0XrAFtNe81FMa0/fn4QSoeAbmiF4= github.com/lucas-clemente/quic-go v0.19.3/go.mod h1:ADXpNbTQjq1hIzCpB+y/k5iz4n4z4IwqoLb94Kh5Hu8= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= @@ -1196,12 +1098,10 @@ github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/marten-seemann/qpack v0.2.0/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= github.com/marten-seemann/qtls v0.10.0 h1:ECsuYUKalRL240rRD4Ri33ISb7kAQ3qGDlrrl55b2pc= github.com/marten-seemann/qtls v0.10.0/go.mod h1:UvMd1oaYDACI99/oZUYLzMCkBXQVT0aGm99sJhbT8hs= -github.com/marten-seemann/qtls-go1-15 v0.1.0 h1:i/YPXVxz8q9umso/5y474CNcHmTpA+5DH+mFPjx6PZg= -github.com/marten-seemann/qtls-go1-15 v0.1.0/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= +github.com/marten-seemann/qtls-go1-15 v0.1.1 h1:LIH6K34bPVttyXnUWixk0bzH6/N07VxbSabxn5A5gZQ= github.com/marten-seemann/qtls-go1-15 v0.1.1/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= @@ -1223,7 +1123,6 @@ github.com/mholt/archiver v3.1.1+incompatible h1:1dCVxuqs0dJseYEhi5pl7MYPH9zDa1w github.com/mholt/archiver v3.1.1+incompatible/go.mod h1:Dh2dOXnSdiLxRiPoVfIr/fI1TwETms9B8CTWfeh7ROU= github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.4/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.12 h1:WMhc1ik4LNkTg8U9l3hI1LvxKmIL+f1+WV/SZtCbDDA= github.com/miekg/dns v1.1.12/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.28 h1:gQhy5bsJa8zTlVI8lywCTZp1lguor+xevFoYlzeCTQY= @@ -1305,15 +1204,11 @@ github.com/multiformats/go-multiaddr-net v0.2.0 h1:MSXRGN0mFymt6B1yo/6BPnIRpLPEn github.com/multiformats/go-multiaddr-net v0.2.0/go.mod h1:gGdH3UXny6U3cKKYCvpXI5rnK7YaOIEOPVDI9tsJbEA= github.com/multiformats/go-multibase v0.0.1 h1:PN9/v21eLywrFWdFNsFKaU04kLJzuYzmrJR+ubhT9qA= github.com/multiformats/go-multibase v0.0.1/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= -github.com/multiformats/go-multibase v0.0.2 h1:2pAgScmS1g9XjH7EtAfNhTuyrWYEWcxy0G5Wo85hWDA= -github.com/multiformats/go-multibase v0.0.2/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= github.com/multiformats/go-multibase v0.0.3 h1:l/B6bJDQjvQ5G52jw4QGSYeOTZoAwIO77RblWplfIqk= github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U= github.com/multiformats/go-multihash v0.0.5 h1:1wxmCvTXAifAepIMyF39vZinRw5sbqjPs/UIi93+uik= github.com/multiformats/go-multihash v0.0.5/go.mod h1:lt/HCbqlQwlPBz7lv0sQCdtfcMtlJvakRUn/0Ual8po= -github.com/multiformats/go-multihash v0.0.7 h1:uoqoE03rGJdlQEPq2EAc6UeSbo4L7mZyeAAoqNalf54= -github.com/multiformats/go-multihash v0.0.7/go.mod h1:XuKXPp8VHcTygube3OWZC+aZrA+H1IhmjoCDtJc7PXM= github.com/multiformats/go-multihash v0.0.8/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= github.com/multiformats/go-multihash v0.0.9/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= github.com/multiformats/go-multihash v0.0.10 h1:lMoNbh2Ssd9PUF74Nz008KGzGPlfeV6wH3rit5IIGCM= @@ -1329,8 +1224,6 @@ github.com/multiformats/go-multistream v0.1.0 h1:UpO6jrsjqs46mqAK3n6wKRYFhugss9A github.com/multiformats/go-multistream v0.1.0/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.1.1 h1:JlAdpIFhBhGRLxe9W6Om0w++Gd6KMWoFPZL/dEnm9nI= github.com/multiformats/go-multistream v0.1.1/go.mod h1:KmHZ40hzVxiaiwlj3MEbYgK9JFk2/9UktWZAF54Du38= -github.com/multiformats/go-multistream v0.1.2 h1:knyamLYMPFPngQjGQ0lhnlys3jtVR/3xV6TREUJr+fE= -github.com/multiformats/go-multistream v0.1.2/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= github.com/multiformats/go-multistream v0.2.0 h1:6AuNmQVKUkRnddw2YiDjt5Elit40SFxMJkVnhmETXtU= github.com/multiformats/go-multistream v0.2.0/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= @@ -1520,8 +1413,6 @@ github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUr github.com/smartystreets/goconvey v0.0.0-20190222223459-a17d461953aa/go.mod h1:2RVY1rIf+2J2o/IM9+vPq9RzmHDSseB7FoXiSNIUsoU= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a h1:pa8hGb/2YqsZKovtsgrwcDH1RZhVbTKCjLp47XpqCDs= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 h1:WN9BUFbdyOsSH/XohnWpXOlq9NBD5sGAB2FciQMUEe8= -github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smola/gocompat v0.2.0 h1:6b1oIMlUXIpz//VKEDzPVBK8KG7beVwmHIUEBIs/Pns= @@ -1566,6 +1457,7 @@ github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFdE= @@ -1609,8 +1501,6 @@ github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc h1:BCPnHtcboa github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc/go.mod h1:r45hJU7yEoA81k6MWNhpMj/kms0n14dkzkxYHoB96UM= github.com/whyrusleeping/cbor-gen v0.0.0-20200123233031-1cdf64d27158 h1:WXhVOwj2USAXB5oMDwRl3piOux2XMV9TANaYxXHdkoE= github.com/whyrusleeping/cbor-gen v0.0.0-20200123233031-1cdf64d27158/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= -github.com/whyrusleeping/cbor-gen v0.0.0-20200402171437-3d27c146c105 h1:Sh6UG5dW5xW8Ek2CtRGq4ipdEvvx9hOyBJjEGyTYDl0= -github.com/whyrusleeping/cbor-gen v0.0.0-20200402171437-3d27c146c105/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= github.com/whyrusleeping/cbor-gen v0.0.0-20200710004633-5379fc63235d h1:wSxKhvbN7kUoP0sfRS+w2tWr45qlU8409i94hHLOT8w= github.com/whyrusleeping/cbor-gen v0.0.0-20200710004633-5379fc63235d/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f h1:jQa4QT2UP9WYv2nzyawpKMOCl+Z/jW7djv2/J50lj9E= @@ -1623,13 +1513,6 @@ github.com/whyrusleeping/go-logging v0.0.1 h1:fwpzlmT0kRC/Fmd0MdmGgJG/CXIZ6gFq46 github.com/whyrusleeping/go-logging v0.0.1/go.mod h1:lDPYj54zutzG1XYfHAhcc7oNXEburHQBn+Iqd4yS4vE= github.com/whyrusleeping/go-notifier v0.0.0-20170827234753-097c5d47330f h1:M/lL30eFZTKnomXY6huvM6G0+gVquFNf6mxghaWlFUg= github.com/whyrusleeping/go-notifier v0.0.0-20170827234753-097c5d47330f/go.mod h1:cZNvX9cFybI01GriPRMXDtczuvUhgbcYr9iCGaNlRv8= -github.com/whyrusleeping/go-smux-multiplex v3.0.16+incompatible h1:iqksILj8STw03EJQe7Laj4ubnw+ojOyik18cd5vPL1o= -github.com/whyrusleeping/go-smux-multiplex v3.0.16+incompatible/go.mod h1:34LEDbeKFZInPUrAG+bjuJmUXONGdEFW7XL0SpTY1y4= -github.com/whyrusleeping/go-smux-multistream v2.0.2+incompatible h1:BdYHctE9HJZLquG9tpTdwWcbG4FaX6tVKPGjCGgiVxo= -github.com/whyrusleeping/go-smux-multistream v2.0.2+incompatible/go.mod h1:dRWHHvc4HDQSHh9gbKEBbUZ+f2Q8iZTPG3UOGYODxSQ= -github.com/whyrusleeping/go-smux-yamux v2.0.8+incompatible/go.mod h1:6qHUzBXUbB9MXmw3AUdB52L8sEb/hScCqOdW2kj/wuI= -github.com/whyrusleeping/go-smux-yamux v2.0.9+incompatible h1:nVkExQ7pYlN9e45LcqTCOiDD0904fjtm0flnHZGbXkw= -github.com/whyrusleeping/go-smux-yamux v2.0.9+incompatible/go.mod h1:6qHUzBXUbB9MXmw3AUdB52L8sEb/hScCqOdW2kj/wuI= github.com/whyrusleeping/go-sysinfo v0.0.0-20190219211824-4a357d4b90b1/go.mod h1:tKH72zYNt/exx6/5IQO6L9LoQ0rEjd5SbbWaDTs9Zso= github.com/whyrusleeping/mafmt v1.2.8 h1:TCghSl5kkwEE0j+sU/gudyhVMRlpBin8fMBBHg59EbA= github.com/whyrusleeping/mafmt v1.2.8/go.mod h1:faQJFPbLSxzD9xpA02ttW/tS9vZykNvXwGvqIpk20FA= @@ -1639,12 +1522,9 @@ github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9 h1:Y1/FEOpaCpD2 github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9/go.mod h1:j4l84WPFclQPj320J9gp0XwNKBb3U0zt5CBqjPp22G4= github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 h1:E9S12nwJwEOXe2d6gT6qxdvqMnNq+VnSsKPgm2ZZNds= github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7/go.mod h1:X2c0RVCI1eSUFI8eLcY3c0423ykwiUdxLJtkDvruhjI= -github.com/whyrusleeping/tar-utils v0.0.0-20180509141711-8c6c8ba81d5c/go.mod h1:xxcJeBb7SIUl/Wzkz1eVKJE/CB34YNrqX2TQI6jY9zs= github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b/go.mod h1:xT1Y5p2JR2PfSZihE0s4mjdJaRGp1waCTf5JzhQLBck= github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee h1:lYbXeSvJi5zk5GLKVuid9TVjS9a0OmLIDKTfoZBL6Ow= github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee/go.mod h1:m2aV4LZI4Aez7dP5PMyVKEHhUyEJ/RjmPEDOpDvudHg= -github.com/whyrusleeping/yamux v1.1.5 h1:4CK3aUUJQu0qpKZv5gEWJjNOQtdbdDhVVS6PJ+HimdE= -github.com/whyrusleeping/yamux v1.1.5/go.mod h1:E8LnQQ8HKx5KD29HZFUwM1PxCOdPRzGwur1mcYhXcD8= github.com/willf/bitset v1.1.10 h1:NotGKqX0KwQ72NUzqrjZq5ipPNDQex9lo3WpaS8L2sc= github.com/willf/bitset v1.1.10/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willf/bloom v2.0.3+incompatible h1:QDacWdqcAUI1MPOwIQZRy9kOR7yxfyEmxX8Wdm2/JPA= @@ -1787,7 +1667,6 @@ golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180524181706-dfa909b99c79/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1854,6 +1733,7 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1910,7 +1790,6 @@ golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 h1:ogLJMz+qpzav7lGMh10LMvAkM/fAoGlaiiHYiFYdm80= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1975,12 +1854,11 @@ golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375 h1:SjQ2+AKWgZLc1xej6WSzL+Dfs5Uyd5xcZH1mGC411IA= -golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200827010519-17fd2f27a9e3/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200928182047-19e03678916f h1:VwGa2Wf+rHGIxvsssCkUNIyFv8jQY0VCBCNWtikoWq0= golang.org/x/tools v0.0.0-20200928182047-19e03678916f/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a h1:CB3a9Nez8M13wwlr/E2YtwoU+qYHKfC+JrDa45RXXoQ= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2078,7 +1956,6 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= From 43c92725580e0862b4be66222b8060798ca5539c Mon Sep 17 00:00:00 2001 From: sidenaio Date: Wed, 10 Mar 2021 18:55:43 +0500 Subject: [PATCH 07/15] fixes --- blockchain/blockchain.go | 33 ++++---------------- blockchain/validation/validation.go | 2 -- common/network.go | 25 +++++++++++++++ core/state/statedb.go | 4 +-- pengings/proposals.go | 47 ++++++++++++++++++++++------- 5 files changed, 69 insertions(+), 42 deletions(-) diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index 8894019a..c9d1ea11 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -55,7 +55,7 @@ const ( ) var ( - MaxHash *big.Float + ParentHashIsInvalid = errors.New("parentHash is invalid") BlockInsertionErr = errors.New("can't insert block") ) @@ -84,17 +84,6 @@ type Blockchain struct { isSyncing bool } -func init() { - var max [32]byte - for i := range max { - max[i] = 0xFF - } - i := new(big.Int) - i.SetBytes(max[:]) - MaxHash = new(big.Float) - MaxHash.SetInt(i) -} - func NewBlockchain(config *config.Config, db dbm.DB, txpool *mempool.TxPool, appState *appstate.AppState, ipfs ipfs.Proxy, secStore *secstore.SecStore, bus eventbus.Bus, offlineDetector *OfflineDetector, keyStore *keystore.KeyStore, subManager *subscriptions.Manager, upgrader *upgrade.Upgrader) *Blockchain { return &Blockchain{ @@ -475,9 +464,9 @@ func (chain *Blockchain) applyEmptyBlockOnState( statsCollector collector.StatsCollector, ) (root common.Hash, identityRoot common.Hash, diff *state.IdentityStateDiff) { - chain.applyNewEpoch(appState, block, statsCollector) chain.applyStatusSwitch(appState, block) chain.applyDelegationSwitch(appState, block) + chain.applyNewEpoch(appState, block, statsCollector) chain.applyGlobalParams(appState, block, statsCollector) chain.applyVrfProposerThreshold(appState, block) diff = appState.Precommit() @@ -846,7 +835,7 @@ func (chain *Blockchain) rewardFinalCommittee(appState *appstate.AppState, block return } totalReward := big.NewInt(0) - totalReward.Div(chain.config.Consensus.FinalCommitteeReward, big.NewInt(int64(identities.Addresses.Cardinality()))) + totalReward.Div(chain.config.Consensus.FinalCommitteeReward, big.NewInt(int64(identities.Original.Cardinality()))) collector.SetCommitteeRewardShare(statsCollector, totalReward) reward, stake := splitReward(totalReward, false, chain.config.Consensus) @@ -1042,6 +1031,7 @@ func (chain *Blockchain) ApplyTxOnState(appState *appstate.AppState, vm vm.VM, t case types.KillDelegatorTx: collector.BeginTxBalanceUpdate(statsCollector, tx, appState) defer collector.CompleteBalanceUpdate(statsCollector, appState) + removeLinksWithInviterAndInvitees(stateDB, *tx.To) stateDB.SetState(*tx.To, state.Killed) appState.IdentityState.Remove(*tx.To) stake := stateDB.GetStakeBalance(*tx.To) @@ -1529,16 +1519,10 @@ func (chain *Blockchain) getProposerData() []byte { func (chain *Blockchain) getSortition(data []byte, threshold float64, modifier int64) (bool, []byte) { hash, proof := chain.secStore.VrfEvaluate(data) + q := common.HashToFloat(hash, modifier ) - v := new(big.Float).SetInt(new(big.Int).SetBytes(hash[:])) - - q := new(big.Float).Quo(v, MaxHash) vrfThreshold := new(big.Float).SetFloat64(threshold) - if modifier > 1 { - q = math.Root(q, uint64(modifier)) - } - if q.Cmp(vrfThreshold) >= 0 { return true, proof } @@ -1715,16 +1699,11 @@ func (chain *Blockchain) ValidateProposerProof(proof []byte, pubKeyData []byte) h, err := verifier.ProofToHash(chain.getProposerData(), proof) - v := new(big.Float).SetInt(new(big.Int).SetBytes(h[:])) - vrfThreshold := new(big.Float).SetFloat64(chain.appState.State.VrfProposerThreshold()) - q := new(big.Float).Quo(v, MaxHash) proposerAddr := crypto.PubkeyToAddress(*pubKey) modifier := chain.appState.ValidatorsCache.PoolSize(proposerAddr) - if modifier > 1 { - q = math.Root(q, uint64(modifier)) - } + q := common.HashToFloat(h, int64(modifier)) if q.Cmp(vrfThreshold) == -1 { return errors.New("Proposer is invalid") diff --git a/blockchain/validation/validation.go b/blockchain/validation/validation.go index 29e639ef..5cad358c 100644 --- a/blockchain/validation/validation.go +++ b/blockchain/validation/validation.go @@ -105,8 +105,6 @@ func init() { types.DeployContract: validateDeployContractTx, types.CallContract: validateCallContractTx, types.TerminateContract: validateTerminateContractTx, - types.DelegateTx: validateDelegateTx, - types.UndelegateTx: validateUndelegateTx, } } func SetAppConfig(cfg *config.Config) { diff --git a/common/network.go b/common/network.go index 0703919b..c2558542 100644 --- a/common/network.go +++ b/common/network.go @@ -4,6 +4,7 @@ import ( math2 "github.com/idena-network/idena-go/common/math" "github.com/shopspring/decimal" "math" + "math/big" "time" ) @@ -30,6 +31,19 @@ const ( LastScoresCount = 10 ) +var MaxHashFloat *big.Float + +func init() { + var max [HashLength]byte + for i := range max { + max[i] = 0xFF + } + i := new(big.Int) + i.SetBytes(max[:]) + MaxHashFloat = new(big.Float) + MaxHashFloat.SetInt(i) +} + func ShortSessionExtraFlipsCount() uint { return ShortSessionExtraFlips } @@ -103,3 +117,14 @@ func CalculateIdentityScores(scores []byte, totalShortPoints float32, totalShort return sumPoints, sumFlips } + +func HashToFloat(hash [32]byte, modifier int64) *big.Float { + v := new(big.Float).SetInt(new(big.Int).SetBytes(hash[:])) + + q := new(big.Float).Quo(v, MaxHashFloat) + + if modifier > 1 { + q = math2.Root(q, uint64(modifier)) + } + return q +} diff --git a/core/state/statedb.go b/core/state/statedb.go index ae71bd33..7c26651b 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -1270,8 +1270,8 @@ func (s *StateDB) ClearStatusSwitchAddresses() { } func (s *StateDB) ToggleStatusSwitchAddress(sender common.Address) { - delegationSwitch := s.GetOrNewStatusSwitchObject() - delegationSwitch.ToggleAddress(sender) + statusSwitch := s.GetOrNewStatusSwitchObject() + statusSwitch.ToggleAddress(sender) } func (s *StateDB) ToggleDelegationAddress(sender common.Address, delegatee common.Address) { diff --git a/pengings/proposals.go b/pengings/proposals.go index 10b7745c..8658ad7d 100644 --- a/pengings/proposals.go +++ b/pengings/proposals.go @@ -8,12 +8,14 @@ import ( "github.com/idena-network/idena-go/common" "github.com/idena-network/idena-go/core/appstate" "github.com/idena-network/idena-go/core/upgrade" + "github.com/idena-network/idena-go/crypto" "github.com/idena-network/idena-go/crypto/vrf" "github.com/idena-network/idena-go/log" "github.com/libp2p/go-libp2p-core/peer" "github.com/patrickmn/go-cache" "github.com/pkg/errors" "github.com/shopspring/decimal" + "math/big" "sync" "time" ) @@ -59,6 +61,8 @@ type proposedBlock struct { type bestHash struct { common.Hash + // modified by pool size representation of hash + floatValue *big.Float ProposerPubKey []byte } @@ -106,21 +110,30 @@ func (proposals *Proposals) AddProposeProof(proposal *types.ProofProposal) (adde return false, false } - if !proposals.compareWithBestHash(currentRound, hash) { + pubKeyBytes, err := types.ProofProposalPubKey(proposal) + if err != nil { return false, false } - pubKey, err := types.ProofProposalPubKey(proposal) + pubKey, err := crypto.UnmarshalPubkey(pubKeyBytes) if err != nil { return false, false } - if err := proposals.chain.ValidateProposerProof(proposal.Proof, pubKey); err != nil { + proposerAddr := crypto.PubkeyToAddress(*pubKey) + + modifier := proposals.appState.ValidatorsCache.PoolSize(proposerAddr) + + if !proposals.compareWithBestHash(currentRound, hash, modifier) { + return false, false + } + + if err := proposals.chain.ValidateProposerProof(proposal.Proof, pubKeyBytes); err != nil { log.Warn("Failed proposed proof validation", "err", err) return false, false } - proposals.setBestHash(currentRound, hash, pubKey) + proposals.setBestHash(currentRound, hash, pubKeyBytes, modifier) return true, false } else if currentRound < proposal.Round && proposal.Round-currentRound < DeferFutureProposalsPeriod { @@ -214,7 +227,16 @@ func (proposals *Proposals) AddProposedBlock(proposal *types.BlockProposal, peer } vrfHash := common.Hash(h) - if !proposals.compareWithBestHash(currentRound, vrfHash) { + pubKey, err := crypto.UnmarshalPubkey(block.Header.ProposedHeader.ProposerPubKey) + if err != nil { + return false, false + } + + proposerAddr := crypto.PubkeyToAddress(*pubKey) + + modifier := proposals.appState.ValidatorsCache.PoolSize(proposerAddr) + + if !proposals.compareWithBestHash(currentRound, vrfHash, modifier) { return false, false } @@ -248,7 +270,7 @@ func (proposals *Proposals) AddProposedBlock(proposal *types.BlockProposal, peer } round.Store(block.Hash(), &proposedBlock{proposal: proposal, receivingTime: receivingTime}) - proposals.setBestHash(currentRound, vrfHash, block.Header.ProposedHeader.ProposerPubKey) + proposals.setBestHash(currentRound, vrfHash, block.Header.ProposedHeader.ProposerPubKey, modifier) return true, false } else if currentRound < block.Height() && block.Height()-currentRound < DeferFutureProposalsPeriod { proposals.pendingBlocks.LoadOrStore(block.Hash(), &blockPeer{ @@ -343,27 +365,30 @@ func (proposals *Proposals) GetBlock(hash common.Hash) *types.Block { return block.(*types.Block) } -func (proposals *Proposals) compareWithBestHash(round uint64, hash common.Hash) bool { +func (proposals *Proposals) compareWithBestHash(round uint64, hash common.Hash, modifier int) bool { proposals.bestProofsMutex.RLock() defer proposals.bestProofsMutex.RUnlock() + + q := common.HashToFloat(hash, int64(modifier)) + if bestHash, ok := proposals.bestProofs[round]; ok { - return bytes.Compare(hash[:], bestHash.Hash[:]) >= 0 + return q.Cmp(bestHash.floatValue) >= 0 } return true } -func (proposals *Proposals) setBestHash(round uint64, hash common.Hash, proposerPubKey []byte) { +func (proposals *Proposals) setBestHash(round uint64, hash common.Hash, proposerPubKey []byte, modifier int) { proposals.bestProofsMutex.Lock() defer proposals.bestProofsMutex.Unlock() if stored, ok := proposals.bestProofs[round]; ok { if bytes.Compare(hash[:], stored.Hash[:]) >= 0 { proposals.bestProofs[round] = bestHash{ - hash, proposerPubKey, + hash, common.HashToFloat(hash, int64(modifier)), proposerPubKey, } } } else { proposals.bestProofs[round] = bestHash{ - hash, proposerPubKey, + hash, common.HashToFloat(hash, int64(modifier)), proposerPubKey, } } } From 16825a22634bf66e10a307d1686a1868c7424583 Mon Sep 17 00:00:00 2001 From: sidenaio Date: Mon, 15 Mar 2021 17:00:45 +0500 Subject: [PATCH 08/15] PR fixes --- blockchain/blockchain.go | 2 +- consensus/engine.go | 2 +- core/validators/validators.go | 6 ++++-- core/validators/validators_test.go | 2 +- pengings/proposals.go | 8 +++++--- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index c9d1ea11..4c242c22 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -1644,7 +1644,7 @@ func (chain *Blockchain) ValidateBlockCert(prevBlock *types.Header, block *types voters.Add(vote.VoterAddr()) } - if voters.Cardinality() < chain.GetCommitteeVotesThreshold(validatorsCache, step == types.Final)-validators.VotesCountSubtrahend() { + if voters.Cardinality() < chain.GetCommitteeVotesThreshold(validatorsCache, step == types.Final)-validators.VotesCountSubtrahend(chain.config.Consensus.AgreementThreshold) { return errors.New("not enough votes") } return nil diff --git a/consensus/engine.go b/consensus/engine.go index 0a4fbdc3..00e32daf 100644 --- a/consensus/engine.go +++ b/consensus/engine.go @@ -484,7 +484,7 @@ func (engine *Engine) countVotes(round uint64, step uint8, parentHash common.Has return common.Hash{}, nil, errors.Errorf("validators were not setup, step=%v", step) } - necessaryVotesCount -= validators.VotesCountSubtrahend() + necessaryVotesCount -= validators.VotesCountSubtrahend(engine.cfg.Consensus.AgreementThreshold) for start := time.Now(); time.Since(start) < timeout; { m := engine.votes.GetVotesOfRound(round) diff --git a/core/validators/validators.go b/core/validators/validators.go index e39f1e53..c2a49de5 100644 --- a/core/validators/validators.go +++ b/core/validators/validators.go @@ -10,6 +10,7 @@ import ( "github.com/idena-network/idena-go/core/state" "github.com/idena-network/idena-go/crypto" "github.com/idena-network/idena-go/log" + math2 "math" "math/rand" "sort" "sync" @@ -271,8 +272,9 @@ func (sv *StepValidators) Contains(addr common.Address) bool { return sv.Addresses.Contains(addr) } -func (sv *StepValidators) VotesCountSubtrahend() int { - return sv.Original.Cardinality() - sv.Size +func (sv *StepValidators) VotesCountSubtrahend(agreementThreshold float64) int { + v := sv.Original.Cardinality() - sv.Size + return int(math2.Round(float64(v) * agreementThreshold)) } type sortedAddresses struct { diff --git a/core/validators/validators_test.go b/core/validators/validators_test.go index 4ae429c8..e92b6ee4 100644 --- a/core/validators/validators_test.go +++ b/core/validators/validators_test.go @@ -113,7 +113,7 @@ func TestValidatorsCache_Load(t *testing.T) { require.False(stepValidators.Addresses.Contains(pool3)) require.Equal(7, stepValidators.Size) - require.Equal(5, stepValidators.VotesCountSubtrahend()) + require.Equal(5, stepValidators.VotesCountSubtrahend(1)) } func TestValidatorsCache_Clone(t *testing.T) { diff --git a/pengings/proposals.go b/pengings/proposals.go index 8658ad7d..c0fa4ce0 100644 --- a/pengings/proposals.go +++ b/pengings/proposals.go @@ -380,15 +380,17 @@ func (proposals *Proposals) compareWithBestHash(round uint64, hash common.Hash, func (proposals *Proposals) setBestHash(round uint64, hash common.Hash, proposerPubKey []byte, modifier int) { proposals.bestProofsMutex.Lock() defer proposals.bestProofsMutex.Unlock() + q := common.HashToFloat(hash, int64(modifier)) + if stored, ok := proposals.bestProofs[round]; ok { - if bytes.Compare(hash[:], stored.Hash[:]) >= 0 { + if q.Cmp(stored.floatValue) >= 0 { proposals.bestProofs[round] = bestHash{ - hash, common.HashToFloat(hash, int64(modifier)), proposerPubKey, + hash, q, proposerPubKey, } } } else { proposals.bestProofs[round] = bestHash{ - hash, common.HashToFloat(hash, int64(modifier)), proposerPubKey, + hash, q, proposerPubKey, } } } From c8299f10a01668cb886ea127a868a08e5839a7b7 Mon Sep 17 00:00:00 2001 From: sidenaio Date: Tue, 16 Mar 2021 01:40:09 +0500 Subject: [PATCH 09/15] Burn newbie stake in KillDelegatorTx --- blockchain/blockchain.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index 4c242c22..380c298e 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -1032,12 +1032,14 @@ func (chain *Blockchain) ApplyTxOnState(appState *appstate.AppState, vm vm.VM, t collector.BeginTxBalanceUpdate(statsCollector, tx, appState) defer collector.CompleteBalanceUpdate(statsCollector, appState) removeLinksWithInviterAndInvitees(stateDB, *tx.To) + delegatorPrevState := stateDB.GetIdentityState(*tx.To) stateDB.SetState(*tx.To, state.Killed) appState.IdentityState.Remove(*tx.To) stake := stateDB.GetStakeBalance(*tx.To) stateDB.SubStake(*tx.To, stake) - stateDB.AddBalance(sender, stake) - + if delegatorPrevState.VerifiedOrBetter() { + stateDB.AddBalance(sender, stake) + } case types.SubmitFlipTx: collector.BeginTxBalanceUpdate(statsCollector, tx, appState) defer collector.CompleteBalanceUpdate(statsCollector, appState) From 9adaf850d40e92add9c2083ca1a48d2a202187e2 Mon Sep 17 00:00:00 2001 From: sidenaio Date: Wed, 17 Mar 2021 19:11:37 +0500 Subject: [PATCH 10/15] PR fixes --- blockchain/blockchain.go | 91 ++++++++++++++++++++++++----- blockchain/validation/validation.go | 4 ++ core/state/statedb.go | 12 ++++ core/validators/validators.go | 33 ++++++++++- core/validators/validators_test.go | 30 ++++++++++ pengings/proposals.go | 11 +++- 6 files changed, 162 insertions(+), 19 deletions(-) diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index 380c298e..f50f5957 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -55,7 +55,6 @@ const ( ) var ( - ParentHashIsInvalid = errors.New("parentHash is invalid") BlockInsertionErr = errors.New("can't insert block") ) @@ -447,12 +446,14 @@ func (chain *Blockchain) applyBlockAndTxsOnState( func (chain *Blockchain) applyBlockOnState(appState *appstate.AppState, block *types.Block, prevBlock *types.Header, totalFee, totalTips *big.Int, usedGas uint64, statsCollector collector.StatsCollector) (root, identityRoot common.Hash, diff *state.IdentityStateDiff) { chain.applyStatusSwitch(appState, block) - chain.applyDelegationSwitch(appState, block) + undelegations := chain.applyDelegationSwitch(appState, block) chain.applyNewEpoch(appState, block, statsCollector) chain.applyBlockRewards(totalFee, totalTips, appState, block, prevBlock, statsCollector) + chain.switchPoolsToOffline(appState, undelegations, block) chain.applyGlobalParams(appState, block, statsCollector) chain.applyNextBlockFee(appState, block, usedGas) chain.applyVrfProposerThreshold(appState, block) + diff = appState.Precommit() return appState.State.Root(), appState.IdentityState.Root(), diff @@ -465,8 +466,10 @@ func (chain *Blockchain) applyEmptyBlockOnState( ) (root common.Hash, identityRoot common.Hash, diff *state.IdentityStateDiff) { chain.applyStatusSwitch(appState, block) - chain.applyDelegationSwitch(appState, block) + undelegations := chain.applyDelegationSwitch(appState, block) chain.applyNewEpoch(appState, block, statsCollector) + chain.switchPoolsToOffline(appState, undelegations, block) + chain.applyGlobalParams(appState, block, statsCollector) chain.applyVrfProposerThreshold(appState, block) diff = appState.Precommit() @@ -738,6 +741,13 @@ func removeLinksWithInviterAndInvitees(stateDB *state.StateDB, addr common.Addre removeLinkWithInvitees(stateDB, addr) } +func switchOnePoolToOffline(appState *appstate.AppState, pool common.Address, lostIdentities []common.Address) { + if appState.ValidatorsCache.IsPool(pool) && appState.ValidatorsCache.IsOnlineIdentity(pool) && + appState.ValidatorsCache.PoolSizeExceptNodes(pool, lostIdentities) <= 0 { + appState.IdentityState.SetOnline(pool, false) + } +} + func removeLinkWithInviter(stateDB *state.StateDB, inviteeAddr common.Address) { inviter := stateDB.GetInviter(inviteeAddr) if inviter == nil { @@ -1201,29 +1211,72 @@ func (chain *Blockchain) applyStatusSwitch(appState *appstate.AppState, block *t } addrs := appState.State.StatusSwitchAddresses() for _, addr := range addrs { - currentStatus := appState.IdentityState.IsOnline(addr) - appState.IdentityState.SetOnline(addr, !currentStatus) + isOnline := appState.IdentityState.IsOnline(addr) + if isOnline { + appState.IdentityState.SetOnline(addr, false) + continue + } + if appState.IdentityState.IsApproved(addr) || appState.ValidatorsCache.IsPool(addr) { + appState.IdentityState.SetOnline(addr, true) + } } appState.State.ClearStatusSwitchAddresses() } -func (chain *Blockchain) applyDelegationSwitch(appState *appstate.AppState, block *types.Block) { +func (chain *Blockchain) applyDelegationSwitch(appState *appstate.AppState, block *types.Block) (undelegations []*state.Delegation) { if !block.Header.Flags().HasFlag(types.IdentityUpdate) { return } delegations := appState.State.Delegations() - for _, delegation := range delegations { + + newPools := map[common.Address]struct{}{} + + for idx := range delegations { + delegation := delegations[idx] if delegation.Delegatee.IsEmpty() { + delegatee :=appState.State.Delegatee(delegation.Delegator) appState.IdentityState.RemoveDelegatee(delegation.Delegator) appState.State.RemoveDelegatee(delegation.Delegator) + if delegatee!=nil { + undelegations = append(undelegations, &state.Delegation{Delegator: delegation.Delegator, Delegatee: *delegatee}) + } } else { - appState.IdentityState.SetDelegatee(delegation.Delegator, delegation.Delegatee) - appState.State.SetDelegatee(delegation.Delegator, delegation.Delegatee) - appState.State.SetDelegationEpoch(delegation.Delegator, appState.State.Epoch()) - appState.IdentityState.SetOnline(delegation.Delegator, false) + _, becamePool := newPools[delegation.Delegator] + if appState.State.Delegatee(delegation.Delegatee) == nil && !becamePool && !appState.ValidatorsCache.IsPool(delegation.Delegator) { + appState.IdentityState.SetDelegatee(delegation.Delegator, delegation.Delegatee) + appState.State.SetDelegatee(delegation.Delegator, delegation.Delegatee) + appState.State.SetDelegationEpoch(delegation.Delegator, appState.State.Epoch()) + appState.IdentityState.SetOnline(delegation.Delegator, false) + newPools[delegation.Delegatee] = struct{}{} + } } } appState.State.ClearDelegations() + return undelegations +} + +func (chain *Blockchain) switchPoolsToOffline(appState *appstate.AppState, undelegations []*state.Delegation, block *types.Block) { + if !block.Header.Flags().HasFlag(types.IdentityUpdate) { + return + } + lostPoolNodes := map[common.Address][]common.Address{} + + addToLostPoolNode := func(pool, node common.Address) { + list := lostPoolNodes[pool] + lostPoolNodes[pool] = append(list, node) + } + + for _, addr := range appState.State.CollectKilledDelegators() { + identity := appState.State.GetIdentity(addr) + addToLostPoolNode(*identity.Delegatee, addr) + } + + for _, delegation := range undelegations { + addToLostPoolNode(delegation.Delegatee, delegation.Delegator) + } + for pool, nodes := range lostPoolNodes { + switchOnePoolToOffline(appState, pool, nodes) + } } func (chain *Blockchain) getTxCost(feePerGas *big.Int, tx *types.Transaction) *big.Int { @@ -1239,7 +1292,12 @@ func getSeedData(prevBlock *types.Header) []byte { func (chain *Blockchain) GetProposerSortition() (bool, []byte) { if checkIfProposer(chain.coinBaseAddress, chain.appState) { - return chain.getSortition(chain.getProposerData(), chain.appState.State.VrfProposerThreshold(), int64(chain.appState.ValidatorsCache.PoolSize(chain.coinBaseAddress))) + + modifier := int64(1) + if chain.appState.ValidatorsCache.IsPool(chain.coinBaseAddress) { + modifier = int64(chain.appState.ValidatorsCache.PoolSize(chain.coinBaseAddress)) + } + return chain.getSortition(chain.getProposerData(), chain.appState.State.VrfProposerThreshold(), modifier) } return false, nil @@ -1358,7 +1416,7 @@ func (chain *Blockchain) calculateFlags(appState *appstate.AppState, block *type var flags types.BlockFlag for _, tx := range block.Body.Transactions { - if tx.Type == types.KillTx || tx.Type == types.KillInviteeTx { + if tx.Type == types.KillTx || tx.Type == types.KillInviteeTx || tx.Type == types.KillDelegatorTx { flags |= types.IdentityUpdate } } @@ -1521,7 +1579,7 @@ func (chain *Blockchain) getProposerData() []byte { func (chain *Blockchain) getSortition(data []byte, threshold float64, modifier int64) (bool, []byte) { hash, proof := chain.secStore.VrfEvaluate(data) - q := common.HashToFloat(hash, modifier ) + q := common.HashToFloat(hash, modifier) vrfThreshold := new(big.Float).SetFloat64(threshold) @@ -1703,7 +1761,10 @@ func (chain *Blockchain) ValidateProposerProof(proof []byte, pubKeyData []byte) vrfThreshold := new(big.Float).SetFloat64(chain.appState.State.VrfProposerThreshold()) proposerAddr := crypto.PubkeyToAddress(*pubKey) - modifier := chain.appState.ValidatorsCache.PoolSize(proposerAddr) + modifier := 1 + if chain.appState.ValidatorsCache.IsPool(proposerAddr) { + modifier = chain.appState.ValidatorsCache.PoolSize(proposerAddr) + } q := common.HashToFloat(h, int64(modifier)) diff --git a/blockchain/validation/validation.go b/blockchain/validation/validation.go index 5cad358c..df2c059b 100644 --- a/blockchain/validation/validation.go +++ b/blockchain/validation/validation.go @@ -734,6 +734,10 @@ func validateDelegateTx(appState *appstate.AppState, tx *types.Transaction, txTy return InvalidSender } + if appState.State.Delegatee(*tx.To) != nil { + return InvalidRecipient + } + delegatee := appState.State.Delegatee(sender) delegationSwitch := appState.State.DelegationSwitch(sender) diff --git a/core/state/statedb.go b/core/state/statedb.go index 7c26651b..1541db5d 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -1418,6 +1418,18 @@ func (s *StateDB) DelegationEpoch(addr common.Address) uint16 { return s.GetOrNewIdentityObject(addr).DelegationEpoch() } +func (s *StateDB) CollectKilledDelegators() []common.Address { + s.lock.Lock() + defer s.lock.Unlock() + var result []common.Address + for _, identity := range s.stateIdentities { + if identity.Delegatee() != nil && !identity.State().NewbieOrBetter() { + result = append(result, identity.address) + } + } + return result +} + type readCloser struct { r io.Reader } diff --git a/core/validators/validators.go b/core/validators/validators.go index c2a49de5..6119d8ab 100644 --- a/core/validators/validators.go +++ b/core/validators/validators.go @@ -216,7 +216,23 @@ func (v *ValidatorsCache) PoolSize(pool common.Address) int { } return size } - return 1 + return 0 +} + +func (v *ValidatorsCache) PoolSizeExceptNodes(pool common.Address, exceptNodes []common.Address) int { + if set, ok := v.pools[pool]; ok { + size := len(set.list) + if v.nodesSet.Contains(pool) { + size++ + } + for _, exceptNode := range exceptNodes { + if set.index(exceptNode) > 0 { + size-- + } + } + return size + } + return 0 } func (v *ValidatorsCache) IsPool(pool common.Address) bool { @@ -283,9 +299,22 @@ type sortedAddresses struct { func (s *sortedAddresses) add(addr common.Address) { i := sort.Search(len(s.list), func(i int) bool { - return bytes.Compare(s.list[i].Bytes(), addr.Bytes()) > 0 + return bytes.Compare(s.list[i].Bytes(), addr.Bytes()) >= 0 }) s.list = append(s.list, common.Address{}) copy(s.list[i+1:], s.list[i:]) s.list[i] = addr } + +func (s *sortedAddresses) index(addr common.Address) int { + i := sort.Search(len(s.list), func(i int) bool { + return bytes.Compare(s.list[i].Bytes(), addr.Bytes()) >= 0 + }) + if i == len(s.list) { + return -1 + } + if bytes.Compare(s.list[i].Bytes(), addr.Bytes()) == 0 { + return i + } + return -1 +} diff --git a/core/validators/validators_test.go b/core/validators/validators_test.go index e92b6ee4..338287fc 100644 --- a/core/validators/validators_test.go +++ b/core/validators/validators_test.go @@ -114,6 +114,13 @@ func TestValidatorsCache_Load(t *testing.T) { require.False(stepValidators.Addresses.Contains(pool3)) require.Equal(7, stepValidators.Size) require.Equal(5, stepValidators.VotesCountSubtrahend(1)) + + identityStateDB.RemoveDelegatee(vCache.pools[pool2].list[0]) + identityStateDB.RemoveDelegatee(vCache.pools[pool2].list[1]) + identityStateDB.Commit(false) + + vCache.Load() + require.False(vCache.IsPool(pool2)) } func TestValidatorsCache_Clone(t *testing.T) { @@ -154,3 +161,26 @@ func TestValidatorsCache_Clone(t *testing.T) { require.Equal(vCache.pools, clone.pools) require.Equal(vCache.delegations, clone.delegations) } + +func Test_sortedAddresses_index(t *testing.T) { + list := &sortedAddresses{list: []common.Address{}} + + list.add(common.Address{0x5}) + list.add(common.Address{0x2}) + list.add(common.Address{0x1}) + list.add(common.Address{0x4}) + list.add(common.Address{0x3}) + + for i := 0; i < 5; i++ { + require.Equal(t, common.Address{byte(i + 1)}, list.list[i]) + } + + for i := 0; i < 5; i++ { + require.Equal(t, i, list.index(common.Address{byte(i + 1)})) + } + require.Equal(t, -1, list.index(common.Address{0x6})) + + list.add(common.Address{0x9}) + + require.Equal(t, -1, list.index(common.Address{0x8})) +} diff --git a/pengings/proposals.go b/pengings/proposals.go index c0fa4ce0..af470b77 100644 --- a/pengings/proposals.go +++ b/pengings/proposals.go @@ -122,7 +122,11 @@ func (proposals *Proposals) AddProposeProof(proposal *types.ProofProposal) (adde proposerAddr := crypto.PubkeyToAddress(*pubKey) - modifier := proposals.appState.ValidatorsCache.PoolSize(proposerAddr) + modifier := 1 + + if proposals.appState.ValidatorsCache.IsPool(proposerAddr) { + modifier = proposals.appState.ValidatorsCache.PoolSize(proposerAddr) + } if !proposals.compareWithBestHash(currentRound, hash, modifier) { return false, false @@ -234,7 +238,10 @@ func (proposals *Proposals) AddProposedBlock(proposal *types.BlockProposal, peer proposerAddr := crypto.PubkeyToAddress(*pubKey) - modifier := proposals.appState.ValidatorsCache.PoolSize(proposerAddr) + modifier := 1 + if proposals.appState.ValidatorsCache.IsPool(proposerAddr) { + modifier = proposals.appState.ValidatorsCache.PoolSize(proposerAddr) + } if !proposals.compareWithBestHash(currentRound, vrfHash, modifier) { return false, false From a9ba05a1f40d1d41117b45f10dc5fea5367677f6 Mon Sep 17 00:00:00 2001 From: sidenaio Date: Thu, 18 Mar 2021 20:08:27 +0500 Subject: [PATCH 11/15] Add tests --- blockchain/blockchain_mocks.go | 15 ++++ blockchain/blockchain_test.go | 123 ++++++++++++++++++++++++++++++++- blockchain/rewards_test.go | 7 +- cmd/stategen/main.go | 2 + config/consensus.go | 4 +- core/state/statedb.go | 2 + core/state/statedb_test.go | 12 ---- go.sum | 7 ++ pengings/proposals_test.go | 35 ++++++++++ 9 files changed, 190 insertions(+), 17 deletions(-) diff --git a/blockchain/blockchain_mocks.go b/blockchain/blockchain_mocks.go index 6f398e13..679caffb 100644 --- a/blockchain/blockchain_mocks.go +++ b/blockchain/blockchain_mocks.go @@ -203,3 +203,18 @@ func (chain *TestBlockchain) GenerateEmptyBlocks(count int) *TestBlockchain { } return chain } + +func (chain *TestBlockchain) CommitState() *TestBlockchain { + if chain.Head.EmptyBlockHeader != nil { + chain.Head.EmptyBlockHeader.Height++ + } else { + chain.Head.ProposedHeader.Height++ + } + block := chain.GenerateEmptyBlock() + err := chain.AddBlock(block, nil, collector.NewStatsCollector()) + if err != nil { + panic(err) + } + chain.addCert(block) + return chain +} diff --git a/blockchain/blockchain_test.go b/blockchain/blockchain_test.go index 7613f6fe..df47e2c3 100644 --- a/blockchain/blockchain_test.go +++ b/blockchain/blockchain_test.go @@ -1,6 +1,7 @@ package blockchain import ( + "crypto/ecdsa" "github.com/idena-network/idena-go/blockchain/attachments" fee2 "github.com/idena-network/idena-go/blockchain/fee" "github.com/idena-network/idena-go/blockchain/types" @@ -867,7 +868,7 @@ func TestBlockchain_applyOfflinePenalty(t *testing.T) { addr := common.Address{i} appState.IdentityState.Add(addr) appState.IdentityState.SetOnline(addr, true) - if i % 3 == 0 { // 3, 6, 9 + if i%3 == 0 { // 3, 6, 9 appState.IdentityState.SetDelegatee(addr, pool1) } } @@ -878,5 +879,123 @@ func TestBlockchain_applyOfflinePenalty(t *testing.T) { chain.applyOfflinePenalty(appState, pool1, nil) - require.Equal(t, big.NewInt(4 * 3 * 1800 / int64(count)).Bytes(), appState.State.GetPenalty(pool1).Bytes()) + require.Equal(t, big.NewInt(4*3*1800/int64(count)).Bytes(), appState.State.GetPenalty(pool1).Bytes()) +} + +func Test_Delegation(t *testing.T) { + chain, appState, txpool, coinbaseKey := NewTestBlockchainWithConfig(true, config.ConsensusVersions[config.ConsensusV4], &config.ValidationConfig{}, nil, -1, -1, 0, 0) + + coinbase := crypto.PubkeyToAddress(coinbaseKey.PublicKey) + + appState.State.SetState(coinbase, state.Verified) + appState.State.SetNextValidationTime(time.Date(2099, 01, 01, 00, 00, 00, 0, time.UTC)) + appState.IdentityState.Add(coinbase) + appState.IdentityState.SetOnline(coinbase, true) + + keys := []*ecdsa.PrivateKey{} + addrs := []common.Address{} + for i := 0; i < 5; i++ { + key, _ := crypto.GenerateKey() + keys = append(keys, key) + + addr := crypto.PubkeyToAddress(key.PublicKey) + + addrs = append(addrs, addr) + appState.State.SetState(addr, state.Newbie) + appState.IdentityState.Add(addr) + appState.IdentityState.SetOnline(addr, true) + appState.State.SetBalance(addr, big.NewInt(0).Mul(big.NewInt(1000), common.DnaBase)) + } + + appState.IdentityState.SetOnline(addrs[3], false) + + validation.SetAppConfig(chain.config) + + pool1 := common.Address{0x1} + pool2 := common.Address{0x2} + + pool3Key, _ := crypto.GenerateKey() + pool3 := crypto.PubkeyToAddress(pool3Key.PublicKey) + + appState.State.SetBalance(pool3, big.NewInt(0).Mul(big.NewInt(1000), common.DnaBase)) + + appState.State.SetState(pool3, state.Newbie) + appState.IdentityState.Add(pool3) + appState.IdentityState.SetOnline(pool3, true) + + appState.Commit(nil) + appState.ValidatorsCache.Load() + chain.CommitState() + + addTx := func(key *ecdsa.PrivateKey, txType types.TxType, nonce uint32, epoch uint16, to *common.Address, payload []byte) error { + tx := &types.Transaction{ + Type: txType, + AccountNonce: nonce, + To: to, + Epoch: epoch, + MaxFee: new(big.Int).Mul(big.NewInt(50), common.DnaBase), + Payload: payload, + } + signedTx, _ := types.SignTx(tx, key) + return txpool.Add(signedTx) + } + + require.NoError(t, addTx(keys[0], types.DelegateTx, 1, 0, &pool1, nil)) + require.NoError(t, addTx(keys[1], types.DelegateTx, 1, 0, &pool2, nil)) + require.NoError(t, addTx(keys[2], types.DelegateTx, 1, 0, &pool2, nil)) + require.NoError(t, addTx(keys[3], types.DelegateTx, 1, 0, &pool3, nil)) + + chain.GenerateBlocks(1) + require.ErrorIs(t, validation.InvalidRecipient, addTx(pool3Key, types.DelegateTx, 1, 0, &pool3, nil)) + require.NoError(t, addTx(pool3Key, types.DelegateTx, 1, 0, &pool2, nil)) + + chain.GenerateBlocks(1) + + require.Len(t, appState.State.Delegations(), 5) + + require.NoError(t, addTx(keys[0], types.OnlineStatusTx, 2, 0, nil, attachments.CreateOnlineStatusAttachment(false))) + require.NoError(t, addTx(keys[3], types.OnlineStatusTx, 2, 0, nil, attachments.CreateOnlineStatusAttachment(true))) + + chain.GenerateBlocks(1) + chain.GenerateEmptyBlocks(50) + + require.False(t, appState.ValidatorsCache.IsOnlineIdentity(addrs[0])) + require.False(t, appState.ValidatorsCache.IsOnlineIdentity(addrs[1])) + require.False(t, appState.ValidatorsCache.IsOnlineIdentity(addrs[2])) + require.False(t, appState.ValidatorsCache.IsOnlineIdentity(addrs[3])) + + require.Len(t, appState.State.Delegations(), 0) + require.Nil(t, appState.State.Delegatee(pool3)) + require.Equal(t, 1, appState.ValidatorsCache.PoolSize(pool1)) + require.Equal(t, 2, appState.ValidatorsCache.PoolSize(pool2)) + require.Equal(t, 2, appState.ValidatorsCache.PoolSize(pool3)) + + attachments.CreateOnlineStatusAttachment(false) + + addr3 := crypto.PubkeyToAddress(keys[3].PublicKey) + require.NoError(t, addTx(pool3Key, types.KillDelegatorTx, 2, 0, &addr3, nil)) + chain.GenerateBlocks(1) + + require.Equal(t, 0, appState.ValidatorsCache.PoolSize(pool3)) + require.False(t, appState.ValidatorsCache.IsPool(pool3)) + require.True(t, appState.ValidatorsCache.IsOnlineIdentity(pool3)) + + require.ErrorIs(t, validation.WrongEpoch, addTx(keys[1], types.UndelegateTx, 2, 0, nil, nil)) + + appState.State.SetGlobalEpoch(1) + appState.Commit(nil) + chain.CommitState() + + require.NoError(t, addTx(keys[1], types.UndelegateTx, 1, 1, nil, nil)) + require.NoError(t, addTx(keys[2], types.UndelegateTx, 1, 1, nil, nil)) + + chain.GenerateBlocks(1) + require.Len(t, appState.State.Delegations(), 2) + + chain.GenerateBlocks(50) + require.Len(t, appState.State.Delegations(), 0) + + require.Equal(t, 0, appState.ValidatorsCache.PoolSize(pool2)) + require.False(t, appState.ValidatorsCache.IsPool(pool2)) + require.False(t, appState.ValidatorsCache.IsOnlineIdentity(pool2)) } diff --git a/blockchain/rewards_test.go b/blockchain/rewards_test.go index 21420d93..a7829e4f 100644 --- a/blockchain/rewards_test.go +++ b/blockchain/rewards_test.go @@ -18,6 +18,9 @@ import ( func Test_rewardValidIdentities(t *testing.T) { god := common.Address{0x1} + + poolOfAuth1 := common.Address{0x10} + auth1 := common.Address{0x2} auth2 := common.Address{0x3} auth3 := common.Address{0x4} @@ -40,6 +43,8 @@ func Test_rewardValidIdentities(t *testing.T) { appState.State.SetGodAddress(god) appState.State.SetState(auth1, state.Newbie) + appState.State.SetDelegatee(auth1, poolOfAuth1) + appState.State.SetState(auth2, state.Candidate) appState.State.SetState(auth3, state.Human) appState.State.SetState(auth4, state.Suspended) @@ -115,7 +120,7 @@ func Test_rewardValidIdentities(t *testing.T) { reward, stake := splitAndSum(conf, false, validationReward*normalAge(3), flipReward*12.0, invitationReward*conf.SecondInvitationRewardCoef, invitationReward*conf.SavedInviteWinnerRewardCoef) - require.True(t, reward.Cmp(appState.State.GetBalance(auth1)) == 0) + require.True(t, reward.Cmp(appState.State.GetBalance(poolOfAuth1)) == 0) require.True(t, stake.Cmp(appState.State.GetStakeBalance(auth1)) == 0) reward, stake = splitAndSum(conf, true, validationReward*normalAge(0), invitationReward*conf.SavedInviteRewardCoef) diff --git a/cmd/stategen/main.go b/cmd/stategen/main.go index 09f03bf3..29150a32 100644 --- a/cmd/stategen/main.go +++ b/cmd/stategen/main.go @@ -153,6 +153,8 @@ func main() { ValidationBits: uint32(data.ValidationTxsBits), ValidationStatus: uint32(data.LastValidationStatus), Scores: data.Scores, + DelegationNonce: data.DelegationNonce, + DelegationEpoch: uint32(data.DelegationEpoch), } if data.Inviter != nil { diff --git a/config/consensus.go b/config/consensus.go index 18823bfd..0fb57cd0 100644 --- a/config/consensus.go +++ b/config/consensus.go @@ -115,8 +115,8 @@ func ApplyConsensusVersion(ver ConsensusVerson, cfg *ConsensusConf) { case ConsensusV4: cfg.EnablePools = true cfg.Version = ConsensusV4 - cfg.StartActivationDate = time.Date(2021, 02, 10, 8, 0, 0, 0, time.UTC).Unix() - cfg.EndActivationDate = time.Date(2021, 02, 17, 0, 0, 0, 0, time.UTC).Unix() + cfg.StartActivationDate = time.Date(2021, 03, 24, 8, 0, 0, 0, time.UTC).Unix() + cfg.EndActivationDate = time.Date(2021, 03, 29, 0, 0, 0, 0, time.UTC).Unix() cfg.MigrationTimeout = 0 } } diff --git a/core/state/statedb.go b/core/state/statedb.go index 1541db5d..c9efb3d5 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -1226,6 +1226,8 @@ func (s *StateDB) SetPredefinedIdentities(state *models.ProtoPredefinedState) { stateObject.data.ValidationTxsBits = byte(identity.ValidationBits) stateObject.data.LastValidationStatus = ValidationStatusFlag(identity.ValidationStatus) stateObject.data.Scores = identity.Scores + stateObject.data.DelegationEpoch = uint16(identity.DelegationEpoch) + stateObject.data.DelegationNonce = identity.DelegationNonce if identity.Inviter != nil { stateObject.data.Inviter = &TxAddr{ diff --git a/core/state/statedb_test.go b/core/state/statedb_test.go index 175b8629..ca5768c2 100644 --- a/core/state/statedb_test.go +++ b/core/state/statedb_test.go @@ -486,15 +486,3 @@ func TestStateDB_IterateContractStore(t *testing.T) { require.Equal(t, len(addr1Values), len(iterated)) require.Equal(t, addr1Values, iterated) } - - -func TestAAA(t *testing.T) { - data1 := []byte{10, 9, 10, 147, 247, 153, 91, 236, 16, 0, 0, 32, 7, 58, 65, 4, 218, 240, 136, 202, 167, 186, 132, 61, 191, 176, 72, 35, 197, 54, 195, 147, 183, 42, 27, 152, 176, 18, 178, 174, 40, 186, 71, 205, 184, 152, 123, 160, 166, 17, 88, 152, 71, 63, 7, 50, 219, 125, 150, 192, 29, 215, 39, 151, 214, 44, 245, 104, 15, 19, 78, 229, 36, 26, 19, 100, 134, 174, 149, 4, 64, 3, 74, 38, 10, 36, 1, 85, 18, 32, 54, 125, 26, 57, 207, 98, 50, 198, 182, 40, 9, 114, 14, 244, 92, 176, 23, 114, 28, 54, 21, 99, 93, 245, 111, 241, 245, 230, 36, 153, 217, 28, 80, 1, 90, 12, 2, 141, 60, 249, 54, 26, 72, 38, 107, 172, 50, 53, 98, 56, 10, 32, 151, 245, 123, 138, 228, 101, 76, 180, 227, 55, 228, 250, 36, 52, 180, 42, 194, 92, 235, 248, 233, 37, 53, 116, 217, 119, 232, 21, 83, 176, 242, 232, 18, 20, 47, 62, 202, 28, 183, 32, 48, 137, 213, 70, 242, 188, 238, 215, 223, 169, 194, 69, 163, 30, 98, 56, 10, 32, 197, 159, 60, 133, 40, 212, 208, 67, 141, 40, 144, 249, 133, 133, 231, 234, 209, 6, 144, 41, 103, 1, 78, 83, 208, 97, 5, 224, 45, 217, 237, 226, 18, 20, 92, 49, 101, 43, 69, 175, 78, 114, 49, 103, 53, 116, 71, 98, 4, 255, 173, 235, 146, 32, 98, 56, 10, 32, 219, 219, 54, 83, 123, 78, 187, 191, 37, 25, 116, 53, 208, 190, 184, 142, 246, 130, 117, 120, 181, 195, 239, 216, 140, 186, 189, 44, 77, 72, 228, 167, 18, 20, 169, 94, 143, 234, 188, 112, 211, 61, 126, 0, 4, 105, 92, 27, 252, 30, 83, 114, 220, 129, 98, 56, 10, 32, 131, 157, 184, 227, 184, 46, 13, 253, 171, 165, 236, 42, 81, 55, 80, 116, 106, 247, 134, 104, 244, 61, 70, 103, 105, 59, 25, 118, 114, 85, 177, 221, 18, 20, 98, 94, 177, 64, 21, 47, 109, 111, 62, 160, 101, 170, 194, 207, 228, 30, 213, 103, 72, 139, 98, 56, 10, 32, 193, 180, 72, 15, 29, 28, 127, 212, 196, 223, 233, 233, 219, 143, 223, 224, 116, 135, 169, 224, 151, 245, 191, 125, 191, 33, 132, 196, 46, 6, 83, 34, 18, 20, 125, 206, 53, 134, 93, 159, 40, 37, 221, 92, 175, 66, 114, 206, 183, 148, 41, 42, 55, 23, 98, 56, 10, 32, 158, 151, 174, 104, 126, 40, 192, 211, 183, 210, 201, 108, 237, 34, 209, 39, 233, 57, 183, 78, 181, 211, 212, 12, 238, 26, 216, 120, 89, 135, 67, 201, 18, 20, 86, 69, 58, 228, 189, 33, 228, 112, 240, 241, 9, 8, 86, 23, 120, 21, 203, 44, 158, 154, 98, 56, 10, 32, 83, 141, 194, 129, 115, 175, 100, 132, 150, 137, 178, 252, 112, 124, 169, 217, 207, 29, 128, 38, 31, 56, 185, 19, 114, 131, 219, 142, 74, 47, 168, 101, 18, 20, 148, 120, 187, 126, 160, 30, 126, 201, 131, 179, 147, 190, 101, 62, 153, 253, 1, 34, 186, 210, 98, 56, 10, 32, 151, 33, 187, 16, 129, 50, 185, 246, 119, 233, 124, 116, 149, 111, 206, 54, 15, 81, 51, 110, 240, 129, 170, 205, 83, 242, 30, 215, 48, 254, 180, 20, 18, 20, 167, 32, 158, 184, 92, 207, 154, 1, 166, 146, 243, 122, 203, 238, 101, 97, 93, 119, 236, 178, 98, 56, 10, 32, 193, 188, 39, 87, 56, 252, 198, 239, 55, 232, 203, 30, 138, 247, 201, 36, 77, 111, 159, 50, 167, 23, 70, 10, 55, 111, 97, 114, 162, 2, 154, 65, 18, 20, 11, 253, 110, 58, 97, 138, 168, 29, 139, 21, 157, 161, 103, 244, 145, 124, 69, 129, 229, 37, 98, 56, 10, 32, 82, 247, 199, 179, 124, 77, 126, 40, 7, 214, 108, 62, 142, 242, 245, 100, 58, 127, 251, 102, 67, 192, 210, 37, 94, 223, 193, 4, 90, 102, 100, 220, 18, 20, 53, 2, 141, 60, 249, 54, 26, 72, 38, 107, 172, 50, 98, 14, 86, 206, 141, 161, 231, 155, 106, 56, 10, 32, 82, 247, 199, 179, 124, 77, 126, 40, 7, 214, 108, 62, 142, 242, 245, 100, 58, 127, 251, 102, 67, 192, 210, 37, 94, 223, 193, 4, 90, 102, 100, 220, 18, 20, 53, 2, 141, 60, 249, 54, 26, 72, 38, 107, 172, 50, 98, 14, 86, 206, 141, 161, 231, 155, 146, 1, 1, 33} - data2 := []byte{10, 9, 10, 147, 247, 153, 91, 236, 16, 0, 0, 32, 7, 58, 65, 4, 218, 240, 136, 202, 167, 186, 132, 61, 191, 176, 72, 35, 197, 54, 195, 147, 183, 42, 27, 152, 176, 18, 178, 174, 40, 186, 71, 205, 184, 152, 123, 160, 166, 17, 88, 152, 71, 63, 7, 50, 219, 125, 150, 192, 29, 215, 39, 151, 214, 44, 245, 104, 15, 19, 78, 229, 36, 26, 19, 100, 134, 174, 149, 4, 64, 3, 74, 38, 10, 36, 1, 85, 18, 32, 54, 125, 26, 57, 207, 98, 50, 198, 182, 40, 9, 114, 14, 244, 92, 176, 23, 114, 28, 54, 21, 99, 93, 245, 111, 241, 245, 230, 36, 153, 217, 28, 80, 1, 90, 12, 2, 141, 60, 249, 54, 26, 72, 38, 107, 172, 50, 53, 98, 56, 10, 32, 151, 245, 123, 138, 228, 101, 76, 180, 227, 55, 228, 250, 36, 52, 180, 42, 194, 92, 235, 248, 233, 37, 53, 116, 217, 119, 232, 21, 83, 176, 242, 232, 18, 20, 47, 62, 202, 28, 183, 32, 48, 137, 213, 70, 242, 188, 238, 215, 223, 169, 194, 69, 163, 30, 98, 56, 10, 32, 197, 159, 60, 133, 40, 212, 208, 67, 141, 40, 144, 249, 133, 133, 231, 234, 209, 6, 144, 41, 103, 1, 78, 83, 208, 97, 5, 224, 45, 217, 237, 226, 18, 20, 92, 49, 101, 43, 69, 175, 78, 114, 49, 103, 53, 116, 71, 98, 4, 255, 173, 235, 146, 32, 98, 56, 10, 32, 219, 219, 54, 83, 123, 78, 187, 191, 37, 25, 116, 53, 208, 190, 184, 142, 246, 130, 117, 120, 181, 195, 239, 216, 140, 186, 189, 44, 77, 72, 228, 167, 18, 20, 169, 94, 143, 234, 188, 112, 211, 61, 126, 0, 4, 105, 92, 27, 252, 30, 83, 114, 220, 129, 98, 56, 10, 32, 131, 157, 184, 227, 184, 46, 13, 253, 171, 165, 236, 42, 81, 55, 80, 116, 106, 247, 134, 104, 244, 61, 70, 103, 105, 59, 25, 118, 114, 85, 177, 221, 18, 20, 98, 94, 177, 64, 21, 47, 109, 111, 62, 160, 101, 170, 194, 207, 228, 30, 213, 103, 72, 139, 98, 56, 10, 32, 193, 180, 72, 15, 29, 28, 127, 212, 196, 223, 233, 233, 219, 143, 223, 224, 116, 135, 169, 224, 151, 245, 191, 125, 191, 33, 132, 196, 46, 6, 83, 34, 18, 20, 125, 206, 53, 134, 93, 159, 40, 37, 221, 92, 175, 66, 114, 206, 183, 148, 41, 42, 55, 23, 98, 56, 10, 32, 158, 151, 174, 104, 126, 40, 192, 211, 183, 210, 201, 108, 237, 34, 209, 39, 233, 57, 183, 78, 181, 211, 212, 12, 238, 26, 216, 120, 89, 135, 67, 201, 18, 20, 86, 69, 58, 228, 189, 33, 228, 112, 240, 241, 9, 8, 86, 23, 120, 21, 203, 44, 158, 154, 98, 56, 10, 32, 83, 141, 194, 129, 115, 175, 100, 132, 150, 137, 178, 252, 112, 124, 169, 217, 207, 29, 128, 38, 31, 56, 185, 19, 114, 131, 219, 142, 74, 47, 168, 101, 18, 20, 148, 120, 187, 126, 160, 30, 126, 201, 131, 179, 147, 190, 101, 62, 153, 253, 1, 34, 186, 210, 98, 56, 10, 32, 151, 33, 187, 16, 129, 50, 185, 246, 119, 233, 124, 116, 149, 111, 206, 54, 15, 81, 51, 110, 240, 129, 170, 205, 83, 242, 30, 215, 48, 254, 180, 20, 18, 20, 167, 32, 158, 184, 92, 207, 154, 1, 166, 146, 243, 122, 203, 238, 101, 97, 93, 119, 236, 178, 98, 56, 10, 32, 193, 188, 39, 87, 56, 252, 198, 239, 55, 232, 203, 30, 138, 247, 201, 36, 77, 111, 159, 50, 167, 23, 70, 10, 55, 111, 97, 114, 162, 2, 154, 65, 18, 20, 11, 253, 110, 58, 97, 138, 168, 29, 139, 21, 157, 161, 103, 244, 145, 124, 69, 129, 229, 37, 98, 56, 10, 32, 82, 247, 199, 179, 124, 77, 126, 40, 7, 214, 108, 62, 142, 242, 245, 100, 58, 127, 251, 102, 67, 192, 210, 37, 94, 223, 193, 4, 90, 102, 100, 220, 18, 20, 53, 2, 141, 60, 249, 54, 26, 72, 38, 107, 172, 50, 98, 14, 86, 206, 141, 161, 231, 155, 106, 56, 10, 32, 82, 247, 199, 179, 124, 77, 126, 40, 7, 214, 108, 62, 142, 242, 245, 100, 58, 127, 251, 102, 67, 192, 210, 37, 94, 223, 193, 4, 90, 102, 100, 220, 18, 20, 53, 2, 141, 60, 249, 54, 26, 72, 38, 107, 172, 50, 98, 14, 86, 206, 141, 161, 231, 155, 146, 1, 1, 33, 160, 1, 1} - - identity1 := Identity{} - identity1.FromBytes(data1) - - identity2 := Identity{} - identity2.FromBytes(data2) -} diff --git a/go.sum b/go.sum index 4d997ded..da498cc0 100644 --- a/go.sum +++ b/go.sum @@ -689,8 +689,11 @@ github.com/klauspost/compress v1.4.1 h1:8VMb5+0wMgdBykOV96DwNwKFQ+WTI4pzYURP99Cc github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.11.8 h1:difgzQsp5mdAz9v8lm3P/I+EpDKMU/6uTMw1y1FObuo= github.com/klauspost/compress v1.11.8/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.11.12 h1:famVnQVu7QwryBN4jNseQdUKES71ZAOnB6UQQJPZvqk= github.com/klauspost/compress v1.11.12/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/cpuid v1.2.0 h1:NMpwD2G9JSFOE1/TJjGSo5zG7Yb2bTe7eq1jH+irmeE= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/cpuid/v2 v2.0.4 h1:g0I61F2K2DjRHz1cnxlkNSBIaePVoJIjjnHui8QHbiw= github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -1142,6 +1145,7 @@ github.com/minio/sha256-simd v0.1.0/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU= github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= +github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g= github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -1220,6 +1224,7 @@ github.com/multiformats/go-multihash v0.0.13 h1:06x+mk/zj1FoMsgNejLpy6QTvJqlSt/B github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= github.com/multiformats/go-multihash v0.0.14 h1:QoBceQYQQtNUuf6s7wHxnE2c8bhbMqhfGzNI032se/I= github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= +github.com/multiformats/go-multihash v0.0.15 h1:hWOPdrNqDjwHDx82vsYGSDZNyktOJJ2dzZJzFkOV1jM= github.com/multiformats/go-multihash v0.0.15/go.mod h1:D6aZrWNLFTV/ynMpKsNtB40mJzmCl4jb1alC0OvHiHg= github.com/multiformats/go-multistream v0.0.1/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.0.4 h1:rNgWgFyzRSTI9L+xISrz7kN5MdNXoEcoIeeCH05wLKA= @@ -1636,6 +1641,7 @@ golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9 h1:phUcVbl53swtrUN8kQEXFh golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1806,6 +1812,7 @@ golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211 h1:9UQO31fZ+0aKQOFldThf7BKPM golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 h1:46ULzRKLh1CwgRq2dC5SlBzEqqNCi8rreOZnNrbqcIY= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/pengings/proposals_test.go b/pengings/proposals_test.go index f74bc3ed..0d425c5f 100644 --- a/pengings/proposals_test.go +++ b/pengings/proposals_test.go @@ -2,6 +2,7 @@ package pengings import ( "github.com/idena-network/idena-go/blockchain/types" + "github.com/idena-network/idena-go/common" "github.com/patrickmn/go-cache" "github.com/stretchr/testify/require" "testing" @@ -38,3 +39,37 @@ func TestProposals_GetBlock(t *testing.T) { require.True(t, proposals.GetBlock(notApprovedBlock.Hash()) == nil) } + +func TestProposals_setBestHash(t *testing.T) { + proposals := &Proposals{ + bestProofs: map[uint64]bestHash{}, + } + pubKey := []byte{0x1} + + proposals.setBestHash(1, common.Hash{0x1}, pubKey, 1) + proposals.setBestHash(2, common.Hash{0x1}, pubKey, 5) + + require.Equal(t, common.Hash{0x1}, proposals.bestProofs[1].Hash) + + proposals.setBestHash(1, common.Hash{0x2}, pubKey, 1) + + require.Equal(t, common.Hash{0x2}, proposals.bestProofs[1].Hash) + proposals.setBestHash(1, common.Hash{0x1}, pubKey, 1) + require.Equal(t, common.Hash{0x2}, proposals.bestProofs[1].Hash) + + require.False(t, proposals.compareWithBestHash(1, common.Hash{0x1}, 1)) + require.True(t, proposals.compareWithBestHash(1, common.Hash{0x3}, 1)) + + hash1 := common.Hash{0x8, 0x1, 0x1, 0xFF} + + proposals.setBestHash(1, hash1, pubKey, 1) + require.Equal(t, hash1, proposals.bestProofs[1].Hash) + + hash2 := common.Hash{0x3, 0x1, 0x1, 0xFF} + require.True(t, proposals.compareWithBestHash(1, hash2, 15)) + require.False(t, proposals.compareWithBestHash(1, hash2, 1)) + + proposals.setBestHash(1, hash2, pubKey, 15) + require.Equal(t, hash2, proposals.bestProofs[1].Hash) + require.Equal(t, common.Hash{0x1}, proposals.bestProofs[2].Hash) +} From 56eee1bea150614b85ee82f5f4ef51183d16ba1c Mon Sep 17 00:00:00 2001 From: sidenaio Date: Sun, 21 Mar 2021 18:37:38 +0500 Subject: [PATCH 12/15] Change default consensus config --- config/consensus.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/consensus.go b/config/consensus.go index 0fb57cd0..6fbf5c8f 100644 --- a/config/consensus.go +++ b/config/consensus.go @@ -122,5 +122,5 @@ func ApplyConsensusVersion(ver ConsensusVerson, cfg *ConsensusConf) { } func GetDefaultConsensusConfig() *ConsensusConf { - return &v4 + return &v3 } From 4deb778b41964dcf8c286c54d34e5db9614bafc8 Mon Sep 17 00:00:00 2001 From: sidenaio Date: Sun, 21 Mar 2021 19:19:09 +0500 Subject: [PATCH 13/15] Set upgrade target --- core/upgrade/upgrader.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/upgrade/upgrader.go b/core/upgrade/upgrader.go index 041f38d1..56af56de 100644 --- a/core/upgrade/upgrader.go +++ b/core/upgrade/upgrader.go @@ -13,7 +13,7 @@ import ( "time" ) -const TargetVersion = config.ConsensusV3 +const TargetVersion = config.ConsensusV4 type Upgrader struct { config *config.Config From 92dcb61aa1577790bae0390fbf3e47d5fb1ac96b Mon Sep 17 00:00:00 2001 From: sidenaio Date: Mon, 22 Mar 2021 18:13:52 +0500 Subject: [PATCH 14/15] Add isPool flag to RPC getIdentity response --- api/dna_api.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/api/dna_api.go b/api/dna_api.go index c945e67b..1c2337f7 100644 --- a/api/dna_api.go +++ b/api/dna_api.go @@ -272,12 +272,16 @@ type Identity struct { Delegatee *common.Address `json:"delegatee"` DelegationEpoch uint16 `json:"delegationEpoch"` DelegationNonce uint32 `json:"delegationNonce"` + IsPool bool `json:"isPool"` } func (api *DnaApi) Identities() []Identity { var identities []Identity - epoch := api.baseApi.getReadonlyAppState().State.Epoch() - api.baseApi.getReadonlyAppState().State.IterateIdentities(func(key []byte, value []byte) bool { + + appState := api.baseApi.getReadonlyAppState() + + epoch := appState.State.Epoch() + appState.State.IterateIdentities(func(key []byte, value []byte) bool { if key == nil { return true } @@ -292,7 +296,7 @@ func (api *DnaApi) Identities() []Identity { if addr == api.GetCoinbaseAddr() { flipKeyWordPairs = api.ceremony.FlipKeyWordPairs() } - identities = append(identities, convertIdentity(epoch, addr, data, flipKeyWordPairs)) + identities = append(identities, convertIdentity(epoch, addr, data, flipKeyWordPairs, appState.ValidatorsCache.IsPool(addr))) return false }) @@ -312,8 +316,9 @@ func (api *DnaApi) Identity(address *common.Address) Identity { flipKeyWordPairs = api.ceremony.FlipKeyWordPairs() } - converted := convertIdentity(api.baseApi.getReadonlyAppState().State.Epoch(), *address, api.baseApi.getReadonlyAppState().State.GetIdentity(*address), flipKeyWordPairs) - converted.Online = getIdentityOnlineStatus(api.baseApi.getReadonlyAppState(), *address) + appState := api.baseApi.getReadonlyAppState() + converted := convertIdentity(appState.State.Epoch(), *address, appState.State.GetIdentity(*address), flipKeyWordPairs, appState.ValidatorsCache.IsPool(*address)) + converted.Online = getIdentityOnlineStatus(appState, *address) return converted } @@ -327,7 +332,7 @@ func getIdentityOnlineStatus(state *appstate.AppState, addr common.Address) bool } } -func convertIdentity(currentEpoch uint16, address common.Address, data state.Identity, flipKeyWordPairs []int) Identity { +func convertIdentity(currentEpoch uint16, address common.Address, data state.Identity, flipKeyWordPairs []int, isPool bool) Identity { var s string switch data.State { case state.Invite: @@ -420,6 +425,7 @@ func convertIdentity(currentEpoch uint16, address common.Address, data state.Ide Delegatee: data.Delegatee, DelegationEpoch: data.DelegationEpoch, DelegationNonce: data.DelegationNonce, + IsPool: isPool, } } From d7c987c6012d2a1c1afea06e9f1e2fdbc95ebb23 Mon Sep 17 00:00:00 2001 From: sidenaio Date: Mon, 22 Mar 2021 18:41:07 +0500 Subject: [PATCH 15/15] Enable genesis generation --- config/consensus.go | 1 + 1 file changed, 1 insertion(+) diff --git a/config/consensus.go b/config/consensus.go index 6fbf5c8f..3d4395fd 100644 --- a/config/consensus.go +++ b/config/consensus.go @@ -118,6 +118,7 @@ func ApplyConsensusVersion(ver ConsensusVerson, cfg *ConsensusConf) { cfg.StartActivationDate = time.Date(2021, 03, 24, 8, 0, 0, 0, time.UTC).Unix() cfg.EndActivationDate = time.Date(2021, 03, 29, 0, 0, 0, 0, time.UTC).Unix() cfg.MigrationTimeout = 0 + cfg.GenerateGenesisAfterUpgrade = true } }