Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into update-yoda-readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Benzbeeb authored Jul 23, 2020
2 parents cb7e016 + 7203645 commit 24a537f
Show file tree
Hide file tree
Showing 39 changed files with 36,818 additions and 31,153 deletions.
61 changes: 61 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,67 @@

# Changelog

## [v1.1.0](https://github.com/bandprotocol/bandchain/releases/tag/v1.1.0)

### Chain (Consensus)

- (impv) [\#2292](https://github.com/bandprotocol/bandchain/pull/2292) go-owasm: Change gas consumption amount when call set return data and allow to set return data only one time.
- (patch) [\#2288](https://github.com/bandprotocol/bandchain/pull/2288) Upgrade to Cosmos-SDK v0.39
- (bugs) [\#2251](https://github.com/bandprotocol/bandchain/pull/2251) go-owasm: Allow OEI to read nil external data

### Chain (Non-consensus)

- (impv) [\#2232](https://github.com/bandprotocol/bandchain/pull/2218) CLI/REST for query active oracle validators.

### Yoda

- (impv) [\#2247](https://github.com/bandprotocol/bandchain/pull/2247) Use max data size configurations from oracle module
- (impv) [\#2249](https://github.com/bandprotocol/bandchain/pull/2249) docker: Run test program during initialization.
- (feat) [\#2218](https://github.com/bandprotocol/bandchain/pull/2218) Implement MultiExec to combine multiple executors.

### Emitter & Flusher

- (impv) [\#2275](https://github.com/bandprotocol/bandchain/pull/2275) Add field `accumulated_commission` in `validators` table.
- (feat) [\#2248](https://github.com/bandprotocol/bandchain/pull/2248) Add identity column on delegation view table.
- (bugs) [\#2273](https://github.com/bandprotocol/bandchain/pull/2273) Fix bug update delegators table after withdraw reward.
- (bugs) [\#2255](https://github.com/bandprotocol/bandchain/pull/2255) Fix bug `reward_amount` and `commission_amount` in extra field.
- (bugs) [\#2252](https://github.com/bandprotocol/bandchain/pull/2252) `handle_set_validator` get wrong validator id.
- (impv) [\#2250](https://github.com/bandprotocol/bandchain/pull/2250) Add account id in `validators` table.
- (feat) [\#2246](https://github.com/bandprotocol/bandchain/pull/2246) Implement handle all resolve proposal status.
- (feat) [\#2242](https://github.com/bandprotocol/bandchain/pull/2242) Implement handle MsgVote for emitter and flusher.
- (feat) [\#2241](https://github.com/bandprotocol/bandchain/pull/2241) Implement handle MsgDeposit for emitter and flusher.
- (impv) [\#2240](https://github.com/bandprotocol/bandchain/pull/2240) Emit Kafka msg for staking genesis state.
- (feat) [\#2238](https://github.com/bandprotocol/bandchain/pull/2238) Implement handle MsgSubmitProposal for emitter and flusher.

### Scan

- (impv) [\#2284](https://github.com/bandprotocol/bandchain/pull/2284) Patch to support new type of big number.
- (feat) [\#2276](https://github.com/bandprotocol/bandchain/pull/2276) Implemented mobile version of homepage top part
- (impv) [\#2287](https://github.com/bandprotocol/bandchain/pull/2287) Improve UI on blockhomepage, and add new card component for mobile
- (impv) [\#2245](https://github.com/bandprotocol/bandchain/pull/2245) Added more features and patch for guanyu testnet
- (impv) [\#2237](https://github.com/bandprotocol/bandchain/pull/2237/files) Add validator's oracle status.
- (bugs) [\#2236](https://github.com/bandprotocol/bandchain/pull/2236) Fixed uptime query on ValidatorIndexPage
- (impv) [\#2235](https://github.com/bandprotocol/bandchain/pull/2235) added `unbonding` and `redelegate` tabs to account index page.
- (impv) [\#2234](https://github.com/bandprotocol/bandchain/pull/2234) Added support for `received` transaction on scan
- (impv) [\#2228](https://github.com/bandprotocol/bandchain/pull/2228) Add `expired` request status to Scan
- (impv) [\#2203](https://github.com/bandprotocol/bandchain/pull/2203/files) Patch request, report subscription for new cacher.
- (impv) [\#2199](https://github.com/bandprotocol/bandchain/pull/2199) Remove proposed blocks count & adjust ui
- (impv) [\#2176](https://github.com/bandprotocol/bandchain/pull/2176/files) Fixed delegations/unbonding subs, avg blocktime and validator uptime to work with new cacher.

### Runtime

- (impv) [\#2233](https://github.com/bandprotocol/bandchain/pull/2233) Remove max timeout variable.
- (impv) [\#2230](https://github.com/bandprotocol/bandchain/pull/2230) Update lambda function follow Remote data source executor.

### Owasm

- (impv) [\#2285](https://github.com/bandprotocol/bandchain/pull/2285) Use centos as docker image base.
- (impv) [\#2231](https://github.com/bandprotocol/bandchain/pull/2231) Maintain gas used and gas limit in VMConfig.

### MISC

- (chore) [\#2281](https://github.com/bandprotocol/bandchain/pull/2281) Update docker script for development deployment flow.

## [v1.0.5](https://github.com/bandprotocol/bandchain/releases/tag/v1.0.5)

- Re-adjust data size parameters for Testnet launch.
Expand Down
34 changes: 1 addition & 33 deletions CHANGELOG_UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,54 +10,22 @@

### Chain (Consensus)

- (bugs) [\#2251](https://github.com/bandprotocol/bandchain/pull/2251) go-owasm: Allow OEI to read nil external data

### Chain (Non-consensus)

- (impv) [\#2232](https://github.com/bandprotocol/bandchain/pull/2218) CLI/REST for query active oracle validators.

### Yoda

- (impv) [\#2247](https://github.com/bandprotocol/bandchain/pull/2247) Use max data size configurations from oracle module
- (impv) [\#2249](https://github.com/bandprotocol/bandchain/pull/2249) docker: Run test program during initialization.
- (feat) [\#2218](https://github.com/bandprotocol/bandchain/pull/2218) Implement MultiExec to combine multiple executors.

### Emitter & Flusher

- (feat) [\#2248](https://github.com/bandprotocol/bandchain/pull/2248) Add identity column on delegation view table.
- (bugs) [\#2273](https://github.com/bandprotocol/bandchain/pull/2273) Fix bug update delegators table after withdraw reward.
- (bugs) [\#2255](https://github.com/bandprotocol/bandchain/pull/2255) Fix bug `reward_amount` and `commission_amount` in extra field.
- (bugs) [\#2252](https://github.com/bandprotocol/bandchain/pull/2252) `handle_set_validator` get wrong validator id.
- (impv) [\#2250](https://github.com/bandprotocol/bandchain/pull/2250) Add account id in `validators` table.
- (feat) [\#2246](https://github.com/bandprotocol/bandchain/pull/2246) Implement handle all resolve proposal status.
- (feat) [\#2242](https://github.com/bandprotocol/bandchain/pull/2242) Implement handle MsgVote for emitter and flusher.
- (feat) [\#2241](https://github.com/bandprotocol/bandchain/pull/2241) Implement handle MsgDeposit for emitter and flusher.
- (impv) [\#2240](https://github.com/bandprotocol/bandchain/pull/2240) Emit Kafka msg for staking genesis state.
- (feat) [\#2238](https://github.com/bandprotocol/bandchain/pull/2238) Implement handle MsgSubmitProposal for emitter and flusher.
- (bugs) [\#2295](https://github.com/bandprotocol/bandchain/pull/2295) Truncate `accumulated_commission` precision.

### Scan

- (impv) [\#2245](https://github.com/bandprotocol/bandchain/pull/2245) Added more features and patch for guanyu testnet
- (impv) [\#2237](https://github.com/bandprotocol/bandchain/pull/2237/files) Add validator's oracle status.
- (bugs) [\#2236](https://github.com/bandprotocol/bandchain/pull/2236) Fixed uptime query on ValidatorIndexPage
- (impv) [\#2235](https://github.com/bandprotocol/bandchain/pull/2235) added `unbonding` and `redelegate` tabs to account index page.
- (impv) [\#2234](https://github.com/bandprotocol/bandchain/pull/2234) Added support for `received` transaction on scan
- (impv) [\#2228](https://github.com/bandprotocol/bandchain/pull/2228) Add `expired` request status to Scan
- (impv) [\#2203](https://github.com/bandprotocol/bandchain/pull/2203/files) Patch request, report subscription for new cacher.
- (impv) [\#2199](https://github.com/bandprotocol/bandchain/pull/2199) Remove proposed blocks count & adjust ui
- (impv) [\#2176](https://github.com/bandprotocol/bandchain/pull/2176/files) Fixed delegations/unbonding subs, avg blocktime and validator uptime to work with new cacher.

### Bridges

### Runtime

- (impv) [\#2233](https://github.com/bandprotocol/bandchain/pull/2233) Remove max timeout variable.
- (impv) [\#2230](https://github.com/bandprotocol/bandchain/pull/2230) Update lambda function follow Remote data source executor.

### Owasm

- (impv) [\#2231](https://github.com/bandprotocol/bandchain/pull/2231) Maintain gas used and gas limit in VMConfig.

### Oracle Binary Encoding (OBI)

### Helpers
Expand Down
6 changes: 3 additions & 3 deletions bridges/evm/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1718,9 +1718,9 @@ lodash.flatten@^4.4.0:
integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=

lodash@^4.17.13:
version "4.17.15"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
version "4.17.19"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b"
integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==

lowercase-keys@^1.0.0, lowercase-keys@^1.0.1:
version "1.0.1"
Expand Down
5 changes: 2 additions & 3 deletions chain/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,13 @@ func NewBandApp(
evidence.NewAppModule(app.EvidenceKeeper),
oracle.NewAppModule(app.OracleKeeper),
)
// During begin block slashing happens after distr.BeginBlocker so that there is nothing left
// NOTE: Oracle module must occur before distr as it takes some fee to distribute to active oracle validators.
// NOTE: During begin block slashing happens after distr.BeginBlocker so that there is nothing left
// over in the validator fee pool, so as to keep the CanWithdrawInvariant invariant.
app.mm.SetOrderBeginBlockers(
upgrade.ModuleName, mint.ModuleName, oracle.ModuleName, distr.ModuleName, slashing.ModuleName,
evidence.ModuleName, staking.ModuleName,
)
// NOTE: The oracle module must occur before staking so that jailed validators due to report
// downtime will not get included in staking module's ValidatorUpdate set.
app.mm.SetOrderEndBlockers(
crisis.ModuleName, gov.ModuleName, staking.ModuleName, oracle.ModuleName,
)
Expand Down
8 changes: 6 additions & 2 deletions chain/cmd/bandd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,15 @@ func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer) abci.Application
for _, h := range viper.GetIntSlice(server.FlagUnsafeSkipUpgrades) {
skipUpgradeHeights[int64(h)] = true
}
pruningOpts, err := server.GetPruningOptionsFromFlags()
if err != nil {
panic(err)
}
if viper.IsSet(flagWithEmitter) {
return emitter.NewBandAppWithEmitter(
viper.GetString(flagWithEmitter), logger, db, traceStore, true, invCheckPeriod,
skipUpgradeHeights, viper.GetString(flags.FlagHome),
baseapp.SetPruning(store.NewPruningOptionsFromString("nothing")),
baseapp.SetPruning(pruningOpts),
baseapp.SetMinGasPrices(viper.GetString(server.FlagMinGasPrices)),
baseapp.SetHaltHeight(viper.GetUint64(server.FlagHaltHeight)),
baseapp.SetHaltTime(viper.GetUint64(server.FlagHaltTime)),
Expand All @@ -91,7 +95,7 @@ func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer) abci.Application
return app.NewBandApp(
logger, db, traceStore, true, invCheckPeriod, skipUpgradeHeights,
viper.GetString(flags.FlagHome),
baseapp.SetPruning(store.NewPruningOptionsFromString(viper.GetString("pruning"))),
baseapp.SetPruning(pruningOpts),
baseapp.SetMinGasPrices(viper.GetString(server.FlagMinGasPrices)),
baseapp.SetHaltHeight(viper.GetUint64(server.FlagHaltHeight)),
baseapp.SetHaltTime(viper.GetUint64(server.FlagHaltTime)),
Expand Down
4 changes: 2 additions & 2 deletions chain/docker-config/start_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ do
done

# send band tokens to reporters
echo "y" | bandcli tx multi-send 1000000uband $(yoda keys list -a) --from $1 --keyring-backend test
echo "y" | bandcli tx multi-send 1000000uband $(yoda keys list -a) --from validator$v --keyring-backend test

# wait for sending band tokens transaction success
sleep 2

# add reporter to bandchain
echo "y" | bandcli tx oracle add-reporters $(yoda keys list -a) --from $1 --keyring-backend test
echo "y" | bandcli tx oracle add-reporters $(yoda keys list -a) --from validator$v --keyring-backend test

# wait for addding reporter transaction success
sleep 2
Expand Down
2 changes: 1 addition & 1 deletion chain/emitter/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (app *App) BeginBlock(req abci.RequestBeginBlock) abci.ResponseBeginBlock {
"block_height": req.Header.GetHeight() - 1,
"voted": val.GetSignedLastBlock(),
})
app.emitUpdateValidatorReward(validator.GetOperator())
app.emitUpdateValidatorRewardAndAccumulatedCommission(validator.GetOperator())
}

for _, event := range res.Events {
Expand Down
13 changes: 12 additions & 1 deletion chain/emitter/distribution.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ func (app *App) getCurrentRewardAndCurrentRatio(addr sdk.ValAddress) (string, st
return currentReward, currentRatio
}

func (app *App) emitUpdateValidatorRewardAndAccumulatedCommission(addr sdk.ValAddress) {
currentReward, currentRatio := app.getCurrentRewardAndCurrentRatio(addr)
accCommission, _ := app.DistrKeeper.GetValidatorAccumulatedCommission(app.DeliverContext, addr).TruncateDecimal()
app.Write("UPDATE_VALIDATOR", JsDict{
"operator_address": addr.String(),
"current_reward": currentReward,
"current_ratio": currentRatio,
"accumulated_commission": accCommission.String(),
})
}

func (app *App) emitUpdateValidatorReward(addr sdk.ValAddress) {
currentReward, currentRatio := app.getCurrentRewardAndCurrentRatio(addr)
app.Write("UPDATE_VALIDATOR", JsDict{
Expand Down Expand Up @@ -56,6 +67,6 @@ func (app *App) handleMsgWithdrawValidatorCommission(
) {
withdrawAddr := app.DistrKeeper.GetDelegatorWithdrawAddr(app.DeliverContext, sdk.AccAddress(msg.ValidatorAddress))
app.AddAccountsInTx(withdrawAddr)
app.emitUpdateValidatorReward(msg.ValidatorAddress)
app.emitUpdateValidatorRewardAndAccumulatedCommission(msg.ValidatorAddress)
extra["commission_amount"] = evMap[types.EventTypeWithdrawCommission+"."+sdk.AttributeKeyAmount][0]
}
36 changes: 19 additions & 17 deletions chain/emitter/staking.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,26 @@ var (
func (app *App) emitSetValidator(addr sdk.ValAddress) {
val, _ := app.StakingKeeper.GetValidator(app.DeliverContext, addr)
currentReward, currentRatio := app.getCurrentRewardAndCurrentRatio(addr)
accCommission, _ := app.DistrKeeper.GetValidatorAccumulatedCommission(app.DeliverContext, addr).TruncateDecimal()
app.Write("SET_VALIDATOR", JsDict{
"operator_address": addr.String(),
"delegator_address": sdk.AccAddress(addr).String(),
"consensus_address": sdk.ConsAddress(val.ConsPubKey.Address()).String(),
"consensus_pubkey": sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, val.ConsPubKey),
"moniker": val.Description.Moniker,
"identity": val.Description.Identity,
"website": val.Description.Website,
"details": val.Description.Details,
"commission_rate": val.Commission.Rate.String(),
"commission_max_rate": val.Commission.MaxRate.String(),
"commission_max_change": val.Commission.MaxChangeRate.String(),
"min_self_delegation": val.MinSelfDelegation.String(),
"tokens": val.Tokens.Uint64(),
"jailed": val.Jailed,
"delegator_shares": val.DelegatorShares.String(),
"current_reward": currentReward,
"current_ratio": currentRatio,
"operator_address": addr.String(),
"delegator_address": sdk.AccAddress(addr).String(),
"consensus_address": sdk.ConsAddress(val.ConsPubKey.Address()).String(),
"consensus_pubkey": sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, val.ConsPubKey),
"moniker": val.Description.Moniker,
"identity": val.Description.Identity,
"website": val.Description.Website,
"details": val.Description.Details,
"commission_rate": val.Commission.Rate.String(),
"commission_max_rate": val.Commission.MaxRate.String(),
"commission_max_change": val.Commission.MaxChangeRate.String(),
"min_self_delegation": val.MinSelfDelegation.String(),
"tokens": val.Tokens.Uint64(),
"jailed": val.Jailed,
"delegator_shares": val.DelegatorShares.String(),
"current_reward": currentReward,
"current_ratio": currentRatio,
"accumulated_commission": accCommission,
})
}

Expand Down
6 changes: 3 additions & 3 deletions chain/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ go 1.13

require (
github.com/bandprotocol/bandchain/go-owasm v0.0.0-00010101000000-000000000000
github.com/cosmos/cosmos-sdk v0.38.5
github.com/cosmos/cosmos-sdk v0.39.0
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d
github.com/ethereum/go-ethereum v1.9.15
github.com/ethereum/go-ethereum v1.9.17
github.com/gin-gonic/gin v1.6.3
github.com/gogo/protobuf v1.3.1
github.com/golang/protobuf v1.4.2
Expand All @@ -23,7 +23,7 @@ require (
github.com/spf13/viper v1.7.0
github.com/stretchr/testify v1.6.1
github.com/tendermint/go-amino v0.15.1
github.com/tendermint/iavl v0.13.3
github.com/tendermint/iavl v0.14.0
github.com/tendermint/tendermint v0.33.6
github.com/tendermint/tm-db v0.5.1
)
Expand Down
Loading

0 comments on commit 24a537f

Please sign in to comment.