diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b503b02d..55507752b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,19 +1,12 @@ # Changelog -## [v3.0.2](https://github.com/MinterTeam/minter-go-node/tree/v3.0.2) +## [v3.0.3](https://github.com/MinterTeam/minter-go-node/tree/v3.0.2) -[Full Changelog](https://github.com/MinterTeam/minter-go-node/compare/v3.0.1...v3.0.2) +[Full Changelog](https://github.com/MinterTeam/minter-go-node/compare/v3.0.0...v3.0.2) ### Fixed - Initial emission - -## [v3.0.1](https://github.com/MinterTeam/minter-go-node/tree/v3.0.1) - -[Full Changelog](https://github.com/MinterTeam/minter-go-node/compare/v3.0.0...v3.0.1) - -### Fixed - - API `/block` and `/blocks` for older versions. ## [v3.0.0](https://github.com/MinterTeam/minter-go-node/tree/v3.0.0) diff --git a/api/v2/service/genesis.go b/api/v2/service/genesis.go index ffd4ad53a..418552bb4 100644 --- a/api/v2/service/genesis.go +++ b/api/v2/service/genesis.go @@ -85,6 +85,9 @@ func (s *Service) Genesis(ctx context.Context, _ *empty.Empty) (*pb.GenesisRespo Validator: &pb.GenesisResponse_ConsensusParams_Validator{ PubKeyTypes: result.Genesis.ConsensusParams.Validator.PubKeyTypes, }, + Version: &pb.GenesisResponse_ConsensusParams_Version{ + AppVersion: result.Genesis.ConsensusParams.Version.AppVersion, + }, }, AppHash: result.Genesis.AppHash.String(), AppState: &appState, diff --git a/api/v2/service/price_commission.go b/api/v2/service/price_commission.go index 4e089771d..abaf301c9 100644 --- a/api/v2/service/price_commission.go +++ b/api/v2/service/price_commission.go @@ -76,11 +76,11 @@ func priceCommissionResponse(price *commission.Price, coin *coins.Model) *pb.Pri BurnToken: price.BurnToken.String(), VoteCommission: price.VoteCommission.String(), VoteUpdate: price.VoteUpdate.String(), - FailedTx: price.FailedTxPrice().String(), - AddLimitOrder: price.AddLimitOrderPrice().String(), - RemoveLimitOrder: price.RemoveLimitOrderPrice().String(), - MoveStake: price.MoveStakePrice().String(), - LockStake: price.LockStakePrice().String(), - Lock: price.LockPrice().String(), + FailedTx: price.FailedTx.String(), + AddLimitOrder: price.AddLimitOrder.String(), + RemoveLimitOrder: price.RemoveLimitOrder.String(), + MoveStake: price.MoveStake.String(), + LockStake: price.LockStake.String(), + Lock: price.Lock.String(), } } diff --git a/cmd/minter/cmd/export.go b/cmd/minter/cmd/export.go index aaccaefc0..7bbbbf112 100644 --- a/cmd/minter/cmd/export.go +++ b/cmd/minter/cmd/export.go @@ -3,6 +3,8 @@ package cmd import ( "crypto/sha256" "encoding/json" + "github.com/MinterTeam/minter-go-node/coreV2/minter" + "github.com/MinterTeam/minter-go-node/coreV2/rewards" "github.com/MinterTeam/minter-go-node/version" "github.com/tendermint/go-amino" "io" @@ -88,16 +90,19 @@ func export(cmd *cobra.Command, args []string) error { } log.Printf("Verify state OK\n") - appState.Version = db.GetVersionName(height) - versions := db.GetVersions() - for _, v := range versions { - appState.Versions = append(appState.Versions, mtypes.Version{ - Height: v.Height, - Name: v.Name, - }) - } - - appState.Emission = db.Emission().String() + appState.Version = minter.V3 + //versions := db.GetVersions() + //for _, v := range versions { + // appState.Versions = append(appState.Versions, mtypes.Version{ + // Height: v.Height, + // Name: v.Name, + // }) + //} + + //appState.Emission = db.Emission().String() + appState.Emission = rewards.NewReward().GetBeforeBlock(height).String() + reserve0, reserve1 := currentState.Swap().GetSwapper(0, 1993).Reserves() + db.UpdatePrice(time.Unix(0, int64(genesisTime)).UTC(), reserve0, reserve1) t, r0, r1, reward, off := db.GetPrice() appState.PrevReward = mtypes.RewardPrice{ Time: uint64(t.UTC().UnixNano()), diff --git a/cmd/minter/main.go b/cmd/minter/main.go index 9ce260699..87ee0c06d 100644 --- a/cmd/minter/main.go +++ b/cmd/minter/main.go @@ -35,7 +35,7 @@ func main() { rootCmd.PersistentFlags().Bool("testnet", false, "use \"true\" for testnet, mainnet is default") rootCmd.PersistentFlags().Bool("pprof", false, "enable pprof") rootCmd.PersistentFlags().String("pprof-addr", "0.0.0.0:6060", "pprof listen addr") - rootCmd.PersistentFlags().String("genesis", "https://github.com/MinterTeam/minter-go-node/releases/download/v2.0/genesis.json", "path with the genesis file to download") + rootCmd.PersistentFlags().String("genesis", "https://github.com/MinterTeam/minter-go-node/releases/download/v3.0.3/genesis.json", "path with the genesis file to download") rootCmd.PersistentFlags().String("persistent-peers", "", "") rootCmd.PersistentFlags().Bool("state-sync", false, "enable state sync snapshots") diff --git a/coreV2/code/code.go b/coreV2/code/code.go index 1f1099ac6..986f954b3 100644 --- a/coreV2/code/code.go +++ b/coreV2/code/code.go @@ -29,6 +29,7 @@ const ( VoteAlreadyExists uint32 = 121 WrongUpdateVersionName uint32 = 122 WrongDueHeight uint32 = 123 + Unavailable uint32 = 124 // coin creation CoinHasNotReserve uint32 = 200 diff --git a/coreV2/minter/blockchain.go b/coreV2/minter/blockchain.go index 800d2e133..d506f44cd 100644 --- a/coreV2/minter/blockchain.go +++ b/coreV2/minter/blockchain.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "github.com/MinterTeam/minter-go-node/coreV2/state/candidates" + "github.com/MinterTeam/minter-go-node/helpers" "github.com/cosmos/cosmos-sdk/snapshots" snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" "github.com/cosmos/cosmos-sdk/types/errors" @@ -143,15 +144,9 @@ func NewMinterBlockchain(storages *utils.Storage, cfg *config.Config, ctx contex expiredOrdersPeriod: expiredOrdersPeriod, stopOk: make(chan struct{}), knownUpdates: map[string]struct{}{ - "": {}, // default version - v230: {}, // add more for update - v250: {}, // commissions and mempool - v260: {}, // amm with orderbook - v261: {}, // hotfix - v262: {}, // hotfix - V3: {}, // tokenomics + V3: {}, // tokenomics }, - executor: GetExecutor(""), + executor: GetExecutor(V3), } if applicationDB.GetStartHeight() != 0 { app.initState() @@ -165,30 +160,21 @@ func graceForUpdate(height uint64) *upgrades.GracePeriod { func GetExecutor(v string) transaction.ExecutorTx { switch v { - case V3: - return transaction.NewExecutorV3(transaction.GetDataV3) - case v260, v261, v262: - return transaction.NewExecutorV250(transaction.GetDataV260) - case v250: - return transaction.NewExecutorV250(transaction.GetDataV250) - case v230: - return transaction.NewExecutor(transaction.GetDataV230) + //case V3: + // return transaction.NewExecutorV3(transaction.GetDataV3) + //case v260, v261, v262: + // return transaction.NewExecutorV250(transaction.GetDataV260) + //case v250: + // return transaction.NewExecutorV250(transaction.GetDataV250) + //case v230: + // return transaction.NewExecutor(transaction.GetDataV230) default: - return transaction.NewExecutor(transaction.GetDataV1) + return transaction.NewExecutorV3(transaction.GetDataV3) } } -const haltBlockV210 = 3431238 -const updateBlockV240 = 4448826 - const ( // known update versions - v2 = "" // default - v230 = "v230" // remove liquidity bug - v250 = "v250" // commissions and failed txs - v260 = "v260" // orderbook - v261 = "v261" // hotfix - v262 = "v262" // hotfix (moved to V3) - V3 = "v300" // tokenomics + V3 = "v300" // tokenomics ) func (blockchain *Blockchain) initState() { @@ -197,21 +183,13 @@ func (blockchain *Blockchain) initState() { var stateDeliver *state.State var err error - if h := blockchain.appDB.GetVersionHeight(V3); h > 0 { - stateDeliver, err = state.NewStateV3(currentHeight, - blockchain.storages.StateDB(), - blockchain.eventsDB, - blockchain.cfg.StateCacheSize, - blockchain.cfg.KeepLastStates, - initialHeight) - } else { - stateDeliver, err = state.NewState(currentHeight, - blockchain.storages.StateDB(), - blockchain.eventsDB, - blockchain.cfg.StateCacheSize, - blockchain.cfg.KeepLastStates, - initialHeight) - } + stateDeliver, err = state.NewStateV3(currentHeight, + blockchain.storages.StateDB(), + blockchain.eventsDB, + blockchain.cfg.StateCacheSize, + blockchain.cfg.KeepLastStates, + initialHeight) + if err != nil { panic(err) } @@ -221,18 +199,14 @@ func (blockchain *Blockchain) initState() { blockchain.stateDeliver = stateDeliver blockchain.stateCheck = state.NewCheckState(stateDeliver) - grace := upgrades.NewGrace() - grace.AddGracePeriods(upgrades.NewGracePeriod(initialHeight, initialHeight+120, true), - upgrades.NewGracePeriod(haltBlockV210, haltBlockV210+120, true), - upgrades.NewGracePeriod(3612653, 3612653+120, true), - upgrades.NewGracePeriod(updateBlockV240, updateBlockV240+120, true)) + blockchain.grace = upgrades.NewGrace() + blockchain.grace.AddGracePeriods(upgrades.NewGracePeriod(initialHeight, initialHeight+120, true)) - for _, v := range blockchain.UpdateVersions() { - grace.AddGracePeriods(graceForUpdate(v.Height)) - blockchain.executor = GetExecutor(v.Name) - } + //for _, v := range blockchain.UpdateVersions() { + // blockchain.grace.AddGracePeriods(graceForUpdate(v.Height)) + // blockchain.executor = GetExecutor(v.Name) + //} - blockchain.grace = grace } // InitChain initialize blockchain with validators and other info. Only called once. @@ -268,8 +242,19 @@ func (blockchain *Blockchain) InitChain(req abciTypes.RequestInitChain) abciType lastHeight := initialHeight blockchain.appDB.SetLastHeight(lastHeight) + blockchain.appDB.SetEmission(helpers.StringToBigInt(genesisState.Emission)) + + blockchain.appDB.SetPrice( + time.Unix(0, int64(genesisState.PrevReward.Time)).UTC(), + helpers.StringToBigInt(genesisState.PrevReward.AmountBIP), + helpers.StringToBigInt(genesisState.PrevReward.AmountUSDT), + helpers.StringToBigInt(genesisState.PrevReward.Reward), + genesisState.PrevReward.Off) + blockchain.appDB.SaveStartHeight() blockchain.appDB.SaveVersions() + blockchain.appDB.SaveEmission() + blockchain.appDB.SavePrice() defer blockchain.appDB.FlushValidators() return abciTypes.ResponseInitChain{ @@ -280,25 +265,24 @@ func (blockchain *Blockchain) InitChain(req abciTypes.RequestInitChain) abciType // BeginBlock signals the beginning of a block. func (blockchain *Blockchain) BeginBlock(req abciTypes.RequestBeginBlock) abciTypes.ResponseBeginBlock { height := uint64(req.Header.Height) - if h := blockchain.appDB.GetVersionHeight(V3); (h > 0 && height == h) || blockchain.stateDeliver == nil { + if blockchain.stateDeliver == nil { blockchain.initState() } - if h := blockchain.appDB.GetVersionHeight(V3); h > 0 { - if emission := blockchain.appDB.Emission(); emission == nil || emission.Cmp(blockchain.rewardsCounter.TotalEmissionBig()) == -1 { - t, _, _, _, _ := blockchain.appDB.GetPrice() - if height%blockchain.updateStakesAndPayRewardsPeriod == 1 && (t.IsZero() || (req.Header.Time.Hour() >= 12 && req.Header.Time.Hour() <= 14) && req.Header.Time.Sub(t) > 3*time.Hour) { - reserve0, reserve1 := blockchain.stateCheck.Swap().GetSwapper(0, types.USDTID).Reserves() - newRewards, safeReward := blockchain.appDB.UpdatePrice(req.Header.Time, reserve0, reserve1) - blockchain.stateDeliver.App.SetReward(newRewards, safeReward) - blockchain.eventsDB.AddEvent(&eventsdb.UpdatedBlockRewardEvent{Value: newRewards.String(), ValueLockedStakeRewards: new(big.Int).Mul(safeReward, big.NewInt(3)).String()}) - } - } else { - blockchain.stateDeliver.App.SetReward(big.NewInt(0), big.NewInt(0)) + if emission := blockchain.appDB.Emission(); emission.Cmp(blockchain.rewardsCounter.TotalEmissionBig()) == -1 { + t, _, _, _, _ := blockchain.appDB.GetPrice() + if height%blockchain.updateStakesAndPayRewardsPeriod == 1 && (t.IsZero() || (req.Header.Time.Hour() >= 12 && req.Header.Time.Hour() <= 14) && req.Header.Time.Sub(t) > 3*time.Hour) { + reserve0, reserve1 := blockchain.stateCheck.Swap().GetSwapper(0, types.USDTID).Reserves() + newRewards, safeReward := blockchain.appDB.UpdatePrice(req.Header.Time, reserve0, reserve1) + blockchain.stateDeliver.App.SetReward(newRewards, safeReward) + blockchain.eventsDB.AddEvent(&eventsdb.UpdatedBlockRewardEvent{Value: newRewards.String(), ValueLockedStakeRewards: new(big.Int).Mul(safeReward, big.NewInt(3)).String()}) } - + } else { + blockchain.stateDeliver.App.SetReward(big.NewInt(0), big.NewInt(0)) } + //} + blockchain.StatisticData().PushStartBlock(&statistics.StartRequest{Height: int64(height), Now: time.Now(), HeaderTime: req.Header.Time}) // compute max gas @@ -341,10 +325,6 @@ func (blockchain *Blockchain) BeginBlock(req abciTypes.RequestBeginBlock) abciTy return abciTypes.ResponseBeginBlock{} } - if versionName == v230 && height > updateBlockV240 { - blockchain.executor = transaction.NewExecutor(transaction.GetDataV240) - } - // give penalty to Byzantine validators for _, byzVal := range req.ByzantineValidators { var address types.TmAddress @@ -426,26 +406,13 @@ func (blockchain *Blockchain) EndBlock(req abciTypes.RequestEndBlock) abciTypes. // accumulate rewards var reward = big.NewInt(0) - var heightIsMaxIfIssueIsOverOrNotDynamic uint64 = math.MaxUint64 - if h := blockchain.appDB.GetVersionHeight(V3); h > 0 && height > h { - emission := blockchain.appDB.Emission() - if emission == nil { - blockchain.appDB.SetEmission(blockchain.rewardsCounter.GetBeforeBlock(height - 1)) - } else if emission.Cmp(blockchain.rewardsCounter.TotalEmissionBig()) == -1 { - reward, _ = blockchain.stateDeliver.App.Reward() - if reward == nil { - reward = blockchain.rewardsCounter.GetRewardForBlock(height) - } else { - heightIsMaxIfIssueIsOverOrNotDynamic = height - } - } - - } else if h == height { - blockchain.appDB.SetEmission(blockchain.rewardsCounter.GetBeforeBlock(height)) - } else { - reward = blockchain.rewardsCounter.GetRewardForBlock(height) + emission := blockchain.appDB.Emission() + if emission.Cmp(blockchain.rewardsCounter.TotalEmissionBig()) == -1 { + reward, _ = blockchain.stateDeliver.App.Reward() + heightIsMaxIfIssueIsOverOrNotDynamic = height } + { rewardWithTxs := big.NewInt(0).Add(reward, blockchain.rewards) @@ -478,13 +445,9 @@ func (blockchain *Blockchain) EndBlock(req abciTypes.RequestEndBlock) abciTypes. // pay rewards var moreRewards = big.NewInt(0) if height%blockchain.updateStakesAndPayRewardsPeriod == 0 { - if h := blockchain.appDB.GetVersionHeight(V3); h > 0 { - moreRewards = blockchain.stateDeliver.Validators.PayRewardsV3(heightIsMaxIfIssueIsOverOrNotDynamic, int64(blockchain.updateStakesAndPayRewardsPeriod)) - blockchain.appDB.SetEmission(big.NewInt(0).Add(blockchain.appDB.Emission(), moreRewards)) - blockchain.stateDeliver.Checker.AddCoinVolume(types.GetBaseCoinID(), moreRewards) - } else { - blockchain.stateDeliver.Validators.PayRewards() - } + moreRewards = blockchain.stateDeliver.Validators.PayRewardsV3(heightIsMaxIfIssueIsOverOrNotDynamic, int64(blockchain.updateStakesAndPayRewardsPeriod)) + blockchain.appDB.SetEmission(big.NewInt(0).Add(blockchain.appDB.Emission(), moreRewards)) + blockchain.stateDeliver.Checker.AddCoinVolume(types.GetBaseCoinID(), moreRewards) } if heightIsMaxIfIssueIsOverOrNotDynamic != math.MaxUint64 { @@ -499,12 +462,7 @@ func (blockchain *Blockchain) EndBlock(req abciTypes.RequestEndBlock) abciTypes. blockchain.stateDeliver.Checker.AddCoinVolume(types.GetBaseCoinID(), reward) { - var updateCommissionsBlockPrices []byte - if height < haltBlockV210 { - updateCommissionsBlockPrices = blockchain.isUpdateCommissionsBlock(height) - } else { - updateCommissionsBlockPrices = blockchain.isUpdateCommissionsBlockV2(height) - } + updateCommissionsBlockPrices := blockchain.isUpdateCommissionsBlockV2(height) if prices := updateCommissionsBlockPrices; len(prices) != 0 { blockchain.stateDeliver.Commission.SetNewCommissions(prices) price := blockchain.stateDeliver.Commission.GetCommissions() @@ -552,12 +510,12 @@ func (blockchain *Blockchain) EndBlock(req abciTypes.RequestEndBlock) abciTypes. BurnToken: price.BurnToken.String(), VoteCommission: price.VoteCommission.String(), VoteUpdate: price.VoteUpdate.String(), - FailedTx: price.FailedTxPrice().String(), - AddLimitOrder: price.AddLimitOrderPrice().String(), - RemoveLimitOrder: price.RemoveLimitOrderPrice().String(), - MoveStake: price.MoveStakePrice().String(), - LockStake: price.LockStakePrice().String(), - Lock: price.LockPrice().String(), + FailedTx: price.FailedTx.String(), + AddLimitOrder: price.AddLimitOrder.String(), + RemoveLimitOrder: price.RemoveLimitOrder.String(), + MoveStake: price.MoveStake.String(), + LockStake: price.LockStake.String(), + Lock: price.Lock.String(), }) } blockchain.stateDeliver.Commission.Delete(height) diff --git a/coreV2/minter/minter.go b/coreV2/minter/minter.go index f33d3f1c6..d3575378c 100644 --- a/coreV2/minter/minter.go +++ b/coreV2/minter/minter.go @@ -101,11 +101,7 @@ func (blockchain *Blockchain) calculatePowers(vals []*validators2.Validator) { func (blockchain *Blockchain) updateValidators() []abciTypes.ValidatorUpdate { height := blockchain.Height() - if h := blockchain.GetVersionHeight(v260); h > 0 { - blockchain.stateDeliver.Candidates.RecalculateStakesV2(height) - } else { - blockchain.stateDeliver.Candidates.RecalculateStakes(height) - } + blockchain.stateDeliver.Candidates.RecalculateStakesV2(height) valsCount := validators.GetValidatorsCountForBlock(height) newCandidates := blockchain.stateDeliver.Candidates.GetNewCandidates(valsCount) if len(newCandidates) < valsCount { @@ -189,19 +185,11 @@ func (blockchain *Blockchain) GetEmission() *big.Int { // GetStateForHeight returns immutable state of Minter Blockchain for given height func (blockchain *Blockchain) GetStateForHeight(height uint64) (*state.CheckState, error) { if height > 0 { - if h := blockchain.appDB.GetVersionHeight(V3); h > 0 && height > h { // todo - s, err := state.NewCheckStateAtHeightV3(height, blockchain.storages.StateDB()) - if err != nil { - return nil, err - } - return s, nil - } else { - s, err := state.NewCheckStateAtHeight(height, blockchain.storages.StateDB()) - if err != nil { - return nil, err - } - return s, nil + s, err := state.NewCheckStateAtHeightV3(height, blockchain.storages.StateDB()) + if err != nil { + return nil, err } + return s, nil } return blockchain.CurrentState(), nil } diff --git a/coreV2/minter/minter_test.go b/coreV2/minter/minter_test.go index 6d6a3fe8a..729862d15 100644 --- a/coreV2/minter/minter_test.go +++ b/coreV2/minter/minter_test.go @@ -1018,7 +1018,7 @@ func getTestGenesis(pv *privval.FilePV, home string, initialState int64) func() validators, candidates := makeTestValidatorsAndCandidates([]string{string(pv.Key.PubKey.Bytes()[:])}, helpers.BipToPip(big.NewInt(12444011))) appState := types.AppState{ - Version: v250, + Version: V3, TotalSlashed: "0", Accounts: []types.Account{ { diff --git a/coreV2/state/accounts/accounts.go b/coreV2/state/accounts/accounts.go index 255846520..78e7ccac5 100644 --- a/coreV2/state/accounts/accounts.go +++ b/coreV2/state/accounts/accounts.go @@ -429,15 +429,11 @@ func (a *Accounts) Export(state *types.AppState) { return balance[i].Coin < balance[j].Coin }) - var lockStakeUntilBlock uint64 - if len(account.LockStakeUntilBlock) > 0 { - lockStakeUntilBlock = account.LockStakeUntilBlock[0] - } acc := types.Account{ Address: account.address, Balance: balance, Nonce: account.Nonce, - LockStakeUntilBlock: lockStakeUntilBlock, + LockStakeUntilBlock: account.LockStakeUntilBlock, } if account.IsMultisig() { diff --git a/coreV2/state/accounts/model.go b/coreV2/state/accounts/model.go index b4e1db295..3b23e8acd 100644 --- a/coreV2/state/accounts/model.go +++ b/coreV2/state/accounts/model.go @@ -14,7 +14,7 @@ type Model struct { MultisigData Multisig // forward compatible - LockStakeUntilBlock []uint64 `rlp:"tail"` + LockStakeUntilBlock uint64 address types.Address coins []types.CoinID @@ -187,18 +187,14 @@ func (model *Model) getLockStakeUntilBlock() uint64 { model.lock.RLock() defer model.lock.RUnlock() - if len(model.LockStakeUntilBlock) == 0 { - return 0 - } - - return model.LockStakeUntilBlock[0] + return model.LockStakeUntilBlock } func (model *Model) setLockStakeUntilBlock(h uint64) { model.lock.Lock() defer model.lock.Unlock() - model.LockStakeUntilBlock = []uint64{h} + model.LockStakeUntilBlock = h model.isDirty = true model.markDirty(model.address) diff --git a/coreV2/state/app/app.go b/coreV2/state/app/app.go index 44dd634ce..52b1583b2 100644 --- a/coreV2/state/app/app.go +++ b/coreV2/state/app/app.go @@ -136,7 +136,6 @@ func (a *App) getOrNew() *Model { TotalSlashed: big.NewInt(0), CoinsCount: 0, MaxGas: 0, - Reward: nil, markDirty: a.markDirty, } a.mx.Lock() diff --git a/coreV2/state/app/model.go b/coreV2/state/app/model.go index f8ab85a51..d1fe8d571 100644 --- a/coreV2/state/app/model.go +++ b/coreV2/state/app/model.go @@ -11,7 +11,8 @@ type Model struct { MaxGas uint64 // forward compatible - Reward [][]byte `rlp:"tail"` + Reward0 []byte + RewardSafe []byte markDirty func() mx sync.RWMutex @@ -38,18 +39,15 @@ func (model *Model) reward() (*big.Int, *big.Int) { model.mx.RLock() defer model.mx.RUnlock() - if len(model.Reward) == 0 { - return nil, nil - } - - return new(big.Int).SetBytes(model.Reward[0]), new(big.Int).SetBytes(model.Reward[1]) + return new(big.Int).SetBytes(model.Reward0), new(big.Int).SetBytes(model.RewardSafe) } func (model *Model) setReward(reward *big.Int, safeReward *big.Int) { model.mx.Lock() defer model.mx.Unlock() - model.Reward = [][]byte{reward.Bytes(), safeReward.Bytes()} + model.Reward0 = reward.Bytes() + model.RewardSafe = safeReward.Bytes() model.markDirty() } diff --git a/coreV2/state/commission/commission.go b/coreV2/state/commission/commission.go index 35d18056d..c1b293bc4 100644 --- a/coreV2/state/commission/commission.go +++ b/coreV2/state/commission/commission.go @@ -125,12 +125,12 @@ func (c *Commission) Export(state *types.AppState) { BurnToken: p.BurnToken.String(), VoteCommission: p.VoteCommission.String(), VoteUpdate: p.VoteUpdate.String(), - FailedTx: p.FailedTxPrice().String(), - AddLimitOrder: p.AddLimitOrderPrice().String(), - RemoveLimitOrder: p.RemoveLimitOrderPrice().String(), - MoveStake: p.MoveStakePrice().String(), - LockStake: p.LockStakePrice().String(), - Lock: p.LockPrice().String(), + FailedTx: p.FailedTx.String(), + AddLimitOrder: p.AddLimitOrder.String(), + RemoveLimitOrder: p.RemoveLimitOrder.String(), + MoveStake: p.MoveStake.String(), + LockStake: p.LockStake.String(), + Lock: p.Lock.String(), }, }) } @@ -183,12 +183,12 @@ func (c *Commission) Export(state *types.AppState) { BurnToken: current.BurnToken.String(), VoteCommission: current.VoteCommission.String(), VoteUpdate: current.VoteUpdate.String(), - FailedTx: current.FailedTxPrice().String(), - AddLimitOrder: current.AddLimitOrderPrice().String(), - RemoveLimitOrder: current.RemoveLimitOrderPrice().String(), - MoveStake: current.MoveStakePrice().String(), - LockStake: current.LockStakePrice().String(), - Lock: current.LockPrice().String(), + FailedTx: current.FailedTx.String(), + AddLimitOrder: current.AddLimitOrder.String(), + RemoveLimitOrder: current.RemoveLimitOrder.String(), + MoveStake: current.MoveStake.String(), + LockStake: current.LockStake.String(), + Lock: current.Lock.String(), } } diff --git a/coreV2/state/commission/model.go b/coreV2/state/commission/model.go index 8cdff8595..4760a439e 100644 --- a/coreV2/state/commission/model.go +++ b/coreV2/state/commission/model.go @@ -53,7 +53,14 @@ type Price struct { VoteCommission *big.Int VoteUpdate *big.Int - // FailedTx, AddLimitOrder, RemoveLimitOrder *big.Int + FailedTx *big.Int + AddLimitOrder *big.Int + RemoveLimitOrder *big.Int + + MoveStake *big.Int + LockStake *big.Int + Lock *big.Int + More []*big.Int `rlp:"tail"` } @@ -65,47 +72,48 @@ func (d *Price) Encode() []byte { return bytes } -func (d *Price) FailedTxPrice() *big.Int { - if len(d.More) > 0 { - return d.More[0] - } - return d.Send -} - -func (d *Price) AddLimitOrderPrice() *big.Int { - if len(d.More) > 1 { - return d.More[1] - } - return d.CreateSwapPool -} - -func (d *Price) RemoveLimitOrderPrice() *big.Int { - if len(d.More) > 2 { - return d.More[2] - } - return d.RemoveLiquidity -} - -func (d *Price) MoveStakePrice() *big.Int { - if len(d.More) > 3 { - return d.More[3] - } - return d.Unbond -} - -func (d *Price) LockStakePrice() *big.Int { - if len(d.More) > 4 { - return d.More[4] - } - return d.Unbond -} - -func (d *Price) LockPrice() *big.Int { - if len(d.More) > 5 { - return d.More[5] - } - return d.Send -} +// +//func (d *Price) FailedTxPrice() *big.Int { +// if len(d.More) > 0 { +// return d.More[0] +// } +// return d.Send +//} +// +//func (d *Price) AddLimitOrderPrice() *big.Int { +// if len(d.More) > 1 { +// return d.More[1] +// } +// return d.CreateSwapPool +//} +// +//func (d *Price) RemoveLimitOrderPrice() *big.Int { +// if len(d.More) > 2 { +// return d.More[2] +// } +// return d.RemoveLiquidity +//} +// +//func (d *Price) MoveStakePrice() *big.Int { +// if len(d.More) > 3 { +// return d.More[3] +// } +// return d.Unbond +//} +// +//func (d *Price) LockStakePrice() *big.Int { +// if len(d.More) > 4 { +// return d.More[4] +// } +// return d.Unbond +//} +// +//func (d *Price) LockPrice() *big.Int { +// if len(d.More) > 5 { +// return d.More[5] +// } +// return d.Send +//} func Decode(s string) *Price { var p Price diff --git a/coreV2/state/state.go b/coreV2/state/state.go index ce1738ac9..bd7f893ca 100644 --- a/coreV2/state/state.go +++ b/coreV2/state/state.go @@ -289,6 +289,7 @@ func (s *State) Commit() ([]byte, error) { func (s *State) Import(state types.AppState, version string) error { defer s.Checker.RemoveBaseCoin() + s.App.SetReward(helpers.StringToBigInt(state.PrevReward.Reward), helpers.StringToBigInt(state.PrevReward.Reward)) s.App.SetMaxGas(state.MaxGas) s.App.SetCoinsCount(uint32(len(state.Coins))) @@ -306,9 +307,9 @@ func (s *State) Import(state types.AppState, version string) error { } s.Accounts.SetNonce(a.Address, a.Nonce) - if a.LockStakeUntilBlock > 0 { - s.Accounts.SetLockStakeUntilBlock(a.Address, a.LockStakeUntilBlock) - } + //if a.LockStakeUntilBlock > 0 { + s.Accounts.SetLockStakeUntilBlock(a.Address, a.LockStakeUntilBlock) + //} for _, b := range a.Balance { balance := helpers.StringToBigInt(b.Value) coinID := types.CoinID(b.Coin) @@ -360,11 +361,7 @@ func (s *State) Import(state types.AppState, version string) error { s.Candidates.SetDeletedCandidates(state.DeletedCandidates) } - if version == "" { - s.Candidates.RecalculateStakes(uint64(s.height)) // RecalculateStakesV2 - } else { - s.Candidates.RecalculateStakesV2(uint64(s.height)) - } + s.Candidates.RecalculateStakesV2(uint64(s.height)) for _, w := range state.Waitlist { value := helpers.StringToBigInt(w.Value) @@ -432,17 +429,22 @@ func (s *State) Import(state types.AppState, version string) error { MintToken: helpers.StringToBigInt(c.MintToken), VoteCommission: helpers.StringToBigInt(c.VoteCommission), VoteUpdate: helpers.StringToBigInt(c.VoteUpdate), - More: nil, - } - - if c.FailedTx != "" && - c.AddLimitOrder != "" && - c.RemoveLimitOrder != "" { - com.More = append(com.More, - helpers.StringToBigInt(c.FailedTx), - helpers.StringToBigInt(c.AddLimitOrder), - helpers.StringToBigInt(c.RemoveLimitOrder)) - } + FailedTx: helpers.StringToBigInt(c.FailedTx), + AddLimitOrder: helpers.StringToBigInt(c.AddLimitOrder), + RemoveLimitOrder: helpers.StringToBigInt(c.RemoveLimitOrder), + MoveStake: helpers.StringToBigInt(c.MoveStake), + LockStake: helpers.StringToBigInt(c.LockStake), + Lock: helpers.StringToBigInt(c.Lock), + } + + //if c.FailedTx != "" && + // c.AddLimitOrder != "" && + // c.RemoveLimitOrder != "" { + // com.More = append(com.More, + // helpers.StringToBigInt(c.FailedTx), + // helpers.StringToBigInt(c.AddLimitOrder), + // helpers.StringToBigInt(c.RemoveLimitOrder)) + //} s.Commission.SetNewCommissions(com.Encode()) @@ -492,16 +494,22 @@ func (s *State) Import(state types.AppState, version string) error { MintToken: helpers.StringToBigInt(vc.MintToken), VoteCommission: helpers.StringToBigInt(vc.VoteCommission), VoteUpdate: helpers.StringToBigInt(vc.VoteUpdate), + FailedTx: helpers.StringToBigInt(vc.FailedTx), + AddLimitOrder: helpers.StringToBigInt(vc.AddLimitOrder), + RemoveLimitOrder: helpers.StringToBigInt(vc.RemoveLimitOrder), + MoveStake: helpers.StringToBigInt(vc.MoveStake), + LockStake: helpers.StringToBigInt(vc.LockStake), + Lock: helpers.StringToBigInt(vc.Lock), More: nil, } - if vc.FailedTx != "" && - vc.AddLimitOrder != "" && - vc.RemoveLimitOrder != "" { - voteCom.More = append(com.More, - helpers.StringToBigInt(vc.FailedTx), - helpers.StringToBigInt(vc.AddLimitOrder), - helpers.StringToBigInt(vc.RemoveLimitOrder)) - } + //if vc.FailedTx != "" && + // vc.AddLimitOrder != "" && + // vc.RemoveLimitOrder != "" { + // voteCom.More = append(com.More, + // helpers.StringToBigInt(vc.FailedTx), + // helpers.StringToBigInt(vc.AddLimitOrder), + // helpers.StringToBigInt(vc.RemoveLimitOrder)) + //} for _, pubkey := range vote.Votes { s.Commission.AddVote(vote.Height, pubkey, voteCom.Encode()) } diff --git a/coreV2/state/swap/order.go b/coreV2/state/swap/order.go index 9d7beed39..cf888193b 100644 --- a/coreV2/state/swap/order.go +++ b/coreV2/state/swap/order.go @@ -1746,7 +1746,7 @@ func (p *Pair) AddLastSwapStepWithOrders(amount0In, amount1Out *big.Int, buy boo lockOrders: &sync.Mutex{}, PairKey: p.PairKey, pairData: &pairData{ - RWMutex: &sync.RWMutex{}, + mu: &sync.RWMutex{}, Reserve0: reserve0, Reserve1: reserve1, ID: p.ID, diff --git a/coreV2/state/swap/orderV2.go b/coreV2/state/swap/orderV2.go index dc7b69c99..677bfd527 100644 --- a/coreV2/state/swap/orderV2.go +++ b/coreV2/state/swap/orderV2.go @@ -1343,7 +1343,7 @@ func (p *PairV2) AddLastSwapStepWithOrders(amount0In, amount1Out *big.Int, buy b lockOrders: &sync.Mutex{}, PairKey: p.PairKey, pairData: &pairData{ - RWMutex: &sync.RWMutex{}, + mu: &sync.RWMutex{}, Reserve0: reserve0, Reserve1: reserve1, ID: p.ID, diff --git a/coreV2/state/swap/swap.go b/coreV2/state/swap/swap.go index d129053b0..1d876ee77 100644 --- a/coreV2/state/swap/swap.go +++ b/coreV2/state/swap/swap.go @@ -392,36 +392,36 @@ const totalPairIDPrefix = 'i' const totalOrdersIDPrefix = 'n' type pairData struct { - *sync.RWMutex // todo: mu *sync.RWMutex - Reserve0 *big.Int - Reserve1 *big.Int - ID *uint32 - markDirty func() + mu *sync.RWMutex + Reserve0 *big.Int + Reserve1 *big.Int + ID *uint32 + markDirty func() } func (pd *pairData) Reserves() (reserve0 *big.Int, reserve1 *big.Int) { - pd.RLock() - defer pd.RUnlock() + pd.mu.RLock() + defer pd.mu.RUnlock() return new(big.Int).Set(pd.Reserve0), new(big.Int).Set(pd.Reserve1) } func (pd *pairData) Price() *big.Float { - pd.RLock() - defer pd.RUnlock() + pd.mu.RLock() + defer pd.mu.RUnlock() return CalcPriceSell(pd.Reserve0, pd.Reserve1) } func (pd *pairData) PriceRat() *big.Rat { - pd.RLock() - defer pd.RUnlock() + pd.mu.RLock() + defer pd.mu.RUnlock() return CalcPriceSellRat(pd.Reserve0, pd.Reserve1) } func (pd *pairData) reverse() *pairData { return &pairData{ - RWMutex: pd.RWMutex, + mu: pd.mu, Reserve0: pd.Reserve1, Reserve1: pd.Reserve0, ID: pd.ID, @@ -455,7 +455,7 @@ func (p *Pair) AddLastSwapStep(amount0In, amount1Out *big.Int) EditableChecker { lockOrders: &sync.Mutex{}, PairKey: p.PairKey, pairData: &pairData{ - RWMutex: &sync.RWMutex{}, + mu: &sync.RWMutex{}, Reserve0: reserve0.Add(reserve0, amount0In), Reserve1: reserve1.Sub(reserve1, amount1Out), ID: p.ID, @@ -953,7 +953,7 @@ func (s *Swap) addPair(key PairKey) *Pair { lockOrders: &sync.Mutex{}, PairKey: key, pairData: &pairData{ - RWMutex: &sync.RWMutex{}, + mu: &sync.RWMutex{}, Reserve0: big.NewInt(0), Reserve1: big.NewInt(0), ID: new(uint32), @@ -1280,16 +1280,16 @@ func (p *Pair) checkSwap(amount0In, amount1In, amount0Out, amount1Out *big.Int) func (p *Pair) update(amount0, amount1 *big.Int) { p.markDirty() - p.pairData.Lock() - defer p.pairData.Unlock() + p.pairData.mu.Lock() + defer p.pairData.mu.Unlock() p.Reserve0.Add(p.Reserve0, amount0) p.Reserve1.Add(p.Reserve1, amount1) } func (p *Pair) Amounts(liquidity, totalSupply *big.Int) (amount0 *big.Int, amount1 *big.Int) { - p.pairData.RLock() - defer p.pairData.RUnlock() + p.pairData.mu.RLock() + defer p.pairData.mu.RUnlock() amount0 = new(big.Int).Div(new(big.Int).Mul(liquidity, p.Reserve0), totalSupply) amount1 = new(big.Int).Div(new(big.Int).Mul(liquidity, p.Reserve1), totalSupply) return amount0, amount1 diff --git a/coreV2/state/swap/swapV2.go b/coreV2/state/swap/swapV2.go index 741c21d95..676c5dba6 100644 --- a/coreV2/state/swap/swapV2.go +++ b/coreV2/state/swap/swapV2.go @@ -341,7 +341,7 @@ func (p *PairV2) AddLastSwapStep(amount0In, amount1Out *big.Int) EditableChecker lockOrders: &sync.Mutex{}, PairKey: p.PairKey, pairData: &pairData{ - RWMutex: &sync.RWMutex{}, + mu: &sync.RWMutex{}, Reserve0: reserve0.Add(reserve0, amount0In), Reserve1: reserve1.Sub(reserve1, amount1Out), ID: p.ID, @@ -729,7 +729,7 @@ func (s *SwapV2) addPair(key PairKey) *PairV2 { lockOrders: &sync.Mutex{}, PairKey: key, pairData: &pairData{ - RWMutex: &sync.RWMutex{}, + mu: &sync.RWMutex{}, Reserve0: big.NewInt(0), Reserve1: big.NewInt(0), ID: new(uint32), @@ -1034,16 +1034,16 @@ func (p *PairV2) checkSwap(amount0In, amount1In, amount0Out, amount1Out *big.Int func (p *PairV2) update(amount0, amount1 *big.Int) { p.markDirty() - p.pairData.Lock() - defer p.pairData.Unlock() + p.pairData.mu.Lock() + defer p.pairData.mu.Unlock() p.Reserve0.Add(p.Reserve0, amount0) p.Reserve1.Add(p.Reserve1, amount1) } func (p *PairV2) Amounts(liquidity, totalSupply *big.Int) (amount0 *big.Int, amount1 *big.Int) { - p.pairData.RLock() - defer p.pairData.RUnlock() + p.pairData.mu.RLock() + defer p.pairData.mu.RUnlock() amount0 = new(big.Int).Div(new(big.Int).Mul(liquidity, p.Reserve0), totalSupply) amount1 = new(big.Int).Div(new(big.Int).Mul(liquidity, p.Reserve1), totalSupply) return amount0, amount1 diff --git a/coreV2/transaction/add_order.go b/coreV2/transaction/add_order.go index ab66018e8..642b90c77 100644 --- a/coreV2/transaction/add_order.go +++ b/coreV2/transaction/add_order.go @@ -75,7 +75,7 @@ func (data AddLimitOrderData) String() string { } func (data AddLimitOrderData) CommissionData(price *commission.Price) *big.Int { - return price.AddLimitOrderPrice() + return price.AddLimitOrder } func (data AddLimitOrderData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64, price *big.Int) Response { diff --git a/coreV2/transaction/executor_v250.go b/coreV2/transaction/executor_v250.go index 359624882..b1caf6f90 100644 --- a/coreV2/transaction/executor_v250.go +++ b/coreV2/transaction/executor_v250.go @@ -212,7 +212,7 @@ func (e *ExecutorV250) RunTx(context state.Interface, rawTx []byte, rewardPool * } if !isCheck && response.Code != 0 { - commissionInBaseCoin := big.NewInt(0).Add(commissions.FailedTxPrice(), big.NewInt(0).Mul(big.NewInt(tx.payloadAndServiceDataLen()), commissions.PayloadByte)) + commissionInBaseCoin := big.NewInt(0).Add(commissions.FailedTx, big.NewInt(0).Mul(big.NewInt(tx.payloadAndServiceDataLen()), commissions.PayloadByte)) commissionInBaseCoin = tx.MulGasPrice(commissionInBaseCoin) if !commissions.Coin.IsBaseCoin() { diff --git a/coreV2/transaction/executor_v3.go b/coreV2/transaction/executor_v3.go index 172665ac6..439dd7bc5 100644 --- a/coreV2/transaction/executor_v3.go +++ b/coreV2/transaction/executor_v3.go @@ -44,6 +44,14 @@ func (e *ExecutorV3) RunTx(context state.Interface, rawTx []byte, rewardPool *bi } } + if tx.Type == TypeLockStake && currentBlock <= 10197360 { + return Response{ + Code: code.Unavailable, + Log: "LockStake available from block 10197360 ", + Info: EncodeError(code.NewCustomCode(code.Unavailable)), + } + } + if tx.ChainID != types.CurrentChainID { return Response{ Code: code.WrongChainID, @@ -203,7 +211,7 @@ func (e *ExecutorV3) RunTx(context state.Interface, rawTx []byte, rewardPool *bi if !isCheck { if response.Code != 0 { - commissionInBaseCoin := big.NewInt(0).Add(commissions.FailedTxPrice(), big.NewInt(0).Mul(big.NewInt(tx.payloadAndServiceDataLen()), commissions.PayloadByte)) + commissionInBaseCoin := big.NewInt(0).Add(commissions.FailedTx, big.NewInt(0).Mul(big.NewInt(tx.payloadAndServiceDataLen()), commissions.PayloadByte)) commissionInBaseCoin = tx.MulGasPrice(commissionInBaseCoin) if !commissions.Coin.IsBaseCoin() { diff --git a/coreV2/transaction/lock.go b/coreV2/transaction/lock.go index 70e8a76a9..fee98a07a 100644 --- a/coreV2/transaction/lock.go +++ b/coreV2/transaction/lock.go @@ -43,7 +43,7 @@ func (data LockData) String() string { } func (data LockData) CommissionData(price *commission.Price) *big.Int { - return price.LockPrice() + return price.Lock } func (data LockData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64, price *big.Int) Response { diff --git a/coreV2/transaction/lock_stake.go b/coreV2/transaction/lock_stake.go index dc7c0a107..5fc8993d7 100644 --- a/coreV2/transaction/lock_stake.go +++ b/coreV2/transaction/lock_stake.go @@ -32,7 +32,7 @@ func (data LockStakeData) String() string { } func (data LockStakeData) CommissionData(price *commission.Price) *big.Int { - return price.LockStakePrice() + return price.LockStake } func (data LockStakeData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64, price *big.Int) Response { diff --git a/coreV2/transaction/move_stake.go b/coreV2/transaction/move_stake.go index 30a135a05..039e3c34b 100644 --- a/coreV2/transaction/move_stake.go +++ b/coreV2/transaction/move_stake.go @@ -101,7 +101,7 @@ func (data MoveStakeData) String() string { } func (data MoveStakeData) CommissionData(price *commission.Price) *big.Int { - return price.MoveStakePrice() + return price.MoveStake } func (data MoveStakeData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64, price *big.Int) Response { diff --git a/coreV2/transaction/remove_limit_order.go b/coreV2/transaction/remove_limit_order.go index 8af52a23d..a59e37bf4 100644 --- a/coreV2/transaction/remove_limit_order.go +++ b/coreV2/transaction/remove_limit_order.go @@ -34,7 +34,7 @@ func (data RemoveLimitOrderData) String() string { } func (data RemoveLimitOrderData) CommissionData(price *commission.Price) *big.Int { - return price.RemoveLimitOrderPrice() + return price.RemoveLimitOrder } func (data RemoveLimitOrderData) Run(tx *Transaction, context state.Interface, rewardPool *big.Int, currentBlock uint64, price *big.Int) Response { diff --git a/coreV2/types/appstate.go b/coreV2/types/appstate.go index 27b8375a5..28bdd911d 100644 --- a/coreV2/types/appstate.go +++ b/coreV2/types/appstate.go @@ -325,7 +325,7 @@ type Candidate struct { type Stake struct { Owner Address `json:"owner"` - Coin uint64 `json:"coin"` + Coin uint64 `json:"coin,omitempty"` Value string `json:"value"` BipValue string `json:"bip_value"` } @@ -345,8 +345,8 @@ type Order struct { Height uint64 `json:"height"` } type Pool struct { - Coin0 uint64 `json:"coin0"` - Coin1 uint64 `json:"coin1"` + Coin0 uint64 `json:"coin0,omitempty"` + Coin1 uint64 `json:"coin1,omitempty"` Reserve0 string `json:"reserve0"` Reserve1 string `json:"reserve1"` ID uint64 `json:"id"` @@ -389,11 +389,11 @@ type Account struct { Balance []Balance `json:"balance,omitempty"` Nonce uint64 `json:"nonce"` MultisigData *Multisig `json:"multisig_data,omitempty"` - LockStakeUntilBlock uint64 `json:"lock_stake_until_block"` + LockStakeUntilBlock uint64 `json:"lock_stake_until_block,omitempty"` } type Balance struct { - Coin uint64 `json:"coin"` + Coin uint64 `json:"coin,omitempty"` Value string `json:"value"` } diff --git a/go.mod b/go.mod index c91ebc619..8973bc484 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/MinterTeam/minter-go-node go 1.17 require ( - github.com/MinterTeam/node-grpc-gateway v1.6.1-0.20220405114733-63e3aa339814 + github.com/MinterTeam/node-grpc-gateway v1.6.2-0.20220412154002-3df9a96c42ec github.com/btcsuite/btcd v0.22.0-beta github.com/c-bata/go-prompt v0.2.5 github.com/cosmos/cosmos-sdk v0.44.5 diff --git a/go.sum b/go.sum index af227a2c9..39c95c425 100644 --- a/go.sum +++ b/go.sum @@ -82,8 +82,8 @@ github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXY github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY= github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/MinterTeam/node-grpc-gateway v1.6.1-0.20220405114733-63e3aa339814 h1:89aOJdqp0a2UoyBVH6XzrlzzJ4phdYYc3TKBZWxwIEM= -github.com/MinterTeam/node-grpc-gateway v1.6.1-0.20220405114733-63e3aa339814/go.mod h1:aXWn+ewPqPGbnHbKEZzNik3motgWpFkT7LFTcBWvlHI= +github.com/MinterTeam/node-grpc-gateway v1.6.2-0.20220412154002-3df9a96c42ec h1:gjT/JfBxbuAw0RV147QOHZyov6lW6475trI/qutol80= +github.com/MinterTeam/node-grpc-gateway v1.6.2-0.20220412154002-3df9a96c42ec/go.mod h1:aXWn+ewPqPGbnHbKEZzNik3motgWpFkT7LFTcBWvlHI= github.com/MinterTeam/tendermint v0.34.17 h1:dfbkPUILMrEp+2AHd26lZLabhJdsvadM4Wb7r6WxKjo= github.com/MinterTeam/tendermint v0.34.17/go.mod h1:ZUTMgGKYs7fUCoDfUVNo1FnZkRojWjHBSnuL/M2U3ug= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= diff --git a/version/version.go b/version/version.go index 49d74821e..f4bf5a50e 100755 --- a/version/version.go +++ b/version/version.go @@ -2,12 +2,12 @@ package version // Version components const ( - AppVer = 7 + AppVer = 8 ) var ( // Version must be a string because scripts like dist.sh read this file. - Version = "3.0.2" + Version = "3.0.3" // GitCommit is the current HEAD set using ldflags. GitCommit string