From 1ab060d2b3298ab13313fdf8de04981a0decf237 Mon Sep 17 00:00:00 2001 From: klim0v Date: Thu, 2 Dec 2021 03:55:10 +0500 Subject: [PATCH 01/39] small fix estimate --- api/v2/service/estimate_coin_buy.go | 1 + api/v2/service/estimate_coin_sell.go | 1 + 2 files changed, 2 insertions(+) diff --git a/api/v2/service/estimate_coin_buy.go b/api/v2/service/estimate_coin_buy.go index dbf59eaa1..9b31b82d1 100644 --- a/api/v2/service/estimate_coin_buy.go +++ b/api/v2/service/estimate_coin_buy.go @@ -283,6 +283,7 @@ func (s *Service) calcBuyPoolWithCommission(ctx context.Context, commissions *co commissionPoolSwapper := cState.Swap().GetSwapper(requestCoinCommissionID, types.GetBaseCoinID()) if commissionFromPool && requestCoinCommissionID != types.GetBaseCoinID() { + commissionInBaseCoin = commissionPoolSwapper.CalculateBuyForSellWithOrders(commission) commissionPoolSwapper = commissionPoolSwapper.AddLastSwapStepWithOrders(commission, commissionInBaseCoin, false) } diff --git a/api/v2/service/estimate_coin_sell.go b/api/v2/service/estimate_coin_sell.go index 8276b472a..665c05ed0 100644 --- a/api/v2/service/estimate_coin_sell.go +++ b/api/v2/service/estimate_coin_sell.go @@ -197,6 +197,7 @@ func (s *Service) calcSellPoolWithCommission(ctx context.Context, commissions *c commissionPoolSwapper := cState.Swap().GetSwapper(requestCoinCommissionID, types.GetBaseCoinID()) if commissionFromPool && requestCoinCommissionID != types.GetBaseCoinID() { + commissionInBaseCoin = commissionPoolSwapper.CalculateBuyForSellWithOrders(commission) commissionPoolSwapper = commissionPoolSwapper.AddLastSwapStepWithOrders(commission, commissionInBaseCoin, false) } if timeoutStatus := s.checkTimeout(ctx); timeoutStatus != nil { From 15f34a02f4fb41e56acfbb6cb5b5d255b4a643cd Mon Sep 17 00:00:00 2001 From: klim0v Date: Tue, 7 Dec 2021 15:52:38 +0300 Subject: [PATCH 02/39] add tag fail_fee_reserve --- coreV2/transaction/executor_v250.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/coreV2/transaction/executor_v250.go b/coreV2/transaction/executor_v250.go index c66ac5a4e..5a9dc2623 100644 --- a/coreV2/transaction/executor_v250.go +++ b/coreV2/transaction/executor_v250.go @@ -288,8 +288,8 @@ func (e *ExecutorV250) RunTx(context state.Interface, rawTx []byte, rewardPool * } if deliverState, ok := context.(*state.State); ok { - var tagsCom *tagPoolChange if isGasCommissionFromPoolSwap { + var tagsCom *tagPoolChange var ( poolIDCom uint32 detailsCom *swap.ChangeDetailsWithOrders @@ -308,16 +308,19 @@ func (e *ExecutorV250) RunTx(context state.Interface, rawTx []byte, rewardPool * for _, value := range ownersCom { deliverState.Accounts.AddBalance(value.Owner, tx.CommissionCoin(), value.ValueBigInt) } + response.Tags = append(response.Tags, + abcTypes.EventAttribute{Key: []byte("tx.commission_details"), Value: []byte(tagsCom.string())}) } else if !tx.CommissionCoin().IsBaseCoin() { deliverState.Coins.SubVolume(tx.CommissionCoin(), commission) deliverState.Coins.SubReserve(tx.CommissionCoin(), commissionInBaseCoin) + response.Tags = append(response.Tags, + abcTypes.EventAttribute{Key: []byte("tx.fail_fee_reserve"), Value: []byte(commissionInBaseCoin.String())}) } deliverState.Accounts.SubBalance(intruder, tx.CommissionCoin(), commission) rewardPool.Add(rewardPool, commissionInBaseCoin) response.Tags = append(response.Tags, - abcTypes.EventAttribute{Key: []byte("tx.commission_details"), Value: []byte(tagsCom.string())}, abcTypes.EventAttribute{Key: []byte("tx.fail_fee"), Value: []byte(commission.String())}, abcTypes.EventAttribute{Key: []byte("tx.fail"), Value: []byte{49}, Index: true}, // "1" ) From ab79940780e623cf0a0739943d3f067572262b30 Mon Sep 17 00:00:00 2001 From: klim0v Date: Tue, 7 Dec 2021 16:12:53 +0300 Subject: [PATCH 03/39] refactor --- api/v2/service/estimate_coin_buy.go | 4 +- api/v2/service/estimate_coin_sell.go | 8 +- api/v2/service/estimate_coin_sell_all.go | 4 +- api/v2/service/estimate_tx_commission.go | 2 +- coreV2/state/swap/order.go | 12 +-- coreV2/state/swap/order_test.go | 78 +++++++++---------- coreV2/state/swap/swap.go | 4 +- coreV2/transaction/add_liquidity_v260.go | 2 +- coreV2/transaction/add_order.go | 2 +- coreV2/transaction/add_order_test.go | 6 +- coreV2/transaction/buy_swap_pool_v260.go | 32 ++++---- coreV2/transaction/executor.go | 2 +- coreV2/transaction/executor_v250.go | 6 +- coreV2/transaction/remove_limit_order.go | 2 +- coreV2/transaction/remove_liquidity_v240.go | 2 +- coreV2/transaction/sell_all_swap_pool_v230.go | 2 +- coreV2/transaction/sell_all_swap_pool_v260.go | 4 +- coreV2/transaction/sell_swap_pool_v260.go | 4 +- tests/order_test.go | 3 +- 19 files changed, 93 insertions(+), 86 deletions(-) diff --git a/api/v2/service/estimate_coin_buy.go b/api/v2/service/estimate_coin_buy.go index 9b31b82d1..221d1c1d4 100644 --- a/api/v2/service/estimate_coin_buy.go +++ b/api/v2/service/estimate_coin_buy.go @@ -190,7 +190,7 @@ func (s *Service) calcBuyFromPool(ctx context.Context, value *big.Int, cState *s coinSell = cState.Coins().GetCoin(sellCoinID) } - errResp, sellValue := transaction.CheckSwap(swapChecker, coinSell, coinBuy, coins.MaxCoinSupply(), buyValue, true) + errResp, sellValue, _ := transaction.CheckSwap(swapChecker, coinSell, coinBuy, coins.MaxCoinSupply(), buyValue, true) if errResp != nil { return nil, s.createError(status.New(codes.FailedPrecondition, errResp.Log), errResp.Info) } @@ -283,7 +283,7 @@ func (s *Service) calcBuyPoolWithCommission(ctx context.Context, commissions *co commissionPoolSwapper := cState.Swap().GetSwapper(requestCoinCommissionID, types.GetBaseCoinID()) if commissionFromPool && requestCoinCommissionID != types.GetBaseCoinID() { - commissionInBaseCoin = commissionPoolSwapper.CalculateBuyForSellWithOrders(commission) + commissionInBaseCoin, _ = commissionPoolSwapper.CalculateBuyForSellWithOrders(commission) commissionPoolSwapper = commissionPoolSwapper.AddLastSwapStepWithOrders(commission, commissionInBaseCoin, false) } diff --git a/api/v2/service/estimate_coin_sell.go b/api/v2/service/estimate_coin_sell.go index 665c05ed0..fe21a1830 100644 --- a/api/v2/service/estimate_coin_sell.go +++ b/api/v2/service/estimate_coin_sell.go @@ -197,7 +197,7 @@ func (s *Service) calcSellPoolWithCommission(ctx context.Context, commissions *c commissionPoolSwapper := cState.Swap().GetSwapper(requestCoinCommissionID, types.GetBaseCoinID()) if commissionFromPool && requestCoinCommissionID != types.GetBaseCoinID() { - commissionInBaseCoin = commissionPoolSwapper.CalculateBuyForSellWithOrders(commission) + commissionInBaseCoin, _ = commissionPoolSwapper.CalculateBuyForSellWithOrders(commission) commissionPoolSwapper = commissionPoolSwapper.AddLastSwapStepWithOrders(commission, commissionInBaseCoin, false) } if timeoutStatus := s.checkTimeout(ctx); timeoutStatus != nil { @@ -220,13 +220,13 @@ func (s *Service) commissionInCoin(cState *state.CheckState, coinCommissionID ty commission = commissionInBaseCoin isSwapFromPool = true case types.GetBaseCoinID(): - commission = cState.Swap().GetSwapper(commissionsCoin, types.GetBaseCoinID()).CalculateBuyForSellWithOrders(commissionInBaseCoin) + commission, _ = cState.Swap().GetSwapper(commissionsCoin, types.GetBaseCoinID()).CalculateBuyForSellWithOrders(commissionInBaseCoin) if commission == nil { return nil, false, s.createError(status.New(codes.FailedPrecondition, "Not possible to pay commission"), transaction.EncodeError(code.NewCommissionCoinNotSufficient("", ""))) } default: if !commissionsCoin.IsBaseCoin() { - commissionInBaseCoin = cState.Swap().GetSwapper(commissionsCoin, types.GetBaseCoinID()).CalculateBuyForSellWithOrders(commissionInBaseCoin) + commissionInBaseCoin, _ = cState.Swap().GetSwapper(commissionsCoin, types.GetBaseCoinID()).CalculateBuyForSellWithOrders(commissionInBaseCoin) if commissionInBaseCoin == nil { return nil, false, s.createError(status.New(codes.FailedPrecondition, "Not possible to pay commission"), transaction.EncodeError(code.NewCommissionCoinNotSufficient("", ""))) } @@ -276,7 +276,7 @@ func (s *Service) calcSellFromPool(ctx context.Context, value *big.Int, cState * } } - errResp, buyValue := transaction.CheckSwap(swapChecker, coinSell, coinBuy, sellValue, big.NewInt(0), false) + errResp, buyValue, _ := transaction.CheckSwap(swapChecker, coinSell, coinBuy, sellValue, big.NewInt(0), false) if errResp != nil { return nil, s.createError(status.New(codes.FailedPrecondition, errResp.Log), errResp.Info) } diff --git a/api/v2/service/estimate_coin_sell_all.go b/api/v2/service/estimate_coin_sell_all.go index 2a66f69d6..326f874ae 100644 --- a/api/v2/service/estimate_coin_sell_all.go +++ b/api/v2/service/estimate_coin_sell_all.go @@ -80,7 +80,7 @@ func (s *Service) EstimateCoinSellAll(ctx context.Context, req *pb.EstimateCoinS if req.SwapFrom == pb.SwapFrom_bancor || req.SwapFrom == pb.SwapFrom_optimal { commissionInBaseCoin := new(big.Int).Set(commissions.SellAllBancor) if !commissions.Coin.IsBaseCoin() { - commissionInBaseCoin = cState.Swap().GetSwapper(types.GetBaseCoinID(), commissions.Coin).CalculateSellForBuyWithOrders(commissionInBaseCoin) + commissionInBaseCoin, _ = cState.Swap().GetSwapper(types.GetBaseCoinID(), commissions.Coin).CalculateSellForBuyWithOrders(commissionInBaseCoin) } if req.GasPrice > 1 { commissionInBaseCoin.Mul(commissionInBaseCoin, big.NewInt(int64(req.GasPrice))) @@ -125,7 +125,7 @@ func (s *Service) EstimateCoinSellAll(ctx context.Context, req *pb.EstimateCoinS if req.SwapFrom == pb.SwapFrom_pool || req.SwapFrom == pb.SwapFrom_optimal { commissionInBaseCoin := new(big.Int).Set(commissions.SellAllPoolBase) if !commissions.Coin.IsBaseCoin() { - commissionInBaseCoin = cState.Swap().GetSwapper(types.GetBaseCoinID(), commissions.Coin).CalculateSellForBuyWithOrders(commissionInBaseCoin) + commissionInBaseCoin, _ = cState.Swap().GetSwapper(types.GetBaseCoinID(), commissions.Coin).CalculateSellForBuyWithOrders(commissionInBaseCoin) } if req.GasPrice > 1 { commissionInBaseCoin.Mul(commissionInBaseCoin, big.NewInt(int64(req.GasPrice))) diff --git a/api/v2/service/estimate_tx_commission.go b/api/v2/service/estimate_tx_commission.go index e7d4e471d..808d9c2ae 100644 --- a/api/v2/service/estimate_tx_commission.go +++ b/api/v2/service/estimate_tx_commission.go @@ -38,7 +38,7 @@ func (s *Service) EstimateTxCommission(ctx context.Context, req *pb.EstimateTxCo commissions := cState.Commission().GetCommissions() price := decodedTx.Price(commissions) if !commissions.Coin.IsBaseCoin() { - price = cState.Swap().GetSwapper(commissions.Coin, types.GetBaseCoinID()).CalculateBuyForSellWithOrders(price) + price, _ = cState.Swap().GetSwapper(commissions.Coin, types.GetBaseCoinID()).CalculateBuyForSellWithOrders(price) } if price == nil { return nil, s.createError(status.New(codes.FailedPrecondition, "Not possible to pay commission"), transaction.EncodeError(code.NewCommissionCoinNotSufficient("", ""))) diff --git a/coreV2/state/swap/order.go b/coreV2/state/swap/order.go index 9cff215bf..a19a0328e 100644 --- a/coreV2/state/swap/order.go +++ b/coreV2/state/swap/order.go @@ -301,12 +301,12 @@ func (l *Limit) CmpOldRate() int { return l.sortPrice().Cmp(l.OldSortPrice()) } -func (p *Pair) CalculateBuyForSellWithOrders(amount0In *big.Int) (amount1Out *big.Int) { +func (p *Pair) CalculateBuyForSellWithOrders(amount0In *big.Int) (amount1Out *big.Int, orders []*Limit) { p.lockOrders.Lock() defer p.lockOrders.Unlock() - amount1Out, _ = p.calculateBuyForSellWithOrders(amount0In) - return amount1Out + amount1Out, orders = p.calculateBuyForSellWithOrders(amount0In) + return amount1Out, orders } func (p *Pair) calculateBuyForSellWithOrders(amount0In *big.Int) (amountOut *big.Int, orders []*Limit) { @@ -498,12 +498,12 @@ func (p *Pair) calculateAddAmountsForPrice(price *big.Float) (amount0 *big.Int, return amount0, amount1Out } -func (p *Pair) CalculateSellForBuyWithOrders(amount1Out *big.Int) (amount0In *big.Int) { +func (p *Pair) CalculateSellForBuyWithOrders(amount1Out *big.Int) (amount0In *big.Int, orders []*Limit) { p.lockOrders.Lock() defer p.lockOrders.Unlock() - amount0In, _ = p.calculateSellForBuyWithOrders(amount1Out) - return amount0In + amount0In, orders = p.calculateSellForBuyWithOrders(amount1Out) + return amount0In, orders } func (p *Pair) calculateSellForBuyWithOrders(amount1Out *big.Int) (amountIn *big.Int, orders []*Limit) { diff --git a/coreV2/state/swap/order_test.go b/coreV2/state/swap/order_test.go index f7b26980c..5ac2640f3 100644 --- a/coreV2/state/swap/order_test.go +++ b/coreV2/state/swap/order_test.go @@ -2875,9 +2875,9 @@ func TestPair_AddLastSwapStepWithOrders(t *testing.T) { _, _, _, _ = pair.SellWithOrders(addAmount0ForPrice) sell := big.NewInt(15e15) - calcBuy1 := pair.CalculateBuyForSellWithOrders(sell) + calcBuy1, _ := pair.CalculateBuyForSellWithOrders(sell) pair1 := pair.AddLastSwapStepWithOrders(sell, calcBuy1, false) - calcBuy2 := pair1.CalculateBuyForSellWithOrders(sell) + calcBuy2, _ := pair1.CalculateBuyForSellWithOrders(sell) pair1.AddLastSwapStepWithOrders(sell, calcBuy2, false) if len(pair.dirtyOrders.list) != 0 { @@ -3288,7 +3288,7 @@ func TestPair_SellWithOrders_01_FullOrder(t *testing.T) { t.Run("order", func(t *testing.T) { swap := New(newBus, immutableTree.GetLastImmutable()) pair := swap.Pair(0, 1) - amount1Out := pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 2002)) + amount1Out, _ := pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 2002)) _, orders := pair.calculateBuyForSellWithOrders(big.NewInt(4146 + 2002)) if len(orders) == 0 { t.Error("empty orders") @@ -3444,8 +3444,8 @@ func TestSwap_Export_WithOrders(t *testing.T) { t.Run("cmp", func(t *testing.T) { amount1Out01Mem := pair01.CalculateBuyForSell(big.NewInt(1e10)) amount1Out10Mem := pair10.CalculateBuyForSell(big.NewInt(1e10)) - amount1Out01OBMem := pair01.CalculateBuyForSellWithOrders(big.NewInt(1e10)) - amount1Out10OBMem := pair10.CalculateBuyForSellWithOrders(big.NewInt(1e10)) + amount1Out01OBMem, _ := pair01.CalculateBuyForSellWithOrders(big.NewInt(1e10)) + amount1Out10OBMem, _ := pair10.CalculateBuyForSellWithOrders(big.NewInt(1e10)) t.Run("mem", func(t *testing.T) { if amount1Out01Mem.Cmp(amount1Out10Mem) != 0 { t.Error(amount1Out01Mem, amount1Out10Mem) @@ -3467,8 +3467,8 @@ func TestSwap_Export_WithOrders(t *testing.T) { pair10Disk := swap.Pair(1, 0) amount1Out01Disk := pair01Disk.CalculateBuyForSell(big.NewInt(1e10)) amount1Out10Disk := pair10Disk.CalculateBuyForSell(big.NewInt(1e10)) - amount1Out01OBDisk := pair01Disk.CalculateBuyForSellWithOrders(big.NewInt(1e10)) - amount1Out10OBDisk := pair10Disk.CalculateBuyForSellWithOrders(big.NewInt(1e10)) + amount1Out01OBDisk, _ := pair01Disk.CalculateBuyForSellWithOrders(big.NewInt(1e10)) + amount1Out10OBDisk, _ := pair10Disk.CalculateBuyForSellWithOrders(big.NewInt(1e10)) t.Run("disk", func(t *testing.T) { if amount1Out01Disk.Cmp(amount1Out10Disk) != 0 { t.Error(amount1Out01Disk, amount1Out10Disk) @@ -3805,14 +3805,14 @@ func TestPair_CalculateBuyForSellWithOrders_01(t *testing.T) { t.Run("without orders", func(t *testing.T) { t.Run("sell", func(t *testing.T) { amount1Out := pair.CalculateBuyForSell(big.NewInt(5000)) - amount1OutWithOB := pair.CalculateBuyForSellWithOrders(big.NewInt(5000)) + amount1OutWithOB, _ := pair.CalculateBuyForSellWithOrders(big.NewInt(5000)) if amount1Out.Cmp(amount1OutWithOB) != 0 { t.Error("not equal", amount1Out, amount1OutWithOB) } }) t.Run("buy", func(t *testing.T) { amount0In := pair.CalculateSellForBuyAllowNeg(big.NewInt(5000)) - amount0InWithOB := pair.CalculateSellForBuyWithOrders(big.NewInt(5000)) + amount0InWithOB, _ := pair.CalculateSellForBuyWithOrders(big.NewInt(5000)) if amount0In.Cmp(amount0InWithOB) != 0 { t.Error("not equal", amount0In, amount0InWithOB) } @@ -3828,7 +3828,7 @@ func TestPair_CalculateBuyForSellWithOrders_01(t *testing.T) { t.Run("sell", func(t *testing.T) { t.Run("before first order", func(t *testing.T) { amount1Out := pair.CalculateBuyForSell(big.NewInt(4146)) - amount1OutWithOB := pair.CalculateBuyForSellWithOrders(big.NewInt(4146)) + amount1OutWithOB, _ := pair.CalculateBuyForSellWithOrders(big.NewInt(4146)) if amount1Out.Cmp(amount1OutWithOB) != 0 { t.Error("not equal sell before first order", amount1Out, amount1OutWithOB) } @@ -3836,7 +3836,7 @@ func TestPair_CalculateBuyForSellWithOrders_01(t *testing.T) { t.Run("first order", func(t *testing.T) { amount1Out := pair.CalculateBuyForSell(big.NewInt(4146)) - amount1OutWithOB := pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 2000)) + amount1OutWithOB, _ := pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 2000)) if big.NewInt(0).Sub(amount1OutWithOB, amount1Out).String() != "998" { t.Error("want to spend 2,000 more and get 1,000-0.2% more by order", amount1Out, amount1OutWithOB) } @@ -3847,13 +3847,13 @@ func TestPair_CalculateBuyForSellWithOrders_01(t *testing.T) { t.Error("Recovered", r) } }() - _ = pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 2000 + 1)) + _, _ = pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 2000 + 1)) }) t.Run("more order", func(t *testing.T) { amount1 := pair.CalculateBuyForSell(big.NewInt(4146)) p := pair.AddLastSwapStep(big.NewInt(4146), amount1) amount1Out := big.NewInt(0).Add(amount1, p.CalculateBuyForSell(big.NewInt(1000))) - amount1OutWithOB := pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 2002 + 1000)) + amount1OutWithOB, _ := pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 2002 + 1000)) if big.NewInt(0).Sub(amount1OutWithOB, amount1Out).String() != "999" { t.Error("want to spend 2,002-0.1% more and get 1,000-0.1% more by order", amount1Out, amount1OutWithOB) } @@ -3862,7 +3862,7 @@ func TestPair_CalculateBuyForSellWithOrders_01(t *testing.T) { t.Run("buy", func(t *testing.T) { t.Run("before first order", func(t *testing.T) { amount0In := pair.CalculateSellForBuy(big.NewInt(2926)) - amount0InWithOB := pair.CalculateSellForBuyWithOrders(big.NewInt(2926)) + amount0InWithOB, _ := pair.CalculateSellForBuyWithOrders(big.NewInt(2926)) if amount0In.Cmp(amount0InWithOB) != 0 { t.Error("not equal", amount0In, amount0InWithOB) } @@ -3870,7 +3870,7 @@ func TestPair_CalculateBuyForSellWithOrders_01(t *testing.T) { t.Run("first order", func(t *testing.T) { amount0In := pair.CalculateSellForBuy(big.NewInt(2926)) amount0In.Add(amount0In, big.NewInt(1)) - amount0InWithOB := pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 999)) + amount0InWithOB, _ := pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 999)) if big.NewInt(0).Sub(amount0InWithOB, amount0In).String() != "2002" { // todo: t.Error("want to get 1,000-0.2% more and spend 2,000 more by order", amount0In, amount0InWithOB) } @@ -3881,14 +3881,14 @@ func TestPair_CalculateBuyForSellWithOrders_01(t *testing.T) { t.Error("Recovered", r) } }() - _ = pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 999 + 1)) + _, _ = pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 999 + 1)) }) t.Run("more order", func(t *testing.T) { amount0 := pair.CalculateSellForBuyAllowNeg(big.NewInt(2926)) amount0.Add(amount0, big.NewInt(1)) // ok, погрешность CalculateAddAmountsForPrice p := pair.AddLastSwapStep(amount0, big.NewInt(2926)).AddLastSwapStep(big.NewInt(2), big.NewInt(-1)) amount0In := big.NewInt(0).Add(amount0, p.CalculateSellForBuy(big.NewInt(466))) - amount0InWithOB := pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 999 + 466)) + amount0InWithOB, _ := pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 999 + 466)) if big.NewInt(0).Sub(amount0InWithOB, amount0In).String() != "2002" { t.Error("want to get 1,000-0.1% more and spend 2,000 more by order", amount0In, amount0InWithOB) } @@ -3903,7 +3903,7 @@ func TestPair_CalculateBuyForSellWithOrders_01(t *testing.T) { t.Run("sell", func(t *testing.T) { t.Run("before second order", func(t *testing.T) { amount1Out := pair.CalculateBuyForSell(big.NewInt(4146)) - amount1OutWithOB := pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 2000)) + amount1OutWithOB, _ := pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 2000)) if big.NewInt(0).Sub(amount1OutWithOB, amount1Out).String() != "998" { t.Error("want to spend 2,000 more and get 1,000-0.2% more by order", amount1Out, amount1OutWithOB) } @@ -3911,7 +3911,7 @@ func TestPair_CalculateBuyForSellWithOrders_01(t *testing.T) { t.Run("all orders", func(t *testing.T) { amount1Out := pair.CalculateBuyForSell(big.NewInt(4146)) //amount1Out.Add(amount1Out, big.NewInt(1)) - amount1OutWithOB := pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 4004)) + amount1OutWithOB, _ := pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 4004)) if big.NewInt(0).Sub(amount1OutWithOB, amount1Out).String() != "1998" { // todo: t.Error("want to spend 4,000 more and get 2,000-0.2% more by order", amount1Out, amount1OutWithOB) } @@ -3922,7 +3922,7 @@ func TestPair_CalculateBuyForSellWithOrders_01(t *testing.T) { amount1 := pair.CalculateBuyForSell(big.NewInt(4146)) p := pair.AddLastSwapStep(big.NewInt(4146), amount1).AddLastSwapStep(big.NewInt(4), big.NewInt(-2)) amount1Out := big.NewInt(0).Add(amount1, p.CalculateBuyForSell(big.NewInt(i))) - amount1OutWithOB := pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 4004 + i)) + amount1OutWithOB, _ := pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 4004 + i)) if amount1OutWithOB.Cmp(amount1Out.Add(amount1Out, big.NewInt(1998))) != 0 { t.Error("want to spend 4,000 more and get 2,000-0.1% more by order", amount1Out, amount1OutWithOB) } @@ -3934,7 +3934,7 @@ func TestPair_CalculateBuyForSellWithOrders_01(t *testing.T) { t.Run("before second order", func(t *testing.T) { amount0In := pair.CalculateSellForBuy(big.NewInt(2926)) amount0In.Add(amount0In, big.NewInt(1)) - amount0InWithOB := pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 999)) + amount0InWithOB, _ := pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 999)) if big.NewInt(0).Sub(amount0InWithOB, amount0In).String() != "2002" { t.Error("want to get 1,000-0.1% more and spend 2,000 more by order", amount0In, amount0InWithOB) } @@ -3942,7 +3942,7 @@ func TestPair_CalculateBuyForSellWithOrders_01(t *testing.T) { t.Run("all orders", func(t *testing.T) { amount0In := pair.CalculateSellForBuy(big.NewInt(2926)) amount0In.Add(amount0In, big.NewInt(1)) - amount0InWithOB := pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 1998)) + amount0InWithOB, _ := pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 1998)) if big.NewInt(0).Sub(amount0InWithOB, amount0In).String() != "4004" { t.Error("want to get 2,000-0.1% more and spend 4,000 more by order", amount0In, amount0InWithOB) } @@ -3952,7 +3952,7 @@ func TestPair_CalculateBuyForSellWithOrders_01(t *testing.T) { amount0.Add(amount0, big.NewInt(1)) p := pair.AddLastSwapStep(amount0, big.NewInt(2926)) amount0In := big.NewInt(0).Add(amount0, p.CalculateSellForBuy(big.NewInt(466))) - amount0InWithOB := pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 1998 + 466)) + amount0InWithOB, _ := pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 1998 + 466)) if big.NewInt(0).Sub(amount0InWithOB, amount0In).String() != "4004" { t.Error("want to get 2,000-0.1% more and spend 4,000 more by order", amount0In, amount0InWithOB) } @@ -3990,14 +3990,14 @@ func TestPair_CalculateBuyForSellWithOrders_10(t *testing.T) { t.Run("without orders", func(t *testing.T) { t.Run("sell", func(t *testing.T) { amount1Out := pair.CalculateBuyForSell(big.NewInt(5000)) - amount1OutWithOB := pair.CalculateBuyForSellWithOrders(big.NewInt(5000)) + amount1OutWithOB, _ := pair.CalculateBuyForSellWithOrders(big.NewInt(5000)) if amount1Out.Cmp(amount1OutWithOB) != 0 { t.Error("not equal", amount1Out, amount1OutWithOB) } }) t.Run("buy", func(t *testing.T) { amount0In := pair.CalculateSellForBuyAllowNeg(big.NewInt(5000)) - amount0InWithOB := pair.CalculateSellForBuyWithOrders(big.NewInt(5000)) + amount0InWithOB, _ := pair.CalculateSellForBuyWithOrders(big.NewInt(5000)) if amount0In.Cmp(amount0InWithOB) != 0 { t.Error("not equal", amount0In, amount0InWithOB) } @@ -4014,7 +4014,7 @@ func TestPair_CalculateBuyForSellWithOrders_10(t *testing.T) { t.Run("sell", func(t *testing.T) { t.Run("before first order", func(t *testing.T) { amount1Out := pair.CalculateBuyForSell(big.NewInt(4146)) - amount1OutWithOB := pair.CalculateBuyForSellWithOrders(big.NewInt(4146)) + amount1OutWithOB, _ := pair.CalculateBuyForSellWithOrders(big.NewInt(4146)) if amount1Out.Cmp(amount1OutWithOB) != 0 { t.Error("not equal sell before first order", amount1Out, amount1OutWithOB) } @@ -4022,7 +4022,7 @@ func TestPair_CalculateBuyForSellWithOrders_10(t *testing.T) { t.Run("first order", func(t *testing.T) { amount1Out := pair.CalculateBuyForSell(big.NewInt(4146)) - amount1OutWithOB := pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 2002)) + amount1OutWithOB, _ := pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 2002)) if big.NewInt(0).Sub(amount1OutWithOB, amount1Out).String() != "999" { t.Error("want to spend 2,000 more and get 1,000-0.1% more by order", amount1Out, amount1OutWithOB) } @@ -4033,13 +4033,13 @@ func TestPair_CalculateBuyForSellWithOrders_10(t *testing.T) { t.Error("Recovered", r) } }() - _ = pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 2000 + 1)) + _, _ = pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 2000 + 1)) }) t.Run("more order", func(t *testing.T) { amount1Out0 := pair.CalculateBuyForSell(big.NewInt(4146)) amount1Out1 := pair.AddLastSwapStep(big.NewInt(4146), amount1Out0).CalculateBuyForSell(big.NewInt(1000)) amount1Out := big.NewInt(0).Add(amount1Out0, amount1Out1) - amount1OutWithOB := pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 2002 + 1000)) + amount1OutWithOB, _ := pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 2002 + 1000)) if big.NewInt(0).Sub(amount1OutWithOB, amount1Out).String() != "999" { t.Error("want to spend 2,000 more and get 1,000-0.1% more by order", amount1Out, amount1OutWithOB) } @@ -4048,7 +4048,7 @@ func TestPair_CalculateBuyForSellWithOrders_10(t *testing.T) { t.Run("buy", func(t *testing.T) { t.Run("before first order", func(t *testing.T) { amount0In := pair.CalculateSellForBuyAllowNeg(big.NewInt(2926)) - amount0InWithOB := pair.CalculateSellForBuyWithOrders(big.NewInt(2926)) + amount0InWithOB, _ := pair.CalculateSellForBuyWithOrders(big.NewInt(2926)) if amount0In.Cmp(amount0InWithOB) != 0 { t.Error("not equal", amount0In, amount0InWithOB) } @@ -4056,7 +4056,7 @@ func TestPair_CalculateBuyForSellWithOrders_10(t *testing.T) { t.Run("first order", func(t *testing.T) { amount0In := pair.CalculateSellForBuy(big.NewInt(2926)) amount0In.Add(amount0In, big.NewInt(1)) - amount0InWithOB := pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 999)) + amount0InWithOB, _ := pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 999)) if big.NewInt(0).Sub(amount0InWithOB, amount0In).String() != "2002" { t.Error("want to get 1,000-0.1% more and spend 2,000 more by order", amount0In, amount0InWithOB) } @@ -4067,14 +4067,14 @@ func TestPair_CalculateBuyForSellWithOrders_10(t *testing.T) { t.Error("Recovered", r) } }() - _ = pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 999 + 1)) + _, _ = pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 999 + 1)) }) t.Run("more order", func(t *testing.T) { amount0 := pair.CalculateSellForBuyAllowNeg(big.NewInt(2926)) amount0.Add(amount0, big.NewInt(1)) p := pair.AddLastSwapStep(amount0, big.NewInt(2926)).AddLastSwapStep(big.NewInt(2), big.NewInt(-1)) amount0In := big.NewInt(0).Add(amount0, p.CalculateSellForBuy(big.NewInt(466))) - amount0InWithOB := pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 999 + 466)) + amount0InWithOB, _ := pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 999 + 466)) if big.NewInt(0).Sub(amount0InWithOB, amount0In).String() != "2002" { t.Error("want to get 1,000-0.1% more and spend 2,000 more by order", amount0In, amount0InWithOB) } @@ -4089,14 +4089,14 @@ func TestPair_CalculateBuyForSellWithOrders_10(t *testing.T) { t.Run("sell", func(t *testing.T) { t.Run("before second order", func(t *testing.T) { amount1Out := pair.CalculateBuyForSell(big.NewInt(4146)) - amount1OutWithOB := pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 2002)) + amount1OutWithOB, _ := pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 2002)) if big.NewInt(0).Sub(amount1OutWithOB, amount1Out).String() != "999" { t.Error("want to spend 2,000 more and get 1,000-0.1% more by order", amount1Out, amount1OutWithOB) } }) t.Run("all orders", func(t *testing.T) { amount1Out := pair.CalculateBuyForSell(big.NewInt(4146)) - amount1OutWithOB := pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 4004)) + amount1OutWithOB, _ := pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 4004)) if big.NewInt(0).Sub(amount1OutWithOB, amount1Out).String() != "1998" { t.Error("want to spend 4,000 more and get 2,000-0.1% more by order", amount1Out, amount1OutWithOB) } @@ -4108,7 +4108,7 @@ func TestPair_CalculateBuyForSellWithOrders_10(t *testing.T) { p := pair.AddLastSwapStep(big.NewInt(4146), amount1).AddLastSwapStep(big.NewInt(4), big.NewInt(-2)) amount11 := p.CalculateBuyForSell(big.NewInt(i)) amount1Out := big.NewInt(0).Add(amount1, amount11) - amount1OutWithOB := pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 4004 + i)) + amount1OutWithOB, _ := pair.CalculateBuyForSellWithOrders(big.NewInt(4146 + 4004 + i)) if amount1OutWithOB.Cmp(big.NewInt(0).Add(amount1Out, big.NewInt(1998))) != 0 { t.Error("want to spend 4,000 more and get 2,000-0.1% more by order", amount1Out, amount1OutWithOB) } @@ -4120,7 +4120,7 @@ func TestPair_CalculateBuyForSellWithOrders_10(t *testing.T) { t.Run("before second order", func(t *testing.T) { amount0In := pair.CalculateSellForBuyAllowNeg(big.NewInt(2926)) amount0In.Add(amount0In, big.NewInt(1)) - amount0InWithOB := pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 999)) + amount0InWithOB, _ := pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 999)) if big.NewInt(0).Sub(amount0InWithOB, amount0In).String() != "2002" { t.Error("want to get 1,000-0.1% more and spend 2,000 more by order", amount0In, amount0InWithOB) } @@ -4128,7 +4128,7 @@ func TestPair_CalculateBuyForSellWithOrders_10(t *testing.T) { t.Run("all orders", func(t *testing.T) { amount0In := pair.CalculateSellForBuyAllowNeg(big.NewInt(2926)) amount0In.Add(amount0In, big.NewInt(1)) - amount0InWithOB := pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 1998)) + amount0InWithOB, _ := pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 1998)) if big.NewInt(0).Sub(amount0InWithOB, amount0In).String() != "4004" { t.Error("want to get 2,000-0.1% more and spend 4,000 more by order", amount0In, amount0InWithOB) } @@ -4138,7 +4138,7 @@ func TestPair_CalculateBuyForSellWithOrders_10(t *testing.T) { amount0.Add(amount0, big.NewInt(1)) p := pair.AddLastSwapStep(amount0, big.NewInt(2926)) amount0In := big.NewInt(0).Add(amount0, p.CalculateSellForBuy(big.NewInt(466))) - amount0InWithOB := pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 1998 + 466)) + amount0InWithOB, _ := pair.CalculateSellForBuyWithOrders(big.NewInt(2926 + 1998 + 466)) if big.NewInt(0).Sub(amount0InWithOB, amount0In).String() != "4004" { t.Error("want to get 2,000-0.1% more and spend 4,000 more by order", amount0In, amount0InWithOB) } diff --git a/coreV2/state/swap/swap.go b/coreV2/state/swap/swap.go index 4b256c29a..0112a534b 100644 --- a/coreV2/state/swap/swap.go +++ b/coreV2/state/swap/swap.go @@ -48,10 +48,10 @@ type EditableChecker interface { CalculateAddAmountsForPrice(float *big.Float) (amount0, amount1 *big.Int) // Deprecated CalculateBuyForSell(amount0In *big.Int) (amount1Out *big.Int) - CalculateBuyForSellWithOrders(amount0In *big.Int) (amount1Out *big.Int) + CalculateBuyForSellWithOrders(amount0In *big.Int) (amount1Out *big.Int, orders []*Limit) // Deprecated CalculateSellForBuy(amount1Out *big.Int) (amount0In *big.Int) - CalculateSellForBuyWithOrders(amount1Out *big.Int) (amount0In *big.Int) + CalculateSellForBuyWithOrders(amount1Out *big.Int) (amount0In *big.Int, orders []*Limit) CalculateAddLiquidity(amount0 *big.Int, supply *big.Int) (liquidity *big.Int, amount1 *big.Int) CheckSwap(amount0In, amount1Out *big.Int) error CheckMint(amount0, maxAmount1, totalSupply *big.Int) (err error) diff --git a/coreV2/transaction/add_liquidity_v260.go b/coreV2/transaction/add_liquidity_v260.go index 6d09a1a9d..eda4481a0 100644 --- a/coreV2/transaction/add_liquidity_v260.go +++ b/coreV2/transaction/add_liquidity_v260.go @@ -118,7 +118,7 @@ func (data AddLiquidityDataV260) Run(tx *Transaction, context state.Interface, r swapper := checkState.Swap().GetSwapper(data.Coin0, data.Coin1) if isGasCommissionFromPoolSwap && swapper.GetID() == commissionPoolSwapper.GetID() { - commissionInBaseCoin = commissionPoolSwapper.CalculateBuyForSellWithOrders(commission) + commissionInBaseCoin, _ = commissionPoolSwapper.CalculateBuyForSellWithOrders(commission) if tx.GasCoin == data.Coin0 && data.Coin1.IsBaseCoin() { swapper = swapper.AddLastSwapStepWithOrders(commission, commissionInBaseCoin, true) } diff --git a/coreV2/transaction/add_order.go b/coreV2/transaction/add_order.go index 414904dd6..e0d5610bd 100644 --- a/coreV2/transaction/add_order.go +++ b/coreV2/transaction/add_order.go @@ -124,7 +124,7 @@ func (data AddLimitOrderData) Run(tx *Transaction, context state.Interface, rewa swapper := checkState.Swap().GetSwapper(data.CoinToSell, data.CoinToBuy) if isGasCommissionFromPoolSwap && swapper.GetID() == commissionPoolSwapper.GetID() { - commissionInBaseCoin = commissionPoolSwapper.CalculateBuyForSellWithOrders(commission) + commissionInBaseCoin, _ = commissionPoolSwapper.CalculateBuyForSellWithOrders(commission) if tx.GasCoin == data.CoinToSell && data.CoinToBuy.IsBaseCoin() { swapper = swapper.AddLastSwapStepWithOrders(commission, commissionInBaseCoin, true) } diff --git a/coreV2/transaction/add_order_test.go b/coreV2/transaction/add_order_test.go index 0bcfd64ca..097d9c0c0 100644 --- a/coreV2/transaction/add_order_test.go +++ b/coreV2/transaction/add_order_test.go @@ -1545,10 +1545,11 @@ func TestAddOrderSwapPoolData_Buy_01_moreOrder(t *testing.T) { } { i := int64(23) + v, _ := cState.Swap.Pair(coin0, coin1).CalculateBuyForSellWithOrders(helpers.BipToPip(big.NewInt(i))) data := BuySwapPoolDataV260{ Coins: []types.CoinID{coin0, coin1}, MaximumValueToSell: helpers.BipToPip(big.NewInt(i)), - ValueToBuy: cState.Swap.Pair(coin0, coin1).CalculateBuyForSellWithOrders(helpers.BipToPip(big.NewInt(i))), + ValueToBuy: v, } encodedData, err := rlp.EncodeToBytes(data) @@ -1705,10 +1706,11 @@ func TestAddOrderSwapPoolData_Buy_01_partOrder(t *testing.T) { } { i := int64(22) + v, _ := cState.Swap.Pair(coin0, coin1).CalculateBuyForSellWithOrders(helpers.BipToPip(big.NewInt(i))) data := BuySwapPoolDataV260{ Coins: []types.CoinID{coin0, coin1}, MaximumValueToSell: helpers.StringToBigIntOrNil("22000000000000000912"), - ValueToBuy: cState.Swap.Pair(coin0, coin1).CalculateBuyForSellWithOrders(helpers.BipToPip(big.NewInt(i))), + ValueToBuy: v, } encodedData, err := rlp.EncodeToBytes(data) diff --git a/coreV2/transaction/buy_swap_pool_v260.go b/coreV2/transaction/buy_swap_pool_v260.go index 46313e959..e3dabb3ce 100644 --- a/coreV2/transaction/buy_swap_pool_v260.go +++ b/coreV2/transaction/buy_swap_pool_v260.go @@ -129,7 +129,7 @@ func (data BuySwapPoolDataV260) Run(tx *Transaction, context state.Interface, re checkDuplicatePools[swapper.GetID()] = struct{}{} if isGasCommissionFromPoolSwap && swapper.GetID() == commissionPoolSwapper.GetID() { - commissionInBaseCoin = commissionPoolSwapper.CalculateBuyForSellWithOrders(commission) + commissionInBaseCoin, _ = commissionPoolSwapper.CalculateBuyForSellWithOrders(commission) if tx.GasCoin == coinToSell && coinToBuy.IsBaseCoin() { swapper = swapper.AddLastSwapStepWithOrders(commission, commissionInBaseCoin, true) } @@ -144,7 +144,7 @@ func (data BuySwapPoolDataV260) Run(tx *Transaction, context state.Interface, re coinToSellModel := checkState.Coins().GetCoin(coinToSell) var valueToSellCalc *big.Int - errResp, valueToSellCalc = CheckSwap(swapper, coinToSellModel, coinToBuyModel, valueToSell, valueToBuy, true) + errResp, valueToSellCalc, _ = CheckSwap(swapper, coinToSellModel, coinToBuyModel, valueToSell, valueToBuy, true) if errResp != nil { return *errResp } @@ -272,9 +272,9 @@ func (data BuySwapPoolDataV260) Run(tx *Transaction, context state.Interface, re } } -func CheckSwap(rSwap swap.EditableChecker, coinIn CalculateCoin, coinOut CalculateCoin, valueIn *big.Int, valueOut *big.Int, isBuy bool) (resp *Response, res *big.Int) { +func CheckSwap(rSwap swap.EditableChecker, coinIn CalculateCoin, coinOut CalculateCoin, valueIn *big.Int, valueOut *big.Int, isBuy bool) (resp *Response, res *big.Int, orders []*swap.Limit) { if isBuy { - calculatedAmountToSell := rSwap.CalculateSellForBuyWithOrders(valueOut) + calculatedAmountToSell, ordrs := rSwap.CalculateSellForBuyWithOrders(valueOut) if calculatedAmountToSell == nil { reserve0, reserve1 := rSwap.Reserves() symbolIn := coinIn.GetFullSymbol() @@ -283,7 +283,7 @@ func CheckSwap(rSwap swap.EditableChecker, coinIn CalculateCoin, coinOut Calcula Code: code.InsufficientLiquidity, Log: fmt.Sprintf("You wanted to buy %s %s, but swap pool has reserve %s %s", valueOut, symbolOut, reserve0.String(), symbolIn), Info: EncodeError(code.NewInsufficientLiquidity(coinIn.ID().String(), valueIn.String(), coinOut.ID().String(), valueOut.String(), reserve0.String(), reserve1.String())), - }, nil + }, nil, orders } if calculatedAmountToSell.Cmp(valueIn) == 1 { return &Response{ @@ -292,12 +292,13 @@ func CheckSwap(rSwap swap.EditableChecker, coinIn CalculateCoin, coinOut Calcula "You wanted to sell maximum %s %s, but currently you need to spend %s %s to complete tx", valueIn.String(), coinIn.GetFullSymbol(), calculatedAmountToSell.String(), coinIn.GetFullSymbol()), Info: EncodeError(code.NewMaximumValueToSellReached(valueIn.String(), calculatedAmountToSell.String(), coinIn.GetFullSymbol(), coinIn.ID().String())), - }, nil + }, nil, orders } valueIn = calculatedAmountToSell res = valueIn + orders = ordrs } else { - calculatedAmountToBuy := rSwap.CalculateBuyForSellWithOrders(valueIn) + calculatedAmountToBuy, ordrs := rSwap.CalculateBuyForSellWithOrders(valueIn) if calculatedAmountToBuy == nil { reserve0, reserve1 := rSwap.Reserves() symbolIn := coinIn.GetFullSymbol() @@ -306,7 +307,7 @@ func CheckSwap(rSwap swap.EditableChecker, coinIn CalculateCoin, coinOut Calcula Code: code.InsufficientLiquidity, Log: fmt.Sprintf("You wanted to sell %s %s and get more than the swap pool has a reserve in %s", valueIn, symbolIn, symbolOut), Info: EncodeError(code.NewInsufficientLiquidity(coinIn.ID().String(), valueIn.String(), coinOut.ID().String(), valueOut.String(), reserve0.String(), reserve1.String())), - }, nil + }, nil, orders } if valueOut.Sign() == 0 { valueOut = big.NewInt(1) @@ -319,15 +320,18 @@ func CheckSwap(rSwap swap.EditableChecker, coinIn CalculateCoin, coinOut Calcula "You wanted to buy minimum %s %s, but currently you buy only %s %s", valueOut.String(), symbolOut, calculatedAmountToBuy.String(), symbolOut), Info: EncodeError(code.NewMinimumValueToBuyReached(valueOut.String(), calculatedAmountToBuy.String(), coinIn.GetFullSymbol(), coinIn.ID().String())), - }, nil + }, nil, orders } valueOut = calculatedAmountToBuy res = valueOut + orders = ordrs } - rSwap1 := rSwap.AddLastSwapStepWithOrders(valueIn, valueOut, isBuy) - reserve0, reserve1 := rSwap1.Reserves() - if reserve0.Sign() == -1 || reserve1.Sign() == -1 { + _, commission1orders, _, amount1, _ := swap.CalcDiffPool(valueIn, valueOut, orders) + + _, reserve1 := rSwap.Reserves() + + if reserve1.Cmp(big.NewInt(0).Sub(amount1, commission1orders)) != 1 { reserve0, reserve1 := rSwap.Reserves() symbolIn := coinIn.GetFullSymbol() symbolOut := coinOut.GetFullSymbol() @@ -336,7 +340,7 @@ func CheckSwap(rSwap swap.EditableChecker, coinIn CalculateCoin, coinOut Calcula Log: fmt.Sprintf("You wanted to exchange %s %s for %s %s, but the pool reserves are %s %s and %s %s", valueIn, symbolIn, valueOut, symbolOut, reserve0.String(), symbolIn, reserve1.String(), symbolOut), Info: EncodeError(code.NewInsufficientLiquidity(coinIn.ID().String(), valueIn.String(), coinOut.ID().String(), valueOut.String(), reserve0.String(), reserve1.String())), } - return r, nil + return r, nil, orders } - return nil, res + return nil, res, orders } diff --git a/coreV2/transaction/executor.go b/coreV2/transaction/executor.go index 87d2989fa..09fe1457f 100644 --- a/coreV2/transaction/executor.go +++ b/coreV2/transaction/executor.go @@ -195,7 +195,7 @@ func (e *Executor) RunTx(context state.Interface, rawTx []byte, rewardPool *big. priceCommission := abcTypes.EventAttribute{Key: []byte("tx.commission_price"), Value: []byte(price.String())} if !commissions.Coin.IsBaseCoin() { - price = checkState.Swap().GetSwapper(commissions.Coin, types.GetBaseCoinID()).CalculateBuyForSellWithOrders(price) + price, _ = checkState.Swap().GetSwapper(commissions.Coin, types.GetBaseCoinID()).CalculateBuyForSellWithOrders(price) } if price == nil || price.Sign() != 1 { return Response{ diff --git a/coreV2/transaction/executor_v250.go b/coreV2/transaction/executor_v250.go index 5a9dc2623..3d0b2d14c 100644 --- a/coreV2/transaction/executor_v250.go +++ b/coreV2/transaction/executor_v250.go @@ -184,7 +184,7 @@ func (e *ExecutorV250) RunTx(context state.Interface, rawTx []byte, rewardPool * if !commissions.Coin.IsBaseCoin() { var resp *Response - resp, price = CheckSwap(checkState.Swap().GetSwapper(commissions.Coin, types.GetBaseCoinID()), checkState.Coins().GetCoin(commissions.Coin), checkState.Coins().GetCoin(0), price, big.NewInt(0), false) + resp, price, _ = CheckSwap(checkState.Swap().GetSwapper(commissions.Coin, types.GetBaseCoinID()), checkState.Coins().GetCoin(commissions.Coin), checkState.Coins().GetCoin(0), price, big.NewInt(0), false) if resp != nil { return *resp } @@ -215,7 +215,7 @@ func (e *ExecutorV250) RunTx(context state.Interface, rawTx []byte, rewardPool * if !commissions.Coin.IsBaseCoin() { var resp *Response - resp, commissionInBaseCoin = CheckSwap(checkState.Swap().GetSwapper(commissions.Coin, types.GetBaseCoinID()), checkState.Coins().GetCoin(commissions.Coin), checkState.Coins().GetCoin(0), commissionInBaseCoin, big.NewInt(0), false) + resp, commissionInBaseCoin, _ = CheckSwap(checkState.Swap().GetSwapper(commissions.Coin, types.GetBaseCoinID()), checkState.Coins().GetCoin(commissions.Coin), checkState.Coins().GetCoin(0), commissionInBaseCoin, big.NewInt(0), false) if resp != nil { return *resp } @@ -265,7 +265,7 @@ func (e *ExecutorV250) RunTx(context state.Interface, rawTx []byte, rewardPool * if isGasCommissionFromPoolSwap { if !commissions.Coin.IsBaseCoin() { var resp *Response - resp, commissionInBaseCoin = CheckSwap(commissionPoolSwapper, checkState.Coins().GetCoin(tx.CommissionCoin()), checkState.Coins().GetCoin(0), commission, big.NewInt(0), false) + resp, commissionInBaseCoin, _ = CheckSwap(commissionPoolSwapper, checkState.Coins().GetCoin(tx.CommissionCoin()), checkState.Coins().GetCoin(0), commission, big.NewInt(0), false) if resp != nil { return *resp } diff --git a/coreV2/transaction/remove_limit_order.go b/coreV2/transaction/remove_limit_order.go index a7b883554..5eedcbdba 100644 --- a/coreV2/transaction/remove_limit_order.go +++ b/coreV2/transaction/remove_limit_order.go @@ -90,7 +90,7 @@ func (data RemoveLimitOrderData) Run(tx *Transaction, context state.Interface, r swapper := checkState.Swap().GetSwapper(order.Coin0, order.Coin1) if isGasCommissionFromPoolSwap && swapper.GetID() == commissionPoolSwapper.GetID() { - commissionInBaseCoin = commissionPoolSwapper.CalculateBuyForSellWithOrders(commission) + commissionInBaseCoin, _ = commissionPoolSwapper.CalculateBuyForSellWithOrders(commission) if tx.GasCoin == order.Coin0 && order.Coin1.IsBaseCoin() { swapper = swapper.AddLastSwapStepWithOrders(commission, commissionInBaseCoin, true) } diff --git a/coreV2/transaction/remove_liquidity_v240.go b/coreV2/transaction/remove_liquidity_v240.go index 318c50fbf..e3b1cc18f 100644 --- a/coreV2/transaction/remove_liquidity_v240.go +++ b/coreV2/transaction/remove_liquidity_v240.go @@ -89,7 +89,7 @@ func (data RemoveLiquidityV240) Run(tx *Transaction, context state.Interface, re } if isGasCommissionFromPoolSwap && swapper.GetID() == commissionPoolSwapper.GetID() { - commissionInBaseCoin = commissionPoolSwapper.CalculateBuyForSellWithOrders(commission) + commissionInBaseCoin, _ = commissionPoolSwapper.CalculateBuyForSellWithOrders(commission) if tx.GasCoin == data.Coin0 && data.Coin1.IsBaseCoin() { swapper = swapper.AddLastSwapStepWithOrders(commission, commissionInBaseCoin, true) } diff --git a/coreV2/transaction/sell_all_swap_pool_v230.go b/coreV2/transaction/sell_all_swap_pool_v230.go index a3943d606..4cda44cad 100644 --- a/coreV2/transaction/sell_all_swap_pool_v230.go +++ b/coreV2/transaction/sell_all_swap_pool_v230.go @@ -310,7 +310,7 @@ func commissionFromPool(swapChecker swap.EditableChecker, coin CalculateCoin, ba } } - errResp, coms := CheckSwap(swapChecker, coin, baseCoin, maxCoinSupply, commissionInBaseCoin, true) + errResp, coms, _ := CheckSwap(swapChecker, coin, baseCoin, maxCoinSupply, commissionInBaseCoin, true) if errResp != nil { return nil, errResp } diff --git a/coreV2/transaction/sell_all_swap_pool_v260.go b/coreV2/transaction/sell_all_swap_pool_v260.go index afde86bc8..5f4fa683d 100644 --- a/coreV2/transaction/sell_all_swap_pool_v260.go +++ b/coreV2/transaction/sell_all_swap_pool_v260.go @@ -190,7 +190,7 @@ func (data SellAllSwapPoolDataV260) Run(tx *Transaction, context state.Interface checkDuplicatePools[swapper.GetID()] = struct{}{} if isGasCommissionFromPoolSwap == true && swapper.GetID() == commissionPoolSwapper.GetID() { - commissionInBaseCoin = commissionPoolSwapper.CalculateBuyForSellWithOrders(commission) + commissionInBaseCoin, _ = commissionPoolSwapper.CalculateBuyForSellWithOrders(commission) if tx.CommissionCoin() == coinToSell && coinToBuy.IsBaseCoin() { swapper = swapper.AddLastSwapStepWithOrders(commission, commissionInBaseCoin, true) } @@ -205,7 +205,7 @@ func (data SellAllSwapPoolDataV260) Run(tx *Transaction, context state.Interface var valueToBuyCalc *big.Int coinToBuyModel := checkState.Coins().GetCoin(coinToBuy) - errResp, valueToBuyCalc = CheckSwap(swapper, coinToSellModel, coinToBuyModel, valueToSell, valueToBuy, false) + errResp, valueToBuyCalc, _ = CheckSwap(swapper, coinToSellModel, coinToBuyModel, valueToSell, valueToBuy, false) if errResp != nil { return *errResp } diff --git a/coreV2/transaction/sell_swap_pool_v260.go b/coreV2/transaction/sell_swap_pool_v260.go index b33ca3165..3a8ee0a1e 100644 --- a/coreV2/transaction/sell_swap_pool_v260.go +++ b/coreV2/transaction/sell_swap_pool_v260.go @@ -114,7 +114,7 @@ func (data SellSwapPoolDataV260) Run(tx *Transaction, context state.Interface, r checkDuplicatePools[swapper.GetID()] = struct{}{} if isGasCommissionFromPoolSwap && swapper.GetID() == commissionPoolSwapper.GetID() { - commissionInBaseCoin = commissionPoolSwapper.CalculateBuyForSellWithOrders(commission) + commissionInBaseCoin, _ = commissionPoolSwapper.CalculateBuyForSellWithOrders(commission) if tx.GasCoin == coinToSell && coinToBuy.IsBaseCoin() { swapper = swapper.AddLastSwapStepWithOrders(commission, commissionInBaseCoin, true) } @@ -129,7 +129,7 @@ func (data SellSwapPoolDataV260) Run(tx *Transaction, context state.Interface, r coinToBuyModel := checkState.Coins().GetCoin(coinToBuy) var valueToBuyCalc *big.Int - errResp, valueToBuyCalc = CheckSwap(swapper, coinToSellModel, coinToBuyModel, valueToSell, valueToBuy, false) + errResp, valueToBuyCalc, _ = CheckSwap(swapper, coinToSellModel, coinToBuyModel, valueToSell, valueToBuy, false) if errResp != nil { return *errResp } diff --git a/tests/order_test.go b/tests/order_test.go index abd9bf277..06d08c0d3 100644 --- a/tests/order_test.go +++ b/tests/order_test.go @@ -1953,10 +1953,11 @@ func TestOrder_buy_more_a_more(t *testing.T) { app := CreateApp(state) // create application SendBeginBlock(app, 1) // send BeginBlock + v, _ := app.CurrentState().Swap().GetSwapper(1, 2).CalculateBuyForSellWithOrders(helpers.StringToBigInt("22330916069244653273092")) tx := CreateTx(app, address, transaction.TypeBuySwapPool, transaction.BuySwapPoolDataV230{ Coins: []types.CoinID{1, 2}, MaximumValueToSell: helpers.StringToBigInt("22330916069244653273092"), - ValueToBuy: app.CurrentState().Swap().GetSwapper(1, 2).CalculateBuyForSellWithOrders(helpers.StringToBigInt("22330916069244653273092")), // +4 + ValueToBuy: v, // +4 }, 0) response := SendTx(app, SignTx(pk, tx)) // compose and send tx From a160cdf63adbfb60a5e544aa9a0d8f4211f10f15 Mon Sep 17 00:00:00 2001 From: klim0v Date: Wed, 8 Dec 2021 16:27:25 +0300 Subject: [PATCH 04/39] bump iavl --- go.mod | 21 +++--- go.sum | 222 +++++++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 202 insertions(+), 41 deletions(-) diff --git a/go.mod b/go.mod index c50c6d900..217f1888a 100644 --- a/go.mod +++ b/go.mod @@ -5,35 +5,32 @@ go 1.16 require ( github.com/MinterTeam/node-grpc-gateway v1.5.1 github.com/btcsuite/btcd v0.21.0-beta - github.com/c-bata/go-prompt v0.2.3 - github.com/cosmos/iavl v0.17.1-0.20210901093355-89f6b77e9284 - github.com/go-kit/kit v0.10.0 + github.com/c-bata/go-prompt v0.2.5 + github.com/cosmos/iavl v0.17.3 + github.com/go-kit/kit v0.12.0 github.com/gogo/protobuf v1.3.2 github.com/golang/protobuf v1.5.2 github.com/gorilla/handlers v1.4.2 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 - github.com/grpc-ecosystem/grpc-gateway/v2 v2.6.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.1 github.com/marcusolsson/tui-go v0.4.0 - github.com/mattn/go-isatty v0.0.12 // indirect - github.com/mattn/go-tty v0.0.3 // indirect github.com/pkg/errors v0.9.1 - github.com/pkg/term v0.0.0-20190109203006-aa71e9d9e942 // indirect - github.com/prometheus/client_golang v1.8.0 + github.com/prometheus/client_golang v1.11.0 github.com/rakyll/statik v0.1.7 github.com/spf13/cobra v1.1.1 github.com/spf13/viper v1.7.1 github.com/stretchr/testify v1.7.0 github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca github.com/tendermint/go-amino v0.15.1 - github.com/tendermint/tendermint v0.34.12 + github.com/tendermint/tendermint v0.34.14 github.com/tendermint/tm-db v0.6.4 github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 github.com/urfave/cli/v2 v2.0.0 - golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9 + golang.org/x/crypto v0.0.0-20211202192323-5770296d904e golang.org/x/sync v0.0.0-20210220032951-036812b2e83c - golang.org/x/sys v0.0.0-20210903071746-97244b99971b - google.golang.org/grpc v1.40.0 + golang.org/x/sys v0.0.0-20211205182925-97ca703d548d + google.golang.org/grpc v1.42.0 google.golang.org/protobuf v1.27.1 ) diff --git a/go.sum b/go.sum index 5c06c4629..513ca79b2 100644 --- a/go.sum +++ b/go.sum @@ -41,8 +41,11 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.4.1 h1:3oxKN3wbHibqx897utPC2LTQU4J+IHWWJO+glkAkpFM= github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= +github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= +github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.5.0 h1:Elr9Wn+sGKPlkaBvwu4mTrxtmOp3F3yV9qhaHbXGjwU= @@ -65,6 +68,7 @@ github.com/adlio/schema v1.1.13 h1:LeNMVg5Z1FX+Qgz8tJUijBLRdcpbFUElz+d1489On98= github.com/adlio/schema v1.1.13/go.mod h1:L5Z7tw+7lRK1Fnpi/LT/ooCP1elkXn0krMWBQHUhEDE= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -76,11 +80,18 @@ github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.8.1/go.mod h1:CM+19rL1+4dFWnOQKwDc7H1KwXTz+h61oUSHyhV0b3o= +github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -102,26 +113,36 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/c-bata/go-prompt v0.2.3 h1:jjCS+QhG/sULBhAaBdjb2PlMRVaKXQgn+4yzaauvs2s= -github.com/c-bata/go-prompt v0.2.3/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= +github.com/c-bata/go-prompt v0.2.5 h1:3zg6PecEywxNn0xiqcXHD96fkbxghD+gdB2tbsYfl+Y= +github.com/c-bata/go-prompt v0.2.5/go.mod h1:vFnjEGDIIA/Lib7giyE4E9c50Lvl8j0S+7FVlAwDAVw= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +github.com/casbin/casbin/v2 v2.37.0/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/confio/ics23/go v0.6.3/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= @@ -145,8 +166,8 @@ github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfc github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d h1:49RLWk1j44Xu4fjHb6JFYmeUnDORVwHNkDxaQ0ctCVU= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/iavl v0.15.3/go.mod h1:OLjQiAQ4fGD2KDZooyJG9yz+p2ao2IAYSbke8mVvSA4= -github.com/cosmos/iavl v0.17.1-0.20210901093355-89f6b77e9284 h1:K5I1Z3qKksdun+GbjxBmhJN/cZ1hDDsIQs3oejVeQ7c= -github.com/cosmos/iavl v0.17.1-0.20210901093355-89f6b77e9284/go.mod h1:bopHqfvADWWa2ngnLBVS79NeHV8qiNjTA2EK61bdbGs= +github.com/cosmos/iavl v0.17.3 h1:s2N819a2olOmiauVa0WAhoIJq9EhSXE9HDBAoR9k+8Y= +github.com/cosmos/iavl v0.17.3/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w= github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= @@ -186,6 +207,7 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51 h1:0JZ+dUmQeA8IIVUMzysrX4/AKuQwWhV2dYQuPZdvdSQ= github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= @@ -194,9 +216,13 @@ github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqL github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 h1:E2s37DuLxFhQDg5gKsWoLBOB0n+ZW8s599zru8FJ2/Y= 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/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goblin v0.0.0-20210519012713-85d372ac71e2/go.mod h1:VzmDKDJVZI3aJmnRI9VjAn9nJ8qPPsN1fqzr9dqInIo= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -212,15 +238,21 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= +github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= +github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-kit/log v0.2.0 h1:7i2K3eKTos3Vc0enKCfnVcgHh2olr/MyfboYq7cAcFw= +github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-zookeeper/zk v1.0.2/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= @@ -230,6 +262,8 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= @@ -238,6 +272,7 @@ github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4er github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -264,8 +299,9 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -276,6 +312,7 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= @@ -324,8 +361,9 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.6.0 h1:rgxjzoDmDXw5q8HONgyHhBas4to0/XWRo/gPpJhsUNQ= github.com/grpc-ecosystem/grpc-gateway/v2 v2.6.0/go.mod h1:qrJPVzv9YlhsrxJc3P/Q85nr0w1lIRikTl4JlhdDH5w= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.1 h1:p5m7GOEGXyoq6QWl4/RRMsQ6tWbTpbQmAnkxXgWSprY= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.1/go.mod h1:8ZeZajTed/blCOHBbj8Fss8bPHiFKcmJJzuIbUtFCAo= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= @@ -333,14 +371,24 @@ github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uM github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -349,21 +397,29 @@ github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= 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/hudl/fargo v1.4.0/go.mod h1:9Ai6uvFy5fQNq6VPKtg+Ceq1+eTY4nKUlR2JElEOcDo= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -372,7 +428,10 @@ github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlT github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= @@ -380,15 +439,19 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7 github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= 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.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= 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= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= @@ -411,28 +474,38 @@ github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP github.com/marcusolsson/tui-go v0.4.0 h1:PZD0lIS+2OUKxs71qsc5U/P+eVU39FeBRgdsh5iQZ28= github.com/marcusolsson/tui-go v0.4.0/go.mod h1:vp1U15jwzYTPWex1hV+CZ7MeQQH7Wr73fz9hc/0I9YI= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.6 h1:V2iyH+aX9C5fsYCpK60U8BYIvmhqxuOL3JZcqc1NB7k= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-tty v0.0.3 h1:5OfyWorkyO7xP52Mq7tB36ajHDG5OHrmBGIS/DtakQI= github.com/mattn/go-tty v0.0.3/go.mod h1:ihxohKRERHTVzN+aSVRwACLCeqIoZAWpoICkkvrWyR0= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 h1:hLDRPB66XQT/8+wG9WsDpiCvZf1yKO7sz7scAjSlBa0= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/minio/highwayhash v1.0.1 h1:dZ6IIu8Z14VlC0VpfKofAhCy74wu/Qb5gcn52yWoz/0= github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= +github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= @@ -441,25 +514,35 @@ github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUb github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.2 h1:6h7AQ0yhTcIsmFmnAwQls75jp2Gzs4iB8W7pjMO+rqo= +github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q= +github.com/nats-io/jwt/v2 v2.0.3/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= +github.com/nats-io/nats-server/v2 v2.5.0/go.mod h1:Kj86UtrXAL6LwYRA6H4RqzkHhK0Vcv2ZnKD5WbQ1t3g= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nats.go v1.12.1/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= +github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= @@ -467,13 +550,15 @@ github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:v github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.2 h1:HFB2fbVIlhIfCfOW81bZFbiC/RvnpXSdhbF2/DJr134= +github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= +github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= @@ -489,18 +574,22 @@ github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.5/go.mod h1:KpXfKdgRDnnhsxw4pNIH9Md5lyFqKUa4YDFlwRYAMyE= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/performancecopilot/speed/v4 v4.0.0/go.mod h1:qxrSyuDGrTOWfV+uKRFhfxw6h/4HXRGUiZiufxo49BM= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= @@ -511,19 +600,22 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/term v0.0.0-20190109203006-aa71e9d9e942 h1:A7GG7zcGjl3jqAqGPmcNjd/D9hzL95SuoOQAaFNdLU0= -github.com/pkg/term v0.0.0-20190109203006-aa71e9d9e942/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= +github.com/pkg/term v1.1.0 h1:xIAAdCMh3QIAy+5FrE8Ad8XoDhEU4ufwbaSozViP9kk= +github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.8.0 h1:zvJNkoCFAnYFNC24FV8nW4JdRJ3GIFcLbg65lL/JDcw= github.com/prometheus/client_golang v1.8.0/go.mod h1:O9VU6huf47PktckDQfMTX0Y8tY0/7TSWwj+ITvv0TnM= +github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -536,17 +628,22 @@ github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.14.0 h1:RHRyE8UocrbjU+6UvRzwi6HjiDfxrrBU91TtbKzkGp4= github.com/prometheus/common v0.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.30.0 h1:JEkYlQnpzrzQFxi6gnukFPdQ+ac82oRhzMcIduJu/Ug= +github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= @@ -613,7 +710,9 @@ github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= +github.com/streadway/handy v0.0.0-20200128134331-0f66f006fb2e/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -640,6 +739,7 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1 github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 h1:uruHq4dN7GR16kFc5fp3d1RIYzJW5onx8Ybykw2YQFA= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= @@ -661,6 +761,10 @@ go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= +go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -668,15 +772,23 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -685,14 +797,23 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9 h1:phUcVbl53swtrUN8kQEXFhUxPlIlWyBfKmidCu7P95o= golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210915214749-c084706c2272/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211202192323-5770296d904e h1:MUP6MR3rJ7Gk9LEia0LP2ytiH6MuCfs7qYz+47jGdD8= +golang.org/x/crypto v0.0.0-20211202192323-5770296d904e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= @@ -703,6 +824,7 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= +golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -766,17 +888,26 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f h1:w6wWR0H+nyVpbSAQbzVEIACVyr/h8l/BEkY6Sokc7Eg= golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -813,6 +944,7 @@ golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -827,6 +959,7 @@ golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -844,18 +977,27 @@ golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200918174421-af09f7315aff/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210903071746-97244b99971b h1:3Dq0eVHn0uaQJmPO+/aYPI/fRMqdrVDbu7MQcku54gg= golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211205182925-97ca703d548d h1:FjkYO/PPp4Wi0EAUOVLxePm7qVW4r4ctbWpURyuOD0E= +golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -871,11 +1013,15 @@ golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -888,6 +1034,7 @@ golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -920,13 +1067,19 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -985,8 +1138,11 @@ google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83 h1:3V2dxSZpz4zozWWUq36vUxXEKnSYitEH2LdsAx+RUmg= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12 h1:DN5b3HU13J4sMd/QjDx34U6afpaexKTDdop+26pdjdk= +google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1010,8 +1166,10 @@ google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.40.0 h1:AGJ0Ih4mHjSeibYkFGh1dD9KJ/eOtZ93I6hoHhukQ5Q= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.42.0 h1:XT2/MFpuPFsEX2fWh3YQtHkZ+WYZFQRfaUgLZYj/p6A= +google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1033,6 +1191,8 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= @@ -1055,8 +1215,9 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1067,7 +1228,10 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= From 51cd56e759a676b50d1e67c24ce438983668cb66 Mon Sep 17 00:00:00 2001 From: klim0v Date: Wed, 8 Dec 2021 16:37:06 +0300 Subject: [PATCH 05/39] bump go --- go.mod | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 217f1888a..84cb8103b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/MinterTeam/minter-go-node -go 1.16 +go 1.17 require ( github.com/MinterTeam/node-grpc-gateway v1.5.1 @@ -34,4 +34,73 @@ require ( google.golang.org/protobuf v1.27.1 ) +require ( + github.com/DataDog/zstd v1.4.1 // indirect + github.com/Workiva/go-datastructures v1.0.52 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash v1.1.0 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/confio/ics23/go v0.6.6 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dgraph-io/badger/v2 v2.2007.2 // indirect + github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de // indirect + github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 // indirect + github.com/dustin/go-humanize v1.0.0 // indirect + github.com/fsnotify/fsnotify v1.4.9 // indirect + github.com/gdamore/encoding v0.0.0-20151215212835-b23993cbb635 // indirect + github.com/gdamore/tcell v1.1.0 // indirect + github.com/go-kit/log v0.2.0 // indirect + github.com/go-logfmt/logfmt v0.5.1 // indirect + github.com/golang/snappy v0.0.3 // indirect + github.com/google/btree v1.0.0 // indirect + github.com/google/orderedcode v0.0.1 // indirect + github.com/gorilla/websocket v1.4.2 // indirect + github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect + github.com/gtank/merlin v0.1.1 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/jmhodges/levigo v1.0.0 // indirect + github.com/libp2p/go-buffer-pool v0.0.2 // indirect + github.com/lucasb-eyer/go-colorful v0.0.0-20180709185858-c7842319cf3a // indirect + github.com/magiconair/properties v1.8.1 // indirect + github.com/mattn/go-colorable v0.1.8 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/mattn/go-runewidth v0.0.9 // indirect + github.com/mattn/go-tty v0.0.3 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect + github.com/minio/highwayhash v1.0.2 // indirect + github.com/mitchellh/go-wordwrap v1.0.0 // indirect + github.com/mitchellh/mapstructure v1.4.2 // indirect + github.com/onsi/ginkgo v1.16.2 // indirect + github.com/onsi/gomega v1.13.0 // indirect + github.com/pelletier/go-toml v1.2.0 // indirect + github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect + github.com/pkg/term v1.1.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.30.0 // indirect + github.com/prometheus/procfs v0.7.3 // indirect + github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect + github.com/rs/cors v1.7.0 // indirect + github.com/russross/blackfriday/v2 v2.0.1 // indirect + github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect + github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect + github.com/sirupsen/logrus v1.8.1 // indirect + github.com/spf13/afero v1.1.2 // indirect + github.com/spf13/cast v1.3.0 // indirect + github.com/spf13/jwalterweatherman v1.0.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/subosito/gotenv v1.2.0 // indirect + github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect + go.etcd.io/bbolt v1.3.5 // indirect + golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect + golang.org/x/text v0.3.7 // indirect + google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12 // indirect + gopkg.in/ini.v1 v1.51.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect +) + replace github.com/tendermint/tendermint => github.com/MinterTeam/tendermint v0.34.11-0.20210923081749-4193cf101f9f From 4731d2fa50f42fb30734e1745b8590c9562111e4 Mon Sep 17 00:00:00 2001 From: klim0v Date: Wed, 8 Dec 2021 16:44:53 +0300 Subject: [PATCH 06/39] bump gateway --- go.mod | 7 ++++--- go.sum | 15 ++++++--------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 84cb8103b..e5a36f177 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.5.1 + github.com/MinterTeam/node-grpc-gateway v1.4.3-0.20211208134306-ae7964561da4 github.com/btcsuite/btcd v0.21.0-beta github.com/c-bata/go-prompt v0.2.5 github.com/cosmos/iavl v0.17.3 @@ -61,6 +61,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect + github.com/kr/text v0.2.0 // indirect github.com/libp2p/go-buffer-pool v0.0.2 // indirect github.com/lucasb-eyer/go-colorful v0.0.0-20180709185858-c7842319cf3a // indirect github.com/magiconair/properties v1.8.1 // indirect @@ -95,9 +96,9 @@ require ( github.com/subosito/gotenv v1.2.0 // indirect github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect go.etcd.io/bbolt v1.3.5 // indirect - golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect + golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b // indirect golang.org/x/text v0.3.7 // indirect - google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12 // indirect + google.golang.org/genproto v0.0.0-20211207154714-918901c715cf // indirect gopkg.in/ini.v1 v1.51.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect diff --git a/go.sum b/go.sum index 513ca79b2..0832aa622 100644 --- a/go.sum +++ b/go.sum @@ -50,8 +50,8 @@ github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.5.0 h1:Elr9Wn+sGKPlkaBvwu4mTrxtmOp3F3yV9qhaHbXGjwU= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/MinterTeam/node-grpc-gateway v1.5.1 h1:OI9zjxOrRRS2CGm8+qEIA7LbBAXru5mkschtaYgHzx8= -github.com/MinterTeam/node-grpc-gateway v1.5.1/go.mod h1:sBCShqinBPRSxRVz+6r7aDwtrQW10QPYkmntFKrFVCM= +github.com/MinterTeam/node-grpc-gateway v1.4.3-0.20211208134306-ae7964561da4 h1:FwYtiBig/nwzJLTuksrqbhSV1Tr+RByzEzW5dOzEJYc= +github.com/MinterTeam/node-grpc-gateway v1.4.3-0.20211208134306-ae7964561da4/go.mod h1:kSjFnXZ52XTOaxj4+nbahfMsAt8GsEIc9DSMzOlfALI= github.com/MinterTeam/tendermint v0.34.11-0.20210923081749-4193cf101f9f h1:Vh91l7xApDxqH/hVQB5petycJ50NLoUTpGo1UIVdAyA= github.com/MinterTeam/tendermint v0.34.11-0.20210923081749-4193cf101f9f/go.mod h1:6RVVRBqwtKhA+H59APKumO+B7Nye4QXSFc6+TYxAxCI= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= @@ -361,7 +361,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.6.0/go.mod h1:qrJPVzv9YlhsrxJc3P/Q85nr0w1lIRikTl4JlhdDH5w= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.1 h1:p5m7GOEGXyoq6QWl4/RRMsQ6tWbTpbQmAnkxXgWSprY= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.1/go.mod h1:8ZeZajTed/blCOHBbj8Fss8bPHiFKcmJJzuIbUtFCAo= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= @@ -895,18 +894,17 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b h1:MWaHNqZy3KTpuTMAGvv+Kw+ylsEpmyJZizz1dqxnu28= +golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -993,7 +991,6 @@ golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211205182925-97ca703d548d h1:FjkYO/PPp4Wi0EAUOVLxePm7qVW4r4ctbWpURyuOD0E= @@ -1139,10 +1136,10 @@ google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12 h1:DN5b3HU13J4sMd/QjDx34U6afpaexKTDdop+26pdjdk= google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211207154714-918901c715cf h1:PSEM+IQFb9xdsj2CGhfqUTfsZvF8DScCVP1QZb2IiTQ= +google.golang.org/genproto v0.0.0-20211207154714-918901c715cf/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= From 30e723bfe57e18b2f204bbec0927de0aad3b440c Mon Sep 17 00:00:00 2001 From: klim0v Date: Wed, 15 Dec 2021 00:14:08 +0300 Subject: [PATCH 07/39] snapshots --- cmd/minter/cmd/node.go | 19 +- cmd/utils/flags.go | 12 +- config/config.go | 31 +- config/toml.go | 17 + coreV2/appdb/appdb.go | 294 ++++++++- coreV2/appdb/proto/buf.gen.yaml | 6 + coreV2/appdb/proto/buf.lock | 10 + coreV2/appdb/proto/buf.yaml | 7 + coreV2/appdb/proto/snapshot.proto | 29 + coreV2/appdb/types/snapshot.pb.go | 1028 +++++++++++++++++++++++++++++ coreV2/minter/blockchain.go | 31 +- coreV2/minter/minter.go | 12 + coreV2/minter/minter_test.go | 9 +- coreV2/minter/snapshots.go | 161 +++++ go.mod | 38 +- go.sum | 334 +++++++++- tests/helpers_test.go | 2 +- tree/tree.go | 22 + 18 files changed, 1980 insertions(+), 82 deletions(-) create mode 100644 coreV2/appdb/proto/buf.gen.yaml create mode 100644 coreV2/appdb/proto/buf.lock create mode 100644 coreV2/appdb/proto/buf.yaml create mode 100644 coreV2/appdb/proto/snapshot.proto create mode 100644 coreV2/appdb/types/snapshot.pb.go create mode 100644 coreV2/minter/snapshots.go diff --git a/cmd/minter/cmd/node.go b/cmd/minter/cmd/node.go index a2ec7fa26..1f0930c8c 100644 --- a/cmd/minter/cmd/node.go +++ b/cmd/minter/cmd/node.go @@ -3,7 +3,7 @@ package cmd import ( "context" "fmt" - + "github.com/cosmos/cosmos-sdk/snapshots" "io" "net/http" _ "net/http/pprof" // nolint: gosec // securely exposed on separate, optional port @@ -88,10 +88,25 @@ func runNode(cmd *cobra.Command) error { if err != nil { return err } - app := minter.NewMinterBlockchain(storages, cfg, cmd.Context(), 720, 0) + app := minter.NewMinterBlockchain(storages, cfg, cmd.Context(), 720, 0, logger.With("module", "node")) + + if cfg.SnapshotInterval > 0 { + snapshotDB, err := storages.InitSnapshotLevelDB("data/snapshots/metadata", minter.GetDbOpts(cfg.StateMemAvailable)) + if err != nil { + return err + } + + snapshotStore, err := snapshots.NewStore(snapshotDB, storages.GetMinterHome()+"/data/snapshots") + if err != nil { + panic(err) + } + + app.SetSnapshotStore(snapshotStore, cfg.SnapshotInterval, cfg.SnapshotKeepRecent) + } // start TM node node := startTendermintNode(app, tmConfig, logger, storages.GetMinterHome()) + client := app.RpcClient() if !cfg.ValidatorMode { diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index e5f565d7d..e4f76383e 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -12,6 +12,7 @@ type Storage struct { minterConfig string eventDB db.DB stateDB db.DB + snapshotDB db.DB } func (s *Storage) SetMinterConfig(minterConfig string) { @@ -31,7 +32,16 @@ func (s *Storage) StateDB() db.DB { } func NewStorage(home string, config string) *Storage { - return &Storage{eventDB: db.NewMemDB(), stateDB: db.NewMemDB(), minterConfig: config, minterHome: home} + return &Storage{eventDB: db.NewMemDB(), stateDB: db.NewMemDB(), snapshotDB: db.NewMemDB(), minterConfig: config, minterHome: home} +} + +func (s *Storage) InitSnapshotLevelDB(name string, opts *opt.Options) (db.DB, error) { + levelDB, err := db.NewGoLevelDBWithOpts(name, s.GetMinterHome(), opts) + if err != nil { + return nil, err + } + s.snapshotDB = levelDB + return s.snapshotDB, nil } func (s *Storage) InitEventLevelDB(name string, opts *opt.Options) (db.DB, error) { diff --git a/config/config.go b/config/config.go index 05939baf4..e0e7fd5bd 100644 --- a/config/config.go +++ b/config/config.go @@ -98,6 +98,7 @@ type Config struct { BaseConfig `mapstructure:",squash"` // Options for services + StateSync *tmConfig.StateSyncConfig `mapstructure:"statesync"` RPC *tmConfig.RPCConfig `mapstructure:"rpc"` P2P *tmConfig.P2PConfig `mapstructure:"p2p"` Mempool *tmConfig.MempoolConfig `mapstructure:"mempool"` @@ -110,6 +111,7 @@ type Config struct { func defaultConfig() *Config { return &Config{ BaseConfig: DefaultBaseConfig(), + StateSync: tmConfig.DefaultStateSyncConfig(), RPC: tmConfig.DefaultRPCConfig(), P2P: tmConfig.DefaultP2PConfig(), Mempool: tmConfig.DefaultMempoolConfig(), @@ -149,19 +151,10 @@ func GetTmConfig(cfg *Config) *tmConfig.Config { ABCI: cfg.ABCI, FilterPeers: cfg.FilterPeers, }, - RPC: cfg.RPC, - P2P: cfg.P2P, - Mempool: cfg.Mempool, - // StateSync: &tmConfig.StateSyncConfig{ - // Enable: true, - // TempDir: "", - // RPCServers: []string{}, // todo - // TrustPeriod: 168 * time.Hour, - // TrustHeight: 0, - // TrustHash: "", - // DiscoveryTime: 15 * time.Second, - // }, - StateSync: tmConfig.DefaultStateSyncConfig(), + RPC: cfg.RPC, + P2P: cfg.P2P, + Mempool: cfg.Mempool, + StateSync: cfg.StateSync, FastSync: tmConfig.DefaultFastSyncConfig(), Consensus: cfg.Consensus, TxIndex: cfg.TxIndex, @@ -262,6 +255,11 @@ type BaseConfig struct { StateMemAvailable int `mapstructure:"state_mem_available"` HaltHeight int `mapstructure:"halt_height"` + + // State sync snapshot interval + SnapshotInterval int `mapstructure:"snapshot_interval"` + // State sync snapshot to keep + SnapshotKeepRecent int `mapstructure:"snapshot_keep_recent"` } // DefaultBaseConfig returns a default base configuration for a Tendermint node @@ -286,11 +284,14 @@ func DefaultBaseConfig() BaseConfig { WSConnectionDuration: time.Minute, ValidatorMode: false, KeepLastStates: 120, - StateCacheSize: 1000000, - StateMemAvailable: 1024, APISimultaneousRequests: 100, LogPath: "stdout", LogFormat: LogFormatPlain, + StateCacheSize: 1000000, + StateMemAvailable: 1024, + HaltHeight: 0, + SnapshotInterval: 0, + SnapshotKeepRecent: 2, } } diff --git a/config/toml.go b/config/toml.go index 02da2a434..f9dbb6da5 100644 --- a/config/toml.go +++ b/config/toml.go @@ -103,6 +103,11 @@ api_simultaneous_requests = {{ .BaseConfig.APISimultaneousRequests }} # and verifying their commits fast_sync = {{ .BaseConfig.FastSync }} +# State sync snapshot interval +snapshot_interval = {{ .BaseConfig.SnapshotInterval }} +# State sync snapshot to keep +snapshot_keep_recent = {{ .BaseConfig.SnapshotKeepRecent }} + # Database backend: leveldb | memdb db_backend = "{{ .BaseConfig.DBBackend }}" @@ -132,6 +137,18 @@ prof_laddr = "{{ .BaseConfig.ProfListenAddress }}" ##### advanced configuration options ##### +[statesync] + +enable = {{ .StateSync.Enable }} + +# At least 2 available RPC servers. +rpc_servers = "{{ .StateSync.RPCServers }}" +# A trusted height +trust_height = {{ .StateSync.TrustHeight }} +# The block ID hash of the trusted height +trust_hash = "{{ .StateSync.TrustHash }}" +trust_period = "{{ .StateSync.TrustPeriod }}" + ##### rpc server configuration options ##### [rpc] diff --git a/coreV2/appdb/appdb.go b/coreV2/appdb/appdb.go index be9e3d54d..351574eca 100644 --- a/coreV2/appdb/appdb.go +++ b/coreV2/appdb/appdb.go @@ -1,12 +1,27 @@ package appdb import ( + "bufio" + "compress/zlib" "encoding/binary" "github.com/MinterTeam/minter-go-node/config" - "github.com/tendermint/tendermint/abci/types" + "github.com/MinterTeam/minter-go-node/tree" + "github.com/cosmos/cosmos-sdk/snapshots" + snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" + //"github.com/cosmos/cosmos-sdk/store/iavl" + "github.com/cosmos/iavl" + + "github.com/MinterTeam/minter-go-node/coreV2/appdb/types" + sdktypes "github.com/cosmos/cosmos-sdk/store/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + iavltree "github.com/cosmos/iavl" + protoio "github.com/gogo/protobuf/io" + abcTypes "github.com/tendermint/tendermint/abci/types" abciTypes "github.com/tendermint/tendermint/abci/types" tmjson "github.com/tendermint/tendermint/libs/json" "github.com/tendermint/tm-db" + "io" + "math" "sync/atomic" "time" ) @@ -24,7 +39,11 @@ const ( // AppDB is responsible for storing basic information about app state on disk type AppDB struct { - db db.DB + db db.DB + + store tree.MTree + keysByName map[string]sdktypes.StoreKey + startHeight uint64 lastHeight uint64 lastTimeBlocks []uint64 @@ -101,7 +120,7 @@ func (appDB *AppDB) SetStartHeight(height uint64) { atomic.StoreUint64(&appDB.startHeight, height) } -// SetStartHeight stores given block height on disk as start height, panics on error +// SaveStartHeight stores given block height on disk as start height, panics on error func (appDB *AppDB) SaveStartHeight() { h := make([]byte, 8) binary.BigEndian.PutUint64(h, atomic.LoadUint64(&appDB.startHeight)) @@ -130,7 +149,7 @@ func (appDB *AppDB) GetStartHeight() uint64 { } // GetValidators returns list of latest validators stored on dist -func (appDB *AppDB) GetValidators() types.ValidatorUpdates { +func (appDB *AppDB) GetValidators() abcTypes.ValidatorUpdates { if appDB.validators != nil { return appDB.validators } @@ -141,10 +160,10 @@ func (appDB *AppDB) GetValidators() types.ValidatorUpdates { } if len(result) == 0 { - return types.ValidatorUpdates{} + return abcTypes.ValidatorUpdates{} } - var vals types.ValidatorUpdates + var vals abcTypes.ValidatorUpdates err = tmjson.Unmarshal(result, &vals) if err != nil { @@ -155,7 +174,7 @@ func (appDB *AppDB) GetValidators() types.ValidatorUpdates { } // SetValidators sets given validators list on mem -func (appDB *AppDB) SetValidators(vals types.ValidatorUpdates) { +func (appDB *AppDB) SetValidators(vals abcTypes.ValidatorUpdates) { appDB.validators = vals } @@ -316,6 +335,10 @@ func (appDB *AppDB) SaveVersions() { appDB.isDirtyVersions = false } +func (appDB *AppDB) SetState(state tree.MTree) { + appDB.store = state +} + // NewAppDB creates AppDB instance with given config func NewAppDB(homeDir string, cfg *config.Config) *AppDB { newDB, err := db.NewDB(dbName, db.BackendType(cfg.DBBackend), homeDir+"/data") @@ -326,3 +349,260 @@ func NewAppDB(homeDir string, cfg *config.Config) *AppDB { db: newDB, } } + +//---------------------- Snapshotting ------------------ + +const ( + // Do not change chunk size without new snapshot format (must be uniform across nodes) + snapshotChunkSize = uint64(10e6) + snapshotBufferSize = int(snapshotChunkSize) + snapshotMaxItemSize = int(64e6) // SDK has no key/value size limit, so we set an arbitrary limit +) + +type Store interface { + Export(version int64) (*iavl.Exporter, error) + Import(version int64) (*iavl.Importer, error) +} + +// Snapshot implements snapshottypes.Snapshotter. The snapshot output for a given format must be +// identical across nodes such that chunks from different sources fit together. If the output for a +// given format changes (at the byte level), the snapshot format must be bumped - see +// TestMultistoreSnapshot_Checksum test. +func (appDB *AppDB) Snapshot(height uint64, format uint32) (<-chan io.ReadCloser, error) { + if format != snapshottypes.CurrentFormat { + return nil, sdkerrors.Wrapf(snapshottypes.ErrUnknownFormat, "format %v", format) + } + if height == 0 { + return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "cannot snapshot height 0") + } + if height > uint64(appDB.GetLastHeight()) { + return nil, sdkerrors.Wrapf(sdkerrors.ErrLogic, "cannot snapshot future height %v", height) + } + + // Spawn goroutine to generate snapshot chunks and pass their io.ReadClosers through a channel + ch := make(chan io.ReadCloser) + go func() { + // Set up a stream pipeline to serialize snapshot nodes: + // ExportNode -> delimited Protobuf -> zlib -> buffer -> chunkWriter -> chan io.ReadCloser + chunkWriter := snapshots.NewChunkWriter(ch, snapshotChunkSize) + defer chunkWriter.Close() + bufWriter := bufio.NewWriterSize(chunkWriter, snapshotBufferSize) + defer func() { + if err := bufWriter.Flush(); err != nil { + chunkWriter.CloseWithError(err) + } + }() + zWriter, err := zlib.NewWriterLevel(bufWriter, 7) + if err != nil { + chunkWriter.CloseWithError(sdkerrors.Wrap(err, "zlib failure")) + return + } + defer func() { + if err := zWriter.Close(); err != nil { + chunkWriter.CloseWithError(err) + } + }() + protoWriter := protoio.NewDelimitedWriter(zWriter) + defer func() { + if err := protoWriter.Close(); err != nil { + chunkWriter.CloseWithError(err) + } + }() + + { + // Export each IAVL store. Stores are serialized as a stream of SnapshotItem Protobuf + // messages. The first item contains a SnapshotStore with store metadata (i.e. name), + // and the following messages contain a SnapshotNode (i.e. an ExportNode). Store changes + // are demarcated by new SnapshotStore items. + + exporter, err := appDB.store.Export(int64(height)) + if err != nil { + chunkWriter.CloseWithError(err) + return + } + defer exporter.Close() + err = protoWriter.WriteMsg(&types.SnapshotItem{ + Item: &types.SnapshotItem_Store{ + Store: &types.SnapshotStoreItem{ + Name: "state", + }, + }, + }) + if err != nil { + chunkWriter.CloseWithError(err) + return + } + + for { + node, err := exporter.Next() + if err == iavltree.ExportDone { + break + } else if err != nil { + chunkWriter.CloseWithError(err) + return + } + err = protoWriter.WriteMsg(&types.SnapshotItem{ + Item: &types.SnapshotItem_IAVL{ + IAVL: &types.SnapshotIAVLItem{ + Key: node.Key, + Value: node.Value, + Height: int32(node.Height), + Version: node.Version, + }, + }, + }) + if err != nil { + chunkWriter.CloseWithError(err) + return + } + } + exporter.Close() + } + + for _, name := range []string{validatorsPath, heightPath, hashPath, versionsPath, blocksTimePath} { + result, err := appDB.db.Get([]byte(name)) + if err != nil { + panic(err) + } + + err = protoWriter.WriteMsg(&types.SnapshotItem{ + Item: &types.SnapshotItem_Store{ + Store: &types.SnapshotStoreItem{ + Name: name, + Value: result, + }, + }, + }) + if err != nil { + chunkWriter.CloseWithError(err) + return + } + } + }() + + return ch, nil +} + +// Restore implements snapshottypes.Snapshotter. +func (appDB *AppDB) Restore( + height uint64, format uint32, chunks <-chan io.ReadCloser, ready chan<- struct{}, +) error { + if format != snapshottypes.CurrentFormat { + return sdkerrors.Wrapf(snapshottypes.ErrUnknownFormat, "format %v", format) + } + if height == 0 { + return sdkerrors.Wrap(sdkerrors.ErrLogic, "cannot restore snapshot at height 0") + } + if height > uint64(math.MaxInt64) { + return sdkerrors.Wrapf(snapshottypes.ErrInvalidMetadata, + "snapshot height %v cannot exceed %v", height, int64(math.MaxInt64)) + } + + // Signal readiness. Must be done before the readers below are set up, since the zlib + // reader reads from the stream on initialization, potentially causing deadlocks. + if ready != nil { + close(ready) + } + + // Set up a restore stream pipeline + // chan io.ReadCloser -> chunkReader -> zlib -> delimited Protobuf -> ExportNode + chunkReader := snapshots.NewChunkReader(chunks) + defer chunkReader.Close() + zReader, err := zlib.NewReader(chunkReader) + if err != nil { + return sdkerrors.Wrap(err, "zlib failure") + } + defer zReader.Close() + protoReader := protoio.NewDelimitedReader(zReader, snapshotMaxItemSize) + defer protoReader.Close() + + // Import nodes into stores. The first item is expected to be a SnapshotItem containing + // a SnapshotStoreItem, telling us which store to import into. The following items will contain + // SnapshotNodeItem (i.e. ExportNode) until we reach the next SnapshotStoreItem or EOF. + var importer *iavltree.Importer + for { + item := &types.SnapshotItem{} + err := protoReader.ReadMsg(item) + if err == io.EOF { + break + } else if err != nil { + return sdkerrors.Wrap(err, "invalid protobuf message") + } + + switch item := item.Item.(type) { + case *types.SnapshotItem_Store: + switch item.Store.Name { + case "state": + if importer != nil { + err = importer.Commit() + if err != nil { + return sdkerrors.Wrap(err, "IAVL commit failed") + } + importer.Close() + } + store, ok := appDB.store.(Store) + if !ok || store == nil { + return sdkerrors.Wrapf(sdkerrors.ErrLogic, "cannot import into non-IAVL store %q", item.Store.Name) + } + importer, err = store.Import(int64(height)) + if err != nil { + return sdkerrors.Wrap(err, "import failed") + } + defer importer.Close() + + case validatorsPath, heightPath, hashPath, versionsPath, blocksTimePath: + if err := appDB.db.Set([]byte(item.Store.Name), item.Store.Value); err != nil { + panic(err) + } + + default: + return sdkerrors.Wrapf(sdkerrors.ErrLogic, "unknown store name %v", item.Store.Name) + } + case *types.SnapshotItem_IAVL: + if importer == nil { + return sdkerrors.Wrap(sdkerrors.ErrLogic, "received IAVL node item before store item") + } + if item.IAVL.Height > math.MaxInt8 { + return sdkerrors.Wrapf(sdkerrors.ErrLogic, "node height %v cannot exceed %v", + item.IAVL.Height, math.MaxInt8) + } + node := &iavltree.ExportNode{ + Key: item.IAVL.Key, + Value: item.IAVL.Value, + Height: int8(item.IAVL.Height), + Version: item.IAVL.Version, + } + // Protobuf does not differentiate between []byte{} as nil, but fortunately IAVL does + // not allow nil keys nor nil values for leaf nodes, so we can always set them to empty. + if node.Key == nil { + node.Key = []byte{} + } + if node.Height == 0 && node.Value == nil { + node.Value = []byte{} + } + err := importer.Add(node) + if err != nil { + return sdkerrors.Wrap(err, "IAVL node import failed") + } + + default: + return sdkerrors.Wrapf(sdkerrors.ErrLogic, "unknown snapshot item %T", item) + } + } + + if importer != nil { + err := importer.Commit() + if err != nil { + return sdkerrors.Wrap(err, "IAVL commit failed") + } + importer.Close() + } + + //appDB.FlushValidators() + //appDB.SaveBlocksTime() + //appDB.SaveVersions() + //appDB.SaveBlocksTime() + // appDB.LoadLatestVersion() + + return nil +} diff --git a/coreV2/appdb/proto/buf.gen.yaml b/coreV2/appdb/proto/buf.gen.yaml new file mode 100644 index 000000000..1e2903a30 --- /dev/null +++ b/coreV2/appdb/proto/buf.gen.yaml @@ -0,0 +1,6 @@ +version: v1beta1 +plugins: + - name: gofast + out: ../types + opt: + - paths=source_relative \ No newline at end of file diff --git a/coreV2/appdb/proto/buf.lock b/coreV2/appdb/proto/buf.lock new file mode 100644 index 000000000..30b0f0847 --- /dev/null +++ b/coreV2/appdb/proto/buf.lock @@ -0,0 +1,10 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: gogo + repository: protobuf + branch: main + commit: 4df00b267f944190a229ce3695781e99 + digest: b1-sjLgsg7CzrkOrIjBDh3s-l0aMjE6oqTj85-OsoopKAw= + create_time: 2021-08-10T00:14:28.345069Z diff --git a/coreV2/appdb/proto/buf.yaml b/coreV2/appdb/proto/buf.yaml new file mode 100644 index 000000000..921b21bb8 --- /dev/null +++ b/coreV2/appdb/proto/buf.yaml @@ -0,0 +1,7 @@ +version: v1beta1 +name: buf.build/minterteam/node-grpc-gateway +deps: + - buf.build/gogo/protobuf +breaking: + use: + - WIRE_JSON \ No newline at end of file diff --git a/coreV2/appdb/proto/snapshot.proto b/coreV2/appdb/proto/snapshot.proto new file mode 100644 index 000000000..59190d470 --- /dev/null +++ b/coreV2/appdb/proto/snapshot.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package core.appdb.snapshot.v1beta1; + +option go_package = "github.com/MinterTeam/minter-go-node/coreV2/appdb/types"; + +import "gogoproto/gogo.proto"; + +// SnapshotItem is an item contained in a rootmulti.Store snapshot. +message SnapshotItem { + // item is the specific type of snapshot item. + oneof item { + SnapshotStoreItem store = 1; + SnapshotIAVLItem iavl = 2 [(gogoproto.customname) = "IAVL"]; + } +} + +// SnapshotStoreItem contains metadata about a snapshotted store. +message SnapshotStoreItem { + string name = 1; + bytes value = 2; +} + +// SnapshotIAVLItem is an exported IAVL node. +message SnapshotIAVLItem { + bytes key = 1; + bytes value = 2; + int64 version = 3; + int32 height = 4; +} \ No newline at end of file diff --git a/coreV2/appdb/types/snapshot.pb.go b/coreV2/appdb/types/snapshot.pb.go new file mode 100644 index 000000000..47bb0348c --- /dev/null +++ b/coreV2/appdb/types/snapshot.pb.go @@ -0,0 +1,1028 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: snapshot.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/golang/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +// SnapshotItem is an item contained in a rootmulti.Store snapshot. +type SnapshotItem struct { + // item is the specific type of snapshot item. + // + // Types that are valid to be assigned to Item: + // *SnapshotItem_Store + // *SnapshotItem_IAVL + Item isSnapshotItem_Item `protobuf_oneof:"item"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SnapshotItem) Reset() { *m = SnapshotItem{} } +func (m *SnapshotItem) String() string { return proto.CompactTextString(m) } +func (*SnapshotItem) ProtoMessage() {} +func (*SnapshotItem) Descriptor() ([]byte, []int) { + return fileDescriptor_0c8aab8e59648e0b, []int{0} +} +func (m *SnapshotItem) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SnapshotItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SnapshotItem.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SnapshotItem) XXX_Merge(src proto.Message) { + xxx_messageInfo_SnapshotItem.Merge(m, src) +} +func (m *SnapshotItem) XXX_Size() int { + return m.Size() +} +func (m *SnapshotItem) XXX_DiscardUnknown() { + xxx_messageInfo_SnapshotItem.DiscardUnknown(m) +} + +var xxx_messageInfo_SnapshotItem proto.InternalMessageInfo + +type isSnapshotItem_Item interface { + isSnapshotItem_Item() + MarshalTo([]byte) (int, error) + Size() int +} + +type SnapshotItem_Store struct { + Store *SnapshotStoreItem `protobuf:"bytes,1,opt,name=store,proto3,oneof" json:"store,omitempty"` +} +type SnapshotItem_IAVL struct { + IAVL *SnapshotIAVLItem `protobuf:"bytes,2,opt,name=iavl,proto3,oneof" json:"iavl,omitempty"` +} + +func (*SnapshotItem_Store) isSnapshotItem_Item() {} +func (*SnapshotItem_IAVL) isSnapshotItem_Item() {} + +func (m *SnapshotItem) GetItem() isSnapshotItem_Item { + if m != nil { + return m.Item + } + return nil +} + +func (m *SnapshotItem) GetStore() *SnapshotStoreItem { + if x, ok := m.GetItem().(*SnapshotItem_Store); ok { + return x.Store + } + return nil +} + +func (m *SnapshotItem) GetIAVL() *SnapshotIAVLItem { + if x, ok := m.GetItem().(*SnapshotItem_IAVL); ok { + return x.IAVL + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*SnapshotItem) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*SnapshotItem_Store)(nil), + (*SnapshotItem_IAVL)(nil), + } +} + +// SnapshotStoreItem contains metadata about a snapshotted store. +type SnapshotStoreItem struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SnapshotStoreItem) Reset() { *m = SnapshotStoreItem{} } +func (m *SnapshotStoreItem) String() string { return proto.CompactTextString(m) } +func (*SnapshotStoreItem) ProtoMessage() {} +func (*SnapshotStoreItem) Descriptor() ([]byte, []int) { + return fileDescriptor_0c8aab8e59648e0b, []int{1} +} +func (m *SnapshotStoreItem) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SnapshotStoreItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SnapshotStoreItem.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SnapshotStoreItem) XXX_Merge(src proto.Message) { + xxx_messageInfo_SnapshotStoreItem.Merge(m, src) +} +func (m *SnapshotStoreItem) XXX_Size() int { + return m.Size() +} +func (m *SnapshotStoreItem) XXX_DiscardUnknown() { + xxx_messageInfo_SnapshotStoreItem.DiscardUnknown(m) +} + +var xxx_messageInfo_SnapshotStoreItem proto.InternalMessageInfo + +func (m *SnapshotStoreItem) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *SnapshotStoreItem) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +// SnapshotIAVLItem is an exported IAVL node. +type SnapshotIAVLItem struct { + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + Version int64 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"` + Height int32 `protobuf:"varint,4,opt,name=height,proto3" json:"height,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SnapshotIAVLItem) Reset() { *m = SnapshotIAVLItem{} } +func (m *SnapshotIAVLItem) String() string { return proto.CompactTextString(m) } +func (*SnapshotIAVLItem) ProtoMessage() {} +func (*SnapshotIAVLItem) Descriptor() ([]byte, []int) { + return fileDescriptor_0c8aab8e59648e0b, []int{2} +} +func (m *SnapshotIAVLItem) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SnapshotIAVLItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SnapshotIAVLItem.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SnapshotIAVLItem) XXX_Merge(src proto.Message) { + xxx_messageInfo_SnapshotIAVLItem.Merge(m, src) +} +func (m *SnapshotIAVLItem) XXX_Size() int { + return m.Size() +} +func (m *SnapshotIAVLItem) XXX_DiscardUnknown() { + xxx_messageInfo_SnapshotIAVLItem.DiscardUnknown(m) +} + +var xxx_messageInfo_SnapshotIAVLItem proto.InternalMessageInfo + +func (m *SnapshotIAVLItem) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +func (m *SnapshotIAVLItem) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +func (m *SnapshotIAVLItem) GetVersion() int64 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *SnapshotIAVLItem) GetHeight() int32 { + if m != nil { + return m.Height + } + return 0 +} + +func init() { + proto.RegisterType((*SnapshotItem)(nil), "core.appdb.snapshot.v1beta1.SnapshotItem") + proto.RegisterType((*SnapshotStoreItem)(nil), "core.appdb.snapshot.v1beta1.SnapshotStoreItem") + proto.RegisterType((*SnapshotIAVLItem)(nil), "core.appdb.snapshot.v1beta1.SnapshotIAVLItem") +} + +func init() { proto.RegisterFile("snapshot.proto", fileDescriptor_0c8aab8e59648e0b) } + +var fileDescriptor_0c8aab8e59648e0b = []byte{ + // 326 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0x41, 0x4a, 0xc3, 0x40, + 0x14, 0x86, 0x3b, 0x36, 0xad, 0xfa, 0x2c, 0x52, 0x87, 0x22, 0x41, 0x21, 0x96, 0xae, 0xba, 0xe9, + 0x84, 0xd6, 0x85, 0x2b, 0x17, 0x76, 0x21, 0x2d, 0xd8, 0xcd, 0x54, 0xba, 0x70, 0x37, 0x69, 0x1f, + 0x49, 0x30, 0xc9, 0x84, 0x64, 0x1a, 0xe8, 0x4d, 0xbc, 0x84, 0xf7, 0x70, 0xe9, 0x09, 0x44, 0xe2, + 0x45, 0x64, 0x26, 0xad, 0x0b, 0x15, 0x71, 0xf7, 0xff, 0xcc, 0xfb, 0xfe, 0xf7, 0xf8, 0x07, 0x8e, + 0xf3, 0x44, 0xa4, 0x79, 0x20, 0x15, 0x4b, 0x33, 0xa9, 0x24, 0x3d, 0x5f, 0xca, 0x0c, 0x99, 0x48, + 0xd3, 0x95, 0xc7, 0xbe, 0x9e, 0x8a, 0xa1, 0x87, 0x4a, 0x0c, 0xcf, 0x3a, 0xbe, 0xf4, 0xa5, 0x99, + 0x73, 0xb5, 0xaa, 0x90, 0xde, 0x33, 0x81, 0xd6, 0x7c, 0x3b, 0x3a, 0x55, 0x18, 0xd3, 0x5b, 0x68, + 0xe4, 0x4a, 0x66, 0x68, 0x93, 0x2e, 0xe9, 0x1f, 0x8d, 0x18, 0xfb, 0x23, 0x93, 0xed, 0xc8, 0xb9, + 0x26, 0x34, 0x3e, 0xa9, 0xf1, 0x0a, 0xa7, 0x33, 0xb0, 0x42, 0x51, 0x44, 0xf6, 0x9e, 0x89, 0x19, + 0xfc, 0x2b, 0x66, 0x7a, 0xb3, 0xb8, 0xd3, 0x29, 0xe3, 0x83, 0xf2, 0xed, 0xc2, 0xd2, 0x6e, 0x52, + 0xe3, 0x26, 0x66, 0xdc, 0x04, 0x2b, 0x54, 0x18, 0xf7, 0xae, 0xe1, 0xe4, 0xc7, 0x52, 0x4a, 0xc1, + 0x4a, 0x44, 0x5c, 0x9d, 0x7c, 0xc8, 0x8d, 0xa6, 0x1d, 0x68, 0x14, 0x22, 0x5a, 0xa3, 0x39, 0xa0, + 0xc5, 0x2b, 0xd3, 0x8b, 0xa0, 0xfd, 0x7d, 0x19, 0x6d, 0x43, 0xfd, 0x11, 0x37, 0x06, 0x6e, 0x71, + 0x2d, 0x7f, 0x67, 0xa9, 0x0d, 0xfb, 0x05, 0x66, 0x79, 0x28, 0x13, 0xbb, 0xde, 0x25, 0xfd, 0x3a, + 0xdf, 0x59, 0x7a, 0x0a, 0xcd, 0x00, 0x43, 0x3f, 0x50, 0xb6, 0xd5, 0x25, 0xfd, 0x06, 0xdf, 0xba, + 0xf1, 0xf4, 0xa5, 0x74, 0xc8, 0x6b, 0xe9, 0x90, 0xf7, 0xd2, 0x21, 0x4f, 0x1f, 0x4e, 0xed, 0xe1, + 0xca, 0x0f, 0x55, 0xb0, 0xf6, 0xd8, 0x52, 0xc6, 0xee, 0x2c, 0x4c, 0x14, 0x66, 0xf7, 0x28, 0x62, + 0x37, 0x36, 0x72, 0xe0, 0xcb, 0x41, 0x22, 0x57, 0xe8, 0xea, 0xae, 0x16, 0x23, 0xd7, 0xb4, 0xe5, + 0xaa, 0x4d, 0x8a, 0xb9, 0xd7, 0x34, 0xdf, 0x75, 0xf9, 0x19, 0x00, 0x00, 0xff, 0xff, 0x1d, 0x5a, + 0x38, 0xfd, 0xf3, 0x01, 0x00, 0x00, +} + +func (m *SnapshotItem) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SnapshotItem) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotItem) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Item != nil { + { + size := m.Item.Size() + i -= size + if _, err := m.Item.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *SnapshotItem_Store) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotItem_Store) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Store != nil { + { + size, err := m.Store.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *SnapshotItem_IAVL) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotItem_IAVL) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.IAVL != nil { + { + size, err := m.IAVL.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *SnapshotStoreItem) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SnapshotStoreItem) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotStoreItem) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SnapshotIAVLItem) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SnapshotIAVLItem) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotIAVLItem) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Height != 0 { + i = encodeVarintSnapshot(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x20 + } + if m.Version != 0 { + i = encodeVarintSnapshot(dAtA, i, uint64(m.Version)) + i-- + dAtA[i] = 0x18 + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintSnapshot(dAtA []byte, offset int, v uint64) int { + offset -= sovSnapshot(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *SnapshotItem) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Item != nil { + n += m.Item.Size() + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SnapshotItem_Store) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Store != nil { + l = m.Store.Size() + n += 1 + l + sovSnapshot(uint64(l)) + } + return n +} +func (m *SnapshotItem_IAVL) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.IAVL != nil { + l = m.IAVL.Size() + n += 1 + l + sovSnapshot(uint64(l)) + } + return n +} +func (m *SnapshotStoreItem) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovSnapshot(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovSnapshot(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SnapshotIAVLItem) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovSnapshot(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovSnapshot(uint64(l)) + } + if m.Version != 0 { + n += 1 + sovSnapshot(uint64(m.Version)) + } + if m.Height != 0 { + n += 1 + sovSnapshot(uint64(m.Height)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovSnapshot(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozSnapshot(x uint64) (n int) { + return sovSnapshot(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *SnapshotItem) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SnapshotItem: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SnapshotItem: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Store", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSnapshot + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &SnapshotStoreItem{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Item = &SnapshotItem_Store{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IAVL", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSnapshot + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &SnapshotIAVLItem{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Item = &SnapshotItem_IAVL{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSnapshot(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSnapshot + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SnapshotStoreItem) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SnapshotStoreItem: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SnapshotStoreItem: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSnapshot + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSnapshot + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSnapshot(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSnapshot + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SnapshotIAVLItem) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SnapshotIAVLItem: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SnapshotIAVLItem: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSnapshot + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSnapshot + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + m.Version = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Version |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipSnapshot(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSnapshot + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipSnapshot(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSnapshot + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSnapshot + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSnapshot + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthSnapshot + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSnapshot + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthSnapshot + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthSnapshot = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSnapshot = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSnapshot = fmt.Errorf("proto: unexpected end of group") +) diff --git a/coreV2/minter/blockchain.go b/coreV2/minter/blockchain.go index 94f779e2c..2dedc237d 100644 --- a/coreV2/minter/blockchain.go +++ b/coreV2/minter/blockchain.go @@ -2,6 +2,9 @@ package minter import ( "context" + "github.com/cosmos/cosmos-sdk/snapshots" + snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" + tmlog "github.com/tendermint/tendermint/libs/log" "log" "math/big" "os" @@ -9,6 +12,8 @@ import ( "sync/atomic" "time" + l "github.com/MinterTeam/minter-go-node/log" + "github.com/MinterTeam/minter-go-node/cmd/utils" "github.com/MinterTeam/minter-go-node/config" "github.com/MinterTeam/minter-go-node/coreV2/appdb" @@ -46,6 +51,8 @@ const votingPowerConsensus = 2. / 3. type Blockchain struct { abciTypes.BaseApplication + logger tmlog.Logger + executor transaction.ExecutorTx statisticData *statistics.Data @@ -78,6 +85,12 @@ type Blockchain struct { grace *upgrades.Grace knownUpdates map[string]struct{} stopOk chan struct{} + + // manages snapshots, i.e. dumps of app state at certain intervals + snapshotManager *snapshots.Manager + snapshotInterval uint64 // block interval between state sync snapshots + snapshotKeepRecent uint32 // recent state sync snapshots to keep + snapshotter snapshottypes.Snapshotter } func (blockchain *Blockchain) GetCurrentRewards() *big.Int { @@ -85,7 +98,7 @@ func (blockchain *Blockchain) GetCurrentRewards() *big.Int { } // NewMinterBlockchain creates Minter Blockchain instance, should be only called once -func NewMinterBlockchain(storages *utils.Storage, cfg *config.Config, ctx context.Context, updateStakePeriod uint64, expiredOrdersPeriod uint64) *Blockchain { +func NewMinterBlockchain(storages *utils.Storage, cfg *config.Config, ctx context.Context, updateStakePeriod uint64, expiredOrdersPeriod uint64, logger tmlog.Logger) *Blockchain { // Initiate Application DB. Used for persisting data like current block, validators, etc. applicationDB := appdb.NewAppDB(storages.GetMinterHome(), cfg) if ctx == nil { @@ -104,7 +117,12 @@ func NewMinterBlockchain(storages *utils.Storage, cfg *config.Config, ctx contex if expiredOrdersPeriod == 0 { expiredOrdersPeriod = types.GetExpireOrdersPeriod() } + if logger == nil { + logger = l.NewLogger(cfg) + } app := &Blockchain{ + logger: logger, + rewardsCounter: rewards.NewReward(), appDB: applicationDB, storages: storages, @@ -174,6 +192,7 @@ func (blockchain *Blockchain) initState() { blockchain.rewards = big.NewInt(0) blockchain.stateDeliver = stateDeliver blockchain.stateCheck = state.NewCheckState(stateDeliver) + blockchain.appDB.SetState(stateDeliver.Tree()) grace := upgrades.NewGrace() grace.AddGracePeriods(upgrades.NewGracePeriod(initialHeight, initialHeight+120, true), @@ -536,8 +555,10 @@ func (blockchain *Blockchain) Commit() abciTypes.ResponseCommit { panic(err) } + height := blockchain.Height() + // Flush events db - err := blockchain.eventsDB.CommitEvents(uint32(blockchain.Height())) + err := blockchain.eventsDB.CommitEvents(uint32(height)) if err != nil { panic(err) } @@ -550,7 +571,7 @@ func (blockchain *Blockchain) Commit() abciTypes.ResponseCommit { // Persist application hash and height blockchain.appDB.SetLastBlockHash(hash) - blockchain.appDB.SetLastHeight(blockchain.Height()) + blockchain.appDB.SetLastHeight(height) blockchain.appDB.FlushValidators() blockchain.appDB.SaveBlocksTime() @@ -563,6 +584,10 @@ func (blockchain *Blockchain) Commit() abciTypes.ResponseCommit { return abciTypes.ResponseCommit{Data: hash} } + if blockchain.snapshotInterval > 0 && height%blockchain.snapshotInterval == 0 { + go blockchain.snapshot(int64(height)) + } + return abciTypes.ResponseCommit{ Data: hash, RetainHeight: 0, diff --git a/coreV2/minter/minter.go b/coreV2/minter/minter.go index f4997731a..dd26184a3 100644 --- a/coreV2/minter/minter.go +++ b/coreV2/minter/minter.go @@ -2,6 +2,7 @@ package minter import ( "fmt" + "github.com/cosmos/cosmos-sdk/snapshots" "log" "math/big" "os" @@ -22,6 +23,17 @@ import ( rpc "github.com/tendermint/tendermint/rpc/client/local" ) +// SetSnapshotStore sets the snapshot store. +func (blockchain *Blockchain) SetSnapshotStore(snapshotStore *snapshots.Store, snapshotInterval, snapshotKeepRecent int) { + if snapshotStore == nil { + blockchain.snapshotManager = nil + return + } + blockchain.snapshotInterval = uint64(snapshotInterval) + blockchain.snapshotKeepRecent = uint32(snapshotKeepRecent) + blockchain.snapshotManager = snapshots.NewManager(snapshotStore, blockchain.appDB) +} + func (blockchain *Blockchain) RpcClient() *rpc.Local { return blockchain.rpcClient } diff --git a/coreV2/minter/minter_test.go b/coreV2/minter/minter_test.go index 3d174673d..56d4996d6 100644 --- a/coreV2/minter/minter_test.go +++ b/coreV2/minter/minter_test.go @@ -56,7 +56,7 @@ func initTestNode(t *testing.T, initialHeight int64) (*Blockchain, *rpc.Local, * ctx, cancelFunc := context.WithCancel(context.Background()) - app := NewMinterBlockchain(storage, minterCfg, ctx, 120, 0) + app := NewMinterBlockchain(storage, minterCfg, ctx, 120, 0, nil) nodeKey, err := p2p.LoadOrGenNodeKey(cfg.NodeKeyFile()) if err != nil { t.Fatal(err) @@ -108,7 +108,12 @@ func initTestNode(t *testing.T, initialHeight int64) (*Blockchain, *rpc.Local, * return app, tmCli, pv, func() { cancelFunc() if err := app.WaitStop(); err != nil { - t.Skip(err) + if err.Error() == "leveldb: closed" { + t.Helper() + t.Log(err) + return + } + t.Error(err) } } } diff --git a/coreV2/minter/snapshots.go b/coreV2/minter/snapshots.go new file mode 100644 index 000000000..058d44141 --- /dev/null +++ b/coreV2/minter/snapshots.go @@ -0,0 +1,161 @@ +package minter + +import ( + "errors" + snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" + abci "github.com/tendermint/tendermint/abci/types" + tmlog "github.com/tendermint/tendermint/libs/log" + "os" +) + +var logger = tmlog.NewTMLogger(os.Stdout) + +func (blockchain *Blockchain) ListSnapshots(req abci.RequestListSnapshots) abci.ResponseListSnapshots { + resp := abci.ResponseListSnapshots{Snapshots: []*abci.Snapshot{}} + if blockchain.snapshotManager == nil { + return resp + } + + snapshots, err := blockchain.snapshotManager.List() + if err != nil { + //blockchain.logger.Error("failed to list snapshots", "err", err) + return resp + } + + for _, snapshot := range snapshots { + abciSnapshot, err := snapshot.ToABCI() + if err != nil { + //blockchain.logger.Error("failed to list snapshots", "err", err) + return resp + } + resp.Snapshots = append(resp.Snapshots, &abciSnapshot) + } + + return resp +} + +func (blockchain *Blockchain) OfferSnapshot(req abci.RequestOfferSnapshot) abci.ResponseOfferSnapshot { + if blockchain.snapshotManager == nil { + //blockchain.logger.Error("snapshot manager not configured") + return abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ABORT} + } + + if req.Snapshot == nil { + //blockchain.logger.Error("received nil snapshot") + return abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT} + } + + snapshot, err := snapshottypes.SnapshotFromABCI(req.Snapshot) + if err != nil { + //blockchain.logger.Error("failed to decode snapshot metadata", "err", err) + return abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT} + } + + err = blockchain.snapshotManager.Restore(snapshot) + switch { + case err == nil: + return abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ACCEPT} + + case errors.Is(err, snapshottypes.ErrUnknownFormat): + return abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT_FORMAT} + + case errors.Is(err, snapshottypes.ErrInvalidMetadata): + blockchain.logger.Error( + "rejecting invalid snapshot", + "height", req.Snapshot.Height, + "format", req.Snapshot.Format, + "err", err, + ) + return abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT} + + default: + blockchain.logger.Error( + "failed to restore snapshot", + "height", req.Snapshot.Height, + "format", req.Snapshot.Format, + "err", err, + ) + + // We currently don't support resetting the IAVL stores and retrying a different snapshot, + // so we ask Tendermint to abort all snapshot restoration. + return abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ABORT} + } +} + +func (blockchain *Blockchain) LoadSnapshotChunk(req abci.RequestLoadSnapshotChunk) abci.ResponseLoadSnapshotChunk { + if blockchain.snapshotManager == nil { + return abci.ResponseLoadSnapshotChunk{} + } + chunk, err := blockchain.snapshotManager.LoadChunk(req.Height, req.Format, req.Chunk) + if err != nil { + //blockchain.logger.Error( + // "failed to load snapshot chunk", + // "height", req.Height, + // "format", req.Format, + // "chunk", req.Chunk, + // "err", err, + //) + return abci.ResponseLoadSnapshotChunk{} + } + return abci.ResponseLoadSnapshotChunk{Chunk: chunk} +} + +func (blockchain *Blockchain) ApplySnapshotChunk(req abci.RequestApplySnapshotChunk) abci.ResponseApplySnapshotChunk { + if blockchain.snapshotManager == nil { + //blockchain.logger.Error("snapshot manager not configured") + return abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ABORT} + } + + _, err := blockchain.snapshotManager.RestoreChunk(req.Chunk) + switch { + case err == nil: + return abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT} + + case errors.Is(err, snapshottypes.ErrChunkHashMismatch): + blockchain.logger.Error( + "chunk checksum mismatch; rejecting sender and requesting refetch", + "chunk", req.Index, + "sender", req.Sender, + "err", err, + ) + return abci.ResponseApplySnapshotChunk{ + Result: abci.ResponseApplySnapshotChunk_RETRY, + RefetchChunks: []uint32{req.Index}, + RejectSenders: []string{req.Sender}, + } + + default: + //blockchain.logger.Error("failed to restore snapshot", "err", err) + return abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ABORT} + } +} + +// snapshot takes a snapshot of the current state and prunes any old snapshottypes. +func (blockchain *Blockchain) snapshot(height int64) { + if blockchain.snapshotManager == nil { + blockchain.logger.Info("snapshot manager not configured") + return + } + + blockchain.logger.Info("creating state snapshot", "height", height) + + snapshot, err := blockchain.snapshotManager.Create(uint64(height)) + if err != nil { + blockchain.logger.Error("failed to create state snapshot", "height", height, "err", err) + return + } + + blockchain.logger.Info("completed state snapshot", "height", height, "format", snapshot.Format) + + if blockchain.snapshotKeepRecent > 0 { + blockchain.logger.Debug("pruning state snapshots") + + pruned, err := blockchain.snapshotManager.Prune(blockchain.snapshotKeepRecent) + if err != nil { + blockchain.logger.Error("Failed to prune state snapshots", "err", err) + return + } + + blockchain.logger.Debug("pruned state snapshots", "pruned", pruned) + } +} diff --git a/go.mod b/go.mod index e5a36f177..8310730ab 100644 --- a/go.mod +++ b/go.mod @@ -4,13 +4,14 @@ go 1.17 require ( github.com/MinterTeam/node-grpc-gateway v1.4.3-0.20211208134306-ae7964561da4 - github.com/btcsuite/btcd v0.21.0-beta + 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 github.com/cosmos/iavl v0.17.3 github.com/go-kit/kit v0.12.0 - github.com/gogo/protobuf v1.3.2 + github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.2 - github.com/gorilla/handlers v1.4.2 + github.com/gorilla/handlers v1.5.1 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.1 @@ -18,11 +19,11 @@ require ( github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.11.0 github.com/rakyll/statik v0.1.7 - github.com/spf13/cobra v1.1.1 - github.com/spf13/viper v1.7.1 + github.com/spf13/cobra v1.2.1 + github.com/spf13/viper v1.8.1 github.com/stretchr/testify v1.7.0 github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca - github.com/tendermint/go-amino v0.15.1 + github.com/tendermint/go-amino v0.16.0 github.com/tendermint/tendermint v0.34.14 github.com/tendermint/tm-db v0.6.4 github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 @@ -34,8 +35,11 @@ require ( google.golang.org/protobuf v1.27.1 ) +//replace github.com/cosmos/cosmos-sdk => github.com/klim0v/cosmos-sdk +replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 + require ( - github.com/DataDog/zstd v1.4.1 // indirect + github.com/DataDog/zstd v1.4.5 // indirect github.com/Workiva/go-datastructures v1.0.52 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash v1.1.0 // indirect @@ -44,9 +48,10 @@ require ( github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgraph-io/badger/v2 v2.2007.2 // indirect - github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de // indirect - github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 // indirect + github.com/dgraph-io/ristretto v0.0.3 // indirect + github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dustin/go-humanize v1.0.0 // indirect + github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.4.9 // indirect github.com/gdamore/encoding v0.0.0-20151215212835-b23993cbb635 // indirect github.com/gdamore/tcell v1.1.0 // indirect @@ -61,10 +66,9 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/kr/text v0.2.0 // indirect github.com/libp2p/go-buffer-pool v0.0.2 // indirect github.com/lucasb-eyer/go-colorful v0.0.0-20180709185858-c7842319cf3a // indirect - github.com/magiconair/properties v1.8.1 // indirect + github.com/magiconair/properties v1.8.5 // indirect github.com/mattn/go-colorable v0.1.8 // indirect github.com/mattn/go-isatty v0.0.14 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect @@ -74,9 +78,7 @@ require ( github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/go-wordwrap v1.0.0 // indirect github.com/mitchellh/mapstructure v1.4.2 // indirect - github.com/onsi/ginkgo v1.16.2 // indirect - github.com/onsi/gomega v1.13.0 // indirect - github.com/pelletier/go-toml v1.2.0 // indirect + github.com/pelletier/go-toml v1.9.3 // indirect github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pkg/term v1.1.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -89,9 +91,9 @@ require ( github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect github.com/sirupsen/logrus v1.8.1 // indirect - github.com/spf13/afero v1.1.2 // indirect - github.com/spf13/cast v1.3.0 // indirect - github.com/spf13/jwalterweatherman v1.0.0 // indirect + github.com/spf13/afero v1.6.0 // indirect + github.com/spf13/cast v1.3.1 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.2.0 // indirect github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect @@ -99,7 +101,7 @@ require ( golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b // indirect golang.org/x/text v0.3.7 // indirect google.golang.org/genproto v0.0.0-20211207154714-918901c715cf // indirect - gopkg.in/ini.v1 v1.51.0 // indirect + gopkg.in/ini.v1 v1.62.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/go.sum b/go.sum index 0832aa622..8e24d41ba 100644 --- a/go.sum +++ b/go.sum @@ -14,6 +14,11 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -33,17 +38,34 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +filippo.io/edwards25519 v1.0.0-beta.2 h1:/BZRNzm8N4K4eWfK28dL4yescorxtO7YG1yun8fy+pI= +filippo.io/edwards25519 v1.0.0-beta.2/go.mod h1:X+pm78QAUPtFLi1z9PYIlS/bdDnvbCOGKtZ+ACWEf7o= +github.com/99designs/keyring v1.1.6 h1:kVDC2uCgVwecxCk+9zoCt2uEL6dt+dfVzMvGgnVcIuM= +github.com/99designs/keyring v1.1.6/go.mod h1:16e0ds7LGQQcT59QqkTg72Hh5ShM51Byv5PEmW6uoRU= +github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= +github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= +github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.4.1 h1:3oxKN3wbHibqx897utPC2LTQU4J+IHWWJO+glkAkpFM= github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= +github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= +github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= @@ -60,10 +82,13 @@ github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= 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/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/VictoriaMetrics/fastcache v1.5.7/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/Workiva/go-datastructures v1.0.52 h1:PLSK6pwn8mYdaoaCZEMsXBpBotr4HHn9abU0yMQt0NI= github.com/Workiva/go-datastructures v1.0.52/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= +github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= github.com/adlio/schema v1.1.13 h1:LeNMVg5Z1FX+Qgz8tJUijBLRdcpbFUElz+d1489On98= github.com/adlio/schema v1.1.13/go.mod h1:L5Z7tw+7lRK1Fnpi/LT/ooCP1elkXn0krMWBQHUhEDE= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= @@ -74,17 +99,21 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-metrics v0.3.9 h1:O2sNqxBdvq8Eq5xmzljcYzAORli6RWCvEym4cJf9m18= github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= @@ -96,16 +125,25 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= +github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= +github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnCiweXmzRIAiUWCInVmPgjkzgv5k4tVyXiQ= +github.com/btcsuite/btcd v0.0.0-20190115013929-ed77733ec07d/go.mod h1:d3C0AkH6BRcvO8T0UEPu53cnw4IbV63x1bEjildYhO0= +github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= -github.com/btcsuite/btcd v0.21.0-beta h1:At9hIZdJW0s9E/fAz28nrz6AmcNlSVucCH796ZteX1M= github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= +github.com/btcsuite/btcd v0.22.0-beta h1:LTDpDKUM5EeOFBPM8IXpinEcmZ6FWfNZbE3lfrfdnWo= +github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= +github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= +github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v1.0.2 h1:9iZ1Terx9fMIOtq1VrwdqfsATL9MC2l8ZrUY6YZ2uts= github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= +github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce h1:YtWJF7RHm2pYCvA5t0RPmAaLUhREsKuKd+SLhxFbFeQ= +github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= @@ -121,6 +159,7 @@ github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEe github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -136,7 +175,9 @@ github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= @@ -145,6 +186,7 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/coinbase/rosetta-sdk-go v0.6.10/go.mod h1:J/JFMsfcePrjJZkwQFLh+hJErkAmdm9Iyy3D5Y0LfXo= github.com/confio/ics23/go v0.6.3/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= github.com/confio/ics23/go v0.6.6 h1:pkOy18YxxJ/r0XFDCnrl4Bjv6h4LkBSpLS6F38mrKL8= github.com/confio/ics23/go v0.6.6/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= @@ -163,11 +205,20 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7 github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d h1:49RLWk1j44Xu4fjHb6JFYmeUnDORVwHNkDxaQ0ctCVU= +github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= +github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= +github.com/cosmos/cosmos-sdk v0.44.5 h1:t5h+KPzZb0Zsag1RP1DCMQlyJyIQqJcqSPJrbUCDGHY= +github.com/cosmos/cosmos-sdk v0.44.5/go.mod h1:maUA6m2TBxOJZkbwl0eRtEBgTX37kcaiOWU5t1HEGaY= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= +github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= +github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/iavl v0.15.3/go.mod h1:OLjQiAQ4fGD2KDZooyJG9yz+p2ao2IAYSbke8mVvSA4= github.com/cosmos/iavl v0.17.3 h1:s2N819a2olOmiauVa0WAhoIJq9EhSXE9HDBAoR9k+8Y= github.com/cosmos/iavl v0.17.3/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w= +github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4= +github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= +github.com/cosmos/ledger-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI= +github.com/cosmos/ledger-go v0.9.2/go.mod h1:oZJ2hHAZROdlHiwTg4t7kP+GKIIkBT+o6c9QWFanOyI= github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= @@ -176,48 +227,68 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= +github.com/danieljoos/wincred v1.0.2 h1:zf4bhty2iLuwgjgpraD2E9UbvO+fe54XXGJbOwe23fU= +github.com/danieljoos/wincred v1.0.2/go.mod h1:SnuYRW9lp1oJrZX/dXJqr0cPK5gYXqx3EJbmjhLdK9U= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= +github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.2 h1:EjjK0KqwaFMlPin1ajhP943VPENHJdEz1KLIegjaI3k= github.com/dgraph-io/badger/v2 v2.2007.2/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= -github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de h1:t0UHb5vdojIDUqktM6+xJAfScFBsVpXZmqC9dsgJmeA= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgraph-io/ristretto v0.0.3 h1:jh22xisGBjrEVnRZ1DVTpBVQm0Xndu8sMl0CWDzSIBI= +github.com/dgraph-io/ristretto v0.0.3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= +github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b h1:HBah4D48ypg3J7Np4N+HY/ZR76fx3HEUGxDU6Uk39oQ= +github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b/go.mod h1:7BvyPhdbLxMXIYTFPLsyJRFMsKmOZnQmzh6Gb+uquuM= +github.com/dvyukov/go-fuzz v0.0.0-20200318091601-be3528f3a813/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/ethereum/go-ethereum v1.9.25/go.mod h1:vMkFiYLHI4tgPw4k2j4MHKoovchFE8plZ0M9VMk4/oM= github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51 h1:0JZ+dUmQeA8IIVUMzysrX4/AKuQwWhV2dYQuPZdvdSQ= github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 h1:E2s37DuLxFhQDg5gKsWoLBOB0n+ZW8s599zru8FJ2/Y= github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= +github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= 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/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= +github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= @@ -228,11 +299,14 @@ github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM 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/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/gdamore/encoding v0.0.0-20151215212835-b23993cbb635 h1:hheUEMzaOie/wKeIc1WPa7CDVuIO5hqQxjS+dwTQEnI= github.com/gdamore/encoding v0.0.0-20151215212835-b23993cbb635/go.mod h1:yrQYJKKDTrHmbYxI7CYi+/hbdiDT2m4Hj+t0ikCjsrQ= github.com/gdamore/tcell v1.1.0 h1:RbQgl7jukmdqROeNcKps7R2YfDCQbWkOd1BwdXrxfr4= github.com/gdamore/tcell v1.1.0/go.mod h1:tqyG50u7+Ctv1w5VX67kLzKcj9YXR/JSBZQq/+mLl1A= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -249,19 +323,25 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-zookeeper/zk v1.0.2/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= +github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= +github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= +github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -280,6 +360,8 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -296,10 +378,12 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.3-0.20201103224600-674baa8c7fc3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -312,16 +396,19 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa h1:Q75Upo5UN4JbPFURXZ8nLKYUvF85dyFRop/vQ0Rv+64= +github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -331,24 +418,35 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e h1:JKmoR8x90Iww1ks85zJ1lfDGgIiMDuIptTOhJq+zKyg= github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v1.4.2 h1:0QniY0USkHQ1RGCLfKxeNHK9bkDHGRYGNDFBCS+YARg= -github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= +github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= +github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= +github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= @@ -363,6 +461,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4 github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.1 h1:p5m7GOEGXyoq6QWl4/RRMsQ6tWbTpbQmAnkxXgWSprY= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.1/go.mod h1:8ZeZajTed/blCOHBbj8Fss8bPHiFKcmJJzuIbUtFCAo= +github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= +github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= @@ -381,6 +481,7 @@ github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/S github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= @@ -396,6 +497,7 @@ github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= @@ -406,16 +508,27 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= +github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87 h1:uUjLpLt6bVvZ72SQc/B4dXcPBw4Vgd7soowdRl52qEM= +github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87/go.mod h1:XGsKKeXxeRr95aEOgipvluMPlgjr7dGlk9ZTWOjcUcg= +github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= 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/hudl/fargo v1.4.0/go.mod h1:9Ai6uvFy5fQNq6VPKtg+Ceq1+eTY4nKUlR2JElEOcDo= +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= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/improbable-eng/grpc-web v0.14.1/go.mod h1:zEjGHa8DAlkoOXmswrNvhUGEYQA9UI7DhrGeHR1DMGU= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jhump/protoreflect v1.9.0/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= @@ -436,18 +549,23 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d h1:Z+RDyXzjKE0i2sTjZ/b1uxiGtPhFy34Ou/Tk0qwN0kM= +github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNrCn9otv/2QP4D7SMJBgaleKpOf66PnW6F5WGNRIc= 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.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= 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= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -458,28 +576,37 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.0.2 h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= 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/lucasb-eyer/go-colorful v0.0.0-20180709185858-c7842319cf3a h1:B2QfFRl5yGVGGcyEVFzfdXlC1BBvszsIAsCeef2oD0k= github.com/lucasb-eyer/go-colorful v0.0.0-20180709185858-c7842319cf3a/go.mod h1:NXg0ArsFk0Y01623LgUqoqcouGDB+PwCCQlrwrG6xJ4= +github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/marcusolsson/tui-go v0.4.0 h1:PZD0lIS+2OUKxs71qsc5U/P+eVU39FeBRgdsh5iQZ28= github.com/marcusolsson/tui-go v0.4.0/go.mod h1:vp1U15jwzYTPWex1hV+CZ7MeQQH7Wr73fz9hc/0I9YI= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= +github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= @@ -488,6 +615,7 @@ github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9 github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= @@ -506,6 +634,7 @@ github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLT github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= @@ -514,6 +643,8 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.2 h1:6h7AQ0yhTcIsmFmnAwQls75jp2Gzs4iB8W7pjMO+rqo= github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= @@ -523,8 +654,13 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= +github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= +github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= +github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= +github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q= @@ -538,7 +674,9 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/neilotoole/errgroup v0.1.5/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= @@ -546,12 +684,15 @@ github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtb github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.2 h1:HFB2fbVIlhIfCfOW81bZFbiC/RvnpXSdhbF2/DJr134= github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= @@ -581,14 +722,22 @@ github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnh github.com/openzipkin/zipkin-go v0.2.5/go.mod h1:KpXfKdgRDnnhsxw4pNIH9Md5lyFqKUa4YDFlwRYAMyE= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= +github.com/otiai10/copy v1.6.0/go.mod h1:XWfuS3CrI0R6IE0FbgHsEazaXO8G0LpMp9o8tos0x4E= +github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= +github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= +github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= +github.com/otiai10/mint v1.3.2/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ= +github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/performancecopilot/speed/v4 v4.0.0/go.mod h1:qxrSyuDGrTOWfV+uKRFhfxw6h/4HXRGUiZiufxo49BM= +github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= @@ -599,6 +748,7 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/term v1.1.0 h1:xIAAdCMh3QIAy+5FrE8Ad8XoDhEU4ufwbaSozViP9kk= github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -630,7 +780,9 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.30.0 h1:JEkYlQnpzrzQFxi6gnukFPdQ+ac82oRhzMcIduJu/Ug= github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -640,23 +792,34 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg= +github.com/regen-network/cosmos-proto v0.3.1/go.mod h1:jO0sVX6a1B36nmE8C9xBFXpNwWejXC7QqCOnH3O0+YM= +github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= +github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= +github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/zerolog v1.23.0/go.mod h1:6c7hFfxPOy7TacJc4Fcdi24/J0NKYGzjG8FWRI916Qo= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= @@ -667,6 +830,8 @@ github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa h1:0U2s5loxr github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= +github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= +github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -687,17 +852,21 @@ github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= +github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= -github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= +github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= +github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -705,16 +874,21 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/spf13/viper v1.8.1 h1:Kq1fyeebqsBfbjZj4EL7gj2IO0mMaiyjYUWcUsl2O44= +github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= +github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= +github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw= +github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/streadway/handy v0.0.0-20200128134331-0f66f006fb2e/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -729,18 +903,30 @@ github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca h1:Ld/zXl5t4+D6 github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= -github.com/tendermint/go-amino v0.15.1 h1:D2uk35eT4iTsvJd9jWIetzthE5C0/k2QmMFkCN+4JgQ= -github.com/tendermint/go-amino v0.15.1/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= +github.com/tendermint/btcd v0.1.1 h1:0VcxPfflS2zZ3RiOAHkBiFUcPvbtRj5O7zHmcJWHV7s= +github.com/tendermint/btcd v0.1.1/go.mod h1:DC6/m53jtQzr/NFmMNEu0rxf18/ktVoVtMrnDD5pN+U= +github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RMWx1aInLzndwxKalgi5rTqgfXxOxbEI= +github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk= +github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= +github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tendermint/tm-db v0.6.3/go.mod h1:lfA1dL9/Y/Y8wwyPp2NMLyn5P5Ptr/gvDFNWtrCWSf8= github.com/tendermint/tm-db v0.6.4 h1:3N2jlnYQkXNQclQwd/eKV/NzlqPlfK21cpRRIx80XXQ= github.com/tendermint/tm-db v0.6.4/go.mod h1:dptYhIpJ2M5kUuenLr+Yyf3zQOv1SgBZcl8/BmWlMBw= +github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= +github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tidwall/sjson v1.1.4/go.mod h1:wXpKXu8CtDjKAZ+3DrKY5ROCorDFahq8l0tey/Lx1fg= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 h1:uruHq4dN7GR16kFc5fp3d1RIYzJW5onx8Ybykw2YQFA= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= +github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= @@ -748,13 +934,19 @@ github.com/urfave/cli/v2 v2.0.0 h1:+HU9SCbu8GnEUFtIBfuUNXN39ofWViIEJIp6SURMpCg= github.com/urfave/cli/v2 v2.0.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= +github.com/vmihailenco/msgpack/v5 v5.1.4/go.mod h1:C5gboKD0TJPqWDTVTtrQNfRbiBwHZGo8UTqP/9/XvLI= +github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8= +github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0= @@ -771,6 +963,7 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -793,9 +986,12 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -803,9 +999,12 @@ golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210915214749-c084706c2272/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211202192323-5770296d904e h1:MUP6MR3rJ7Gk9LEia0LP2ytiH6MuCfs7qYz+47jGdD8= golang.org/x/crypto v0.0.0-20211202192323-5770296d904e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= @@ -815,6 +1014,7 @@ golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= @@ -836,20 +1036,26 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mobile v0.0.0-20200801112145-973feb4309de/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -886,10 +1092,15 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -904,6 +1115,13 @@ golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -939,6 +1157,7 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -974,14 +1193,23 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200918174421-af09f7315aff/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -996,12 +1224,14 @@ golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211205182925-97ca703d548d h1:FjkYO/PPp4Wi0EAUOVLxePm7qVW4r4ctbWpURyuOD0E= golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= @@ -1012,11 +1242,9 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -1045,6 +1273,7 @@ golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1059,13 +1288,22 @@ golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWc golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/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-20200717024301-6ddee64345a6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1094,6 +1332,12 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1101,6 +1345,7 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1123,6 +1368,7 @@ google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -1134,8 +1380,20 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211207154714-918901c715cf h1:PSEM+IQFb9xdsj2CGhfqUTfsZvF8DScCVP1QZb2IiTQ= @@ -1158,10 +1416,14 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= @@ -1178,6 +1440,7 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= @@ -1196,11 +1459,15 @@ gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU= +gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= +gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1224,6 +1491,7 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= diff --git a/tests/helpers_test.go b/tests/helpers_test.go index 244e719cf..a944d42f7 100644 --- a/tests/helpers_test.go +++ b/tests/helpers_test.go @@ -33,7 +33,7 @@ func CreateApp(state types.AppState) *minter.Blockchain { cfg := config.GetConfig(storage.GetMinterHome()) cfg.DBBackend = "memdb" - app := minter.NewMinterBlockchain(storage, cfg, nil, updateStakePeriod, expiredOrdersPeriod) + app := minter.NewMinterBlockchain(storage, cfg, nil, updateStakePeriod, expiredOrdersPeriod, nil) var updates []tmTypes.ValidatorUpdate for _, validator := range state.Validators { updates = append(updates, tmTypes.Ed25519ValidatorUpdate(validator.PubKey.Bytes(), 1)) diff --git a/tree/tree.go b/tree/tree.go index bde8a674e..66a67cc81 100644 --- a/tree/tree.go +++ b/tree/tree.go @@ -1,6 +1,7 @@ package tree import ( + "fmt" "sync" "github.com/cosmos/iavl" @@ -19,6 +20,9 @@ type MTree interface { GetLastImmutable() *iavl.ImmutableTree GetImmutableAtHeight(version int64) (*iavl.ImmutableTree, error) + Export(version int64) (*iavl.Exporter, error) + Import(version int64) (*iavl.Importer, error) + DeleteVersion(version int64) error DeleteVersionsRange(fromVersion, toVersion int64) error @@ -54,6 +58,24 @@ func (t *mutableTree) Commit(savers ...saver) (hash []byte, version int64, err e return hash, version, err } + +// Import imports an IAVL tree at the given version, returning an iavl.Importer for importing. +func (t *mutableTree) Import(version int64) (*iavl.Importer, error) { + return t.tree.Import(version) +} + +// Exports the IAVL store at the given version, returning an iavl.Exporter for the tree. +func (t *mutableTree) Export(version int64) (*iavl.Exporter, error) { + itree, err := t.GetImmutableAtHeight(version) + if err != nil { + return nil, fmt.Errorf("iavl export failed for version %v: %w", version, err) + } + if itree == nil { + return nil, fmt.Errorf("iavl export failed: unable to fetch tree for version %v", version) + } + return itree.Export(), nil +} + func (t *mutableTree) MutableTree() *iavl.MutableTree { return t.tree } From 0c54acb8bdae27fcfc7c8a5a247fe0559c73f8c3 Mon Sep 17 00:00:00 2001 From: klim0v Date: Wed, 15 Dec 2021 01:45:58 +0300 Subject: [PATCH 08/39] waiting completed snapshots --- coreV2/minter/blockchain.go | 1 + coreV2/minter/minter.go | 1 + coreV2/minter/snapshots.go | 8 ++++++++ version/version.go | 2 +- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/coreV2/minter/blockchain.go b/coreV2/minter/blockchain.go index 2dedc237d..09296d9f2 100644 --- a/coreV2/minter/blockchain.go +++ b/coreV2/minter/blockchain.go @@ -91,6 +91,7 @@ type Blockchain struct { snapshotInterval uint64 // block interval between state sync snapshots snapshotKeepRecent uint32 // recent state sync snapshots to keep snapshotter snapshottypes.Snapshotter + wgSnapshot sync.WaitGroup } func (blockchain *Blockchain) GetCurrentRewards() *big.Int { diff --git a/coreV2/minter/minter.go b/coreV2/minter/minter.go index dd26184a3..463fafad8 100644 --- a/coreV2/minter/minter.go +++ b/coreV2/minter/minter.go @@ -74,6 +74,7 @@ func (blockchain *Blockchain) stop() { func (blockchain *Blockchain) WaitStop() error { defer close(blockchain.stopOk) blockchain.tmNode.Wait() + blockchain.wgSnapshot.Wait() return blockchain.Close() } diff --git a/coreV2/minter/snapshots.go b/coreV2/minter/snapshots.go index 058d44141..25d671d48 100644 --- a/coreV2/minter/snapshots.go +++ b/coreV2/minter/snapshots.go @@ -137,6 +137,14 @@ func (blockchain *Blockchain) snapshot(height int64) { return } + if blockchain.stopped { + blockchain.logger.Info("node stopped, snapshot skipped", "height", height) + return + } + + blockchain.wgSnapshot.Add(1) + defer blockchain.wgSnapshot.Done() + blockchain.logger.Info("creating state snapshot", "height", height) snapshot, err := blockchain.snapshotManager.Create(uint64(height)) diff --git a/version/version.go b/version/version.go index 4819352e4..d7dbacdc2 100755 --- a/version/version.go +++ b/version/version.go @@ -7,7 +7,7 @@ const ( var ( // Version must be a string because scripts like dist.sh read this file. - Version = "2.6.0" + Version = "2.6.1" // GitCommit is the current HEAD set using ldflags. GitCommit string From 30a59fb068532ab50397a64447a7cf9ba5626c48 Mon Sep 17 00:00:00 2001 From: klim0v Date: Wed, 15 Dec 2021 03:55:53 +0300 Subject: [PATCH 09/39] waiting completed snapshots --- config/toml.go | 4 +- coreV2/appdb/appdb.go | 105 +++++++++++++++++++++++++++++++----------- 2 files changed, 81 insertions(+), 28 deletions(-) diff --git a/config/toml.go b/config/toml.go index f9dbb6da5..14026bbfa 100644 --- a/config/toml.go +++ b/config/toml.go @@ -104,9 +104,9 @@ api_simultaneous_requests = {{ .BaseConfig.APISimultaneousRequests }} fast_sync = {{ .BaseConfig.FastSync }} # State sync snapshot interval -snapshot_interval = {{ .BaseConfig.SnapshotInterval }} +snapshot_interval = {{ .BaseConfig.SnapshotInterval }} # State sync snapshot to keep -snapshot_keep_recent = {{ .BaseConfig.SnapshotKeepRecent }} +snapshot_keep_recent = {{ .BaseConfig.SnapshotKeepRecent }} # Database backend: leveldb | memdb db_backend = "{{ .BaseConfig.DBBackend }}" diff --git a/coreV2/appdb/appdb.go b/coreV2/appdb/appdb.go index 351574eca..c67d41357 100644 --- a/coreV2/appdb/appdb.go +++ b/coreV2/appdb/appdb.go @@ -8,11 +8,12 @@ import ( "github.com/MinterTeam/minter-go-node/tree" "github.com/cosmos/cosmos-sdk/snapshots" snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" + "sync" + //"github.com/cosmos/cosmos-sdk/store/iavl" "github.com/cosmos/iavl" "github.com/MinterTeam/minter-go-node/coreV2/appdb/types" - sdktypes "github.com/cosmos/cosmos-sdk/store/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" iavltree "github.com/cosmos/iavl" protoio "github.com/gogo/protobuf/io" @@ -40,9 +41,9 @@ const ( // AppDB is responsible for storing basic information about app state on disk type AppDB struct { db db.DB + mu sync.RWMutex - store tree.MTree - keysByName map[string]sdktypes.StoreKey + store tree.MTree startHeight uint64 lastHeight uint64 @@ -63,6 +64,9 @@ func (appDB *AppDB) Close() error { // GetLastBlockHash returns latest block hash stored on disk func (appDB *AppDB) GetLastBlockHash() []byte { + appDB.mu.RLock() + defer appDB.mu.RUnlock() + rawHash, err := appDB.db.Get([]byte(hashPath)) if err != nil { panic(err) @@ -79,6 +83,9 @@ func (appDB *AppDB) GetLastBlockHash() []byte { // SetLastBlockHash stores given block hash on disk, panics on error func (appDB *AppDB) SetLastBlockHash(hash []byte) { + appDB.mu.Lock() + defer appDB.mu.Unlock() + if err := appDB.db.Set([]byte(hashPath), hash); err != nil { panic(err) } @@ -91,6 +98,9 @@ func (appDB *AppDB) GetLastHeight() uint64 { return val } + appDB.mu.RLock() + defer appDB.mu.RUnlock() + result, err := appDB.db.Get([]byte(heightPath)) if err != nil { panic(err) @@ -108,6 +118,10 @@ func (appDB *AppDB) GetLastHeight() uint64 { func (appDB *AppDB) SetLastHeight(height uint64) { h := make([]byte, 8) binary.BigEndian.PutUint64(h, height) + + appDB.mu.Lock() + defer appDB.mu.Unlock() + if err := appDB.db.Set([]byte(heightPath), h); err != nil { panic(err) } @@ -124,6 +138,10 @@ func (appDB *AppDB) SetStartHeight(height uint64) { func (appDB *AppDB) SaveStartHeight() { h := make([]byte, 8) binary.BigEndian.PutUint64(h, atomic.LoadUint64(&appDB.startHeight)) + + appDB.mu.Lock() + defer appDB.mu.Unlock() + if err := appDB.db.Set([]byte(startHeightPath), h); err != nil { panic(err) } @@ -135,6 +153,10 @@ func (appDB *AppDB) GetStartHeight() uint64 { if val != 0 { return val } + + appDB.mu.RLock() + defer appDB.mu.RUnlock() + result, err := appDB.db.Get([]byte(startHeightPath)) if err != nil { panic(err) @@ -154,6 +176,9 @@ func (appDB *AppDB) GetValidators() abcTypes.ValidatorUpdates { return appDB.validators } + appDB.mu.RLock() + defer appDB.mu.RUnlock() + result, err := appDB.db.Get([]byte(validatorsPath)) if err != nil { panic(err) @@ -188,6 +213,9 @@ func (appDB *AppDB) FlushValidators() { panic(err) } + appDB.mu.Lock() + defer appDB.mu.Unlock() + if err := appDB.db.Set([]byte(validatorsPath), data); err != nil { panic(err) } @@ -199,6 +227,10 @@ const BlocksTimeCount = 4 // GetLastBlockTimeDelta returns delta of time between latest blocks func (appDB *AppDB) GetLastBlockTimeDelta() (sumTimes int, count int) { if len(appDB.lastTimeBlocks) == 0 { + + appDB.mu.RLock() + defer appDB.mu.RUnlock() + result, err := appDB.db.Get([]byte(blocksTimePath)) if err != nil { panic(err) @@ -232,6 +264,10 @@ func calcBlockDelta(times []uint64) (sumTimes int, num int) { func (appDB *AppDB) AddBlocksTime(time time.Time) { if len(appDB.lastTimeBlocks) == 0 { + + appDB.mu.RLock() + defer appDB.mu.RUnlock() + result, err := appDB.db.Get([]byte(blocksTimePath)) if err != nil { panic(err) @@ -257,6 +293,9 @@ func (appDB *AppDB) SaveBlocksTime() { panic(err) } + appDB.mu.Lock() + defer appDB.mu.Unlock() + if err := appDB.db.Set([]byte(blocksTimePath), data); err != nil { panic(err) } @@ -291,6 +330,10 @@ func (appDB *AppDB) GetVersionHeight(name string) uint64 { func (appDB *AppDB) GetVersions() []*Version { if len(appDB.versions) == 0 { + + appDB.mu.RLock() + defer appDB.mu.RUnlock() + result, err := appDB.db.Get([]byte(versionsPath)) if err != nil { panic(err) @@ -301,7 +344,6 @@ func (appDB *AppDB) GetVersions() []*Version { panic(err) } } - // appDB.version = appDB.versions[len(appDB.versions)-1] } return appDB.versions @@ -328,6 +370,9 @@ func (appDB *AppDB) SaveVersions() { panic(err) } + appDB.mu.Lock() + defer appDB.mu.Unlock() + if err := appDB.db.Set([]byte(versionsPath), data); err != nil { panic(err) } @@ -375,10 +420,30 @@ func (appDB *AppDB) Snapshot(height uint64, format uint32) (<-chan io.ReadCloser if height == 0 { return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "cannot snapshot height 0") } - if height > uint64(appDB.GetLastHeight()) { + if height > appDB.GetLastHeight() { return nil, sdkerrors.Wrapf(sdkerrors.ErrLogic, "cannot snapshot future height %v", height) } + var results []*types.SnapshotItem + + appDB.mu.RLock() + for _, name := range []string{validatorsPath, heightPath, hashPath, versionsPath, blocksTimePath, startHeightPath} { + result, err := appDB.db.Get([]byte(name)) + if err != nil { + panic(err) + } + + results = append(results, &types.SnapshotItem{ + Item: &types.SnapshotItem_Store{ + Store: &types.SnapshotStoreItem{ + Name: name, + Value: result, + }, + }, + }) + } + appDB.mu.RUnlock() + // Spawn goroutine to generate snapshot chunks and pass their io.ReadClosers through a channel ch := make(chan io.ReadCloser) go func() { @@ -410,6 +475,14 @@ func (appDB *AppDB) Snapshot(height uint64, format uint32) (<-chan io.ReadCloser }() { + for _, s := range results { + err = protoWriter.WriteMsg(s) + if err != nil { + chunkWriter.CloseWithError(err) + return + } + } + // Export each IAVL store. Stores are serialized as a stream of SnapshotItem Protobuf // messages. The first item contains a SnapshotStore with store metadata (i.e. name), // and the following messages contain a SnapshotNode (i.e. an ExportNode). Store changes @@ -458,26 +531,6 @@ func (appDB *AppDB) Snapshot(height uint64, format uint32) (<-chan io.ReadCloser } exporter.Close() } - - for _, name := range []string{validatorsPath, heightPath, hashPath, versionsPath, blocksTimePath} { - result, err := appDB.db.Get([]byte(name)) - if err != nil { - panic(err) - } - - err = protoWriter.WriteMsg(&types.SnapshotItem{ - Item: &types.SnapshotItem_Store{ - Store: &types.SnapshotStoreItem{ - Name: name, - Value: result, - }, - }, - }) - if err != nil { - chunkWriter.CloseWithError(err) - return - } - } }() return ch, nil @@ -550,7 +603,7 @@ func (appDB *AppDB) Restore( } defer importer.Close() - case validatorsPath, heightPath, hashPath, versionsPath, blocksTimePath: + case validatorsPath, heightPath, hashPath, versionsPath, blocksTimePath, startHeightPath: if err := appDB.db.Set([]byte(item.Store.Name), item.Store.Value); err != nil { panic(err) } From 09b63338a15460040917bdd3b6c13ef6ca947169 Mon Sep 17 00:00:00 2001 From: klim0v Date: Wed, 15 Dec 2021 04:06:32 +0300 Subject: [PATCH 10/39] refactor mu --- coreV2/appdb/appdb.go | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/coreV2/appdb/appdb.go b/coreV2/appdb/appdb.go index c67d41357..041e6ece4 100644 --- a/coreV2/appdb/appdb.go +++ b/coreV2/appdb/appdb.go @@ -93,14 +93,16 @@ func (appDB *AppDB) SetLastBlockHash(hash []byte) { // GetLastHeight returns latest block height stored on disk func (appDB *AppDB) GetLastHeight() uint64 { + appDB.mu.RLock() + defer appDB.mu.RUnlock() + return appDB.getLastHeight() +} +func (appDB *AppDB) getLastHeight() uint64 { val := atomic.LoadUint64(&appDB.lastHeight) if val != 0 { return val } - appDB.mu.RLock() - defer appDB.mu.RUnlock() - result, err := appDB.db.Get([]byte(heightPath)) if err != nil { panic(err) @@ -417,16 +419,20 @@ func (appDB *AppDB) Snapshot(height uint64, format uint32) (<-chan io.ReadCloser if format != snapshottypes.CurrentFormat { return nil, sdkerrors.Wrapf(snapshottypes.ErrUnknownFormat, "format %v", format) } - if height == 0 { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "cannot snapshot height 0") - } - if height > appDB.GetLastHeight() { + + var results []*types.SnapshotItem + appDB.mu.RLock() + + if height != appDB.getLastHeight() { + appDB.mu.RUnlock() return nil, sdkerrors.Wrapf(sdkerrors.ErrLogic, "cannot snapshot future height %v", height) } - var results []*types.SnapshotItem + if height == 0 { + appDB.mu.RUnlock() + return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "cannot snapshot height 0") + } - appDB.mu.RLock() for _, name := range []string{validatorsPath, heightPath, hashPath, versionsPath, blocksTimePath, startHeightPath} { result, err := appDB.db.Get([]byte(name)) if err != nil { From ee3abfc56b0ad2c348c41a302ac7a04fba3ce77f Mon Sep 17 00:00:00 2001 From: klim0v Date: Wed, 15 Dec 2021 04:26:53 +0300 Subject: [PATCH 11/39] refactor mu --- coreV2/appdb/appdb.go | 63 ++++++++++++++++++------------------- coreV2/minter/blockchain.go | 3 +- coreV2/minter/snapshots.go | 5 --- 3 files changed, 32 insertions(+), 39 deletions(-) diff --git a/coreV2/appdb/appdb.go b/coreV2/appdb/appdb.go index 041e6ece4..0b839f71f 100644 --- a/coreV2/appdb/appdb.go +++ b/coreV2/appdb/appdb.go @@ -41,7 +41,8 @@ const ( // AppDB is responsible for storing basic information about app state on disk type AppDB struct { db db.DB - mu sync.RWMutex + //mu sync.RWMutex + WG sync.WaitGroup store tree.MTree @@ -64,8 +65,8 @@ func (appDB *AppDB) Close() error { // GetLastBlockHash returns latest block hash stored on disk func (appDB *AppDB) GetLastBlockHash() []byte { - appDB.mu.RLock() - defer appDB.mu.RUnlock() + // appDB.mu.RLock() + // defer appDB.mu.RUnlock() rawHash, err := appDB.db.Get([]byte(hashPath)) if err != nil { @@ -83,8 +84,8 @@ func (appDB *AppDB) GetLastBlockHash() []byte { // SetLastBlockHash stores given block hash on disk, panics on error func (appDB *AppDB) SetLastBlockHash(hash []byte) { - appDB.mu.Lock() - defer appDB.mu.Unlock() + // appDB.mu.Lock() + // defer appDB.mu.Unlock() if err := appDB.db.Set([]byte(hashPath), hash); err != nil { panic(err) @@ -93,8 +94,8 @@ func (appDB *AppDB) SetLastBlockHash(hash []byte) { // GetLastHeight returns latest block height stored on disk func (appDB *AppDB) GetLastHeight() uint64 { - appDB.mu.RLock() - defer appDB.mu.RUnlock() + // appDB.mu.RLock() + // defer appDB.mu.RUnlock() return appDB.getLastHeight() } func (appDB *AppDB) getLastHeight() uint64 { @@ -121,8 +122,8 @@ func (appDB *AppDB) SetLastHeight(height uint64) { h := make([]byte, 8) binary.BigEndian.PutUint64(h, height) - appDB.mu.Lock() - defer appDB.mu.Unlock() + // appDB.mu.Lock() + // defer appDB.mu.Unlock() if err := appDB.db.Set([]byte(heightPath), h); err != nil { panic(err) @@ -141,8 +142,8 @@ func (appDB *AppDB) SaveStartHeight() { h := make([]byte, 8) binary.BigEndian.PutUint64(h, atomic.LoadUint64(&appDB.startHeight)) - appDB.mu.Lock() - defer appDB.mu.Unlock() + // appDB.mu.Lock() + // defer appDB.mu.Unlock() if err := appDB.db.Set([]byte(startHeightPath), h); err != nil { panic(err) @@ -156,8 +157,8 @@ func (appDB *AppDB) GetStartHeight() uint64 { return val } - appDB.mu.RLock() - defer appDB.mu.RUnlock() + // appDB.mu.RLock() + // defer appDB.mu.RUnlock() result, err := appDB.db.Get([]byte(startHeightPath)) if err != nil { @@ -178,8 +179,8 @@ func (appDB *AppDB) GetValidators() abcTypes.ValidatorUpdates { return appDB.validators } - appDB.mu.RLock() - defer appDB.mu.RUnlock() + // appDB.mu.RLock() + // defer appDB.mu.RUnlock() result, err := appDB.db.Get([]byte(validatorsPath)) if err != nil { @@ -215,8 +216,8 @@ func (appDB *AppDB) FlushValidators() { panic(err) } - appDB.mu.Lock() - defer appDB.mu.Unlock() + // appDB.mu.Lock() + // defer appDB.mu.Unlock() if err := appDB.db.Set([]byte(validatorsPath), data); err != nil { panic(err) @@ -230,8 +231,8 @@ const BlocksTimeCount = 4 func (appDB *AppDB) GetLastBlockTimeDelta() (sumTimes int, count int) { if len(appDB.lastTimeBlocks) == 0 { - appDB.mu.RLock() - defer appDB.mu.RUnlock() + // appDB.mu.RLock() + // defer appDB.mu.RUnlock() result, err := appDB.db.Get([]byte(blocksTimePath)) if err != nil { @@ -267,8 +268,8 @@ func calcBlockDelta(times []uint64) (sumTimes int, num int) { func (appDB *AppDB) AddBlocksTime(time time.Time) { if len(appDB.lastTimeBlocks) == 0 { - appDB.mu.RLock() - defer appDB.mu.RUnlock() + // appDB.mu.RLock() + // defer appDB.mu.RUnlock() result, err := appDB.db.Get([]byte(blocksTimePath)) if err != nil { @@ -295,8 +296,8 @@ func (appDB *AppDB) SaveBlocksTime() { panic(err) } - appDB.mu.Lock() - defer appDB.mu.Unlock() + // appDB.mu.Lock() + // defer appDB.mu.Unlock() if err := appDB.db.Set([]byte(blocksTimePath), data); err != nil { panic(err) @@ -333,8 +334,8 @@ func (appDB *AppDB) GetVersionHeight(name string) uint64 { func (appDB *AppDB) GetVersions() []*Version { if len(appDB.versions) == 0 { - appDB.mu.RLock() - defer appDB.mu.RUnlock() + // appDB.mu.RLock() + // defer appDB.mu.RUnlock() result, err := appDB.db.Get([]byte(versionsPath)) if err != nil { @@ -372,8 +373,8 @@ func (appDB *AppDB) SaveVersions() { panic(err) } - appDB.mu.Lock() - defer appDB.mu.Unlock() + // appDB.mu.Lock() + // defer appDB.mu.Unlock() if err := appDB.db.Set([]byte(versionsPath), data); err != nil { panic(err) @@ -421,15 +422,11 @@ func (appDB *AppDB) Snapshot(height uint64, format uint32) (<-chan io.ReadCloser } var results []*types.SnapshotItem - appDB.mu.RLock() - - if height != appDB.getLastHeight() { - appDB.mu.RUnlock() + if height != appDB.GetLastHeight() { return nil, sdkerrors.Wrapf(sdkerrors.ErrLogic, "cannot snapshot future height %v", height) } if height == 0 { - appDB.mu.RUnlock() return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "cannot snapshot height 0") } @@ -448,7 +445,7 @@ func (appDB *AppDB) Snapshot(height uint64, format uint32) (<-chan io.ReadCloser }, }) } - appDB.mu.RUnlock() + appDB.WG.Done() // Spawn goroutine to generate snapshot chunks and pass their io.ReadClosers through a channel ch := make(chan io.ReadCloser) diff --git a/coreV2/minter/blockchain.go b/coreV2/minter/blockchain.go index 09296d9f2..e2a95ef14 100644 --- a/coreV2/minter/blockchain.go +++ b/coreV2/minter/blockchain.go @@ -585,7 +585,8 @@ func (blockchain *Blockchain) Commit() abciTypes.ResponseCommit { return abciTypes.ResponseCommit{Data: hash} } - if blockchain.snapshotInterval > 0 && height%blockchain.snapshotInterval == 0 { + if blockchain.snapshotInterval > 0 && height%blockchain.snapshotInterval == 0 && blockchain.snapshotManager != nil { + blockchain.appDB.WG.Add(1) go blockchain.snapshot(int64(height)) } diff --git a/coreV2/minter/snapshots.go b/coreV2/minter/snapshots.go index 25d671d48..6847185e7 100644 --- a/coreV2/minter/snapshots.go +++ b/coreV2/minter/snapshots.go @@ -132,11 +132,6 @@ func (blockchain *Blockchain) ApplySnapshotChunk(req abci.RequestApplySnapshotCh // snapshot takes a snapshot of the current state and prunes any old snapshottypes. func (blockchain *Blockchain) snapshot(height int64) { - if blockchain.snapshotManager == nil { - blockchain.logger.Info("snapshot manager not configured") - return - } - if blockchain.stopped { blockchain.logger.Info("node stopped, snapshot skipped", "height", height) return From 443d7b237071604893ce30379025f56d11814a00 Mon Sep 17 00:00:00 2001 From: klim0v Date: Wed, 15 Dec 2021 04:32:58 +0300 Subject: [PATCH 12/39] refactor wg --- coreV2/appdb/appdb.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/coreV2/appdb/appdb.go b/coreV2/appdb/appdb.go index 0b839f71f..0e8e2ebdb 100644 --- a/coreV2/appdb/appdb.go +++ b/coreV2/appdb/appdb.go @@ -84,6 +84,8 @@ func (appDB *AppDB) GetLastBlockHash() []byte { // SetLastBlockHash stores given block hash on disk, panics on error func (appDB *AppDB) SetLastBlockHash(hash []byte) { + + appDB.WG.Wait() // appDB.mu.Lock() // defer appDB.mu.Unlock() @@ -122,6 +124,7 @@ func (appDB *AppDB) SetLastHeight(height uint64) { h := make([]byte, 8) binary.BigEndian.PutUint64(h, height) + appDB.WG.Wait() // appDB.mu.Lock() // defer appDB.mu.Unlock() @@ -142,6 +145,7 @@ func (appDB *AppDB) SaveStartHeight() { h := make([]byte, 8) binary.BigEndian.PutUint64(h, atomic.LoadUint64(&appDB.startHeight)) + appDB.WG.Wait() // appDB.mu.Lock() // defer appDB.mu.Unlock() @@ -216,6 +220,7 @@ func (appDB *AppDB) FlushValidators() { panic(err) } + appDB.WG.Wait() // appDB.mu.Lock() // defer appDB.mu.Unlock() @@ -296,6 +301,7 @@ func (appDB *AppDB) SaveBlocksTime() { panic(err) } + appDB.WG.Wait() // appDB.mu.Lock() // defer appDB.mu.Unlock() @@ -373,6 +379,7 @@ func (appDB *AppDB) SaveVersions() { panic(err) } + appDB.WG.Wait() // appDB.mu.Lock() // defer appDB.mu.Unlock() @@ -418,15 +425,18 @@ type Store interface { // TestMultistoreSnapshot_Checksum test. func (appDB *AppDB) Snapshot(height uint64, format uint32) (<-chan io.ReadCloser, error) { if format != snapshottypes.CurrentFormat { + appDB.WG.Done() return nil, sdkerrors.Wrapf(snapshottypes.ErrUnknownFormat, "format %v", format) } var results []*types.SnapshotItem if height != appDB.GetLastHeight() { + appDB.WG.Done() return nil, sdkerrors.Wrapf(sdkerrors.ErrLogic, "cannot snapshot future height %v", height) } if height == 0 { + appDB.WG.Done() return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "cannot snapshot height 0") } From 2396152956c2d6ddb52d2d27feb4db0f6a64e9bf Mon Sep 17 00:00:00 2001 From: klim0v Date: Wed, 15 Dec 2021 05:12:10 +0300 Subject: [PATCH 13/39] refactor wg --- coreV2/minter/snapshots.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coreV2/minter/snapshots.go b/coreV2/minter/snapshots.go index 6847185e7..cf45577de 100644 --- a/coreV2/minter/snapshots.go +++ b/coreV2/minter/snapshots.go @@ -137,6 +137,7 @@ func (blockchain *Blockchain) snapshot(height int64) { return } + //blockchain.wgSnapshot.Wait() blockchain.wgSnapshot.Add(1) defer blockchain.wgSnapshot.Done() @@ -144,6 +145,7 @@ func (blockchain *Blockchain) snapshot(height int64) { snapshot, err := blockchain.snapshotManager.Create(uint64(height)) if err != nil { + blockchain.appDB.WG.Done() blockchain.logger.Error("failed to create state snapshot", "height", height, "err", err) return } From 9f2179cc6e4e5defb9ea94261b9db91440761b02 Mon Sep 17 00:00:00 2001 From: klim0v Date: Wed, 15 Dec 2021 05:13:25 +0300 Subject: [PATCH 14/39] refactor wg --- coreV2/minter/snapshots.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreV2/minter/snapshots.go b/coreV2/minter/snapshots.go index cf45577de..653231b46 100644 --- a/coreV2/minter/snapshots.go +++ b/coreV2/minter/snapshots.go @@ -137,7 +137,7 @@ func (blockchain *Blockchain) snapshot(height int64) { return } - //blockchain.wgSnapshot.Wait() + blockchain.wgSnapshot.Wait() blockchain.wgSnapshot.Add(1) defer blockchain.wgSnapshot.Done() From 491e896c7d8fe1e1e4917bd48e51e380c058ce46 Mon Sep 17 00:00:00 2001 From: klim0v Date: Wed, 15 Dec 2021 13:03:23 +0300 Subject: [PATCH 15/39] refactor wg --- coreV2/minter/minter.go | 1 + 1 file changed, 1 insertion(+) diff --git a/coreV2/minter/minter.go b/coreV2/minter/minter.go index 463fafad8..5569a23cf 100644 --- a/coreV2/minter/minter.go +++ b/coreV2/minter/minter.go @@ -75,6 +75,7 @@ func (blockchain *Blockchain) WaitStop() error { defer close(blockchain.stopOk) blockchain.tmNode.Wait() blockchain.wgSnapshot.Wait() + blockchain.wgSnapshot.Add(1) return blockchain.Close() } From 4944dab7142c6fd3101b4429249a91c026bf7299 Mon Sep 17 00:00:00 2001 From: klim0v Date: Wed, 15 Dec 2021 23:56:40 +0300 Subject: [PATCH 16/39] refactor stop --- config/toml.go | 2 +- coreV2/minter/blockchain.go | 3 ++- coreV2/minter/snapshots.go | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/config/toml.go b/config/toml.go index 14026bbfa..e62cc2a7d 100644 --- a/config/toml.go +++ b/config/toml.go @@ -142,7 +142,7 @@ prof_laddr = "{{ .BaseConfig.ProfListenAddress }}" enable = {{ .StateSync.Enable }} # At least 2 available RPC servers. -rpc_servers = "{{ .StateSync.RPCServers }}" +rpc_servers = {{ .StateSync.RPCServers }} # A trusted height trust_height = {{ .StateSync.TrustHeight }} # The block ID hash of the trusted height diff --git a/coreV2/minter/blockchain.go b/coreV2/minter/blockchain.go index e2a95ef14..a1018226d 100644 --- a/coreV2/minter/blockchain.go +++ b/coreV2/minter/blockchain.go @@ -124,6 +124,7 @@ func NewMinterBlockchain(storages *utils.Storage, cfg *config.Config, ctx contex app := &Blockchain{ logger: logger, + rewards: big.NewInt(0), rewardsCounter: rewards.NewReward(), appDB: applicationDB, storages: storages, @@ -190,7 +191,6 @@ func (blockchain *Blockchain) initState() { } atomic.StoreUint64(&blockchain.height, currentHeight) - blockchain.rewards = big.NewInt(0) blockchain.stateDeliver = stateDeliver blockchain.stateCheck = state.NewCheckState(stateDeliver) blockchain.appDB.SetState(stateDeliver.Tree()) @@ -544,6 +544,7 @@ func (blockchain *Blockchain) CheckTx(req abciTypes.RequestCheckTx) abciTypes.Re // Commit the state and return the application Merkle root hash func (blockchain *Blockchain) Commit() abciTypes.ResponseCommit { if blockchain.stopped { + blockchain.wgSnapshot.Wait() select { case <-time.After(10 * time.Second): blockchain.Close() diff --git a/coreV2/minter/snapshots.go b/coreV2/minter/snapshots.go index 653231b46..5210a08cb 100644 --- a/coreV2/minter/snapshots.go +++ b/coreV2/minter/snapshots.go @@ -54,6 +54,7 @@ func (blockchain *Blockchain) OfferSnapshot(req abci.RequestOfferSnapshot) abci. err = blockchain.snapshotManager.Restore(snapshot) switch { case err == nil: + blockchain.initState() return abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ACCEPT} case errors.Is(err, snapshottypes.ErrUnknownFormat): @@ -109,6 +110,7 @@ func (blockchain *Blockchain) ApplySnapshotChunk(req abci.RequestApplySnapshotCh _, err := blockchain.snapshotManager.RestoreChunk(req.Chunk) switch { case err == nil: + blockchain.initState() return abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT} case errors.Is(err, snapshottypes.ErrChunkHashMismatch): @@ -125,7 +127,7 @@ func (blockchain *Blockchain) ApplySnapshotChunk(req abci.RequestApplySnapshotCh } default: - //blockchain.logger.Error("failed to restore snapshot", "err", err) + blockchain.logger.Error("failed to restore snapshot", "err", err) return abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ABORT} } } From 7c58a85b411c817fb2f1f6e1f93988fbc12c6a6e Mon Sep 17 00:00:00 2001 From: klim0v Date: Thu, 16 Dec 2021 00:17:26 +0300 Subject: [PATCH 17/39] cleanup code --- config/toml.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/toml.go b/config/toml.go index e62cc2a7d..294aef0d9 100644 --- a/config/toml.go +++ b/config/toml.go @@ -143,10 +143,13 @@ enable = {{ .StateSync.Enable }} # At least 2 available RPC servers. rpc_servers = {{ .StateSync.RPCServers }} + # A trusted height trust_height = {{ .StateSync.TrustHeight }} + # The block ID hash of the trusted height trust_hash = "{{ .StateSync.TrustHash }}" + trust_period = "{{ .StateSync.TrustPeriod }}" ##### rpc server configuration options ##### From 8a47ef75ae44a1b8bc53bce40abbb038b37f1e57 Mon Sep 17 00:00:00 2001 From: klim0v Date: Thu, 16 Dec 2021 00:18:26 +0300 Subject: [PATCH 18/39] fix candidate not found with height param --- api/v2/service/candidate.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/v2/service/candidate.go b/api/v2/service/candidate.go index 85c67772a..5f62512d3 100644 --- a/api/v2/service/candidate.go +++ b/api/v2/service/candidate.go @@ -34,7 +34,6 @@ func (s *Service) Candidate(ctx context.Context, req *pb.CandidateRequest) (*pb. if req.Height != 0 { cState.Candidates().LoadCandidates() - cState.Candidates().LoadStakesOfCandidate(pubkey) } candidate := cState.Candidates().GetCandidate(pubkey) @@ -42,6 +41,10 @@ func (s *Service) Candidate(ctx context.Context, req *pb.CandidateRequest) (*pb. return nil, status.Error(codes.NotFound, "Candidate not found") } + if req.Height != 0 { + cState.Candidates().LoadStakesOfCandidate(pubkey) + } + result := makeResponseCandidate(cState, candidate, true, req.NotShowStakes) if cState.Validators().GetByPublicKey(candidate.PubKey) != nil { result.Validator = true From 553f40f3e25935eabc5feaef42734f810a95a808 Mon Sep 17 00:00:00 2001 From: klim0v Date: Thu, 16 Dec 2021 00:21:41 +0300 Subject: [PATCH 19/39] close SnapshotDB --- cmd/utils/flags.go | 4 ++++ coreV2/minter/blockchain.go | 3 +++ 2 files changed, 7 insertions(+) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index e4f76383e..f562195c6 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -31,6 +31,10 @@ func (s *Storage) StateDB() db.DB { return s.stateDB } +func (s *Storage) SnapshotDB() db.DB { + return s.snapshotDB +} + func NewStorage(home string, config string) *Storage { return &Storage{eventDB: db.NewMemDB(), stateDB: db.NewMemDB(), snapshotDB: db.NewMemDB(), minterConfig: config, minterHome: home} } diff --git a/coreV2/minter/blockchain.go b/coreV2/minter/blockchain.go index a1018226d..cf0cb7d3e 100644 --- a/coreV2/minter/blockchain.go +++ b/coreV2/minter/blockchain.go @@ -618,5 +618,8 @@ func (blockchain *Blockchain) Close() error { if err := blockchain.storages.EventDB().Close(); err != nil { return err } + if err := blockchain.storages.SnapshotDB().Close(); err != nil { + return err + } return nil } From 420527172464cc8b8e3f3ca1533ba1a448b229e8 Mon Sep 17 00:00:00 2001 From: klim0v Date: Thu, 16 Dec 2021 22:51:12 +0300 Subject: [PATCH 20/39] wip --- cmd/minter/cmd/node.go | 2 +- config/toml.go | 1 + coreV2/appdb/appdb.go | 39 ++++++++++++++++++++----------------- coreV2/minter/blockchain.go | 3 ++- coreV2/minter/snapshots.go | 35 +++++++++++++++++++-------------- tree/tree.go | 2 +- 6 files changed, 46 insertions(+), 36 deletions(-) diff --git a/cmd/minter/cmd/node.go b/cmd/minter/cmd/node.go index 1f0930c8c..5b985db18 100644 --- a/cmd/minter/cmd/node.go +++ b/cmd/minter/cmd/node.go @@ -90,7 +90,7 @@ func runNode(cmd *cobra.Command) error { } app := minter.NewMinterBlockchain(storages, cfg, cmd.Context(), 720, 0, logger.With("module", "node")) - if cfg.SnapshotInterval > 0 { + if cfg.SnapshotInterval > 0 || cfg.StateSync.Enable { snapshotDB, err := storages.InitSnapshotLevelDB("data/snapshots/metadata", minter.GetDbOpts(cfg.StateMemAvailable)) if err != nil { return err diff --git a/config/toml.go b/config/toml.go index 294aef0d9..198c75865 100644 --- a/config/toml.go +++ b/config/toml.go @@ -105,6 +105,7 @@ fast_sync = {{ .BaseConfig.FastSync }} # State sync snapshot interval snapshot_interval = {{ .BaseConfig.SnapshotInterval }} + # State sync snapshot to keep snapshot_keep_recent = {{ .BaseConfig.SnapshotKeepRecent }} diff --git a/coreV2/appdb/appdb.go b/coreV2/appdb/appdb.go index 0e8e2ebdb..67fc2bb1b 100644 --- a/coreV2/appdb/appdb.go +++ b/coreV2/appdb/appdb.go @@ -8,11 +8,9 @@ import ( "github.com/MinterTeam/minter-go-node/tree" "github.com/cosmos/cosmos-sdk/snapshots" snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" + "log" "sync" - //"github.com/cosmos/cosmos-sdk/store/iavl" - "github.com/cosmos/iavl" - "github.com/MinterTeam/minter-go-node/coreV2/appdb/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" iavltree "github.com/cosmos/iavl" @@ -44,7 +42,8 @@ type AppDB struct { //mu sync.RWMutex WG sync.WaitGroup - store tree.MTree + store tree.MTree + stateDB db.DB startHeight uint64 lastHeight uint64 @@ -393,6 +392,9 @@ func (appDB *AppDB) SaveVersions() { func (appDB *AppDB) SetState(state tree.MTree) { appDB.store = state } +func (appDB *AppDB) SetStateDB(stateDB db.DB) { + appDB.stateDB = stateDB +} // NewAppDB creates AppDB instance with given config func NewAppDB(homeDir string, cfg *config.Config) *AppDB { @@ -414,10 +416,10 @@ const ( snapshotMaxItemSize = int(64e6) // SDK has no key/value size limit, so we set an arbitrary limit ) -type Store interface { - Export(version int64) (*iavl.Exporter, error) - Import(version int64) (*iavl.Importer, error) -} +//type Store interface { +//Export(version int64) (*iavl.Exporter, error) +//Import(version int64) (*iavl.Importer, error) +//} // Snapshot implements snapshottypes.Snapshotter. The snapshot output for a given format must be // identical across nodes such that chunks from different sources fit together. If the output for a @@ -606,17 +608,24 @@ func (appDB *AppDB) Restore( } importer.Close() } - store, ok := appDB.store.(Store) - if !ok || store == nil { - return sdkerrors.Wrapf(sdkerrors.ErrLogic, "cannot import into non-IAVL store %q", item.Store.Name) + if appDB.store == nil { + startHeight := appDB.GetStartHeight() + log.Println(startHeight) + lastHeight := appDB.GetLastHeight() + log.Println(lastHeight) + appDB.store, err = tree.NewMutableTree(0, appDB.stateDB, 1000000, startHeight) + if err != nil { + return sdkerrors.Wrap(err, "create state failed") + } } - importer, err = store.Import(int64(height)) + importer, err = appDB.store.Import(int64(height)) if err != nil { return sdkerrors.Wrap(err, "import failed") } defer importer.Close() case validatorsPath, heightPath, hashPath, versionsPath, blocksTimePath, startHeightPath: + log.Println(item.Store.Name) if err := appDB.db.Set([]byte(item.Store.Name), item.Store.Value); err != nil { panic(err) } @@ -664,11 +673,5 @@ func (appDB *AppDB) Restore( importer.Close() } - //appDB.FlushValidators() - //appDB.SaveBlocksTime() - //appDB.SaveVersions() - //appDB.SaveBlocksTime() - // appDB.LoadLatestVersion() - return nil } diff --git a/coreV2/minter/blockchain.go b/coreV2/minter/blockchain.go index cf0cb7d3e..02885015f 100644 --- a/coreV2/minter/blockchain.go +++ b/coreV2/minter/blockchain.go @@ -102,6 +102,7 @@ func (blockchain *Blockchain) GetCurrentRewards() *big.Int { func NewMinterBlockchain(storages *utils.Storage, cfg *config.Config, ctx context.Context, updateStakePeriod uint64, expiredOrdersPeriod uint64, logger tmlog.Logger) *Blockchain { // Initiate Application DB. Used for persisting data like current block, validators, etc. applicationDB := appdb.NewAppDB(storages.GetMinterHome(), cfg) + applicationDB.SetStateDB(storages.StateDB()) if ctx == nil { ctx = context.Background() } @@ -189,11 +190,11 @@ func (blockchain *Blockchain) initState() { if err != nil { panic(err) } + blockchain.appDB.SetState(stateDeliver.Tree()) atomic.StoreUint64(&blockchain.height, currentHeight) blockchain.stateDeliver = stateDeliver blockchain.stateCheck = state.NewCheckState(stateDeliver) - blockchain.appDB.SetState(stateDeliver.Tree()) grace := upgrades.NewGrace() grace.AddGracePeriods(upgrades.NewGracePeriod(initialHeight, initialHeight+120, true), diff --git a/coreV2/minter/snapshots.go b/coreV2/minter/snapshots.go index 5210a08cb..162b22ac2 100644 --- a/coreV2/minter/snapshots.go +++ b/coreV2/minter/snapshots.go @@ -4,13 +4,11 @@ import ( "errors" snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" abci "github.com/tendermint/tendermint/abci/types" - tmlog "github.com/tendermint/tendermint/libs/log" - "os" ) -var logger = tmlog.NewTMLogger(os.Stdout) - +// List available snapshots func (blockchain *Blockchain) ListSnapshots(req abci.RequestListSnapshots) abci.ResponseListSnapshots { + blockchain.logger.Debug("ListSnapshots") resp := abci.ResponseListSnapshots{Snapshots: []*abci.Snapshot{}} if blockchain.snapshotManager == nil { return resp @@ -34,14 +32,16 @@ func (blockchain *Blockchain) ListSnapshots(req abci.RequestListSnapshots) abci. return resp } +// Offer a snapshot to the application func (blockchain *Blockchain) OfferSnapshot(req abci.RequestOfferSnapshot) abci.ResponseOfferSnapshot { + blockchain.logger.Info("Processing OfferSnapshot...", "Snapshot", req.Snapshot.String()) if blockchain.snapshotManager == nil { //blockchain.logger.Error("snapshot manager not configured") return abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ABORT} } if req.Snapshot == nil { - //blockchain.logger.Error("received nil snapshot") + blockchain.logger.Error("received nil snapshot") return abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT} } @@ -54,7 +54,7 @@ func (blockchain *Blockchain) OfferSnapshot(req abci.RequestOfferSnapshot) abci. err = blockchain.snapshotManager.Restore(snapshot) switch { case err == nil: - blockchain.initState() + blockchain.logger.Info("Done OfferSnapshot!", "Snapshot", req.Snapshot.String()) return abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ACCEPT} case errors.Is(err, snapshottypes.ErrUnknownFormat): @@ -83,34 +83,39 @@ func (blockchain *Blockchain) OfferSnapshot(req abci.RequestOfferSnapshot) abci. } } +// Load a snapshot chunk func (blockchain *Blockchain) LoadSnapshotChunk(req abci.RequestLoadSnapshotChunk) abci.ResponseLoadSnapshotChunk { + blockchain.logger.Info("Processing LoadSnapshotChunk...", "req", req.String()) if blockchain.snapshotManager == nil { return abci.ResponseLoadSnapshotChunk{} } chunk, err := blockchain.snapshotManager.LoadChunk(req.Height, req.Format, req.Chunk) if err != nil { - //blockchain.logger.Error( - // "failed to load snapshot chunk", - // "height", req.Height, - // "format", req.Format, - // "chunk", req.Chunk, - // "err", err, - //) + blockchain.logger.Error( + "failed to load snapshot chunk", + "height", req.Height, + "format", req.Format, + "chunk", req.Chunk, + "err", err, + ) return abci.ResponseLoadSnapshotChunk{} } + blockchain.logger.Debug("Done LoadSnapshotChunk!", "req", req.String()) return abci.ResponseLoadSnapshotChunk{Chunk: chunk} } +// Apply a shapshot chunk func (blockchain *Blockchain) ApplySnapshotChunk(req abci.RequestApplySnapshotChunk) abci.ResponseApplySnapshotChunk { + blockchain.logger.Info("Processing ApplySnapshotChunk...", "Index", req.Index, "Sender", req.Sender) if blockchain.snapshotManager == nil { - //blockchain.logger.Error("snapshot manager not configured") + blockchain.logger.Error("snapshot manager not configured") return abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ABORT} } _, err := blockchain.snapshotManager.RestoreChunk(req.Chunk) switch { case err == nil: - blockchain.initState() + blockchain.logger.Info("Done ApplySnapshotChunk!", "Index", req.Index, "Sender", req.Sender) return abci.ResponseApplySnapshotChunk{Result: abci.ResponseApplySnapshotChunk_ACCEPT} case errors.Is(err, snapshottypes.ErrChunkHashMismatch): diff --git a/tree/tree.go b/tree/tree.go index 66a67cc81..a4595e7f9 100644 --- a/tree/tree.go +++ b/tree/tree.go @@ -83,7 +83,7 @@ func (t *mutableTree) MutableTree() *iavl.MutableTree { // NewMutableTree creates and returns new MutableTree using given db. Panics on error. // If you want to get read-only state, you should use height = 0 and LazyLoadVersion (version), see NewImmutableTree func NewMutableTree(height uint64, db dbm.DB, cacheSize int, initialVersion uint64) (MTree, error) { - tree, err := iavl.NewMutableTreeWithOpts(db, cacheSize, &iavl.Options{InitialVersion: initialVersion}) + tree, err := iavl.NewMutableTree(db, cacheSize) if err != nil { return nil, err } From d94d945af589182b4937dee1659737ff3c1c877a Mon Sep 17 00:00:00 2001 From: klim0v Date: Fri, 17 Dec 2021 02:11:46 +0300 Subject: [PATCH 21/39] wip --- cmd/minter/cmd/node.go | 16 ++-- coreV2/appdb/appdb.go | 13 +--- coreV2/minter/snapshots.go | 15 +++- go.mod | 25 ++++--- go.sum | 148 ++++++++++++++++++++++--------------- 5 files changed, 122 insertions(+), 95 deletions(-) diff --git a/cmd/minter/cmd/node.go b/cmd/minter/cmd/node.go index 5b985db18..a789609ec 100644 --- a/cmd/minter/cmd/node.go +++ b/cmd/minter/cmd/node.go @@ -3,14 +3,6 @@ package cmd import ( "context" "fmt" - "github.com/cosmos/cosmos-sdk/snapshots" - "io" - "net/http" - _ "net/http/pprof" // nolint: gosec // securely exposed on separate, optional port - "net/url" - "os" - "syscall" - apiV2 "github.com/MinterTeam/minter-go-node/api/v2" serviceApi "github.com/MinterTeam/minter-go-node/api/v2/service" "github.com/MinterTeam/minter-go-node/cli/service" @@ -21,6 +13,7 @@ import ( "github.com/MinterTeam/minter-go-node/coreV2/statistics" "github.com/MinterTeam/minter-go-node/log" "github.com/MinterTeam/minter-go-node/version" + "github.com/cosmos/cosmos-sdk/snapshots" "github.com/spf13/cobra" tmCfg "github.com/tendermint/tendermint/config" tmLog "github.com/tendermint/tendermint/libs/log" @@ -31,6 +24,12 @@ import ( "github.com/tendermint/tendermint/proxy" rpc "github.com/tendermint/tendermint/rpc/client/local" tmTypes "github.com/tendermint/tendermint/types" + "io" + "net/http" + _ "net/http/pprof" // nolint: gosec // securely exposed on separate, optional port + "net/url" + "os" + "syscall" ) // RunNode is the command that allows the CLI to start a node. @@ -232,7 +231,6 @@ func startTendermintNode(app *minter.Blockchain, cfg *tmCfg.Config, logger tmLog // // return mempoolReactor, mempool //}, - nil, logger.With("module", "tendermint"), ) diff --git a/coreV2/appdb/appdb.go b/coreV2/appdb/appdb.go index 67fc2bb1b..ef135fc0d 100644 --- a/coreV2/appdb/appdb.go +++ b/coreV2/appdb/appdb.go @@ -8,7 +8,6 @@ import ( "github.com/MinterTeam/minter-go-node/tree" "github.com/cosmos/cosmos-sdk/snapshots" snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" - "log" "sync" "github.com/MinterTeam/minter-go-node/coreV2/appdb/types" @@ -416,11 +415,6 @@ const ( snapshotMaxItemSize = int(64e6) // SDK has no key/value size limit, so we set an arbitrary limit ) -//type Store interface { -//Export(version int64) (*iavl.Exporter, error) -//Import(version int64) (*iavl.Importer, error) -//} - // Snapshot implements snapshottypes.Snapshotter. The snapshot output for a given format must be // identical across nodes such that chunks from different sources fit together. If the output for a // given format changes (at the byte level), the snapshot format must be bumped - see @@ -609,11 +603,7 @@ func (appDB *AppDB) Restore( importer.Close() } if appDB.store == nil { - startHeight := appDB.GetStartHeight() - log.Println(startHeight) - lastHeight := appDB.GetLastHeight() - log.Println(lastHeight) - appDB.store, err = tree.NewMutableTree(0, appDB.stateDB, 1000000, startHeight) + appDB.store, err = tree.NewMutableTree(0, appDB.stateDB, 1000000, appDB.GetStartHeight()) if err != nil { return sdkerrors.Wrap(err, "create state failed") } @@ -625,7 +615,6 @@ func (appDB *AppDB) Restore( defer importer.Close() case validatorsPath, heightPath, hashPath, versionsPath, blocksTimePath, startHeightPath: - log.Println(item.Store.Name) if err := appDB.db.Set([]byte(item.Store.Name), item.Store.Value); err != nil { panic(err) } diff --git a/coreV2/minter/snapshots.go b/coreV2/minter/snapshots.go index 162b22ac2..105dec7e3 100644 --- a/coreV2/minter/snapshots.go +++ b/coreV2/minter/snapshots.go @@ -1,6 +1,7 @@ package minter import ( + "encoding/hex" "errors" snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" abci "github.com/tendermint/tendermint/abci/types" @@ -34,7 +35,12 @@ func (blockchain *Blockchain) ListSnapshots(req abci.RequestListSnapshots) abci. // Offer a snapshot to the application func (blockchain *Blockchain) OfferSnapshot(req abci.RequestOfferSnapshot) abci.ResponseOfferSnapshot { - blockchain.logger.Info("Processing OfferSnapshot...", "Snapshot", req.Snapshot.String()) + blockchain.logger.Info("Processing OfferSnapshot...", + "AppHash", hex.EncodeToString(req.AppHash), + "Height", req.Snapshot.Height, + "Format", req.Snapshot.Format, + "Chunks", req.Snapshot.Chunks, + ) if blockchain.snapshotManager == nil { //blockchain.logger.Error("snapshot manager not configured") return abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ABORT} @@ -54,7 +60,12 @@ func (blockchain *Blockchain) OfferSnapshot(req abci.RequestOfferSnapshot) abci. err = blockchain.snapshotManager.Restore(snapshot) switch { case err == nil: - blockchain.logger.Info("Done OfferSnapshot!", "Snapshot", req.Snapshot.String()) + blockchain.logger.Info("Done OfferSnapshot!", + "AppHash", hex.EncodeToString(req.AppHash), + "Height", req.Snapshot.Height, + "Format", req.Snapshot.Format, + "Chunks", req.Snapshot.Chunks, + ) return abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_ACCEPT} case errors.Is(err, snapshottypes.ErrUnknownFormat): diff --git a/go.mod b/go.mod index 8310730ab..8c4adf50a 100644 --- a/go.mod +++ b/go.mod @@ -20,12 +20,12 @@ require ( github.com/prometheus/client_golang v1.11.0 github.com/rakyll/statik v0.1.7 github.com/spf13/cobra v1.2.1 - github.com/spf13/viper v1.8.1 + github.com/spf13/viper v1.9.0 github.com/stretchr/testify v1.7.0 github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca github.com/tendermint/go-amino v0.16.0 - github.com/tendermint/tendermint v0.34.14 - github.com/tendermint/tm-db v0.6.4 + github.com/tendermint/tendermint v0.34.15 + github.com/tendermint/tm-db v0.6.6 github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 github.com/urfave/cli/v2 v2.0.0 golang.org/x/crypto v0.0.0-20211202192323-5770296d904e @@ -40,7 +40,7 @@ replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alp require ( github.com/DataDog/zstd v1.4.5 // indirect - github.com/Workiva/go-datastructures v1.0.52 // indirect + github.com/Workiva/go-datastructures v1.0.53 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect @@ -52,7 +52,7 @@ require ( github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dustin/go-humanize v1.0.0 // indirect github.com/felixge/httpsnoop v1.0.1 // indirect - github.com/fsnotify/fsnotify v1.4.9 // indirect + github.com/fsnotify/fsnotify v1.5.1 // indirect github.com/gdamore/encoding v0.0.0-20151215212835-b23993cbb635 // indirect github.com/gdamore/tcell v1.1.0 // indirect github.com/go-kit/log v0.2.0 // indirect @@ -66,6 +66,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect + github.com/lib/pq v1.10.4 // indirect github.com/libp2p/go-buffer-pool v0.0.2 // indirect github.com/lucasb-eyer/go-colorful v0.0.0-20180709185858-c7842319cf3a // indirect github.com/magiconair/properties v1.8.5 // indirect @@ -78,7 +79,7 @@ require ( github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/go-wordwrap v1.0.0 // indirect github.com/mitchellh/mapstructure v1.4.2 // indirect - github.com/pelletier/go-toml v1.9.3 // indirect + github.com/pelletier/go-toml v1.9.4 // indirect github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pkg/term v1.1.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -86,24 +87,26 @@ require ( github.com/prometheus/common v0.30.0 // indirect github.com/prometheus/procfs v0.7.3 // indirect github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect - github.com/rs/cors v1.7.0 // indirect + github.com/rs/cors v1.8.0 // indirect github.com/russross/blackfriday/v2 v2.0.1 // indirect github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect github.com/sirupsen/logrus v1.8.1 // indirect github.com/spf13/afero v1.6.0 // indirect - github.com/spf13/cast v1.3.1 // indirect + github.com/spf13/cast v1.4.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.2.0 // indirect github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect - go.etcd.io/bbolt v1.3.5 // indirect + go.etcd.io/bbolt v1.3.6 // indirect golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b // indirect golang.org/x/text v0.3.7 // indirect google.golang.org/genproto v0.0.0-20211207154714-918901c715cf // indirect - gopkg.in/ini.v1 v1.62.0 // indirect + gopkg.in/ini.v1 v1.63.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) -replace github.com/tendermint/tendermint => github.com/MinterTeam/tendermint v0.34.11-0.20210923081749-4193cf101f9f +replace github.com/tendermint/tendermint => github.com/MinterTeam/tendermint v0.34.15-beta1 + +//replace github.com/tendermint/tendermint => /Users/klim0v/GolandProjects/tendermint diff --git a/go.sum b/go.sum index 8e24d41ba..ecf399496 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,4 @@ -bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= +bazil.org/fuse v0.0.0-20200407214033-5883e5a4b512/go.mod h1:FbcW6z/2VytnFDhZfumh8Ss8zxHE6qpMP5sHTRe0EaM= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -19,6 +19,11 @@ cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmW cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -28,6 +33,7 @@ cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM7 cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/firestore v1.6.0/go.mod h1:afJwI0vaXwAG54kI7A//lP/lSPDkQORQuMkv56TxEPU= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -38,14 +44,11 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-beta.2 h1:/BZRNzm8N4K4eWfK28dL4yescorxtO7YG1yun8fy+pI= filippo.io/edwards25519 v1.0.0-beta.2/go.mod h1:X+pm78QAUPtFLi1z9PYIlS/bdDnvbCOGKtZ+ACWEf7o= -github.com/99designs/keyring v1.1.6 h1:kVDC2uCgVwecxCk+9zoCt2uEL6dt+dfVzMvGgnVcIuM= github.com/99designs/keyring v1.1.6/go.mod h1:16e0ds7LGQQcT59QqkTg72Hh5ShM51Byv5PEmW6uoRU= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= @@ -59,6 +62,7 @@ github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= @@ -69,13 +73,12 @@ github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.5.0 h1:Elr9Wn+sGKPlkaBvwu4mTrxtmOp3F3yV9qhaHbXGjwU= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/MinterTeam/node-grpc-gateway v1.4.3-0.20211208134306-ae7964561da4 h1:FwYtiBig/nwzJLTuksrqbhSV1Tr+RByzEzW5dOzEJYc= github.com/MinterTeam/node-grpc-gateway v1.4.3-0.20211208134306-ae7964561da4/go.mod h1:kSjFnXZ52XTOaxj4+nbahfMsAt8GsEIc9DSMzOlfALI= -github.com/MinterTeam/tendermint v0.34.11-0.20210923081749-4193cf101f9f h1:Vh91l7xApDxqH/hVQB5petycJ50NLoUTpGo1UIVdAyA= -github.com/MinterTeam/tendermint v0.34.11-0.20210923081749-4193cf101f9f/go.mod h1:6RVVRBqwtKhA+H59APKumO+B7Nye4QXSFc6+TYxAxCI= +github.com/MinterTeam/tendermint v0.34.15-beta1 h1:8gYx6lR6Z0WMQD4Akhnkxu+yo/SyVmOmew9ONaUvo3M= +github.com/MinterTeam/tendermint v0.34.15-beta1/go.mod h1:/7EDAw02rD7GT8syC317cX9ZhZTCdaFVvYjU8W+yJSs= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= @@ -86,11 +89,11 @@ github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrU github.com/VictoriaMetrics/fastcache v1.5.7/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/Workiva/go-datastructures v1.0.52 h1:PLSK6pwn8mYdaoaCZEMsXBpBotr4HHn9abU0yMQt0NI= -github.com/Workiva/go-datastructures v1.0.52/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= +github.com/Workiva/go-datastructures v1.0.53 h1:J6Y/52yX10Xc5JjXmGtWoSSxs3mZnGSaq37xZZh7Yig= +github.com/Workiva/go-datastructures v1.0.53/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= -github.com/adlio/schema v1.1.13 h1:LeNMVg5Z1FX+Qgz8tJUijBLRdcpbFUElz+d1489On98= -github.com/adlio/schema v1.1.13/go.mod h1:L5Z7tw+7lRK1Fnpi/LT/ooCP1elkXn0krMWBQHUhEDE= +github.com/adlio/schema v1.1.14 h1:lIjyp5/2wSuEOmeQGNPpaRsVGZRqz9A/B+PaMtEotaU= +github.com/adlio/schema v1.1.14/go.mod h1:hQveFEMiDlG/M9yz9RAajnH5DzT6nAfqOG9YkEQU2pg= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= @@ -125,10 +128,8 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnCiweXmzRIAiUWCInVmPgjkzgv5k4tVyXiQ= github.com/btcsuite/btcd v0.0.0-20190115013929-ed77733ec07d/go.mod h1:d3C0AkH6BRcvO8T0UEPu53cnw4IbV63x1bEjildYhO0= @@ -187,16 +188,13 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coinbase/rosetta-sdk-go v0.6.10/go.mod h1:J/JFMsfcePrjJZkwQFLh+hJErkAmdm9Iyy3D5Y0LfXo= -github.com/confio/ics23/go v0.6.3/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= github.com/confio/ics23/go v0.6.6 h1:pkOy18YxxJ/r0XFDCnrl4Bjv6h4LkBSpLS6F38mrKL8= github.com/confio/ics23/go v0.6.6/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= -github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.1.0 h1:UFRRY5JemiAhPZrr/uE0n8fMTLcZsUvySPr1+D7pgr8= -github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= +github.com/containerd/continuity v0.2.0 h1:j/9Wnn+hrEWjLvHuIxUU1YI5JjEjVlT2AA68cse9rwY= +github.com/containerd/continuity v0.2.0/go.mod h1:wCYX+dRqZdImhGucXOqTQn05AhX6EUDaGEMUzTFFpLg= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -212,12 +210,9 @@ github.com/cosmos/cosmos-sdk v0.44.5/go.mod h1:maUA6m2TBxOJZkbwl0eRtEBgTX37kcaiO github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= -github.com/cosmos/iavl v0.15.3/go.mod h1:OLjQiAQ4fGD2KDZooyJG9yz+p2ao2IAYSbke8mVvSA4= github.com/cosmos/iavl v0.17.3 h1:s2N819a2olOmiauVa0WAhoIJq9EhSXE9HDBAoR9k+8Y= github.com/cosmos/iavl v0.17.3/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w= -github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4= github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= -github.com/cosmos/ledger-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI= github.com/cosmos/ledger-go v0.9.2/go.mod h1:oZJ2hHAZROdlHiwTg4t7kP+GKIIkBT+o6c9QWFanOyI= github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= @@ -227,7 +222,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= -github.com/danieljoos/wincred v1.0.2 h1:zf4bhty2iLuwgjgpraD2E9UbvO+fe54XXGJbOwe23fU= github.com/danieljoos/wincred v1.0.2/go.mod h1:SnuYRW9lp1oJrZX/dXJqr0cPK5gYXqx3EJbmjhLdK9U= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -256,7 +250,6 @@ github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbT github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b h1:HBah4D48ypg3J7Np4N+HY/ZR76fx3HEUGxDU6Uk39oQ= github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b/go.mod h1:7BvyPhdbLxMXIYTFPLsyJRFMsKmOZnQmzh6Gb+uquuM= github.com/dvyukov/go-fuzz v0.0.0-20200318091601-be3528f3a813/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= @@ -297,8 +290,9 @@ github.com/franela/goblin v0.0.0-20210519012713-85d372ac71e2/go.mod h1:VzmDKDJVZ github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= 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/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/gdamore/encoding v0.0.0-20151215212835-b23993cbb635 h1:hheUEMzaOie/wKeIc1WPa7CDVuIO5hqQxjS+dwTQEnI= github.com/gdamore/encoding v0.0.0-20151215212835-b23993cbb635/go.mod h1:yrQYJKKDTrHmbYxI7CYi+/hbdiDT2m4Hj+t0ikCjsrQ= @@ -306,6 +300,7 @@ github.com/gdamore/tcell v1.1.0 h1:RbQgl7jukmdqROeNcKps7R2YfDCQbWkOd1BwdXrxfr4= github.com/gdamore/tcell v1.1.0/go.mod h1:tqyG50u7+Ctv1w5VX67kLzKcj9YXR/JSBZQq/+mLl1A= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -325,7 +320,9 @@ github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNV github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= @@ -336,10 +333,8 @@ github.com/go-zookeeper/zk v1.0.2/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= @@ -409,6 +404,7 @@ github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6 github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -422,12 +418,16 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e h1:JKmoR8x90Iww1ks85zJ1lfDGgIiMDuIptTOhJq+zKyg= github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -437,7 +437,6 @@ github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= @@ -461,7 +460,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4 github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.1 h1:p5m7GOEGXyoq6QWl4/RRMsQ6tWbTpbQmAnkxXgWSprY= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.1/go.mod h1:8ZeZajTed/blCOHBbj8Fss8bPHiFKcmJJzuIbUtFCAo= -github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= @@ -508,7 +506,6 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= -github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87 h1:uUjLpLt6bVvZ72SQc/B4dXcPBw4Vgd7soowdRl52qEM= github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87/go.mod h1:XGsKKeXxeRr95aEOgipvluMPlgjr7dGlk9ZTWOjcUcg= github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -554,7 +551,6 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d h1:Z+RDyXzjKE0i2sTjZ/b1uxiGtPhFy34Ou/Tk0qwN0kM= github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNrCn9otv/2QP4D7SMJBgaleKpOf66PnW6F5WGNRIc= 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= @@ -577,10 +573,12 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.3/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.4 h1:SO9z7FRPzA03QhHKJrH5BXA6HU1rS4V2nIVrrNC1iYk= +github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.0.2 h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= @@ -590,7 +588,6 @@ github.com/lucasb-eyer/go-colorful v0.0.0-20180709185858-c7842319cf3a/go.mod h1: github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/marcusolsson/tui-go v0.4.0 h1:PZD0lIS+2OUKxs71qsc5U/P+eVU39FeBRgdsh5iQZ28= @@ -608,6 +605,7 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= @@ -634,7 +632,6 @@ github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLT github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= @@ -654,7 +651,6 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= -github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -700,12 +696,10 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= -github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v1.0.2 h1:opHZMaswlyxz1OuGpBE53Dwe4/xF7EZTY0A2L/FpCOg= github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= @@ -733,13 +727,15 @@ github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144T github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= +github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/performancecopilot/speed/v4 v4.0.0/go.mod h1:qxrSyuDGrTOWfV+uKRFhfxw6h/4HXRGUiZiufxo49BM= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= +github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -762,7 +758,6 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.8.0/go.mod h1:O9VU6huf47PktckDQfMTX0Y8tY0/7TSWwj+ITvv0TnM= github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -779,7 +774,6 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= @@ -791,7 +785,6 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7z github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= @@ -803,7 +796,6 @@ github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Ung github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg= github.com/regen-network/cosmos-proto v0.3.1/go.mod h1:jO0sVX6a1B36nmE8C9xBFXpNwWejXC7QqCOnH3O0+YM= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= @@ -815,8 +807,9 @@ github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rs/cors v1.8.0 h1:P2KMzcFwrPoSjkF1WLRPsp3UMLyql8L4v9hQpVeK5so= +github.com/rs/cors v1.8.0/go.mod h1:EBwu+T5AvHOcXwvZIkQFjUN6s8Czyqw12GL/Y0tUyRM= github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.23.0/go.mod h1:6c7hFfxPOy7TacJc4Fcdi24/J0NKYGzjG8FWRI916Qo= @@ -825,6 +818,7 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/crypt v0.1.0/go.mod h1:B/mN0msZuINBtQ1zZLEQcegFJJf9vnYIR88KRMEuODE= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa h1:0U2s5loxrTy6/VgfVoLuVLFJcURKLH49ie0zSch7gh4= github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= @@ -835,7 +829,6 @@ github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= @@ -856,12 +849,12 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= +github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= @@ -873,10 +866,9 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.8.1 h1:Kq1fyeebqsBfbjZj4EL7gj2IO0mMaiyjYUWcUsl2O44= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= +github.com/spf13/viper v1.9.0 h1:yR6EXjTp0y0cLN8OZg1CRZmOBdI88UcGkhgyJhu6nZk= +github.com/spf13/viper v1.9.0/go.mod h1:+i6ajR7OX2XaiBkrcZJFK21htRk7eDeLg7+O6bhUPP4= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw= github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= @@ -903,24 +895,25 @@ github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca h1:Ld/zXl5t4+D6 github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= -github.com/tendermint/btcd v0.1.1 h1:0VcxPfflS2zZ3RiOAHkBiFUcPvbtRj5O7zHmcJWHV7s= github.com/tendermint/btcd v0.1.1/go.mod h1:DC6/m53jtQzr/NFmMNEu0rxf18/ktVoVtMrnDD5pN+U= -github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RMWx1aInLzndwxKalgi5rTqgfXxOxbEI= github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tendermint/tm-db v0.6.3/go.mod h1:lfA1dL9/Y/Y8wwyPp2NMLyn5P5Ptr/gvDFNWtrCWSf8= -github.com/tendermint/tm-db v0.6.4 h1:3N2jlnYQkXNQclQwd/eKV/NzlqPlfK21cpRRIx80XXQ= github.com/tendermint/tm-db v0.6.4/go.mod h1:dptYhIpJ2M5kUuenLr+Yyf3zQOv1SgBZcl8/BmWlMBw= +github.com/tendermint/tm-db v0.6.6 h1:EzhaOfR0bdKyATqcd5PNeyeq8r+V4bRPHBfyFdD9kGM= +github.com/tendermint/tm-db v0.6.6/go.mod h1:wP8d49A85B7/erz/r4YbKssKw6ylsO/hKtFk7E1aWZI= github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/sjson v1.1.4/go.mod h1:wXpKXu8CtDjKAZ+3DrKY5ROCorDFahq8l0tey/Lx1fg= +github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 h1:uruHq4dN7GR16kFc5fp3d1RIYzJW5onx8Ybykw2YQFA= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM= github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= @@ -945,12 +938,12 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8= github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= +go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= +go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= @@ -1103,10 +1096,11 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211005001312-d4b1ae081e3b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b h1:MWaHNqZy3KTpuTMAGvv+Kw+ylsEpmyJZizz1dqxnu28= golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -1123,6 +1117,9 @@ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1159,6 +1156,7 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1170,6 +1168,7 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1197,8 +1196,8 @@ golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200918174421-af09f7315aff/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1215,16 +1214,19 @@ golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211004093028-2c5d950f24ef/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211205182925-97ca703d548d h1:FjkYO/PPp4Wi0EAUOVLxePm7qVW4r4ctbWpURyuOD0E= golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1296,6 +1298,7 @@ golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -1305,6 +1308,8 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1338,6 +1343,12 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1392,7 +1403,17 @@ google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= @@ -1425,7 +1446,10 @@ google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.42.0 h1:XT2/MFpuPFsEX2fWh3YQtHkZ+WYZFQRfaUgLZYj/p6A= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= @@ -1459,9 +1483,11 @@ gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU= +gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= +gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.63.2 h1:tGK/CyBg7SMzb60vP1M03vNZ3VDu3wGQJwn7Sxi9r3c= +gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= From fa6057f9cb447cb3634599b22acd496a8b7f0392 Mon Sep 17 00:00:00 2001 From: klim0v Date: Fri, 17 Dec 2021 02:35:47 +0300 Subject: [PATCH 22/39] works, but the tendermint hard fork is used --- coreV2/minter/blockchain.go | 3 +++ go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/coreV2/minter/blockchain.go b/coreV2/minter/blockchain.go index 02885015f..c069a5a78 100644 --- a/coreV2/minter/blockchain.go +++ b/coreV2/minter/blockchain.go @@ -248,6 +248,9 @@ func (blockchain *Blockchain) InitChain(req abciTypes.RequestInitChain) abciType // BeginBlock signals the beginning of a block. func (blockchain *Blockchain) BeginBlock(req abciTypes.RequestBeginBlock) abciTypes.ResponseBeginBlock { + if blockchain.stateDeliver == nil { + blockchain.initState() + } height := uint64(req.Header.Height) blockchain.StatisticData().PushStartBlock(&statistics.StartRequest{Height: int64(height), Now: time.Now(), HeaderTime: req.Header.Time}) diff --git a/go.mod b/go.mod index 8c4adf50a..e1613c566 100644 --- a/go.mod +++ b/go.mod @@ -107,6 +107,6 @@ require ( gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) -replace github.com/tendermint/tendermint => github.com/MinterTeam/tendermint v0.34.15-beta1 +replace github.com/tendermint/tendermint => github.com/MinterTeam/tendermint v0.34.15-beta1.0.20211216233158-7d1d8faa5437 //replace github.com/tendermint/tendermint => /Users/klim0v/GolandProjects/tendermint diff --git a/go.sum b/go.sum index ecf399496..05159a04e 100644 --- a/go.sum +++ b/go.sum @@ -77,8 +77,8 @@ github.com/Microsoft/go-winio v0.5.0 h1:Elr9Wn+sGKPlkaBvwu4mTrxtmOp3F3yV9qhaHbXG github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/MinterTeam/node-grpc-gateway v1.4.3-0.20211208134306-ae7964561da4 h1:FwYtiBig/nwzJLTuksrqbhSV1Tr+RByzEzW5dOzEJYc= github.com/MinterTeam/node-grpc-gateway v1.4.3-0.20211208134306-ae7964561da4/go.mod h1:kSjFnXZ52XTOaxj4+nbahfMsAt8GsEIc9DSMzOlfALI= -github.com/MinterTeam/tendermint v0.34.15-beta1 h1:8gYx6lR6Z0WMQD4Akhnkxu+yo/SyVmOmew9ONaUvo3M= -github.com/MinterTeam/tendermint v0.34.15-beta1/go.mod h1:/7EDAw02rD7GT8syC317cX9ZhZTCdaFVvYjU8W+yJSs= +github.com/MinterTeam/tendermint v0.34.15-beta1.0.20211216233158-7d1d8faa5437 h1:Y4ZyRwcCErvNlE0c5s5tD6eaMdw9g9RaBe+B+F2coUQ= +github.com/MinterTeam/tendermint v0.34.15-beta1.0.20211216233158-7d1d8faa5437/go.mod h1:/7EDAw02rD7GT8syC317cX9ZhZTCdaFVvYjU8W+yJSs= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= From 9e87a40eafed278a35d26c26ebfc629c60afa62f Mon Sep 17 00:00:00 2001 From: klim0v Date: Fri, 17 Dec 2021 17:05:11 +0300 Subject: [PATCH 23/39] fix bancor estimate_coin_sell_all.go --- api/v2/service/estimate_coin_sell_all.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/api/v2/service/estimate_coin_sell_all.go b/api/v2/service/estimate_coin_sell_all.go index 326f874ae..d2968e22f 100644 --- a/api/v2/service/estimate_coin_sell_all.go +++ b/api/v2/service/estimate_coin_sell_all.go @@ -225,20 +225,6 @@ func (s *Service) calcSellAllFromBancor(value *big.Int, coinTo *coins.Model, coi ))) } - if !coinFrom.ID().IsBaseCoin() { - value = formula.CalculateSaleReturn(coinFrom.Volume(), coinFrom.Reserve(), coinFrom.Crr(), value) - if errResp := transaction.CheckReserveUnderflow(coinFrom, value); errResp != nil { - return nil, s.createError(status.New(codes.FailedPrecondition, errResp.Log), errResp.Info) - } - } - - if !coinTo.ID().IsBaseCoin() { - value = formula.CalculatePurchaseReturn(coinTo.Volume(), coinTo.Reserve(), coinTo.Crr(), value) - if errResp := transaction.CheckForCoinSupplyOverflow(coinTo, value); errResp != nil { - return nil, s.createError(status.New(codes.FailedPrecondition, errResp.Log), errResp.Info) - } - } - if !coinFrom.ID().IsBaseCoin() { value = formula.CalculateSaleReturn(coinFrom.Volume(), coinFrom.Reserve(), coinFrom.Crr(), value) if errResp := transaction.CheckReserveUnderflow(coinFrom, value); errResp != nil { From 987e62649cb3e89092b674c233f9f608585fc24d Mon Sep 17 00:00:00 2001 From: klim0v Date: Fri, 17 Dec 2021 17:22:10 +0300 Subject: [PATCH 24/39] fix neg pow bancor estimate_coin_sell_all.go --- api/v2/service/estimate_coin_sell_all.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/v2/service/estimate_coin_sell_all.go b/api/v2/service/estimate_coin_sell_all.go index d2968e22f..d971fab7d 100644 --- a/api/v2/service/estimate_coin_sell_all.go +++ b/api/v2/service/estimate_coin_sell_all.go @@ -226,15 +226,19 @@ func (s *Service) calcSellAllFromBancor(value *big.Int, coinTo *coins.Model, coi } if !coinFrom.ID().IsBaseCoin() { - value = formula.CalculateSaleReturn(coinFrom.Volume(), coinFrom.Reserve(), coinFrom.Crr(), value) - if errResp := transaction.CheckReserveUnderflow(coinFrom, value); errResp != nil { + var errResp *transaction.Response + value, errResp = transaction.CalculateSaleReturnAndCheck(coinFrom, value) + if errResp != nil { return nil, s.createError(status.New(codes.FailedPrecondition, errResp.Log), errResp.Info) } } + value.Sub(value, commissionInBaseCoin) + if value.Sign() != 1 { return nil, status.New(codes.FailedPrecondition, "Not enough coins to pay commission").Err() } + if !coinTo.ID().IsBaseCoin() { value = formula.CalculatePurchaseReturn(coinTo.Volume(), coinTo.Reserve(), coinTo.Crr(), value) if errResp := transaction.CheckForCoinSupplyOverflow(coinTo, value); errResp != nil { From 90fb66244752a53d5796575c28064d6615e4eae9 Mon Sep 17 00:00:00 2001 From: klim0v Date: Fri, 17 Dec 2021 18:41:00 +0300 Subject: [PATCH 25/39] Update CHANGELOG.md --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17cc5af9b..5660c3006 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [v2.6.1](https://github.com/MinterTeam/minter-go-node/tree/v2.6.1) + +[Full Changelog](https://github.com/MinterTeam/minter-go-node/compare/v2.6.0...v2.6.1) + +### Added + +- Support for state sync snapshots + +### Fixed + +- Bug evaluating the exchange of coins through a bankor in API `/v2/estimate_coin_sell_all` + ## [v2.6.0](https://github.com/MinterTeam/minter-go-node/tree/v2.6.0) [Full Changelog](https://github.com/MinterTeam/minter-go-node/compare/v2.5.0...v2.6.0) From efdefa4803539968b671c27c4368453cb852b6ff Mon Sep 17 00:00:00 2001 From: klim0v Date: Fri, 17 Dec 2021 19:32:22 +0300 Subject: [PATCH 26/39] fix tests --- .github/workflows/main.yml | 6 +- .github/workflows/tests.yml | 24 + coreV2/mempool/bench_test.go | 81 +- coreV2/mempool/cache.go | 199 +-- coreV2/mempool/priority_mempool.go | 1459 ++++++++++----------- coreV2/mempool/priority_mempool_test.go | 1599 ++++++++++++----------- coreV2/minter/minter_test.go | 1 - go.mod | 2 +- go.sum | 4 +- tree/tree.go | 2 +- 10 files changed, 1702 insertions(+), 1675 deletions(-) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8034c1d65..deaa4e03f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,12 +3,12 @@ name: docker on: push: branches: - - master - - dev + # - master + # - dev pull_request: branches: - - master +# - master jobs: docker: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 000000000..c1ab14615 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,24 @@ +name: docker + +on: + push: + branches: + - master + - dev + + pull_request: + branches: + - master + - dev + +jobs: + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: '1.17' + - run: go mod tidy && go build ./... + - name: Test + run: go test -cover ./... diff --git a/coreV2/mempool/bench_test.go b/coreV2/mempool/bench_test.go index bced28f05..78b038f71 100644 --- a/coreV2/mempool/bench_test.go +++ b/coreV2/mempool/bench_test.go @@ -1,42 +1,43 @@ package mempool -import ( - "github.com/tendermint/tendermint/abci/example/kvstore" - tmpool "github.com/tendermint/tendermint/mempool" - "github.com/tendermint/tendermint/proxy" - "testing" -) - -func BenchmarkReap(b *testing.B) { - app := kvstore.NewApplication() - cc := proxy.NewLocalClientCreator(app) - mempool, cleanup := newMempoolWithApp(cc) - defer cleanup() - - size := 10000 - mempool.config.Size = size - for i := 0; i < size; i++ { - tx := createTxWithRandomGas(116, nil) - if err := mempool.CheckTx(tx, nil, tmpool.TxInfo{}); err != nil { - b.Error(err) - } - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - mempool.ReapMaxBytesMaxGas(100000000, 10000000) - } -} - -func BenchmarkCheckTx(b *testing.B) { - app := kvstore.NewApplication() - cc := proxy.NewLocalClientCreator(app) - mempool, cleanup := newMempoolWithApp(cc) - defer cleanup() - - for i := 0; i < b.N; i++ { - tx := createTxWithRandomGas(116, nil) - if err := mempool.CheckTx(tx, nil, tmpool.TxInfo{}); err != nil { - b.Error(err) - } - } -} +// +//import ( +// "github.com/tendermint/tendermint/abci/example/kvstore" +// tmpool "github.com/tendermint/tendermint/mempool" +// "github.com/tendermint/tendermint/proxy" +// "testing" +//) +// +//func BenchmarkReap(b *testing.B) { +// app := kvstore.NewApplication() +// cc := proxy.NewLocalClientCreator(app) +// mempool, cleanup := newMempoolWithApp(cc) +// defer cleanup() +// +// size := 10000 +// mempool.config.Size = size +// for i := 0; i < size; i++ { +// tx := createTxWithRandomGas(116, nil) +// if err := mempool.CheckTx(tx, nil, tmpool.TxInfo{}); err != nil { +// b.Error(err) +// } +// } +// b.ResetTimer() +// for i := 0; i < b.N; i++ { +// mempool.ReapMaxBytesMaxGas(100000000, 10000000) +// } +//} +// +//func BenchmarkCheckTx(b *testing.B) { +// app := kvstore.NewApplication() +// cc := proxy.NewLocalClientCreator(app) +// mempool, cleanup := newMempoolWithApp(cc) +// defer cleanup() +// +// for i := 0; i < b.N; i++ { +// tx := createTxWithRandomGas(116, nil) +// if err := mempool.CheckTx(tx, nil, tmpool.TxInfo{}); err != nil { +// b.Error(err) +// } +// } +//} diff --git a/coreV2/mempool/cache.go b/coreV2/mempool/cache.go index 02aa94b37..2ff2d1ad1 100644 --- a/coreV2/mempool/cache.go +++ b/coreV2/mempool/cache.go @@ -1,101 +1,102 @@ package mempool -import ( - "container/list" - "crypto/sha256" - tmsync "github.com/tendermint/tendermint/libs/sync" - "github.com/tendermint/tendermint/types" -) - -type txCache interface { - Reset() - Push(tx types.Tx) bool - Remove(tx types.Tx) -} - -// mapTxCache maintains a LRU cache of transactions. This only stores the hash -// of the tx, due to memory concerns. -type mapTxCache struct { - mtx tmsync.Mutex - size int - cacheMap map[[TxKeySize]byte]*list.Element - list *list.List -} - -var _ txCache = (*mapTxCache)(nil) - -// newMapTxCache returns a new mapTxCache. -func newMapTxCache(cacheSize int) *mapTxCache { - return &mapTxCache{ - size: cacheSize, - cacheMap: make(map[[TxKeySize]byte]*list.Element, cacheSize), - list: list.New(), - } -} - -// Reset resets the cache to an empty state. -func (cache *mapTxCache) Reset() { - cache.mtx.Lock() - cache.cacheMap = make(map[[TxKeySize]byte]*list.Element, cache.size) - cache.list.Init() - cache.mtx.Unlock() -} - -// Push adds the given tx to the cache and returns true. It returns -// false if tx is already in the cache. -func (cache *mapTxCache) Push(tx types.Tx) bool { - cache.mtx.Lock() - defer cache.mtx.Unlock() - - // Use the tx hash in the cache - txHash := TxKey(tx) - if moved, exists := cache.cacheMap[txHash]; exists { - cache.list.MoveToBack(moved) - return false - } - - if cache.list.Len() >= cache.size { - popped := cache.list.Front() - if popped != nil { - poppedTxHash := popped.Value.([TxKeySize]byte) - delete(cache.cacheMap, poppedTxHash) - cache.list.Remove(popped) - } - } - e := cache.list.PushBack(txHash) - cache.cacheMap[txHash] = e - return true -} - -// Remove removes the given tx from the cache. -func (cache *mapTxCache) Remove(tx types.Tx) { - cache.mtx.Lock() - txHash := TxKey(tx) - popped := cache.cacheMap[txHash] - delete(cache.cacheMap, txHash) - if popped != nil { - cache.list.Remove(popped) - } - - cache.mtx.Unlock() -} - -type nopTxCache struct{} - -var _ txCache = (*nopTxCache)(nil) - -func (nopTxCache) Reset() {} -func (nopTxCache) Push(types.Tx) bool { return true } -func (nopTxCache) Remove(types.Tx) {} - -//-------------------------------------------------------------------------------- - -// TxKey is the fixed length array hash used as the key in maps. -func TxKey(tx types.Tx) [TxKeySize]byte { - return sha256.Sum256(tx) -} - -// txID is a hash of the Tx. -func txID(tx []byte) []byte { - return types.Tx(tx).Hash() -} +// +//import ( +// "container/list" +// "crypto/sha256" +// tmsync "github.com/tendermint/tendermint/libs/sync" +// "github.com/tendermint/tendermint/types" +//) +// +//type txCache interface { +// Reset() +// Push(tx types.Tx) bool +// Remove(tx types.Tx) +//} +// +//// mapTxCache maintains a LRU cache of transactions. This only stores the hash +//// of the tx, due to memory concerns. +//type mapTxCache struct { +// mtx tmsync.Mutex +// size int +// cacheMap map[[TxKeySize]byte]*list.Element +// list *list.List +//} +// +//var _ txCache = (*mapTxCache)(nil) +// +//// newMapTxCache returns a new mapTxCache. +//func newMapTxCache(cacheSize int) *mapTxCache { +// return &mapTxCache{ +// size: cacheSize, +// cacheMap: make(map[[TxKeySize]byte]*list.Element, cacheSize), +// list: list.New(), +// } +//} +// +//// Reset resets the cache to an empty state. +//func (cache *mapTxCache) Reset() { +// cache.mtx.Lock() +// cache.cacheMap = make(map[[TxKeySize]byte]*list.Element, cache.size) +// cache.list.Init() +// cache.mtx.Unlock() +//} +// +//// Push adds the given tx to the cache and returns true. It returns +//// false if tx is already in the cache. +//func (cache *mapTxCache) Push(tx types.Tx) bool { +// cache.mtx.Lock() +// defer cache.mtx.Unlock() +// +// // Use the tx hash in the cache +// txHash := TxKey(tx) +// if moved, exists := cache.cacheMap[txHash]; exists { +// cache.list.MoveToBack(moved) +// return false +// } +// +// if cache.list.Len() >= cache.size { +// popped := cache.list.Front() +// if popped != nil { +// poppedTxHash := popped.Value.([TxKeySize]byte) +// delete(cache.cacheMap, poppedTxHash) +// cache.list.Remove(popped) +// } +// } +// e := cache.list.PushBack(txHash) +// cache.cacheMap[txHash] = e +// return true +//} +// +//// Remove removes the given tx from the cache. +//func (cache *mapTxCache) Remove(tx types.Tx) { +// cache.mtx.Lock() +// txHash := TxKey(tx) +// popped := cache.cacheMap[txHash] +// delete(cache.cacheMap, txHash) +// if popped != nil { +// cache.list.Remove(popped) +// } +// +// cache.mtx.Unlock() +//} +// +//type nopTxCache struct{} +// +//var _ txCache = (*nopTxCache)(nil) +// +//func (nopTxCache) Reset() {} +//func (nopTxCache) Push(types.Tx) bool { return true } +//func (nopTxCache) Remove(types.Tx) {} +// +////-------------------------------------------------------------------------------- +// +//// TxKey is the fixed length array hash used as the key in maps. +//func TxKey(tx types.Tx) [TxKeySize]byte { +// return sha256.Sum256(tx) +//} +// +//// txID is a hash of the Tx. +//func txID(tx []byte) []byte { +// return types.Tx(tx).Hash() +//} diff --git a/coreV2/mempool/priority_mempool.go b/coreV2/mempool/priority_mempool.go index f11c102f2..7e9fe31bd 100644 --- a/coreV2/mempool/priority_mempool.go +++ b/coreV2/mempool/priority_mempool.go @@ -1,731 +1,732 @@ package mempool -import ( - "bytes" - "crypto/sha256" - "fmt" - "github.com/MinterTeam/minter-go-node/coreV2/transaction" - tmpool "github.com/tendermint/tendermint/mempool" - "sort" - "sync" - "sync/atomic" - - abci "github.com/tendermint/tendermint/abci/types" - cfg "github.com/tendermint/tendermint/config" - auto "github.com/tendermint/tendermint/libs/autofile" - "github.com/tendermint/tendermint/libs/clist" - "github.com/tendermint/tendermint/libs/log" - tmmath "github.com/tendermint/tendermint/libs/math" - tmos "github.com/tendermint/tendermint/libs/os" - tmsync "github.com/tendermint/tendermint/libs/sync" - "github.com/tendermint/tendermint/p2p" - "github.com/tendermint/tendermint/proxy" - "github.com/tendermint/tendermint/types" -) - -// TxKeySize is the size of the transaction key index -const TxKeySize = sha256.Size - -var newline = []byte("\n") - -//-------------------------------------------------------------------------------- - -// PriorityMempool is an ordered in-memory pool for transactions before they are -// proposed in a consensus round. Transaction validity is checked using the -// CheckTx abci message before the transaction is added to the pool. The -// mempool uses a concurrent list structure for storing transactions that can -// be efficiently accessed by multiple concurrent readers. -type PriorityMempool struct { - // Atomic integers - height int64 // the last block Update()'d to - txsBytes int64 // total size of mempool, in bytes - - // notify listeners (ie. consensus) when txs are available - notifiedTxsAvailable bool - txsAvailable chan struct{} // fires once for each height, when the mempool is not empty - - config *cfg.MempoolConfig - - // Exclusive mutex for Update method to prevent concurrent execution of - // CheckTx or ReapMaxBytesMaxGas(ReapMaxTxs) methods. - updateMtx tmsync.RWMutex - preCheck tmpool.PreCheckFunc - postCheck tmpool.PostCheckFunc - - wal *auto.AutoFile // a log of mempool txs - txs *clist.CList // concurrent linked-list of good txs - proxyAppConn proxy.AppConnMempool - - // Track whether we're rechecking txs. - // These are not protected by a mutex and are expected to be mutated in - // serial (ie. by abci responses which are called in serial). - recheckCursor *clist.CElement // next expected response - recheckEnd *clist.CElement // re-checking stops here - - // Map for quick access to txs to record sender in CheckTx. - // txsMap: txKey -> CElement - txsMap sync.Map - - // Keep a cache of already-seen txs. - // This reduces the pressure on the proxyApp. - cache txCache - - logger log.Logger - - metrics *tmpool.Metrics - - executor transaction.DecoderTx - - txsgpmu sync.RWMutex - txsByGas map[uint32]map[[32]byte]*tmpool.MempoolTx - minterTxMap sync.Map - gasPrices []uint32 -} - -// PriorityMempoolOption sets an optional parameter on the mempool. -type PriorityMempoolOption func(*PriorityMempool) - -// NewPriorityMempool returns a new mempool with the given configuration and connection to an application. -func NewPriorityMempool( - config *cfg.MempoolConfig, - proxyAppConn proxy.AppConnMempool, - height int64, - options ...PriorityMempoolOption, -) *PriorityMempool { - mempool := &PriorityMempool{ - config: config, - proxyAppConn: proxyAppConn, - txs: clist.New(), - height: height, - recheckCursor: nil, - recheckEnd: nil, - logger: log.NewNopLogger(), - metrics: tmpool.NopMetrics(), - executor: transaction.NewExecutor(transaction.GetData), - txsByGas: make(map[uint32]map[[32]byte]*tmpool.MempoolTx), - } - if config.CacheSize > 0 { - mempool.cache = newMapTxCache(config.CacheSize) - } else { - mempool.cache = nopTxCache{} - } - proxyAppConn.SetResponseCallback(mempool.globalCb) - for _, option := range options { - option(mempool) - } - return mempool -} - -// NOTE: not thread safe - should only be called once, on startup -func (mem *PriorityMempool) EnableTxsAvailable() { - mem.txsAvailable = make(chan struct{}, 1) -} - -// SetLogger sets the Logger. -func (mem *PriorityMempool) SetLogger(l log.Logger) { - mem.logger = l -} - -// WithPreCheck sets a filter for the mempool to reject a tx if f(tx) returns -// false. This is ran before CheckTx. Only applies to the first created block. -// After that, Update overwrites the existing value. -func WithPreCheck(f tmpool.PreCheckFunc) PriorityMempoolOption { - return func(mem *PriorityMempool) { mem.preCheck = f } -} - -// WithPostCheck sets a filter for the mempool to reject a tx if f(tx) returns -// false. This is ran after CheckTx. Only applies to the first created block. -// After that, Update overwrites the existing value. -func WithPostCheck(f tmpool.PostCheckFunc) PriorityMempoolOption { - return func(mem *PriorityMempool) { mem.postCheck = f } -} - -// WithMetrics sets the metrics. -func WithMetrics(metrics *tmpool.Metrics) PriorityMempoolOption { - return func(mem *PriorityMempool) { mem.metrics = metrics } -} - -func (mem *PriorityMempool) InitWAL() error { - var ( - walDir = mem.config.WalDir() - walFile = walDir + "/wal" - ) - - const perm = 0700 - if err := tmos.EnsureDir(walDir, perm); err != nil { - return err - } - - af, err := auto.OpenAutoFile(walFile) - if err != nil { - return fmt.Errorf("can't open autofile %s: %w", walFile, err) - } - - mem.wal = af - return nil -} - -func (mem *PriorityMempool) CloseWAL() { - if err := mem.wal.Close(); err != nil { - mem.logger.Error("Error closing WAL", "err", err) - } - mem.wal = nil -} - -// Safe for concurrent use by multiple goroutines. -func (mem *PriorityMempool) Lock() { - mem.updateMtx.Lock() -} - -// Safe for concurrent use by multiple goroutines. -func (mem *PriorityMempool) Unlock() { - mem.updateMtx.Unlock() -} - -// Safe for concurrent use by multiple goroutines. -func (mem *PriorityMempool) Size() int { - return mem.txs.Len() -} - -// Safe for concurrent use by multiple goroutines. -func (mem *PriorityMempool) TxsBytes() int64 { - return atomic.LoadInt64(&mem.txsBytes) -} - -// Lock() must be help by the caller during execution. -func (mem *PriorityMempool) FlushAppConn() error { - return mem.proxyAppConn.FlushSync() -} - -// XXX: Unsafe! Calling Flush may leave mempool in inconsistent state. -func (mem *PriorityMempool) Flush() { - mem.updateMtx.RLock() - defer mem.updateMtx.RUnlock() - - _ = atomic.SwapInt64(&mem.txsBytes, 0) - mem.cache.Reset() - - for e := mem.txs.Front(); e != nil; e = e.Next() { - mem.txs.Remove(e) - mem.removeTxFromTxsGasPriceMap(e.Value.(*tmpool.MempoolTx).Tx) - e.DetachPrev() - } - - mem.txsMap.Range(func(key, _ interface{}) bool { - mem.txsMap.Delete(key) - return true - }) -} - -// TxsFront returns the first transaction in the ordered list for peer -// goroutines to call .NextWait() on. -// FIXME: leaking implementation details! -// -// Safe for concurrent use by multiple goroutines. -func (mem *PriorityMempool) TxsFront() *clist.CElement { - return mem.txs.Front() -} - -// TxsWaitChan returns a channel to wait on transactions. It will be closed -// once the mempool is not empty (ie. the internal `mem.txs` has at least one -// element) -// -// Safe for concurrent use by multiple goroutines. -func (mem *PriorityMempool) TxsWaitChan() <-chan struct{} { - return mem.txs.WaitChan() -} - -// It blocks if we're waiting on Update() or Reap(). -// cb: A callback from the CheckTx command. -// It gets called from another goroutine. -// CONTRACT: Either cb will get called, or err returned. -// -// Safe for concurrent use by multiple goroutines. -func (mem *PriorityMempool) CheckTx(tx types.Tx, cb func(*abci.Response), txInfo tmpool.TxInfo) error { - mem.updateMtx.RLock() - // use defer to unlock mutex because application (*local client*) might panic - defer mem.updateMtx.RUnlock() - - txSize := len(tx) - - if err := mem.isFull(txSize); err != nil { - return err - } - - if txSize > mem.config.MaxTxBytes { - return ErrTxTooLarge{mem.config.MaxTxBytes, txSize} - } - - if mem.preCheck != nil { - if err := mem.preCheck(tx); err != nil { - return tmpool.ErrPreCheck{err} - } - } - - // NOTE: writing to the WAL and calling proxy must be done before adding tx - // to the cache. otherwise, if either of them fails, next time CheckTx is - // called with tx, ErrTxInCache will be returned without tx being checked at - // all even once. - if mem.wal != nil { - // TODO: Notify administrators when WAL fails - _, err := mem.wal.Write(append([]byte(tx), newline...)) - if err != nil { - return fmt.Errorf("wal.Write: %w", err) - } - } - - // NOTE: proxyAppConn may error if tx buffer is full - if err := mem.proxyAppConn.Error(); err != nil { - return err - } - - if !mem.cache.Push(tx) { - // Record a new sender for a tx we've already seen. - // Note it's possible a tx is still in the cache but no longer in the mempool - // (eg. after committing a block, txs are removed from mempool but not cache), - // so we only record the sender for txs still in the mempool. - if e, ok := mem.txsMap.Load(TxKey(tx)); ok { - memTx := e.(*clist.CElement).Value.(*tmpool.MempoolTx) - memTx.Senders.LoadOrStore(txInfo.SenderID, true) - // TODO: consider punishing peer for dups, - // its non-trivial since invalid txs can become valid, - // but they can spam the same tx with little cost to them atm. - } - - return tmpool.ErrTxInCache - } - - reqRes := mem.proxyAppConn.CheckTxAsync(abci.RequestCheckTx{Tx: tx}) - reqRes.SetCallback(mem.reqResCb(tx, txInfo.SenderID, txInfo.SenderP2PID, cb)) - - return nil -} - -// Global callback that will be called after every ABCI response. -// Having a single global callback avoids needing to set a callback for each request. -// However, processing the checkTx response requires the peerID (so we can track which txs we heard from who), -// and peerID is not included in the ABCI request, so we have to set request-specific callbacks that -// include this information. If we're not in the midst of a recheck, this function will just return, -// so the request specific callback can do the work. -// -// When rechecking, we don't need the peerID, so the recheck callback happens -// here. -func (mem *PriorityMempool) globalCb(req *abci.Request, res *abci.Response) { - if mem.recheckCursor == nil { - return - } - - mem.metrics.RecheckTimes.Add(1) - mem.resCbRecheck(req, res) - - // update metrics - mem.metrics.Size.Set(float64(mem.Size())) -} - -// Request specific callback that should be set on individual reqRes objects -// to incorporate local information when processing the response. -// This allows us to track the peer that sent us this tx, so we can avoid sending it back to them. -// NOTE: alternatively, we could include this information in the ABCI request itself. -// -// External callers of CheckTx, like the RPC, can also pass an externalCb through here that is called -// when all other response processing is complete. -// -// Used in CheckTx to record PeerID who sent us the tx. -func (mem *PriorityMempool) reqResCb( - tx []byte, - peerID uint16, - peerP2PID p2p.ID, - externalCb func(*abci.Response), -) func(res *abci.Response) { - return func(res *abci.Response) { - if mem.recheckCursor != nil { - // this should never happen - panic("recheck cursor is not nil in reqResCb") - } - - mem.resCbFirstTime(tx, peerID, peerP2PID, res) - - // update metrics - mem.metrics.Size.Set(float64(mem.Size())) - - // passed in by the caller of CheckTx, eg. the RPC - if externalCb != nil { - externalCb(res) - } - } -} - -// Called from: -// - resCbFirstTime (lock not held) if tx is valid -func (mem *PriorityMempool) addTx(memTx *tmpool.MempoolTx) { - tx, err := mem.executor.DecodeFromBytes(memTx.Tx) // TODO: handle error - if err != nil { - panic(fmt.Sprintf("failed to decode tx: %X", memTx.Tx)) - } - - mem.txsgpmu.Lock() - if _, ok := mem.txsByGas[tx.GasPrice]; !ok { - mem.txsByGas[tx.GasPrice] = make(map[[32]byte]*tmpool.MempoolTx) - } - mem.txsByGas[tx.GasPrice][TxKey(memTx.Tx)] = memTx - mem.txsgpmu.Unlock() - mem.minterTxMap.Store(TxKey(memTx.Tx), tx) - mem.addGasPrice(tx.GasPrice) - - e := mem.txs.PushBack(memTx) - mem.txsMap.Store(TxKey(memTx.Tx), e) - atomic.AddInt64(&mem.txsBytes, int64(len(memTx.Tx))) - mem.metrics.TxSizeBytes.Observe(float64(len(memTx.Tx))) -} - -// Called from: -// - Update (lock held) if tx was committed -// - resCbRecheck (lock not held) if tx was invalidated -func (mem *PriorityMempool) removeTx(tx types.Tx, elem *clist.CElement, removeFromCache bool) { - mem.removeTxFromTxsGasPriceMap(tx) - mem.txs.Remove(elem) - elem.DetachPrev() - mem.txsMap.Delete(TxKey(tx)) - atomic.AddInt64(&mem.txsBytes, int64(-len(tx))) - - if removeFromCache { - mem.cache.Remove(tx) - } -} - -// RemoveTxByKey removes a transaction from the mempool by its TxKey index. -func (mem *PriorityMempool) RemoveTxByKey(txKey [TxKeySize]byte, removeFromCache bool) { - if e, ok := mem.txsMap.Load(txKey); ok { - memTx := e.(*clist.CElement).Value.(*tmpool.MempoolTx) - if memTx != nil { - mem.removeTx(memTx.Tx, e.(*clist.CElement), removeFromCache) - } - } -} - -func (mem *PriorityMempool) isFull(txSize int) error { - var ( - memSize = mem.Size() - txsBytes = mem.TxsBytes() - ) - - if memSize >= mem.config.Size || int64(txSize)+txsBytes > mem.config.MaxTxsBytes { - return ErrMempoolIsFull{ - memSize, mem.config.Size, - txsBytes, mem.config.MaxTxsBytes, - } - } - - return nil -} - -// callback, which is called after the app checked the tx for the first time. -// -// The case where the app checks the tx for the second and subsequent times is -// handled by the resCbRecheck callback. -func (mem *PriorityMempool) resCbFirstTime( - tx []byte, - peerID uint16, - peerP2PID p2p.ID, - res *abci.Response, -) { - switch r := res.Value.(type) { - case *abci.Response_CheckTx: - var postCheckErr error - if mem.postCheck != nil { - postCheckErr = mem.postCheck(tx, r.CheckTx) - } - if (r.CheckTx.Code == abci.CodeTypeOK) && postCheckErr == nil { - // Check mempool isn't full again to reduce the chance of exceeding the - // limits. - if err := mem.isFull(len(tx)); err != nil { - // remove from cache (mempool might have a space later) - mem.cache.Remove(tx) - mem.logger.Error(err.Error()) - return - } - - memTx := &tmpool.MempoolTx{ - Height: mem.height, - GasWanted: r.CheckTx.GasWanted, - Tx: tx, - } - memTx.Senders.Store(peerID, true) - mem.addTx(memTx) - mem.logger.Debug("added good transaction", - "tx", txID(tx), - "res", r, - "height", memTx.Height, - "total", mem.Size(), - ) - mem.notifyTxsAvailable() - } else { - // ignore bad transaction - mem.logger.Debug("rejected bad transaction", - "tx", txID(tx), "peerID", peerP2PID, "res", r, "err", postCheckErr) - mem.metrics.FailedTxs.Add(1) - if !mem.config.KeepInvalidTxsInCache { - // remove from cache (it might be good later) - mem.cache.Remove(tx) - } - } - default: - // ignore other messages - } -} - -// callback, which is called after the app rechecked the tx. -// -// The case where the app checks the tx for the first time is handled by the -// resCbFirstTime callback. -func (mem *PriorityMempool) resCbRecheck(req *abci.Request, res *abci.Response) { - switch r := res.Value.(type) { - case *abci.Response_CheckTx: - tx := req.GetCheckTx().Tx - memTx := mem.recheckCursor.Value.(*tmpool.MempoolTx) - if !bytes.Equal(tx, memTx.Tx) { - panic(fmt.Sprintf( - "Unexpected tx response from proxy during recheck\nExpected %X, got %X", - memTx.Tx, - tx)) - } - var postCheckErr error - if mem.postCheck != nil { - postCheckErr = mem.postCheck(tx, r.CheckTx) - } - if (r.CheckTx.Code == abci.CodeTypeOK) && postCheckErr == nil { - // Good, nothing to do. - } else { - // Tx became invalidated due to newly committed block. - mem.logger.Debug("tx is no longer valid", "tx", txID(tx), "res", r, "err", postCheckErr) - // NOTE: we remove tx from the cache because it might be good later - mem.removeTx(tx, mem.recheckCursor, !mem.config.KeepInvalidTxsInCache) - } - if mem.recheckCursor == mem.recheckEnd { - mem.recheckCursor = nil - } else { - mem.recheckCursor = mem.recheckCursor.Next() - } - if mem.recheckCursor == nil { - // Done! - mem.logger.Debug("done rechecking txs") - - // incase the recheck removed all txs - if mem.Size() > 0 { - mem.notifyTxsAvailable() - } - } - default: - // ignore other messages - } -} - -// Safe for concurrent use by multiple goroutines. -func (mem *PriorityMempool) TxsAvailable() <-chan struct{} { - return mem.txsAvailable -} - -func (mem *PriorityMempool) notifyTxsAvailable() { - if mem.Size() == 0 { - panic("notified txs available but mempool is empty!") - } - if mem.txsAvailable != nil && !mem.notifiedTxsAvailable { - // channel cap is 1, so this will send once - mem.notifiedTxsAvailable = true - select { - case mem.txsAvailable <- struct{}{}: - default: - } - } -} - -// Safe for concurrent use by multiple goroutines. -func (mem *PriorityMempool) ReapMaxBytesMaxGas(maxBytes, maxGas int64) types.Txs { - mem.updateMtx.RLock() - defer mem.updateMtx.RUnlock() - - var totalGas int64 - - // TODO: we will get a performance boost if we have a good estimate of avg - // size per tx, and set the initial capacity based off of that. - // txs := make([]types.Tx, 0, tmmath.MinInt(mem.txs.Len(), max/mem.avgTxSize)) - txs := make([]types.Tx, 0, mem.txs.Len()) - - mem.txsgpmu.RLock() - defer mem.txsgpmu.RUnlock() - - for _, gp := range mem.gasPrices { - for _, memTx := range mem.txsByGas[gp] { - dataSize := types.ComputeProtoSizeForTxs(append(txs, memTx.Tx)) - - // Check total size requirement - if maxBytes > -1 && dataSize > maxBytes { - return txs - } - // Check total gas requirement. - // If maxGas is negative, skip this check. - // Since newTotalGas < masGas, which - // must be non-negative, it follows that this won't overflow. - newTotalGas := totalGas + memTx.GasWanted - if maxGas > -1 && newTotalGas > maxGas { - return txs - } - totalGas = newTotalGas - txs = append(txs, memTx.Tx) - } - } - - return txs -} - -// Safe for concurrent use by multiple goroutines. -func (mem *PriorityMempool) ReapMaxTxs(max int) types.Txs { - mem.updateMtx.RLock() - defer mem.updateMtx.RUnlock() - - if max < 0 { - max = mem.txs.Len() - } - - txs := make([]types.Tx, 0, tmmath.MinInt(mem.txs.Len(), max)) - for e := mem.txs.Front(); e != nil && len(txs) <= max; e = e.Next() { - memTx := e.Value.(*tmpool.MempoolTx) - txs = append(txs, memTx.Tx) - } - return txs -} - -// Lock() must be help by the caller during execution. -func (mem *PriorityMempool) Update( - height int64, - txs types.Txs, - deliverTxResponses []*abci.ResponseDeliverTx, - preCheck tmpool.PreCheckFunc, - postCheck tmpool.PostCheckFunc, -) error { - // Set height - mem.height = height - mem.notifiedTxsAvailable = false - - if preCheck != nil { - mem.preCheck = preCheck - } - if postCheck != nil { - mem.postCheck = postCheck - } - - for i, tx := range txs { - if deliverTxResponses[i].Code == abci.CodeTypeOK { - // Add valid committed tx to the cache (if missing). - _ = mem.cache.Push(tx) - } else if !mem.config.KeepInvalidTxsInCache { - // Allow invalid transactions to be resubmitted. - mem.cache.Remove(tx) - } - - // Remove committed tx from the mempool. - // - // Note an evil proposer can drop valid txs! - // Mempool before: - // 100 -> 101 -> 102 - // Block, proposed by an evil proposer: - // 101 -> 102 - // Mempool after: - // 100 - // https://github.com/tendermint/tendermint/issues/3322. - if e, ok := mem.txsMap.Load(TxKey(tx)); ok { - mem.removeTx(tx, e.(*clist.CElement), false) - } - } - - // Either recheck non-committed txs to see if they became invalid - // or just notify there're some txs left. - if mem.Size() > 0 { - if mem.config.Recheck { - mem.logger.Debug("recheck txs", "numtxs", mem.Size(), "height", height) - mem.recheckTxs() - // At this point, mem.txs are being rechecked. - // mem.recheckCursor re-scans mem.txs and possibly removes some txs. - // Before mem.Reap(), we should wait for mem.recheckCursor to be nil. - } else { - mem.notifyTxsAvailable() - } - } - - // Update metrics - mem.metrics.Size.Set(float64(mem.Size())) - - return nil -} - -func (mem *PriorityMempool) recheckTxs() { - if mem.Size() == 0 { - panic("recheckTxs is called, but the mempool is empty") - } - - mem.recheckCursor = mem.txs.Front() - mem.recheckEnd = mem.txs.Back() - - // Push txs to proxyAppConn - // NOTE: globalCb may be called concurrently. - for e := mem.txs.Front(); e != nil; e = e.Next() { - memTx := e.Value.(*tmpool.MempoolTx) - mem.proxyAppConn.CheckTxAsync(abci.RequestCheckTx{ - Tx: memTx.Tx, - Type: abci.CheckTxType_Recheck, - }) - } - - mem.proxyAppConn.FlushAsync() -} - -// Add new gas price to list of available gas prices -func (mem *PriorityMempool) addGasPrice(gp uint32) { - exists := false - i := sort.Search(len(mem.gasPrices), func(i int) bool { - if mem.gasPrices[i] == gp { - exists = true - } - return mem.gasPrices[i] < gp - }) - - if exists { - return - } - - mem.gasPrices = append(mem.gasPrices, 0) - copy(mem.gasPrices[i+1:], mem.gasPrices[i:]) - mem.gasPrices[i] = gp -} - -// Remove gas price from list of available gas prices -func (mem *PriorityMempool) removeGasPrice(gp uint32) { - key := 0 - for i, v := range mem.gasPrices { - if v == gp { - key = i - break - } - } - - mem.gasPrices = append(mem.gasPrices[:key], mem.gasPrices[key+1:]...) -} - -// Get transaction gas price from map by key -func (mem *PriorityMempool) getTxGasPriceFromMap(tx types.Tx) uint32 { - data, _ := mem.minterTxMap.Load(TxKey(tx)) - return data.(*transaction.Transaction).GasPrice -} - -// Remove transaction from map -func (mem *PriorityMempool) removeTxFromTxsGasPriceMap(tx types.Tx) { - mem.txsgpmu.Lock() - defer mem.txsgpmu.Unlock() - - gp := mem.getTxGasPriceFromMap(tx) - delete(mem.txsByGas[gp], TxKey(tx)) - - if len(mem.txsByGas[gp]) == 0 { - mem.removeGasPrice(gp) - } -} +// +//import ( +// "bytes" +// "crypto/sha256" +// "fmt" +// "github.com/MinterTeam/minter-go-node/coreV2/transaction" +// tmpool "github.com/tendermint/tendermint/mempool" +// "sort" +// "sync" +// "sync/atomic" +// +// abci "github.com/tendermint/tendermint/abci/types" +// cfg "github.com/tendermint/tendermint/config" +// auto "github.com/tendermint/tendermint/libs/autofile" +// "github.com/tendermint/tendermint/libs/clist" +// "github.com/tendermint/tendermint/libs/log" +// tmmath "github.com/tendermint/tendermint/libs/math" +// tmos "github.com/tendermint/tendermint/libs/os" +// tmsync "github.com/tendermint/tendermint/libs/sync" +// "github.com/tendermint/tendermint/p2p" +// "github.com/tendermint/tendermint/proxy" +// "github.com/tendermint/tendermint/types" +//) +// +//// TxKeySize is the size of the transaction key index +//const TxKeySize = sha256.Size +// +//var newline = []byte("\n") +// +////-------------------------------------------------------------------------------- +// +//// PriorityMempool is an ordered in-memory pool for transactions before they are +//// proposed in a consensus round. Transaction validity is checked using the +//// CheckTx abci message before the transaction is added to the pool. The +//// mempool uses a concurrent list structure for storing transactions that can +//// be efficiently accessed by multiple concurrent readers. +//type PriorityMempool struct { +// // Atomic integers +// height int64 // the last block Update()'d to +// txsBytes int64 // total size of mempool, in bytes +// +// // notify listeners (ie. consensus) when txs are available +// notifiedTxsAvailable bool +// txsAvailable chan struct{} // fires once for each height, when the mempool is not empty +// +// config *cfg.MempoolConfig +// +// // Exclusive mutex for Update method to prevent concurrent execution of +// // CheckTx or ReapMaxBytesMaxGas(ReapMaxTxs) methods. +// updateMtx tmsync.RWMutex +// preCheck tmpool.PreCheckFunc +// postCheck tmpool.PostCheckFunc +// +// wal *auto.AutoFile // a log of mempool txs +// txs *clist.CList // concurrent linked-list of good txs +// proxyAppConn proxy.AppConnMempool +// +// // Track whether we're rechecking txs. +// // These are not protected by a mutex and are expected to be mutated in +// // serial (ie. by abci responses which are called in serial). +// recheckCursor *clist.CElement // next expected response +// recheckEnd *clist.CElement // re-checking stops here +// +// // Map for quick access to txs to record sender in CheckTx. +// // txsMap: txKey -> CElement +// txsMap sync.Map +// +// // Keep a cache of already-seen txs. +// // This reduces the pressure on the proxyApp. +// cache txCache +// +// logger log.Logger +// +// metrics *tmpool.Metrics +// +// executor transaction.DecoderTx +// +// txsgpmu sync.RWMutex +// txsByGas map[uint32]map[[32]byte]*tmpool.MempoolTx +// minterTxMap sync.Map +// gasPrices []uint32 +//} +// +//// PriorityMempoolOption sets an optional parameter on the mempool. +//type PriorityMempoolOption func(*PriorityMempool) +// +//// NewPriorityMempool returns a new mempool with the given configuration and connection to an application. +//func NewPriorityMempool( +// config *cfg.MempoolConfig, +// proxyAppConn proxy.AppConnMempool, +// height int64, +// options ...PriorityMempoolOption, +//) *PriorityMempool { +// mempool := &PriorityMempool{ +// config: config, +// proxyAppConn: proxyAppConn, +// txs: clist.New(), +// height: height, +// recheckCursor: nil, +// recheckEnd: nil, +// logger: log.NewNopLogger(), +// metrics: tmpool.NopMetrics(), +// executor: transaction.NewExecutor(transaction.GetData), +// txsByGas: make(map[uint32]map[[32]byte]*tmpool.MempoolTx), +// } +// if config.CacheSize > 0 { +// mempool.cache = newMapTxCache(config.CacheSize) +// } else { +// mempool.cache = nopTxCache{} +// } +// proxyAppConn.SetResponseCallback(mempool.globalCb) +// for _, option := range options { +// option(mempool) +// } +// return mempool +//} +// +//// NOTE: not thread safe - should only be called once, on startup +//func (mem *PriorityMempool) EnableTxsAvailable() { +// mem.txsAvailable = make(chan struct{}, 1) +//} +// +//// SetLogger sets the Logger. +//func (mem *PriorityMempool) SetLogger(l log.Logger) { +// mem.logger = l +//} +// +//// WithPreCheck sets a filter for the mempool to reject a tx if f(tx) returns +//// false. This is ran before CheckTx. Only applies to the first created block. +//// After that, Update overwrites the existing value. +//func WithPreCheck(f tmpool.PreCheckFunc) PriorityMempoolOption { +// return func(mem *PriorityMempool) { mem.preCheck = f } +//} +// +//// WithPostCheck sets a filter for the mempool to reject a tx if f(tx) returns +//// false. This is ran after CheckTx. Only applies to the first created block. +//// After that, Update overwrites the existing value. +//func WithPostCheck(f tmpool.PostCheckFunc) PriorityMempoolOption { +// return func(mem *PriorityMempool) { mem.postCheck = f } +//} +// +//// WithMetrics sets the metrics. +//func WithMetrics(metrics *tmpool.Metrics) PriorityMempoolOption { +// return func(mem *PriorityMempool) { mem.metrics = metrics } +//} +// +//func (mem *PriorityMempool) InitWAL() error { +// var ( +// walDir = mem.config.WalDir() +// walFile = walDir + "/wal" +// ) +// +// const perm = 0700 +// if err := tmos.EnsureDir(walDir, perm); err != nil { +// return err +// } +// +// af, err := auto.OpenAutoFile(walFile) +// if err != nil { +// return fmt.Errorf("can't open autofile %s: %w", walFile, err) +// } +// +// mem.wal = af +// return nil +//} +// +//func (mem *PriorityMempool) CloseWAL() { +// if err := mem.wal.Close(); err != nil { +// mem.logger.Error("Error closing WAL", "err", err) +// } +// mem.wal = nil +//} +// +//// Safe for concurrent use by multiple goroutines. +//func (mem *PriorityMempool) Lock() { +// mem.updateMtx.Lock() +//} +// +//// Safe for concurrent use by multiple goroutines. +//func (mem *PriorityMempool) Unlock() { +// mem.updateMtx.Unlock() +//} +// +//// Safe for concurrent use by multiple goroutines. +//func (mem *PriorityMempool) Size() int { +// return mem.txs.Len() +//} +// +//// Safe for concurrent use by multiple goroutines. +//func (mem *PriorityMempool) TxsBytes() int64 { +// return atomic.LoadInt64(&mem.txsBytes) +//} +// +//// Lock() must be help by the caller during execution. +//func (mem *PriorityMempool) FlushAppConn() error { +// return mem.proxyAppConn.FlushSync() +//} +// +//// XXX: Unsafe! Calling Flush may leave mempool in inconsistent state. +//func (mem *PriorityMempool) Flush() { +// mem.updateMtx.RLock() +// defer mem.updateMtx.RUnlock() +// +// _ = atomic.SwapInt64(&mem.txsBytes, 0) +// mem.cache.Reset() +// +// for e := mem.txs.Front(); e != nil; e = e.Next() { +// mem.txs.Remove(e) +// mem.removeTxFromTxsGasPriceMap(e.Value.(*tmpool.MempoolTx).Tx) +// e.DetachPrev() +// } +// +// mem.txsMap.Range(func(key, _ interface{}) bool { +// mem.txsMap.Delete(key) +// return true +// }) +//} +// +//// TxsFront returns the first transaction in the ordered list for peer +//// goroutines to call .NextWait() on. +//// FIXME: leaking implementation details! +//// +//// Safe for concurrent use by multiple goroutines. +//func (mem *PriorityMempool) TxsFront() *clist.CElement { +// return mem.txs.Front() +//} +// +//// TxsWaitChan returns a channel to wait on transactions. It will be closed +//// once the mempool is not empty (ie. the internal `mem.txs` has at least one +//// element) +//// +//// Safe for concurrent use by multiple goroutines. +//func (mem *PriorityMempool) TxsWaitChan() <-chan struct{} { +// return mem.txs.WaitChan() +//} +// +//// It blocks if we're waiting on Update() or Reap(). +//// cb: A callback from the CheckTx command. +//// It gets called from another goroutine. +//// CONTRACT: Either cb will get called, or err returned. +//// +//// Safe for concurrent use by multiple goroutines. +//func (mem *PriorityMempool) CheckTx(tx types.Tx, cb func(*abci.Response), txInfo tmpool.TxInfo) error { +// mem.updateMtx.RLock() +// // use defer to unlock mutex because application (*local client*) might panic +// defer mem.updateMtx.RUnlock() +// +// txSize := len(tx) +// +// if err := mem.isFull(txSize); err != nil { +// return err +// } +// +// if txSize > mem.config.MaxTxBytes { +// return ErrTxTooLarge{mem.config.MaxTxBytes, txSize} +// } +// +// if mem.preCheck != nil { +// if err := mem.preCheck(tx); err != nil { +// return tmpool.ErrPreCheck{err} +// } +// } +// +// // NOTE: writing to the WAL and calling proxy must be done before adding tx +// // to the cache. otherwise, if either of them fails, next time CheckTx is +// // called with tx, ErrTxInCache will be returned without tx being checked at +// // all even once. +// if mem.wal != nil { +// // TODO: Notify administrators when WAL fails +// _, err := mem.wal.Write(append([]byte(tx), newline...)) +// if err != nil { +// return fmt.Errorf("wal.Write: %w", err) +// } +// } +// +// // NOTE: proxyAppConn may error if tx buffer is full +// if err := mem.proxyAppConn.Error(); err != nil { +// return err +// } +// +// if !mem.cache.Push(tx) { +// // Record a new sender for a tx we've already seen. +// // Note it's possible a tx is still in the cache but no longer in the mempool +// // (eg. after committing a block, txs are removed from mempool but not cache), +// // so we only record the sender for txs still in the mempool. +// if e, ok := mem.txsMap.Load(TxKey(tx)); ok { +// memTx := e.(*clist.CElement).Value.(*tmpool.MempoolTx) +// memTx.Senders.LoadOrStore(txInfo.SenderID, true) +// // TODO: consider punishing peer for dups, +// // its non-trivial since invalid txs can become valid, +// // but they can spam the same tx with little cost to them atm. +// } +// +// return tmpool.ErrTxInCache +// } +// +// reqRes := mem.proxyAppConn.CheckTxAsync(abci.RequestCheckTx{Tx: tx}) +// reqRes.SetCallback(mem.reqResCb(tx, txInfo.SenderID, txInfo.SenderP2PID, cb)) +// +// return nil +//} +// +//// Global callback that will be called after every ABCI response. +//// Having a single global callback avoids needing to set a callback for each request. +//// However, processing the checkTx response requires the peerID (so we can track which txs we heard from who), +//// and peerID is not included in the ABCI request, so we have to set request-specific callbacks that +//// include this information. If we're not in the midst of a recheck, this function will just return, +//// so the request specific callback can do the work. +//// +//// When rechecking, we don't need the peerID, so the recheck callback happens +//// here. +//func (mem *PriorityMempool) globalCb(req *abci.Request, res *abci.Response) { +// if mem.recheckCursor == nil { +// return +// } +// +// mem.metrics.RecheckTimes.Add(1) +// mem.resCbRecheck(req, res) +// +// // update metrics +// mem.metrics.Size.Set(float64(mem.Size())) +//} +// +//// Request specific callback that should be set on individual reqRes objects +//// to incorporate local information when processing the response. +//// This allows us to track the peer that sent us this tx, so we can avoid sending it back to them. +//// NOTE: alternatively, we could include this information in the ABCI request itself. +//// +//// External callers of CheckTx, like the RPC, can also pass an externalCb through here that is called +//// when all other response processing is complete. +//// +//// Used in CheckTx to record PeerID who sent us the tx. +//func (mem *PriorityMempool) reqResCb( +// tx []byte, +// peerID uint16, +// peerP2PID p2p.ID, +// externalCb func(*abci.Response), +//) func(res *abci.Response) { +// return func(res *abci.Response) { +// if mem.recheckCursor != nil { +// // this should never happen +// panic("recheck cursor is not nil in reqResCb") +// } +// +// mem.resCbFirstTime(tx, peerID, peerP2PID, res) +// +// // update metrics +// mem.metrics.Size.Set(float64(mem.Size())) +// +// // passed in by the caller of CheckTx, eg. the RPC +// if externalCb != nil { +// externalCb(res) +// } +// } +//} +// +//// Called from: +//// - resCbFirstTime (lock not held) if tx is valid +//func (mem *PriorityMempool) addTx(memTx *tmpool.MempoolTx) { +// tx, err := mem.executor.DecodeFromBytes(memTx.Tx) // TODO: handle error +// if err != nil { +// panic(fmt.Sprintf("failed to decode tx: %X", memTx.Tx)) +// } +// +// mem.txsgpmu.Lock() +// if _, ok := mem.txsByGas[tx.GasPrice]; !ok { +// mem.txsByGas[tx.GasPrice] = make(map[[32]byte]*tmpool.MempoolTx) +// } +// mem.txsByGas[tx.GasPrice][TxKey(memTx.Tx)] = memTx +// mem.txsgpmu.Unlock() +// mem.minterTxMap.Store(TxKey(memTx.Tx), tx) +// mem.addGasPrice(tx.GasPrice) +// +// e := mem.txs.PushBack(memTx) +// mem.txsMap.Store(TxKey(memTx.Tx), e) +// atomic.AddInt64(&mem.txsBytes, int64(len(memTx.Tx))) +// mem.metrics.TxSizeBytes.Observe(float64(len(memTx.Tx))) +//} +// +//// Called from: +//// - Update (lock held) if tx was committed +//// - resCbRecheck (lock not held) if tx was invalidated +//func (mem *PriorityMempool) removeTx(tx types.Tx, elem *clist.CElement, removeFromCache bool) { +// mem.removeTxFromTxsGasPriceMap(tx) +// mem.txs.Remove(elem) +// elem.DetachPrev() +// mem.txsMap.Delete(TxKey(tx)) +// atomic.AddInt64(&mem.txsBytes, int64(-len(tx))) +// +// if removeFromCache { +// mem.cache.Remove(tx) +// } +//} +// +//// RemoveTxByKey removes a transaction from the mempool by its TxKey index. +//func (mem *PriorityMempool) RemoveTxByKey(txKey [TxKeySize]byte, removeFromCache bool) { +// if e, ok := mem.txsMap.Load(txKey); ok { +// memTx := e.(*clist.CElement).Value.(*tmpool.MempoolTx) +// if memTx != nil { +// mem.removeTx(memTx.Tx, e.(*clist.CElement), removeFromCache) +// } +// } +//} +// +//func (mem *PriorityMempool) isFull(txSize int) error { +// var ( +// memSize = mem.Size() +// txsBytes = mem.TxsBytes() +// ) +// +// if memSize >= mem.config.Size || int64(txSize)+txsBytes > mem.config.MaxTxsBytes { +// return ErrMempoolIsFull{ +// memSize, mem.config.Size, +// txsBytes, mem.config.MaxTxsBytes, +// } +// } +// +// return nil +//} +// +//// callback, which is called after the app checked the tx for the first time. +//// +//// The case where the app checks the tx for the second and subsequent times is +//// handled by the resCbRecheck callback. +//func (mem *PriorityMempool) resCbFirstTime( +// tx []byte, +// peerID uint16, +// peerP2PID p2p.ID, +// res *abci.Response, +//) { +// switch r := res.Value.(type) { +// case *abci.Response_CheckTx: +// var postCheckErr error +// if mem.postCheck != nil { +// postCheckErr = mem.postCheck(tx, r.CheckTx) +// } +// if (r.CheckTx.Code == abci.CodeTypeOK) && postCheckErr == nil { +// // Check mempool isn't full again to reduce the chance of exceeding the +// // limits. +// if err := mem.isFull(len(tx)); err != nil { +// // remove from cache (mempool might have a space later) +// mem.cache.Remove(tx) +// mem.logger.Error(err.Error()) +// return +// } +// +// memTx := &tmpool.MempoolTx{ +// Height: mem.height, +// GasWanted: r.CheckTx.GasWanted, +// Tx: tx, +// } +// memTx.Senders.Store(peerID, true) +// mem.addTx(memTx) +// mem.logger.Debug("added good transaction", +// "tx", txID(tx), +// "res", r, +// "height", memTx.Height, +// "total", mem.Size(), +// ) +// mem.notifyTxsAvailable() +// } else { +// // ignore bad transaction +// mem.logger.Debug("rejected bad transaction", +// "tx", txID(tx), "peerID", peerP2PID, "res", r, "err", postCheckErr) +// mem.metrics.FailedTxs.Add(1) +// if !mem.config.KeepInvalidTxsInCache { +// // remove from cache (it might be good later) +// mem.cache.Remove(tx) +// } +// } +// default: +// // ignore other messages +// } +//} +// +//// callback, which is called after the app rechecked the tx. +//// +//// The case where the app checks the tx for the first time is handled by the +//// resCbFirstTime callback. +//func (mem *PriorityMempool) resCbRecheck(req *abci.Request, res *abci.Response) { +// switch r := res.Value.(type) { +// case *abci.Response_CheckTx: +// tx := req.GetCheckTx().Tx +// memTx := mem.recheckCursor.Value.(*tmpool.MempoolTx) +// if !bytes.Equal(tx, memTx.Tx) { +// panic(fmt.Sprintf( +// "Unexpected tx response from proxy during recheck\nExpected %X, got %X", +// memTx.Tx, +// tx)) +// } +// var postCheckErr error +// if mem.postCheck != nil { +// postCheckErr = mem.postCheck(tx, r.CheckTx) +// } +// if (r.CheckTx.Code == abci.CodeTypeOK) && postCheckErr == nil { +// // Good, nothing to do. +// } else { +// // Tx became invalidated due to newly committed block. +// mem.logger.Debug("tx is no longer valid", "tx", txID(tx), "res", r, "err", postCheckErr) +// // NOTE: we remove tx from the cache because it might be good later +// mem.removeTx(tx, mem.recheckCursor, !mem.config.KeepInvalidTxsInCache) +// } +// if mem.recheckCursor == mem.recheckEnd { +// mem.recheckCursor = nil +// } else { +// mem.recheckCursor = mem.recheckCursor.Next() +// } +// if mem.recheckCursor == nil { +// // Done! +// mem.logger.Debug("done rechecking txs") +// +// // incase the recheck removed all txs +// if mem.Size() > 0 { +// mem.notifyTxsAvailable() +// } +// } +// default: +// // ignore other messages +// } +//} +// +//// Safe for concurrent use by multiple goroutines. +//func (mem *PriorityMempool) TxsAvailable() <-chan struct{} { +// return mem.txsAvailable +//} +// +//func (mem *PriorityMempool) notifyTxsAvailable() { +// if mem.Size() == 0 { +// panic("notified txs available but mempool is empty!") +// } +// if mem.txsAvailable != nil && !mem.notifiedTxsAvailable { +// // channel cap is 1, so this will send once +// mem.notifiedTxsAvailable = true +// select { +// case mem.txsAvailable <- struct{}{}: +// default: +// } +// } +//} +// +//// Safe for concurrent use by multiple goroutines. +//func (mem *PriorityMempool) ReapMaxBytesMaxGas(maxBytes, maxGas int64) types.Txs { +// mem.updateMtx.RLock() +// defer mem.updateMtx.RUnlock() +// +// var totalGas int64 +// +// // TODO: we will get a performance boost if we have a good estimate of avg +// // size per tx, and set the initial capacity based off of that. +// // txs := make([]types.Tx, 0, tmmath.MinInt(mem.txs.Len(), max/mem.avgTxSize)) +// txs := make([]types.Tx, 0, mem.txs.Len()) +// +// mem.txsgpmu.RLock() +// defer mem.txsgpmu.RUnlock() +// +// for _, gp := range mem.gasPrices { +// for _, memTx := range mem.txsByGas[gp] { +// dataSize := types.ComputeProtoSizeForTxs(append(txs, memTx.Tx)) +// +// // Check total size requirement +// if maxBytes > -1 && dataSize > maxBytes { +// return txs +// } +// // Check total gas requirement. +// // If maxGas is negative, skip this check. +// // Since newTotalGas < masGas, which +// // must be non-negative, it follows that this won't overflow. +// newTotalGas := totalGas + memTx.GasWanted +// if maxGas > -1 && newTotalGas > maxGas { +// return txs +// } +// totalGas = newTotalGas +// txs = append(txs, memTx.Tx) +// } +// } +// +// return txs +//} +// +//// Safe for concurrent use by multiple goroutines. +//func (mem *PriorityMempool) ReapMaxTxs(max int) types.Txs { +// mem.updateMtx.RLock() +// defer mem.updateMtx.RUnlock() +// +// if max < 0 { +// max = mem.txs.Len() +// } +// +// txs := make([]types.Tx, 0, tmmath.MinInt(mem.txs.Len(), max)) +// for e := mem.txs.Front(); e != nil && len(txs) <= max; e = e.Next() { +// memTx := e.Value.(*tmpool.MempoolTx) +// txs = append(txs, memTx.Tx) +// } +// return txs +//} +// +//// Lock() must be help by the caller during execution. +//func (mem *PriorityMempool) Update( +// height int64, +// txs types.Txs, +// deliverTxResponses []*abci.ResponseDeliverTx, +// preCheck tmpool.PreCheckFunc, +// postCheck tmpool.PostCheckFunc, +//) error { +// // Set height +// mem.height = height +// mem.notifiedTxsAvailable = false +// +// if preCheck != nil { +// mem.preCheck = preCheck +// } +// if postCheck != nil { +// mem.postCheck = postCheck +// } +// +// for i, tx := range txs { +// if deliverTxResponses[i].Code == abci.CodeTypeOK { +// // Add valid committed tx to the cache (if missing). +// _ = mem.cache.Push(tx) +// } else if !mem.config.KeepInvalidTxsInCache { +// // Allow invalid transactions to be resubmitted. +// mem.cache.Remove(tx) +// } +// +// // Remove committed tx from the mempool. +// // +// // Note an evil proposer can drop valid txs! +// // Mempool before: +// // 100 -> 101 -> 102 +// // Block, proposed by an evil proposer: +// // 101 -> 102 +// // Mempool after: +// // 100 +// // https://github.com/tendermint/tendermint/issues/3322. +// if e, ok := mem.txsMap.Load(TxKey(tx)); ok { +// mem.removeTx(tx, e.(*clist.CElement), false) +// } +// } +// +// // Either recheck non-committed txs to see if they became invalid +// // or just notify there're some txs left. +// if mem.Size() > 0 { +// if mem.config.Recheck { +// mem.logger.Debug("recheck txs", "numtxs", mem.Size(), "height", height) +// mem.recheckTxs() +// // At this point, mem.txs are being rechecked. +// // mem.recheckCursor re-scans mem.txs and possibly removes some txs. +// // Before mem.Reap(), we should wait for mem.recheckCursor to be nil. +// } else { +// mem.notifyTxsAvailable() +// } +// } +// +// // Update metrics +// mem.metrics.Size.Set(float64(mem.Size())) +// +// return nil +//} +// +//func (mem *PriorityMempool) recheckTxs() { +// if mem.Size() == 0 { +// panic("recheckTxs is called, but the mempool is empty") +// } +// +// mem.recheckCursor = mem.txs.Front() +// mem.recheckEnd = mem.txs.Back() +// +// // Push txs to proxyAppConn +// // NOTE: globalCb may be called concurrently. +// for e := mem.txs.Front(); e != nil; e = e.Next() { +// memTx := e.Value.(*tmpool.MempoolTx) +// mem.proxyAppConn.CheckTxAsync(abci.RequestCheckTx{ +// Tx: memTx.Tx, +// Type: abci.CheckTxType_Recheck, +// }) +// } +// +// mem.proxyAppConn.FlushAsync() +//} +// +//// Add new gas price to list of available gas prices +//func (mem *PriorityMempool) addGasPrice(gp uint32) { +// exists := false +// i := sort.Search(len(mem.gasPrices), func(i int) bool { +// if mem.gasPrices[i] == gp { +// exists = true +// } +// return mem.gasPrices[i] < gp +// }) +// +// if exists { +// return +// } +// +// mem.gasPrices = append(mem.gasPrices, 0) +// copy(mem.gasPrices[i+1:], mem.gasPrices[i:]) +// mem.gasPrices[i] = gp +//} +// +//// Remove gas price from list of available gas prices +//func (mem *PriorityMempool) removeGasPrice(gp uint32) { +// key := 0 +// for i, v := range mem.gasPrices { +// if v == gp { +// key = i +// break +// } +// } +// +// mem.gasPrices = append(mem.gasPrices[:key], mem.gasPrices[key+1:]...) +//} +// +//// Get transaction gas price from map by key +//func (mem *PriorityMempool) getTxGasPriceFromMap(tx types.Tx) uint32 { +// data, _ := mem.minterTxMap.Load(TxKey(tx)) +// return data.(*transaction.Transaction).GasPrice +//} +// +//// Remove transaction from map +//func (mem *PriorityMempool) removeTxFromTxsGasPriceMap(tx types.Tx) { +// mem.txsgpmu.Lock() +// defer mem.txsgpmu.Unlock() +// +// gp := mem.getTxGasPriceFromMap(tx) +// delete(mem.txsByGas[gp], TxKey(tx)) +// +// if len(mem.txsByGas[gp]) == 0 { +// mem.removeGasPrice(gp) +// } +//} diff --git a/coreV2/mempool/priority_mempool_test.go b/coreV2/mempool/priority_mempool_test.go index 8b55d02ea..90942ae77 100644 --- a/coreV2/mempool/priority_mempool_test.go +++ b/coreV2/mempool/priority_mempool_test.go @@ -1,801 +1,802 @@ package mempool -import ( - "crypto/ecdsa" - "crypto/sha256" - "fmt" - "github.com/MinterTeam/minter-go-node/coreV2/transaction" - "github.com/MinterTeam/minter-go-node/coreV2/types" - "github.com/MinterTeam/minter-go-node/crypto" - "github.com/MinterTeam/minter-go-node/helpers" - "github.com/MinterTeam/minter-go-node/rlp" - tmpool "github.com/tendermint/tendermint/mempool" - "io/ioutil" - "math/big" - mrand "math/rand" - "os" - "path/filepath" - "testing" - "time" - - "github.com/gogo/protobuf/proto" - gogotypes "github.com/gogo/protobuf/types" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/MinterTeam/minter-go-node/tests/example/counter" - "github.com/tendermint/tendermint/abci/example/kvstore" - abciserver "github.com/tendermint/tendermint/abci/server" - abci "github.com/tendermint/tendermint/abci/types" - cfg "github.com/tendermint/tendermint/config" - "github.com/tendermint/tendermint/libs/log" - tmrand "github.com/tendermint/tendermint/libs/rand" - "github.com/tendermint/tendermint/libs/service" - "github.com/tendermint/tendermint/proxy" - tmtypes "github.com/tendermint/tendermint/types" -) - -// A cleanupFunc cleans up any config / test files created for a particular -// test. -type cleanupFunc func() - -func newMempoolWithApp(cc proxy.ClientCreator) (*PriorityMempool, cleanupFunc) { - return newMempoolWithAppAndConfig(cc, cfg.ResetTestRoot("mempool_test")) -} - -func newMempoolWithAppAndConfig(cc proxy.ClientCreator, config *cfg.Config) (*PriorityMempool, cleanupFunc) { - appConnMem, _ := cc.NewABCIClient() - appConnMem.SetLogger(log.TestingLogger().With("module", "abci-client", "connection", "mempool")) - err := appConnMem.Start() - if err != nil { - panic(err) - } - mempool := NewPriorityMempool(config.Mempool, appConnMem, 0) - mempool.SetLogger(log.TestingLogger()) - return mempool, func() { os.RemoveAll(config.RootDir) } -} - -func ensureNoFire(t *testing.T, ch <-chan struct{}, timeoutMS int) { - timer := time.NewTimer(time.Duration(timeoutMS) * time.Millisecond) - select { - case <-ch: - t.Fatal("Expected not to fire") - case <-timer.C: - } -} - -func ensureFire(t *testing.T, ch <-chan struct{}, timeoutMS int) { - timer := time.NewTimer(time.Duration(timeoutMS) * time.Millisecond) - select { - case <-ch: - case <-timer.C: - t.Fatal("Expected to fire") - } -} - -func createTx(bytesLen uint64, addressPrivKey *ecdsa.PrivateKey) []byte { - encodedData, _ := rlp.EncodeToBytes(transaction.SendData{ - Coin: types.GetBaseCoinID(), - To: [20]byte{1}, - Value: helpers.BipToPip(big.NewInt(10)), - }) - - payload := []byte{0x01, 0x01} - for i := bytesLen - 116; i > 0; i-- { - payload = append(payload, 0x01) - } - - tx := transaction.Transaction{ - Nonce: uint64(1), - ChainID: types.CurrentChainID, - GasPrice: 1, - GasCoin: types.GetBaseCoinID(), - Type: transaction.TypeSend, - Data: encodedData, - SignatureType: transaction.SigTypeSingle, - Payload: payload, - } - - privKey := new(ecdsa.PrivateKey) - if addressPrivKey == nil { - privKey, _ = crypto.GenerateKey() - } else { - *privKey = *addressPrivKey - } - - for { - tx.Sign(privKey) - txBytes, _ := tx.Serialize() - - if (uint64(len(txBytes)) == bytesLen-1 || uint64(len(txBytes)) == bytesLen+1) && addressPrivKey == nil { - privKey, _ = crypto.GenerateKey() - continue - } - - return txBytes - } -} - -func createTxWithRandomGas(bytesLen uint64, addressPrivKey *ecdsa.PrivateKey) []byte { - encodedData, _ := rlp.EncodeToBytes(transaction.SendData{ - Coin: types.GetBaseCoinID(), - To: [20]byte{1}, - Value: helpers.BipToPip(big.NewInt(10)), - }) - - payload := []byte{0x01, 0x01} - for i := bytesLen - 116; i > 0; i-- { - payload = append(payload, 0x01) - } - - gp := tmrand.Intn(200) - tx := transaction.Transaction{ - Nonce: uint64(1), - ChainID: types.CurrentChainID, - GasPrice: uint32(gp), - GasCoin: types.GetBaseCoinID(), - Type: transaction.TypeSend, - Data: encodedData, - SignatureType: transaction.SigTypeSingle, - Payload: payload, - } - - privKey := new(ecdsa.PrivateKey) - if addressPrivKey == nil { - privKey, _ = crypto.GenerateKey() - } else { - *privKey = *addressPrivKey - } - - for { - tx.Sign(privKey) - txBytes, _ := tx.Serialize() - - if (uint64(len(txBytes)) == bytesLen-1 || uint64(len(txBytes)) == bytesLen+1) && addressPrivKey == nil { - privKey, _ = crypto.GenerateKey() - continue - } - - return txBytes - } -} - -func checkTxs(t *testing.T, mempool tmpool.Mempool, count int, peerID uint16) tmtypes.Txs { - txs := make(tmtypes.Txs, count) - txInfo := tmpool.TxInfo{SenderID: peerID} - for i := 0; i < count; i++ { - txBytes := createTx(116, nil) - txs[i] = txBytes - if err := mempool.CheckTx(txBytes, nil, txInfo); err != nil { - // Skip invalid txs. - // TestMempoolFilters will fail otherwise. It asserts a number of txs - // returned. - if tmpool.IsPreCheckError(err) { - continue - } - t.Fatalf("CheckTx failed: %v while checking #%d tx", err, i) - } - } - return txs -} - -func TestReapMaxBytesMaxGas(t *testing.T) { - app := kvstore.NewApplication() - cc := proxy.NewLocalClientCreator(app) - mempool, cleanup := newMempoolWithApp(cc) - defer cleanup() - - // Ensure gas calculation behaves as expected - checkTxs(t, mempool, 1, tmpool.UnknownPeerID) - tx0 := mempool.txs.Front().Value.(*tmpool.MempoolTx) - //// assert that kv store has gas wanted = 1. - require.Equal(t, app.CheckTx(abci.RequestCheckTx{Tx: tx0.Tx}).GasWanted, int64(1), "KVStore had a gas value neq to 1") - require.Equal(t, tx0.GasWanted, int64(1), "transactions gas was set incorrectly") - //// ensure each tx is 116 bytes long - require.Equal(t, len(tx0.Tx), 116, "Tx is longer than 116 bytes") - mempool.Flush() - - // each table driven test creates numTxsToCreate txs with checkTx, and at the end clears all remaining txs. - // each tx has 20 bytes - tests := []struct { - numTxsToCreate int - maxBytes int64 - maxGas int64 - expectedNumTxs int - }{ - {20, -1, -1, 20}, - {20, -1, 0, 0}, - {20, -1, 10, 10}, - {20, -1, 30, 20}, - {20, 0, -1, 0}, - {20, 0, 10, 0}, - {20, 10, 10, 0}, - - {20, 118, 10, 1}, - {20, 590, 5, 5}, - {20, 1180, -1, 10}, - {20, 1180, 10, 10}, - {20, 1180, 15, 10}, - // - {20, 20000, -1, 20}, - {20, 20000, 5, 5}, - {20, 20000, 30, 20}, - } - for tcIndex, tt := range tests { - checkTxs(t, mempool, tt.numTxsToCreate, tmpool.UnknownPeerID) - got := mempool.ReapMaxBytesMaxGas(tt.maxBytes, tt.maxGas) - assert.Equal(t, tt.expectedNumTxs, len(got), "Got %d txs, expected %d, tc #%d", - len(got), tt.expectedNumTxs, tcIndex) - mempool.Flush() - } -} - -func TestReapMaxBytesMaxGasPriority(t *testing.T) { - app := kvstore.NewApplication() - cc := proxy.NewLocalClientCreator(app) - mempool, cleanup := newMempoolWithApp(cc) - defer cleanup() - - txInfo := tmpool.TxInfo{SenderID: tmpool.UnknownPeerID} - for i := 0; i < 1000; i++ { - if err := mempool.CheckTx(createTxWithRandomGas(116, nil), nil, txInfo); err != nil { - if tmpool.IsPreCheckError(err) { - continue - } - } - } - - txs := mempool.ReapMaxBytesMaxGas(10000000000, 10000000000) - assert.Equal(t, 1000, len(txs)) - - executor := transaction.NewExecutor(transaction.GetData) - - for i := 0; i <= len(txs)-2; i++ { - data, _ := executor.DecodeFromBytes(txs[i]) - data1, _ := executor.DecodeFromBytes(txs[i+1]) - assert.Equal(t, true, data1.GasPrice <= data.GasPrice) - } -} - -func TestMempoolFilters(t *testing.T) { - app := kvstore.NewApplication() - cc := proxy.NewLocalClientCreator(app) - mempool, cleanup := newMempoolWithApp(cc) - defer cleanup() - emptyTxArr := []tmtypes.Tx{[]byte{}} - - nopPreFilter := func(tx tmtypes.Tx) error { return nil } - nopPostFilter := func(tx tmtypes.Tx, res *abci.ResponseCheckTx) error { return nil } - - // each table driven test creates numTxsToCreate txs with checkTx, and at the end clears all remaining txs. - // each tx has 20 bytes - tests := []struct { - numTxsToCreate int - preFilter tmpool.PreCheckFunc - postFilter tmpool.PostCheckFunc - expectedNumTxs int - }{ - {10, nopPreFilter, nopPostFilter, 10}, - {10, tmpool.PreCheckMaxBytes(10), nopPostFilter, 0}, - {10, tmpool.PreCheckMaxBytes(118), nopPostFilter, 10}, - {10, nopPreFilter, tmpool.PostCheckMaxGas(-1), 10}, - {10, nopPreFilter, tmpool.PostCheckMaxGas(0), 0}, - {10, nopPreFilter, tmpool.PostCheckMaxGas(1), 10}, - {10, nopPreFilter, tmpool.PostCheckMaxGas(3000), 10}, - {10, tmpool.PreCheckMaxBytes(10), tmpool.PostCheckMaxGas(20), 0}, - {10, tmpool.PreCheckMaxBytes(126), tmpool.PostCheckMaxGas(116), 10}, - {10, tmpool.PreCheckMaxBytes(118), tmpool.PostCheckMaxGas(1), 10}, - {10, tmpool.PreCheckMaxBytes(118), tmpool.PostCheckMaxGas(0), 0}, - } - for tcIndex, tt := range tests { - err := mempool.Update(1, emptyTxArr, abciResponses(len(emptyTxArr), abci.CodeTypeOK), tt.preFilter, tt.postFilter) - require.NoError(t, err) - checkTxs(t, mempool, tt.numTxsToCreate, tmpool.UnknownPeerID) - require.Equal(t, tt.expectedNumTxs, mempool.Size(), "mempool had the incorrect size, on test case %d", tcIndex) - mempool.Flush() - } -} - -func TestMempoolUpdate(t *testing.T) { - app := kvstore.NewApplication() - cc := proxy.NewLocalClientCreator(app) - mempool, cleanup := newMempoolWithApp(cc) - defer cleanup() - - // 1. Adds valid txs to the cache - { - tx := createTx(116, nil) - err := mempool.Update(1, []tmtypes.Tx{tx}, abciResponses(1, abci.CodeTypeOK), nil, nil) - require.NoError(t, err) - err = mempool.CheckTx(tx, nil, tmpool.TxInfo{}) - if assert.Error(t, err) { - assert.Equal(t, tmpool.ErrTxInCache, err) - } - } - - // 2. Removes valid txs from the mempool - { - tx := createTx(117, nil) - err := mempool.CheckTx(tx, nil, tmpool.TxInfo{}) - require.NoError(t, err) - err = mempool.Update(1, []tmtypes.Tx{tx}, abciResponses(1, abci.CodeTypeOK), nil, nil) - require.NoError(t, err) - assert.Zero(t, mempool.Size()) - } - - // 3. Removes invalid transactions from the cache and the mempool (if present) - { - tx := createTx(118, nil) - err := mempool.CheckTx(tx, nil, tmpool.TxInfo{}) - require.NoError(t, err) - err = mempool.Update(1, []tmtypes.Tx{tx}, abciResponses(1, 1), nil, nil) - require.NoError(t, err) - assert.Zero(t, mempool.Size()) - - err = mempool.CheckTx(tx, nil, tmpool.TxInfo{}) - require.NoError(t, err) - } -} - -func TestMempool_KeepInvalidTxsInCache(t *testing.T) { - app := counter.NewApplication(true, nil) - cc := proxy.NewLocalClientCreator(app) - wcfg := cfg.DefaultConfig() - wcfg.Mempool.KeepInvalidTxsInCache = true - mempool, cleanup := newMempoolWithAppAndConfig(cc, wcfg) - defer cleanup() - - // 1. An invalid transaction must remain in the cache after Update - { - a := createTx(116, nil) - b := createTx(116, nil) - - err := mempool.CheckTx(b, nil, tmpool.TxInfo{}) - require.NoError(t, err) - - // simulate new block - _ = app.DeliverTx(abci.RequestDeliverTx{Tx: a}) - _ = app.DeliverTx(abci.RequestDeliverTx{Tx: b}) - err = mempool.Update(1, []tmtypes.Tx{a, b}, []*abci.ResponseDeliverTx{{Code: abci.CodeTypeOK}, {Code: 2}}, nil, nil) - require.NoError(t, err) - - // a must be added to the cache - err = mempool.CheckTx(a, nil, tmpool.TxInfo{}) - if assert.Error(t, err) { - assert.Equal(t, tmpool.ErrTxInCache, err) - } - - // b must remain in the cache - err = mempool.CheckTx(b, nil, tmpool.TxInfo{}) - if assert.Error(t, err) { - assert.Equal(t, tmpool.ErrTxInCache, err) - } - } - - // 2. An invalid transaction must remain in the cache - { - a := createTx(116, nil) - - // remove a from the cache to test (2) - mempool.cache.Remove(a) - - err := mempool.CheckTx(a, nil, tmpool.TxInfo{}) - require.NoError(t, err) - - err = mempool.CheckTx(a, nil, tmpool.TxInfo{}) - if assert.Error(t, err) { - assert.Equal(t, tmpool.ErrTxInCache, err) - } - } -} - -func TestTxsAvailable(t *testing.T) { - app := kvstore.NewApplication() - cc := proxy.NewLocalClientCreator(app) - mempool, cleanup := newMempoolWithApp(cc) - defer cleanup() - mempool.EnableTxsAvailable() - - timeoutMS := 500 - - // with no txs, it shouldnt fire - ensureNoFire(t, mempool.TxsAvailable(), timeoutMS) - - // send a bunch of txs, it should only fire once - txs := checkTxs(t, mempool, 100, tmpool.UnknownPeerID) - ensureFire(t, mempool.TxsAvailable(), timeoutMS) - ensureNoFire(t, mempool.TxsAvailable(), timeoutMS) - - // call update with half the txs. - // it should fire once now for the new height - // since there are still txs left - committedTxs, txs := txs[:50], txs[50:] - if err := mempool.Update(1, committedTxs, abciResponses(len(committedTxs), abci.CodeTypeOK), nil, nil); err != nil { - t.Error(err) - } - ensureFire(t, mempool.TxsAvailable(), timeoutMS) - ensureNoFire(t, mempool.TxsAvailable(), timeoutMS) - - // send a bunch more txs. we already fired for this height so it shouldnt fire again - moreTxs := checkTxs(t, mempool, 50, tmpool.UnknownPeerID) - ensureNoFire(t, mempool.TxsAvailable(), timeoutMS) - - // now call update with all the txs. it should not fire as there are no txs left - committedTxs = append(txs, moreTxs...) //nolint: gocritic - if err := mempool.Update(2, committedTxs, abciResponses(len(committedTxs), abci.CodeTypeOK), nil, nil); err != nil { - t.Error(err) - } - ensureNoFire(t, mempool.TxsAvailable(), timeoutMS) - - // send a bunch more txs, it should only fire once - checkTxs(t, mempool, 100, tmpool.UnknownPeerID) - ensureFire(t, mempool.TxsAvailable(), timeoutMS) - ensureNoFire(t, mempool.TxsAvailable(), timeoutMS) -} - -func TestSerialReap(t *testing.T) { - app := counter.NewApplication(true, nil) - app.SetOption(abci.RequestSetOption{Key: "serial", Value: "on"}) - cc := proxy.NewLocalClientCreator(app) - - mempool, cleanup := newMempoolWithApp(cc) - fmt.Println(mempool.config) - defer cleanup() - - appConnCon, _ := cc.NewABCIClient() - appConnCon.SetLogger(log.TestingLogger().With("module", "abci-client", "connection", "consensus")) - err := appConnCon.Start() - require.Nil(t, err) - - priv, _ := crypto.GenerateKey() - - cacheMap := make(map[string]struct{}) - deliverTxsRange := func(start, end int) { - // Deliver some txs. - for i := start; i < end; i++ { - // This will succeeds - txBytes := createTx(116+uint64(i), priv) - err := mempool.CheckTx(txBytes, nil, tmpool.TxInfo{}) - _, cached := cacheMap[string(txBytes)] - if cached { - require.NotNil(t, err, "expected error for cached tx") - } else { - require.Nil(t, err, "expected no err for uncached tx") - } - cacheMap[string(txBytes)] = struct{}{} - - // Duplicates are cached and should return error - err = mempool.CheckTx(txBytes, nil, tmpool.TxInfo{}) - require.NotNil(t, err, "Expected error after CheckTx on duplicated tx") - } - } - - reapCheck := func(exp int) { - txs := mempool.ReapMaxBytesMaxGas(-1, -1) - require.Equal(t, len(txs), exp, fmt.Sprintf("Expected to reap %v txs but got %v", exp, len(txs))) - } - - updateRange := func(start, end int) { - txs := make([]tmtypes.Tx, 0) - for i := start; i < end; i++ { - txBytes := createTx(116+uint64(i), priv) - txs = append(txs, txBytes) - } - if err := mempool.Update(0, txs, abciResponses(len(txs), abci.CodeTypeOK), nil, nil); err != nil { - t.Error(err) - } - } - - commitRange := func(start, end int) { - // Deliver some txs. - for i := start; i < end; i++ { - txBytes := createTx(116+uint64(i), priv) - res, err := appConnCon.DeliverTxSync(abci.RequestDeliverTx{Tx: txBytes}) - if err != nil { - t.Errorf("client error committing tx: %v", err) - } - if res.IsErr() { - t.Errorf("error committing tx. Code:%v result:%X log:%v", - res.Code, res.Data, res.Log) - } - } - res, err := appConnCon.CommitSync() - if err != nil { - t.Errorf("client error committing: %v", err) - } - if len(res.Data) != 8 { - t.Errorf("error committing. Hash:%X", res.Data) - } - } - - //---------------------------------------- - - // Deliver some txs. - deliverTxsRange(0, 100) - - // Reap the txs. - reapCheck(100) - - // Reap again. We should get the same amount - reapCheck(100) - - // Deliver 0 to 999, we should reap 900 new txs - // because 100 were already counted. - deliverTxsRange(0, 1000) - - // Reap the txs. - reapCheck(1000) - - // Reap again. We should get the same amount - reapCheck(1000) - - // Commit from the conensus AppConn - commitRange(0, 500) - updateRange(0, 500) - - // We should have 500 left. - reapCheck(500) - - // Deliver 100 invalid txs and 100 valid txs - deliverTxsRange(900, 1100) - - // We should have 600 now. - reapCheck(600) -} - -func TestMempoolCloseWAL(t *testing.T) { - // 1. Create the temporary directory for mempool and WAL testing. - rootDir, err := ioutil.TempDir("", "mempool-test") - require.Nil(t, err, "expecting successful tmpdir creation") - - // 2. Ensure that it doesn't contain any elements -- Sanity check - m1, err := filepath.Glob(filepath.Join(rootDir, "*")) - require.Nil(t, err, "successful globbing expected") - require.Equal(t, 0, len(m1), "no matches yet") - - // 3. Create the mempool - wcfg := cfg.DefaultConfig() - wcfg.Mempool.RootDir = rootDir - app := kvstore.NewApplication() - cc := proxy.NewLocalClientCreator(app) - mempool, cleanup := newMempoolWithAppAndConfig(cc, wcfg) - defer cleanup() - mempool.height = 10 - err = mempool.InitWAL() - require.NoError(t, err) - - // 4. Ensure that the directory contains the WAL file - m2, err := filepath.Glob(filepath.Join(rootDir, "*")) - require.Nil(t, err, "successful globbing expected") - require.Equal(t, 1, len(m2), "expecting the wal match in") - - // 5. Write some contents to the WAL - tx := createTx(116, nil) - err = mempool.CheckTx(tx, nil, tmpool.TxInfo{}) - require.NoError(t, err) - walFilepath := mempool.wal.Path - sum1 := checksumFile(walFilepath, t) - - //// 6. Sanity check to ensure that the written TX matches the expectation. - require.Equal(t, sum1, checksumIt(append(tx, []byte("\n")...)), "foo with a newline should be written") - - // 7. Invoke CloseWAL() and ensure it discards the - // WAL thus any other write won't go through. - mempool.CloseWAL() - err = mempool.CheckTx(createTx(117, nil), nil, tmpool.TxInfo{}) - require.NoError(t, err) - sum2 := checksumFile(walFilepath, t) - require.Equal(t, sum1, sum2, "expected no change to the WAL after invoking CloseWAL() since it was discarded") - - // 8. Sanity check to ensure that the WAL file still exists - m3, err := filepath.Glob(filepath.Join(rootDir, "*")) - require.Nil(t, err, "successful globbing expected") - require.Equal(t, 1, len(m3), "expecting the wal match in") -} - -func TestMempool_CheckTxChecksTxSize(t *testing.T) { - app := kvstore.NewApplication() - cc := proxy.NewLocalClientCreator(app) - mempl, cleanup := newMempoolWithApp(cc) - defer cleanup() - - maxTxSize := mempl.config.MaxTxBytes - - testCases := []struct { - len int - err bool - experr int - }{ - // check small txs. no error - 0: {10, false, 0}, - 1: {1000, false, 0}, - 2: {1000000, false, 0}, - - // check around maxTxSize - 3: {maxTxSize - 122, false, 0}, - 4: {maxTxSize - 121, false, 0}, - 5: {maxTxSize - 120, true, maxTxSize + 1}, - } - - for i, testCase := range testCases { - caseString := fmt.Sprintf("case %d, len %d", i, testCase.len) - - tx := createTx(uint64(116+testCase.len), nil) - - err := mempl.CheckTx(tx, nil, tmpool.TxInfo{}) - bv := gogotypes.BytesValue{Value: tx} - bz, err2 := bv.Marshal() - require.NoError(t, err2) - require.Equal(t, len(bz), proto.Size(&bv), caseString) - - if !testCase.err { - require.NoError(t, err, caseString) - } else { - require.Equal(t, err, ErrTxTooLarge{maxTxSize, testCase.experr}, caseString) - } - } -} - -func TestMempoolTxsBytes(t *testing.T) { - app := kvstore.NewApplication() - cc := proxy.NewLocalClientCreator(app) - config := cfg.ResetTestRoot("mempool_test") - config.Mempool.MaxTxsBytes = 126 - mempool, cleanup := newMempoolWithAppAndConfig(cc, config) - defer cleanup() - - // 1. zero by default - assert.EqualValues(t, 0, mempool.TxsBytes()) - - // 2. len(tx) after CheckTx - tx1 := createTx(116, nil) - err := mempool.CheckTx(tx1, nil, tmpool.TxInfo{}) - require.NoError(t, err) - assert.EqualValues(t, 116, mempool.TxsBytes()) - - // 3. zero again after tx is removed by Update - err = mempool.Update(1, []tmtypes.Tx{tx1}, abciResponses(1, abci.CodeTypeOK), nil, nil) - require.NoError(t, err) - assert.EqualValues(t, 0, mempool.TxsBytes()) - - // 4. zero after Flush - err = mempool.CheckTx(createTx(117, nil), nil, tmpool.TxInfo{}) - require.NoError(t, err) - assert.EqualValues(t, 117, mempool.TxsBytes()) - - mempool.Flush() - assert.EqualValues(t, 0, mempool.TxsBytes()) - - // 5. ErrMempoolIsFull is returned when/if MaxTxsBytes limit is reached. - err = mempool.CheckTx(createTx(126, nil), nil, tmpool.TxInfo{}) - require.NoError(t, err) - err = mempool.CheckTx(createTx(117, nil), nil, tmpool.TxInfo{}) - if assert.Error(t, err) { - assert.IsType(t, ErrMempoolIsFull{}, err) - } - - // 6. zero after tx is rechecked and removed due to not being valid anymore - app2 := counter.NewApplication(true, transaction.NewExecutor(transaction.GetData)) - cc = proxy.NewLocalClientCreator(app2) - mempool, cleanup = newMempoolWithApp(cc) - defer cleanup() - - app2.TxCount = 1 - tx := createTx(124, nil) - err = mempool.CheckTx(tx, nil, tmpool.TxInfo{}) - require.NoError(t, err) - assert.EqualValues(t, 124, mempool.TxsBytes()) - - appConnCon, _ := cc.NewABCIClient() - appConnCon.SetLogger(log.TestingLogger().With("module", "abci-client", "connection", "consensus")) - err = appConnCon.Start() - require.Nil(t, err) - t.Cleanup(func() { - if err := appConnCon.Stop(); err != nil { - t.Error(err) - } - }) - res, err := appConnCon.DeliverTxSync(abci.RequestDeliverTx{Tx: tx}) - require.NoError(t, err) - require.EqualValues(t, uint32(0), res.Code) - res2, err := appConnCon.CommitSync() - require.NoError(t, err) - require.NotEmpty(t, res2.Data) - - // Pretend like we committed nothing so txBytes gets rechecked and removed. - err = mempool.Update(1, []tmtypes.Tx{}, abciResponses(0, abci.CodeTypeOK), nil, nil) - require.NoError(t, err) - assert.EqualValues(t, 0, mempool.TxsBytes()) - - // 7. Test RemoveTxByK ey function - mempool, cleanup = newMempoolWithAppAndConfig(proxy.NewLocalClientCreator(app), config) - defer cleanup() - - tx = createTx(123, nil) - err = mempool.CheckTx(tx, nil, tmpool.TxInfo{}) - require.NoError(t, err) - assert.EqualValues(t, 123, mempool.TxsBytes()) - mempool.RemoveTxByKey(TxKey(createTx(124, nil)), true) - assert.EqualValues(t, 123, mempool.TxsBytes()) - mempool.RemoveTxByKey(TxKey(tx), true) - assert.EqualValues(t, 0, mempool.TxsBytes()) - -} - -// This will non-deterministically catch some concurrency failures like -// https://github.com/tendermint/tendermint/issues/3509 -// TODO: all of the tests should probably also run using the remote proxy app -// since otherwise we're not actually testing the concurrency of the mempool here! -func TestMempoolRemoteAppConcurrency(t *testing.T) { - sockPath := fmt.Sprintf("unix:///tmp/echo_%v.sock", tmrand.Str(6)) - app := kvstore.NewApplication() - cc, server := newRemoteApp(t, sockPath, app) - t.Cleanup(func() { - if err := server.Stop(); err != nil { - t.Error(err) - } - }) - config := cfg.ResetTestRoot("mempool_test") - mempool, cleanup := newMempoolWithAppAndConfig(cc, config) - defer cleanup() - - // generate small number of txs - nTxs := 10 - txs := make([]tmtypes.Tx, nTxs) - for i := 0; i < nTxs; i++ { - txs[i] = createTx(116, nil) - } - - // simulate a group of peers sending them over and over - N := config.Mempool.Size - maxPeers := 5 - for i := 0; i < N; i++ { - peerID := mrand.Intn(maxPeers) - txNum := mrand.Intn(nTxs) - tx := txs[txNum] - - // this will err with tmpool.ErrTxInCache many times ... - mempool.CheckTx(tx, nil, tmpool.TxInfo{SenderID: uint16(peerID)}) //nolint: errcheck // will error - } - err := mempool.FlushAppConn() - require.NoError(t, err) -} - -// caller must close server -func newRemoteApp( - t *testing.T, - addr string, - app abci.Application, -) ( - clientCreator proxy.ClientCreator, - server service.Service, -) { - clientCreator = proxy.NewRemoteClientCreator(addr, "socket", true) - - // Start server - server = abciserver.NewSocketServer(addr, app) - server.SetLogger(log.TestingLogger().With("module", "abci-server")) - if err := server.Start(); err != nil { - t.Fatalf("Error starting socket server: %v", err.Error()) - } - return clientCreator, server -} -func checksumIt(data []byte) string { - h := sha256.New() - h.Write(data) - return fmt.Sprintf("%x", h.Sum(nil)) -} - -func checksumFile(p string, t *testing.T) string { - data, err := ioutil.ReadFile(p) - require.Nil(t, err, "expecting successful read of %q", p) - return checksumIt(data) -} - -func abciResponses(n int, code uint32) []*abci.ResponseDeliverTx { - responses := make([]*abci.ResponseDeliverTx, 0, n) - for i := 0; i < n; i++ { - responses = append(responses, &abci.ResponseDeliverTx{Code: code}) - } - return responses -} +// +//import ( +// "crypto/ecdsa" +// "crypto/sha256" +// "fmt" +// "github.com/MinterTeam/minter-go-node/coreV2/transaction" +// "github.com/MinterTeam/minter-go-node/coreV2/types" +// "github.com/MinterTeam/minter-go-node/crypto" +// "github.com/MinterTeam/minter-go-node/helpers" +// "github.com/MinterTeam/minter-go-node/rlp" +// tmpool "github.com/tendermint/tendermint/mempool" +// "io/ioutil" +// "math/big" +// mrand "math/rand" +// "os" +// "path/filepath" +// "testing" +// "time" +// +// "github.com/gogo/protobuf/proto" +// gogotypes "github.com/gogo/protobuf/types" +// "github.com/stretchr/testify/assert" +// "github.com/stretchr/testify/require" +// +// "github.com/MinterTeam/minter-go-node/tests/example/counter" +// "github.com/tendermint/tendermint/abci/example/kvstore" +// abciserver "github.com/tendermint/tendermint/abci/server" +// abci "github.com/tendermint/tendermint/abci/types" +// cfg "github.com/tendermint/tendermint/config" +// "github.com/tendermint/tendermint/libs/log" +// tmrand "github.com/tendermint/tendermint/libs/rand" +// "github.com/tendermint/tendermint/libs/service" +// "github.com/tendermint/tendermint/proxy" +// tmtypes "github.com/tendermint/tendermint/types" +//) +// +//// A cleanupFunc cleans up any config / test files created for a particular +//// test. +//type cleanupFunc func() +// +//func newMempoolWithApp(cc proxy.ClientCreator) (*PriorityMempool, cleanupFunc) { +// return newMempoolWithAppAndConfig(cc, cfg.ResetTestRoot("mempool_test")) +//} +// +//func newMempoolWithAppAndConfig(cc proxy.ClientCreator, config *cfg.Config) (*PriorityMempool, cleanupFunc) { +// appConnMem, _ := cc.NewABCIClient() +// appConnMem.SetLogger(log.TestingLogger().With("module", "abci-client", "connection", "mempool")) +// err := appConnMem.Start() +// if err != nil { +// panic(err) +// } +// mempool := NewPriorityMempool(config.Mempool, appConnMem, 0) +// mempool.SetLogger(log.TestingLogger()) +// return mempool, func() { os.RemoveAll(config.RootDir) } +//} +// +//func ensureNoFire(t *testing.T, ch <-chan struct{}, timeoutMS int) { +// timer := time.NewTimer(time.Duration(timeoutMS) * time.Millisecond) +// select { +// case <-ch: +// t.Fatal("Expected not to fire") +// case <-timer.C: +// } +//} +// +//func ensureFire(t *testing.T, ch <-chan struct{}, timeoutMS int) { +// timer := time.NewTimer(time.Duration(timeoutMS) * time.Millisecond) +// select { +// case <-ch: +// case <-timer.C: +// t.Fatal("Expected to fire") +// } +//} +// +//func createTx(bytesLen uint64, addressPrivKey *ecdsa.PrivateKey) []byte { +// encodedData, _ := rlp.EncodeToBytes(transaction.SendData{ +// Coin: types.GetBaseCoinID(), +// To: [20]byte{1}, +// Value: helpers.BipToPip(big.NewInt(10)), +// }) +// +// payload := []byte{0x01, 0x01} +// for i := bytesLen - 116; i > 0; i-- { +// payload = append(payload, 0x01) +// } +// +// tx := transaction.Transaction{ +// Nonce: uint64(1), +// ChainID: types.CurrentChainID, +// GasPrice: 1, +// GasCoin: types.GetBaseCoinID(), +// Type: transaction.TypeSend, +// Data: encodedData, +// SignatureType: transaction.SigTypeSingle, +// Payload: payload, +// } +// +// privKey := new(ecdsa.PrivateKey) +// if addressPrivKey == nil { +// privKey, _ = crypto.GenerateKey() +// } else { +// *privKey = *addressPrivKey +// } +// +// for { +// tx.Sign(privKey) +// txBytes, _ := tx.Serialize() +// +// if (uint64(len(txBytes)) == bytesLen-1 || uint64(len(txBytes)) == bytesLen+1) && addressPrivKey == nil { +// privKey, _ = crypto.GenerateKey() +// continue +// } +// +// return txBytes +// } +//} +// +//func createTxWithRandomGas(bytesLen uint64, addressPrivKey *ecdsa.PrivateKey) []byte { +// encodedData, _ := rlp.EncodeToBytes(transaction.SendData{ +// Coin: types.GetBaseCoinID(), +// To: [20]byte{1}, +// Value: helpers.BipToPip(big.NewInt(10)), +// }) +// +// payload := []byte{0x01, 0x01} +// for i := bytesLen - 116; i > 0; i-- { +// payload = append(payload, 0x01) +// } +// +// gp := tmrand.Intn(200) +// tx := transaction.Transaction{ +// Nonce: uint64(1), +// ChainID: types.CurrentChainID, +// GasPrice: uint32(gp), +// GasCoin: types.GetBaseCoinID(), +// Type: transaction.TypeSend, +// Data: encodedData, +// SignatureType: transaction.SigTypeSingle, +// Payload: payload, +// } +// +// privKey := new(ecdsa.PrivateKey) +// if addressPrivKey == nil { +// privKey, _ = crypto.GenerateKey() +// } else { +// *privKey = *addressPrivKey +// } +// +// for { +// tx.Sign(privKey) +// txBytes, _ := tx.Serialize() +// +// if (uint64(len(txBytes)) == bytesLen-1 || uint64(len(txBytes)) == bytesLen+1) && addressPrivKey == nil { +// privKey, _ = crypto.GenerateKey() +// continue +// } +// +// return txBytes +// } +//} +// +//func checkTxs(t *testing.T, mempool tmpool.Mempool, count int, peerID uint16) tmtypes.Txs { +// txs := make(tmtypes.Txs, count) +// txInfo := tmpool.TxInfo{SenderID: peerID} +// for i := 0; i < count; i++ { +// txBytes := createTx(116, nil) +// txs[i] = txBytes +// if err := mempool.CheckTx(txBytes, nil, txInfo); err != nil { +// // Skip invalid txs. +// // TestMempoolFilters will fail otherwise. It asserts a number of txs +// // returned. +// if tmpool.IsPreCheckError(err) { +// continue +// } +// t.Fatalf("CheckTx failed: %v while checking #%d tx", err, i) +// } +// } +// return txs +//} +// +//func TestReapMaxBytesMaxGas(t *testing.T) { +// app := kvstore.NewApplication() +// cc := proxy.NewLocalClientCreator(app) +// mempool, cleanup := newMempoolWithApp(cc) +// defer cleanup() +// +// // Ensure gas calculation behaves as expected +// checkTxs(t, mempool, 1, tmpool.UnknownPeerID) +// tx0 := mempool.txs.Front().Value.(*tmpool.MempoolTx) +// //// assert that kv store has gas wanted = 1. +// require.Equal(t, app.CheckTx(abci.RequestCheckTx{Tx: tx0.Tx}).GasWanted, int64(1), "KVStore had a gas value neq to 1") +// require.Equal(t, tx0.GasWanted, int64(1), "transactions gas was set incorrectly") +// //// ensure each tx is 116 bytes long +// require.Equal(t, len(tx0.Tx), 116, "Tx is longer than 116 bytes") +// mempool.Flush() +// +// // each table driven test creates numTxsToCreate txs with checkTx, and at the end clears all remaining txs. +// // each tx has 20 bytes +// tests := []struct { +// numTxsToCreate int +// maxBytes int64 +// maxGas int64 +// expectedNumTxs int +// }{ +// {20, -1, -1, 20}, +// {20, -1, 0, 0}, +// {20, -1, 10, 10}, +// {20, -1, 30, 20}, +// {20, 0, -1, 0}, +// {20, 0, 10, 0}, +// {20, 10, 10, 0}, +// +// {20, 118, 10, 1}, +// {20, 590, 5, 5}, +// {20, 1180, -1, 10}, +// {20, 1180, 10, 10}, +// {20, 1180, 15, 10}, +// // +// {20, 20000, -1, 20}, +// {20, 20000, 5, 5}, +// {20, 20000, 30, 20}, +// } +// for tcIndex, tt := range tests { +// checkTxs(t, mempool, tt.numTxsToCreate, tmpool.UnknownPeerID) +// got := mempool.ReapMaxBytesMaxGas(tt.maxBytes, tt.maxGas) +// assert.Equal(t, tt.expectedNumTxs, len(got), "Got %d txs, expected %d, tc #%d", +// len(got), tt.expectedNumTxs, tcIndex) +// mempool.Flush() +// } +//} +// +//func TestReapMaxBytesMaxGasPriority(t *testing.T) { +// app := kvstore.NewApplication() +// cc := proxy.NewLocalClientCreator(app) +// mempool, cleanup := newMempoolWithApp(cc) +// defer cleanup() +// +// txInfo := tmpool.TxInfo{SenderID: tmpool.UnknownPeerID} +// for i := 0; i < 1000; i++ { +// if err := mempool.CheckTx(createTxWithRandomGas(116, nil), nil, txInfo); err != nil { +// if tmpool.IsPreCheckError(err) { +// continue +// } +// } +// } +// +// txs := mempool.ReapMaxBytesMaxGas(10000000000, 10000000000) +// assert.Equal(t, 1000, len(txs)) +// +// executor := transaction.NewExecutor(transaction.GetData) +// +// for i := 0; i <= len(txs)-2; i++ { +// data, _ := executor.DecodeFromBytes(txs[i]) +// data1, _ := executor.DecodeFromBytes(txs[i+1]) +// assert.Equal(t, true, data1.GasPrice <= data.GasPrice) +// } +//} +// +//func TestMempoolFilters(t *testing.T) { +// app := kvstore.NewApplication() +// cc := proxy.NewLocalClientCreator(app) +// mempool, cleanup := newMempoolWithApp(cc) +// defer cleanup() +// emptyTxArr := []tmtypes.Tx{[]byte{}} +// +// nopPreFilter := func(tx tmtypes.Tx) error { return nil } +// nopPostFilter := func(tx tmtypes.Tx, res *abci.ResponseCheckTx) error { return nil } +// +// // each table driven test creates numTxsToCreate txs with checkTx, and at the end clears all remaining txs. +// // each tx has 20 bytes +// tests := []struct { +// numTxsToCreate int +// preFilter tmpool.PreCheckFunc +// postFilter tmpool.PostCheckFunc +// expectedNumTxs int +// }{ +// {10, nopPreFilter, nopPostFilter, 10}, +// {10, tmpool.PreCheckMaxBytes(10), nopPostFilter, 0}, +// {10, tmpool.PreCheckMaxBytes(118), nopPostFilter, 10}, +// {10, nopPreFilter, tmpool.PostCheckMaxGas(-1), 10}, +// {10, nopPreFilter, tmpool.PostCheckMaxGas(0), 0}, +// {10, nopPreFilter, tmpool.PostCheckMaxGas(1), 10}, +// {10, nopPreFilter, tmpool.PostCheckMaxGas(3000), 10}, +// {10, tmpool.PreCheckMaxBytes(10), tmpool.PostCheckMaxGas(20), 0}, +// {10, tmpool.PreCheckMaxBytes(126), tmpool.PostCheckMaxGas(116), 10}, +// {10, tmpool.PreCheckMaxBytes(118), tmpool.PostCheckMaxGas(1), 10}, +// {10, tmpool.PreCheckMaxBytes(118), tmpool.PostCheckMaxGas(0), 0}, +// } +// for tcIndex, tt := range tests { +// err := mempool.Update(1, emptyTxArr, abciResponses(len(emptyTxArr), abci.CodeTypeOK), tt.preFilter, tt.postFilter) +// require.NoError(t, err) +// checkTxs(t, mempool, tt.numTxsToCreate, tmpool.UnknownPeerID) +// require.Equal(t, tt.expectedNumTxs, mempool.Size(), "mempool had the incorrect size, on test case %d", tcIndex) +// mempool.Flush() +// } +//} +// +//func TestMempoolUpdate(t *testing.T) { +// app := kvstore.NewApplication() +// cc := proxy.NewLocalClientCreator(app) +// mempool, cleanup := newMempoolWithApp(cc) +// defer cleanup() +// +// // 1. Adds valid txs to the cache +// { +// tx := createTx(116, nil) +// err := mempool.Update(1, []tmtypes.Tx{tx}, abciResponses(1, abci.CodeTypeOK), nil, nil) +// require.NoError(t, err) +// err = mempool.CheckTx(tx, nil, tmpool.TxInfo{}) +// if assert.Error(t, err) { +// assert.Equal(t, tmpool.ErrTxInCache, err) +// } +// } +// +// // 2. Removes valid txs from the mempool +// { +// tx := createTx(117, nil) +// err := mempool.CheckTx(tx, nil, tmpool.TxInfo{}) +// require.NoError(t, err) +// err = mempool.Update(1, []tmtypes.Tx{tx}, abciResponses(1, abci.CodeTypeOK), nil, nil) +// require.NoError(t, err) +// assert.Zero(t, mempool.Size()) +// } +// +// // 3. Removes invalid transactions from the cache and the mempool (if present) +// { +// tx := createTx(118, nil) +// err := mempool.CheckTx(tx, nil, tmpool.TxInfo{}) +// require.NoError(t, err) +// err = mempool.Update(1, []tmtypes.Tx{tx}, abciResponses(1, 1), nil, nil) +// require.NoError(t, err) +// assert.Zero(t, mempool.Size()) +// +// err = mempool.CheckTx(tx, nil, tmpool.TxInfo{}) +// require.NoError(t, err) +// } +//} +// +//func TestMempool_KeepInvalidTxsInCache(t *testing.T) { +// app := counter.NewApplication(true, nil) +// cc := proxy.NewLocalClientCreator(app) +// wcfg := cfg.DefaultConfig() +// wcfg.Mempool.KeepInvalidTxsInCache = true +// mempool, cleanup := newMempoolWithAppAndConfig(cc, wcfg) +// defer cleanup() +// +// // 1. An invalid transaction must remain in the cache after Update +// { +// a := createTx(116, nil) +// b := createTx(116, nil) +// +// err := mempool.CheckTx(b, nil, tmpool.TxInfo{}) +// require.NoError(t, err) +// +// // simulate new block +// _ = app.DeliverTx(abci.RequestDeliverTx{Tx: a}) +// _ = app.DeliverTx(abci.RequestDeliverTx{Tx: b}) +// err = mempool.Update(1, []tmtypes.Tx{a, b}, []*abci.ResponseDeliverTx{{Code: abci.CodeTypeOK}, {Code: 2}}, nil, nil) +// require.NoError(t, err) +// +// // a must be added to the cache +// err = mempool.CheckTx(a, nil, tmpool.TxInfo{}) +// if assert.Error(t, err) { +// assert.Equal(t, tmpool.ErrTxInCache, err) +// } +// +// // b must remain in the cache +// err = mempool.CheckTx(b, nil, tmpool.TxInfo{}) +// if assert.Error(t, err) { +// assert.Equal(t, tmpool.ErrTxInCache, err) +// } +// } +// +// // 2. An invalid transaction must remain in the cache +// { +// a := createTx(116, nil) +// +// // remove a from the cache to test (2) +// mempool.cache.Remove(a) +// +// err := mempool.CheckTx(a, nil, tmpool.TxInfo{}) +// require.NoError(t, err) +// +// err = mempool.CheckTx(a, nil, tmpool.TxInfo{}) +// if assert.Error(t, err) { +// assert.Equal(t, tmpool.ErrTxInCache, err) +// } +// } +//} +// +//func TestTxsAvailable(t *testing.T) { +// app := kvstore.NewApplication() +// cc := proxy.NewLocalClientCreator(app) +// mempool, cleanup := newMempoolWithApp(cc) +// defer cleanup() +// mempool.EnableTxsAvailable() +// +// timeoutMS := 500 +// +// // with no txs, it shouldnt fire +// ensureNoFire(t, mempool.TxsAvailable(), timeoutMS) +// +// // send a bunch of txs, it should only fire once +// txs := checkTxs(t, mempool, 100, tmpool.UnknownPeerID) +// ensureFire(t, mempool.TxsAvailable(), timeoutMS) +// ensureNoFire(t, mempool.TxsAvailable(), timeoutMS) +// +// // call update with half the txs. +// // it should fire once now for the new height +// // since there are still txs left +// committedTxs, txs := txs[:50], txs[50:] +// if err := mempool.Update(1, committedTxs, abciResponses(len(committedTxs), abci.CodeTypeOK), nil, nil); err != nil { +// t.Error(err) +// } +// ensureFire(t, mempool.TxsAvailable(), timeoutMS) +// ensureNoFire(t, mempool.TxsAvailable(), timeoutMS) +// +// // send a bunch more txs. we already fired for this height so it shouldnt fire again +// moreTxs := checkTxs(t, mempool, 50, tmpool.UnknownPeerID) +// ensureNoFire(t, mempool.TxsAvailable(), timeoutMS) +// +// // now call update with all the txs. it should not fire as there are no txs left +// committedTxs = append(txs, moreTxs...) //nolint: gocritic +// if err := mempool.Update(2, committedTxs, abciResponses(len(committedTxs), abci.CodeTypeOK), nil, nil); err != nil { +// t.Error(err) +// } +// ensureNoFire(t, mempool.TxsAvailable(), timeoutMS) +// +// // send a bunch more txs, it should only fire once +// checkTxs(t, mempool, 100, tmpool.UnknownPeerID) +// ensureFire(t, mempool.TxsAvailable(), timeoutMS) +// ensureNoFire(t, mempool.TxsAvailable(), timeoutMS) +//} +// +//func TestSerialReap(t *testing.T) { +// app := counter.NewApplication(true, nil) +// app.SetOption(abci.RequestSetOption{Key: "serial", Value: "on"}) +// cc := proxy.NewLocalClientCreator(app) +// +// mempool, cleanup := newMempoolWithApp(cc) +// fmt.Println(mempool.config) +// defer cleanup() +// +// appConnCon, _ := cc.NewABCIClient() +// appConnCon.SetLogger(log.TestingLogger().With("module", "abci-client", "connection", "consensus")) +// err := appConnCon.Start() +// require.Nil(t, err) +// +// priv, _ := crypto.GenerateKey() +// +// cacheMap := make(map[string]struct{}) +// deliverTxsRange := func(start, end int) { +// // Deliver some txs. +// for i := start; i < end; i++ { +// // This will succeeds +// txBytes := createTx(116+uint64(i), priv) +// err := mempool.CheckTx(txBytes, nil, tmpool.TxInfo{}) +// _, cached := cacheMap[string(txBytes)] +// if cached { +// require.NotNil(t, err, "expected error for cached tx") +// } else { +// require.Nil(t, err, "expected no err for uncached tx") +// } +// cacheMap[string(txBytes)] = struct{}{} +// +// // Duplicates are cached and should return error +// err = mempool.CheckTx(txBytes, nil, tmpool.TxInfo{}) +// require.NotNil(t, err, "Expected error after CheckTx on duplicated tx") +// } +// } +// +// reapCheck := func(exp int) { +// txs := mempool.ReapMaxBytesMaxGas(-1, -1) +// require.Equal(t, len(txs), exp, fmt.Sprintf("Expected to reap %v txs but got %v", exp, len(txs))) +// } +// +// updateRange := func(start, end int) { +// txs := make([]tmtypes.Tx, 0) +// for i := start; i < end; i++ { +// txBytes := createTx(116+uint64(i), priv) +// txs = append(txs, txBytes) +// } +// if err := mempool.Update(0, txs, abciResponses(len(txs), abci.CodeTypeOK), nil, nil); err != nil { +// t.Error(err) +// } +// } +// +// commitRange := func(start, end int) { +// // Deliver some txs. +// for i := start; i < end; i++ { +// txBytes := createTx(116+uint64(i), priv) +// res, err := appConnCon.DeliverTxSync(abci.RequestDeliverTx{Tx: txBytes}) +// if err != nil { +// t.Errorf("client error committing tx: %v", err) +// } +// if res.IsErr() { +// t.Errorf("error committing tx. Code:%v result:%X log:%v", +// res.Code, res.Data, res.Log) +// } +// } +// res, err := appConnCon.CommitSync() +// if err != nil { +// t.Errorf("client error committing: %v", err) +// } +// if len(res.Data) != 8 { +// t.Errorf("error committing. Hash:%X", res.Data) +// } +// } +// +// //---------------------------------------- +// +// // Deliver some txs. +// deliverTxsRange(0, 100) +// +// // Reap the txs. +// reapCheck(100) +// +// // Reap again. We should get the same amount +// reapCheck(100) +// +// // Deliver 0 to 999, we should reap 900 new txs +// // because 100 were already counted. +// deliverTxsRange(0, 1000) +// +// // Reap the txs. +// reapCheck(1000) +// +// // Reap again. We should get the same amount +// reapCheck(1000) +// +// // Commit from the conensus AppConn +// commitRange(0, 500) +// updateRange(0, 500) +// +// // We should have 500 left. +// reapCheck(500) +// +// // Deliver 100 invalid txs and 100 valid txs +// deliverTxsRange(900, 1100) +// +// // We should have 600 now. +// reapCheck(600) +//} +// +//func TestMempoolCloseWAL(t *testing.T) { +// // 1. Create the temporary directory for mempool and WAL testing. +// rootDir, err := ioutil.TempDir("", "mempool-test") +// require.Nil(t, err, "expecting successful tmpdir creation") +// +// // 2. Ensure that it doesn't contain any elements -- Sanity check +// m1, err := filepath.Glob(filepath.Join(rootDir, "*")) +// require.Nil(t, err, "successful globbing expected") +// require.Equal(t, 0, len(m1), "no matches yet") +// +// // 3. Create the mempool +// wcfg := cfg.DefaultConfig() +// wcfg.Mempool.RootDir = rootDir +// app := kvstore.NewApplication() +// cc := proxy.NewLocalClientCreator(app) +// mempool, cleanup := newMempoolWithAppAndConfig(cc, wcfg) +// defer cleanup() +// mempool.height = 10 +// err = mempool.InitWAL() +// require.NoError(t, err) +// +// // 4. Ensure that the directory contains the WAL file +// m2, err := filepath.Glob(filepath.Join(rootDir, "*")) +// require.Nil(t, err, "successful globbing expected") +// require.Equal(t, 1, len(m2), "expecting the wal match in") +// +// // 5. Write some contents to the WAL +// tx := createTx(116, nil) +// err = mempool.CheckTx(tx, nil, tmpool.TxInfo{}) +// require.NoError(t, err) +// walFilepath := mempool.wal.Path +// sum1 := checksumFile(walFilepath, t) +// +// //// 6. Sanity check to ensure that the written TX matches the expectation. +// require.Equal(t, sum1, checksumIt(append(tx, []byte("\n")...)), "foo with a newline should be written") +// +// // 7. Invoke CloseWAL() and ensure it discards the +// // WAL thus any other write won't go through. +// mempool.CloseWAL() +// err = mempool.CheckTx(createTx(117, nil), nil, tmpool.TxInfo{}) +// require.NoError(t, err) +// sum2 := checksumFile(walFilepath, t) +// require.Equal(t, sum1, sum2, "expected no change to the WAL after invoking CloseWAL() since it was discarded") +// +// // 8. Sanity check to ensure that the WAL file still exists +// m3, err := filepath.Glob(filepath.Join(rootDir, "*")) +// require.Nil(t, err, "successful globbing expected") +// require.Equal(t, 1, len(m3), "expecting the wal match in") +//} +// +//func TestMempool_CheckTxChecksTxSize(t *testing.T) { +// app := kvstore.NewApplication() +// cc := proxy.NewLocalClientCreator(app) +// mempl, cleanup := newMempoolWithApp(cc) +// defer cleanup() +// +// maxTxSize := mempl.config.MaxTxBytes +// +// testCases := []struct { +// len int +// err bool +// experr int +// }{ +// // check small txs. no error +// 0: {10, false, 0}, +// 1: {1000, false, 0}, +// 2: {1000000, false, 0}, +// +// // check around maxTxSize +// 3: {maxTxSize - 122, false, 0}, +// 4: {maxTxSize - 121, false, 0}, +// 5: {maxTxSize - 120, true, maxTxSize + 1}, +// } +// +// for i, testCase := range testCases { +// caseString := fmt.Sprintf("case %d, len %d", i, testCase.len) +// +// tx := createTx(uint64(116+testCase.len), nil) +// +// err := mempl.CheckTx(tx, nil, tmpool.TxInfo{}) +// bv := gogotypes.BytesValue{Value: tx} +// bz, err2 := bv.Marshal() +// require.NoError(t, err2) +// require.Equal(t, len(bz), proto.Size(&bv), caseString) +// +// if !testCase.err { +// require.NoError(t, err, caseString) +// } else { +// require.Equal(t, err, ErrTxTooLarge{maxTxSize, testCase.experr}, caseString) +// } +// } +//} +// +//func TestMempoolTxsBytes(t *testing.T) { +// app := kvstore.NewApplication() +// cc := proxy.NewLocalClientCreator(app) +// config := cfg.ResetTestRoot("mempool_test") +// config.Mempool.MaxTxsBytes = 126 +// mempool, cleanup := newMempoolWithAppAndConfig(cc, config) +// defer cleanup() +// +// // 1. zero by default +// assert.EqualValues(t, 0, mempool.TxsBytes()) +// +// // 2. len(tx) after CheckTx +// tx1 := createTx(116, nil) +// err := mempool.CheckTx(tx1, nil, tmpool.TxInfo{}) +// require.NoError(t, err) +// assert.EqualValues(t, 116, mempool.TxsBytes()) +// +// // 3. zero again after tx is removed by Update +// err = mempool.Update(1, []tmtypes.Tx{tx1}, abciResponses(1, abci.CodeTypeOK), nil, nil) +// require.NoError(t, err) +// assert.EqualValues(t, 0, mempool.TxsBytes()) +// +// // 4. zero after Flush +// err = mempool.CheckTx(createTx(117, nil), nil, tmpool.TxInfo{}) +// require.NoError(t, err) +// assert.EqualValues(t, 117, mempool.TxsBytes()) +// +// mempool.Flush() +// assert.EqualValues(t, 0, mempool.TxsBytes()) +// +// // 5. ErrMempoolIsFull is returned when/if MaxTxsBytes limit is reached. +// err = mempool.CheckTx(createTx(126, nil), nil, tmpool.TxInfo{}) +// require.NoError(t, err) +// err = mempool.CheckTx(createTx(117, nil), nil, tmpool.TxInfo{}) +// if assert.Error(t, err) { +// assert.IsType(t, ErrMempoolIsFull{}, err) +// } +// +// // 6. zero after tx is rechecked and removed due to not being valid anymore +// app2 := counter.NewApplication(true, transaction.NewExecutor(transaction.GetData)) +// cc = proxy.NewLocalClientCreator(app2) +// mempool, cleanup = newMempoolWithApp(cc) +// defer cleanup() +// +// app2.TxCount = 1 +// tx := createTx(124, nil) +// err = mempool.CheckTx(tx, nil, tmpool.TxInfo{}) +// require.NoError(t, err) +// assert.EqualValues(t, 124, mempool.TxsBytes()) +// +// appConnCon, _ := cc.NewABCIClient() +// appConnCon.SetLogger(log.TestingLogger().With("module", "abci-client", "connection", "consensus")) +// err = appConnCon.Start() +// require.Nil(t, err) +// t.Cleanup(func() { +// if err := appConnCon.Stop(); err != nil { +// t.Error(err) +// } +// }) +// res, err := appConnCon.DeliverTxSync(abci.RequestDeliverTx{Tx: tx}) +// require.NoError(t, err) +// require.EqualValues(t, uint32(0), res.Code) +// res2, err := appConnCon.CommitSync() +// require.NoError(t, err) +// require.NotEmpty(t, res2.Data) +// +// // Pretend like we committed nothing so txBytes gets rechecked and removed. +// err = mempool.Update(1, []tmtypes.Tx{}, abciResponses(0, abci.CodeTypeOK), nil, nil) +// require.NoError(t, err) +// assert.EqualValues(t, 0, mempool.TxsBytes()) +// +// // 7. Test RemoveTxByK ey function +// mempool, cleanup = newMempoolWithAppAndConfig(proxy.NewLocalClientCreator(app), config) +// defer cleanup() +// +// tx = createTx(123, nil) +// err = mempool.CheckTx(tx, nil, tmpool.TxInfo{}) +// require.NoError(t, err) +// assert.EqualValues(t, 123, mempool.TxsBytes()) +// mempool.RemoveTxByKey(TxKey(createTx(124, nil)), true) +// assert.EqualValues(t, 123, mempool.TxsBytes()) +// mempool.RemoveTxByKey(TxKey(tx), true) +// assert.EqualValues(t, 0, mempool.TxsBytes()) +// +//} +// +//// This will non-deterministically catch some concurrency failures like +//// https://github.com/tendermint/tendermint/issues/3509 +//// TODO: all of the tests should probably also run using the remote proxy app +//// since otherwise we're not actually testing the concurrency of the mempool here! +//func TestMempoolRemoteAppConcurrency(t *testing.T) { +// sockPath := fmt.Sprintf("unix:///tmp/echo_%v.sock", tmrand.Str(6)) +// app := kvstore.NewApplication() +// cc, server := newRemoteApp(t, sockPath, app) +// t.Cleanup(func() { +// if err := server.Stop(); err != nil { +// t.Error(err) +// } +// }) +// config := cfg.ResetTestRoot("mempool_test") +// mempool, cleanup := newMempoolWithAppAndConfig(cc, config) +// defer cleanup() +// +// // generate small number of txs +// nTxs := 10 +// txs := make([]tmtypes.Tx, nTxs) +// for i := 0; i < nTxs; i++ { +// txs[i] = createTx(116, nil) +// } +// +// // simulate a group of peers sending them over and over +// N := config.Mempool.Size +// maxPeers := 5 +// for i := 0; i < N; i++ { +// peerID := mrand.Intn(maxPeers) +// txNum := mrand.Intn(nTxs) +// tx := txs[txNum] +// +// // this will err with tmpool.ErrTxInCache many times ... +// mempool.CheckTx(tx, nil, tmpool.TxInfo{SenderID: uint16(peerID)}) //nolint: errcheck // will error +// } +// err := mempool.FlushAppConn() +// require.NoError(t, err) +//} +// +//// caller must close server +//func newRemoteApp( +// t *testing.T, +// addr string, +// app abci.Application, +//) ( +// clientCreator proxy.ClientCreator, +// server service.Service, +//) { +// clientCreator = proxy.NewRemoteClientCreator(addr, "socket", true) +// +// // Start server +// server = abciserver.NewSocketServer(addr, app) +// server.SetLogger(log.TestingLogger().With("module", "abci-server")) +// if err := server.Start(); err != nil { +// t.Fatalf("Error starting socket server: %v", err.Error()) +// } +// return clientCreator, server +//} +//func checksumIt(data []byte) string { +// h := sha256.New() +// h.Write(data) +// return fmt.Sprintf("%x", h.Sum(nil)) +//} +// +//func checksumFile(p string, t *testing.T) string { +// data, err := ioutil.ReadFile(p) +// require.Nil(t, err, "expecting successful read of %q", p) +// return checksumIt(data) +//} +// +//func abciResponses(n int, code uint32) []*abci.ResponseDeliverTx { +// responses := make([]*abci.ResponseDeliverTx, 0, n) +// for i := 0; i < n; i++ { +// responses = append(responses, &abci.ResponseDeliverTx{Code: code}) +// } +// return responses +//} diff --git a/coreV2/minter/minter_test.go b/coreV2/minter/minter_test.go index 56d4996d6..605eee033 100644 --- a/coreV2/minter/minter_test.go +++ b/coreV2/minter/minter_test.go @@ -70,7 +70,6 @@ func initTestNode(t *testing.T, initialHeight int64) (*Blockchain, *rpc.Local, * getTestGenesis(pv, storage.GetMinterHome(), initialHeight), tmNode.DefaultDBProvider, tmNode.DefaultMetricsProvider(cfg.Instrumentation), - nil, logger, tmNode.CustomReactors(map[string]p2p.Reactor{ // "PEX": p2pmock.NewReactor(), diff --git a/go.mod b/go.mod index e1613c566..87dd654ab 100644 --- a/go.mod +++ b/go.mod @@ -107,6 +107,6 @@ require ( gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) -replace github.com/tendermint/tendermint => github.com/MinterTeam/tendermint v0.34.15-beta1.0.20211216233158-7d1d8faa5437 +replace github.com/tendermint/tendermint => github.com/MinterTeam/tendermint v0.34.11-0.20211217161414-dda5434727d3 //replace github.com/tendermint/tendermint => /Users/klim0v/GolandProjects/tendermint diff --git a/go.sum b/go.sum index 05159a04e..f3d2841ff 100644 --- a/go.sum +++ b/go.sum @@ -77,8 +77,8 @@ github.com/Microsoft/go-winio v0.5.0 h1:Elr9Wn+sGKPlkaBvwu4mTrxtmOp3F3yV9qhaHbXG github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/MinterTeam/node-grpc-gateway v1.4.3-0.20211208134306-ae7964561da4 h1:FwYtiBig/nwzJLTuksrqbhSV1Tr+RByzEzW5dOzEJYc= github.com/MinterTeam/node-grpc-gateway v1.4.3-0.20211208134306-ae7964561da4/go.mod h1:kSjFnXZ52XTOaxj4+nbahfMsAt8GsEIc9DSMzOlfALI= -github.com/MinterTeam/tendermint v0.34.15-beta1.0.20211216233158-7d1d8faa5437 h1:Y4ZyRwcCErvNlE0c5s5tD6eaMdw9g9RaBe+B+F2coUQ= -github.com/MinterTeam/tendermint v0.34.15-beta1.0.20211216233158-7d1d8faa5437/go.mod h1:/7EDAw02rD7GT8syC317cX9ZhZTCdaFVvYjU8W+yJSs= +github.com/MinterTeam/tendermint v0.34.11-0.20211217161414-dda5434727d3 h1:4T/mn9nqyHDMrNvM/aV8CQaz8fZJNrC6zmSw3G4q7Do= +github.com/MinterTeam/tendermint v0.34.11-0.20211217161414-dda5434727d3/go.mod h1:/7EDAw02rD7GT8syC317cX9ZhZTCdaFVvYjU8W+yJSs= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= diff --git a/tree/tree.go b/tree/tree.go index a4595e7f9..66a67cc81 100644 --- a/tree/tree.go +++ b/tree/tree.go @@ -83,7 +83,7 @@ func (t *mutableTree) MutableTree() *iavl.MutableTree { // NewMutableTree creates and returns new MutableTree using given db. Panics on error. // If you want to get read-only state, you should use height = 0 and LazyLoadVersion (version), see NewImmutableTree func NewMutableTree(height uint64, db dbm.DB, cacheSize int, initialVersion uint64) (MTree, error) { - tree, err := iavl.NewMutableTree(db, cacheSize) + tree, err := iavl.NewMutableTreeWithOpts(db, cacheSize, &iavl.Options{InitialVersion: initialVersion}) if err != nil { return nil, err } From 03a537b760d66a9d9f234f6795414a9776b126d5 Mon Sep 17 00:00:00 2001 From: klim0v Date: Fri, 17 Dec 2021 19:35:38 +0300 Subject: [PATCH 27/39] check exist state version for delete --- tree/tree.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tree/tree.go b/tree/tree.go index 66a67cc81..6dc2286b4 100644 --- a/tree/tree.go +++ b/tree/tree.go @@ -153,8 +153,14 @@ func (t *mutableTree) DeleteVersionsRange(fromVersion, toVersion int64) error { func (t *mutableTree) DeleteVersion(version int64) error { t.lock.Lock() defer t.lock.Unlock() + if t.existVersion(version) { + return t.tree.DeleteVersion(version) + } + return nil +} - return t.tree.DeleteVersion(version) +func (t *mutableTree) existVersion(version int64) bool { + return t.tree.VersionExists(version) } func (t *mutableTree) AvailableVersions() []int { From 20653fdeea9cd20a787772ca85733322b78335bc Mon Sep 17 00:00:00 2001 From: klim0v Date: Fri, 17 Dec 2021 19:49:09 +0300 Subject: [PATCH 28/39] ci --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index deaa4e03f..198c1f637 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,11 +3,13 @@ name: docker on: push: branches: + - todo # - master # - dev pull_request: branches: + - todo # - master jobs: @@ -27,7 +29,7 @@ jobs: with: fetch-depth: 1 - # if secret DOCKER_HUB_REPO is not set DOCKER_HUB_USER will be used instead of REPO + # if secret DOCKER_HUB_REPO is not set DOCKER_HUB_USER will be used instead of REPO # otherwise secrets are empty and repo "testbuild" will be used - name: Set envs env: From c26a8505feb7d304b66db911d61cc9e3476c3a37 Mon Sep 17 00:00:00 2001 From: klim0v Date: Mon, 20 Dec 2021 14:17:09 +0300 Subject: [PATCH 29/39] add state-sync flag --- cmd/minter/cmd/root.go | 9 +++++++++ cmd/minter/main.go | 1 + config/config.go | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/cmd/minter/cmd/root.go b/cmd/minter/cmd/root.go index 7b820ad00..8b804689f 100644 --- a/cmd/minter/cmd/root.go +++ b/cmd/minter/cmd/root.go @@ -54,5 +54,14 @@ var RootCmd = &cobra.Command{ if peers != "" { cfg.P2P.PersistentPeers = peers } + + stateSync, err := cmd.Flags().GetBool("state-sync") + if err != nil { + panic(err) + } + + if stateSync { + cfg.StateSync.Enable = stateSync + } }, } diff --git a/cmd/minter/main.go b/cmd/minter/main.go index eed69456d..9ce260699 100644 --- a/cmd/minter/main.go +++ b/cmd/minter/main.go @@ -37,6 +37,7 @@ func main() { 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("persistent-peers", "", "") + rootCmd.PersistentFlags().Bool("state-sync", false, "enable state sync snapshots") cmd.ExportCommand.Flags().Uint64("height", 0, "export height") cmd.ExportCommand.Flags().Bool("indent", false, "using indent") diff --git a/config/config.go b/config/config.go index e0e7fd5bd..56efe3bae 100644 --- a/config/config.go +++ b/config/config.go @@ -42,6 +42,9 @@ func DefaultConfig() *Config { "c578fba1bdb5265be75dd412f8cf1bbeb7399620@seed.minter.stakeholder.space:26656," + "bab220855eb9625ea547f1ef1d11692c60a7a406@138.201.28.219:26656" + cfg.P2P.PersistentPeers = "bac66d7240caca750dfb78a1ebb0a82a7a5ba898@state-test.minter.network:26656," + + "5b877dcc33c780bf9ae9dfde9070c055832b72b5@sync-test.minter.network:26656" + cfg.TxIndex = &tmConfig.TxIndexConfig{ Indexer: "kv", } @@ -69,6 +72,11 @@ func DefaultConfig() *Config { cfg.PrivValidatorState = "config/priv_validator_state.json" cfg.NodeKey = "config/node_key.json" + cfg.StateSync.RPCServers = []string{"state-test.minter.network:26657", "sync-test.minter.network:26657"} + cfg.StateSync.TrustHeight = 8043210 + cfg.StateSync.TrustHash = "F8A11602BE2C7770FC118BB7EFC4FC99146A3666423FB42E29A94AF87CFF7EC6" + cfg.StateSync.TrustPeriod = time.Hour * 8760 + return cfg } From 05ad8df683972b5667dc18fe8143b76a5f2b5fba Mon Sep 17 00:00:00 2001 From: klim0v Date: Mon, 20 Dec 2021 15:14:30 +0300 Subject: [PATCH 30/39] fix toml --- config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index 56efe3bae..2056f38af 100644 --- a/config/config.go +++ b/config/config.go @@ -72,7 +72,7 @@ func DefaultConfig() *Config { cfg.PrivValidatorState = "config/priv_validator_state.json" cfg.NodeKey = "config/node_key.json" - cfg.StateSync.RPCServers = []string{"state-test.minter.network:26657", "sync-test.minter.network:26657"} + cfg.StateSync.RPCServers = []string{"\"state-test.minter.network:26657\"", ",", "\"sync-test.minter.network:26657\""} cfg.StateSync.TrustHeight = 8043210 cfg.StateSync.TrustHash = "F8A11602BE2C7770FC118BB7EFC4FC99146A3666423FB42E29A94AF87CFF7EC6" cfg.StateSync.TrustPeriod = time.Hour * 8760 From 3057a53adf72a65919fd7acf9e3f7e076170b007 Mon Sep 17 00:00:00 2001 From: klim0v Date: Mon, 20 Dec 2021 15:48:11 +0300 Subject: [PATCH 31/39] fix template --- config/config.go | 2 +- config/toml.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index 2056f38af..56efe3bae 100644 --- a/config/config.go +++ b/config/config.go @@ -72,7 +72,7 @@ func DefaultConfig() *Config { cfg.PrivValidatorState = "config/priv_validator_state.json" cfg.NodeKey = "config/node_key.json" - cfg.StateSync.RPCServers = []string{"\"state-test.minter.network:26657\"", ",", "\"sync-test.minter.network:26657\""} + cfg.StateSync.RPCServers = []string{"state-test.minter.network:26657", "sync-test.minter.network:26657"} cfg.StateSync.TrustHeight = 8043210 cfg.StateSync.TrustHash = "F8A11602BE2C7770FC118BB7EFC4FC99146A3666423FB42E29A94AF87CFF7EC6" cfg.StateSync.TrustPeriod = time.Hour * 8760 diff --git a/config/toml.go b/config/toml.go index 198c75865..55876dee9 100644 --- a/config/toml.go +++ b/config/toml.go @@ -143,7 +143,7 @@ prof_laddr = "{{ .BaseConfig.ProfListenAddress }}" enable = {{ .StateSync.Enable }} # At least 2 available RPC servers. -rpc_servers = {{ .StateSync.RPCServers }} +rpc_servers = [{{range $element := .StateSync.RPCServers}} "{{$element}}", {{end}}] # A trusted height trust_height = {{ .StateSync.TrustHeight }} From 389c57fbe136ea523776422cf8216aea58a8fcb0 Mon Sep 17 00:00:00 2001 From: klim0v Date: Mon, 20 Dec 2021 16:24:47 +0300 Subject: [PATCH 32/39] ci --- .github/workflows/main.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 198c1f637..01e88a48e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,14 +3,12 @@ name: docker on: push: branches: - - todo - # - master - # - dev + - master + - dev pull_request: branches: - - todo -# - master + - master jobs: docker: From 97c72d97fe17dea3d9ae75c0a7481856c6cb4341 Mon Sep 17 00:00:00 2001 From: klim0v Date: Mon, 20 Dec 2021 16:58:10 +0300 Subject: [PATCH 33/39] ci --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 01e88a48e..fe21b8fb1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,6 +9,7 @@ on: pull_request: branches: - master + - dev jobs: docker: From ab07957d695a0767534ddf9c3d55074585dd3fe6 Mon Sep 17 00:00:00 2001 From: klim0v Date: Mon, 20 Dec 2021 17:10:44 +0300 Subject: [PATCH 34/39] ci --- Dockerfile-ci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile-ci b/Dockerfile-ci index cd4df1932..3bf2cd0d1 100644 --- a/Dockerfile-ci +++ b/Dockerfile-ci @@ -19,4 +19,4 @@ WORKDIR /minter RUN mkdir /minter/data EXPOSE 8843 ENTRYPOINT ["/usr/bin/minter"] -CMD ["node", "--home-dir", "/minter", "--genesis", "https://github.com/MinterTeam/minter-go-node/releases/download/v1.2-testnet-9/genesis.json"] +CMD ["node", "--home-dir", "/minter", "--state-sync"] From 05e488e31be26a8a02852c1b1ded3be04db9bde5 Mon Sep 17 00:00:00 2001 From: klim0v Date: Mon, 20 Dec 2021 17:13:24 +0300 Subject: [PATCH 35/39] ci --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fe21b8fb1..01e88a48e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,7 +9,6 @@ on: pull_request: branches: - master - - dev jobs: docker: From db5ec8d165a1b24aa32ef17dfa15e63c793895eb Mon Sep 17 00:00:00 2001 From: klim0v Date: Mon, 20 Dec 2021 17:18:43 +0300 Subject: [PATCH 36/39] ci --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 01e88a48e..51c5feee7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: docker: env: CONTAINER_NAME: minter_node - CONTAINER_TIMEOUT_SEC: 30 + CONTAINER_TIMEOUT_SEC: 90 API_RUN_PORT: 8843 SECRET_DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} SECRET_DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} From 92c45a296eac472c491df5187a8a8f8a66d71f2d Mon Sep 17 00:00:00 2001 From: klim0v Date: Mon, 20 Dec 2021 17:19:01 +0300 Subject: [PATCH 37/39] ci --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 51c5feee7..5f76a30a6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: docker: env: CONTAINER_NAME: minter_node - CONTAINER_TIMEOUT_SEC: 90 + CONTAINER_TIMEOUT_SEC: 60 API_RUN_PORT: 8843 SECRET_DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} SECRET_DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} From a056e8bac3503ada3698937366947aa24e831eea Mon Sep 17 00:00:00 2001 From: klim0v Date: Mon, 27 Dec 2021 22:09:30 +0300 Subject: [PATCH 38/39] refactor --- coreV2/state/candidates/candidates.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreV2/state/candidates/candidates.go b/coreV2/state/candidates/candidates.go index 790614acb..c0c9e49e9 100644 --- a/coreV2/state/candidates/candidates.go +++ b/coreV2/state/candidates/candidates.go @@ -1475,7 +1475,7 @@ func (c *Candidates) deleteCandaditeFromList(candidate *Candidate) { } func (c *Candidates) loadDeletedCandidates() { - if c.deletedCandidates != nil { + if len(c.deletedCandidates) != 0 { return } c.deletedCandidates = make(map[types.Pubkey]*deletedID) From 16522d9056a87b077f480a6b9ea955c68745b98c Mon Sep 17 00:00:00 2001 From: klim0v Date: Mon, 27 Dec 2021 22:22:53 +0300 Subject: [PATCH 39/39] refactor --- coreV2/minter/blockchain.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/coreV2/minter/blockchain.go b/coreV2/minter/blockchain.go index c069a5a78..68cadcafa 100644 --- a/coreV2/minter/blockchain.go +++ b/coreV2/minter/blockchain.go @@ -142,6 +142,7 @@ func NewMinterBlockchain(storages *utils.Storage, cfg *config.Config, ctx contex v230: {}, // add more for update v250: {}, // commissions and mempool v260: {}, // amm with orderbook + v261: {}, // amm with orderbook }, executor: GetExecutor(""), } @@ -157,7 +158,7 @@ func graceForUpdate(height uint64) *upgrades.GracePeriod { func GetExecutor(v string) transaction.ExecutorTx { switch v { - case v260: + case v260, v261: return transaction.NewExecutorV250(transaction.GetDataV260) case v250: return transaction.NewExecutorV250(transaction.GetDataV250) @@ -176,6 +177,7 @@ const ( // known update versions v230 = "v230" // remove liquidity bug v250 = "v250" // commissions and failed txs v260 = "v260" // orderbook + v261 = "v261" // hotfix ) func (blockchain *Blockchain) initState() {