Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • hackjealousy/thornode
  • thorchain/thornode
  • lpfloyd/thornode
  • balder7/thornode
  • Gaiieg/thornode
  • vivek.vardhan7/thornode
  • yairi.medinac/thornode
  • alessio/thornode
  • stjordanis/thornode
  • jtakalai1/thornode
  • ggulgun/thornode
  • pascaldekloe/thornode
  • n.huskisson1992/thornode
  • horacio.mlequo/thornode
  • blockx-labs/thornode
  • silverbackgodx/thornode
  • aleksbez/thornode
  • kushptl/thornode
  • difordcrypt/thornode
  • 5thdimension/thornode
  • edgarmanuelruizplasticos/thornode
  • DevLopME-Az/thornode
  • aswizzle/thornode
  • kiasaki/thornode
  • zhangliang041/thornode
  • cartersz/thornode
  • vikingshield/thornode
  • crzyazblue1/thornode
  • vkbdev/thornode
  • nathanaafo/thornode
  • bi23com_guard/thornode
  • crux25/thornode
  • TheArchitect108/thornode
  • zby121103/thornode
  • the_eridanus/thornode
  • halley9r/thornode
  • pendergrassjohn288/thornode
  • faisal1389/thornode
  • alexdcox/thornode
  • huginntc/thornode
  • guidovranken/thornode
  • thorCatStevens/thornode
  • mogarchy/thornode
  • blackprotocol/blacknode
  • pranav292gpt/thornode
  • dp49/thornode
  • Bevan96230395/thornode
  • JonathanLorimer/thornode
  • akil27/thornode
  • assafmo/thornode
  • Multipartite/thornode
  • george_s/thornode
  • thehuman/thornode
  • 0x-General/thornode
  • kaladinlight/thornode
  • oliver154/thornode
  • TreefeedXavier/thornode
  • veado/thornode
  • HooriRn/thornode
  • PaperNautilus/thornode
  • scorchedfire/thornode
  • KevinXdefi/thornode
  • canziclark24/thornode
  • GiMa-Maya/blacknode
  • ajabhishek759/thornode
  • akincibor/thornode
  • digitaldollarchain/digital-dollar-node
  • rufus.t.firefly/thornode
  • lends/thornode
  • mohs1n/thornode
  • SaifulJnU/thornode
  • SamusElderg/thornode
  • Hippocampus.web3/thornode
  • TxCorpi0x/thornode
  • ursa9r/thornode
  • mdanny1209/thornode
  • OxQuasar/thornode
  • justinvforvendetta/thornode
  • pluto_x1/thornode
  • cryptobuks/thornode
  • samyap/thornode
  • AsmundTHORSec/thornode
  • jiecut42/thornode
  • fishtail6993/thornode
  • koitsu/thornode
  • TheRagnarLodbrok/thornode
  • leonalistingservice/thornode
  • cosminl/thornode
  • zlyzol/thornode
  • inkthorchain/thornode
  • dyns/thornode
  • OKEAMAH/thornode
  • kirtixs/thornode
  • asamere/thornode
  • codehans/thornode
  • markfromdenmark/thornode
  • starsquid/thornode
  • danbryan1/thornode
  • jonreiter/thornode
  • beorn_9r/thornode
  • ahdzib/thornode
  • aper.cu/thornode
  • rekt0x/thornode
  • pharr117/thornode
  • gima-swapkit/thornode
  • proof.of.steve/thornode
  • proof.of.steve/thor-node-2
  • mayachain/thorchain/thornode
  • kocubinski/thornode
  • mattshields/thorchain/thornode
110 results
Show changes
Commits on Source (2)
......@@ -1276,10 +1276,11 @@ components:
- status
- pub_key_set
- validator_cons_pub_key
- bond
- active_block_height
- bond_address
- status_since
- node_operator_address
- total_bond
- bond_providers
- signer_membership
- requested_to_leave
- forced_to_leave
......@@ -1291,7 +1292,6 @@ components:
- current_award
- observe_chains
- preflight_status
- bond_providers
properties:
node_address:
type: string
......@@ -1314,23 +1314,38 @@ components:
type: string
description: the consensus pub key for the node
example: "thor104gsqwta048e80j909g6y9kkqdjrw0lff866ew"
bond:
type: string
description: current node bond
example: "123456789"
active_block_height:
type: integer
format: int64
description: the block height at which the node became active
example: 123456
bond_address:
type: string
example: "thor1f3s7q037eancht7sg0aj995dht25rwrnu4ats5"
status_since:
type: integer
format: int64
description: the block height of the current provided information for the node
example: 100000
node_operator_address:
type: string
example: "thor1f3s7q037eancht7sg0aj995dht25rwrnu4ats5"
total_bond:
type: string
description: current node bond
example: "123456789"
bond_providers:
type: object
title: NodeBondProviders
properties:
node_operator_fee:
type: string
description: node operator fee in basis points
providers:
type: object
title: NodeBondProvider
properties:
bond_address:
type: string
bond:
type: string
signer_membership:
type: array
description: the set of vault public keys of which the node is a member
......@@ -1362,9 +1377,6 @@ components:
type: object
title: NodeJail
properties:
node_address:
type: string
example: "tthor1f3s7q037eancht7sg0aj995dht25rwrnu4ats5"
release_height:
type: integer
format: int64
......@@ -1411,22 +1423,6 @@ components:
type: integer
format: int64
example: 0
bond_providers:
type: object
title: NodeBondProviders
properties:
node_address:
type: string
node_operator_fee:
type: string
providers:
type: object
title: NodeBondProvider
properties:
bond_address:
type: string
bond:
type: string
KeygenMetric:
type: object
......@@ -1604,24 +1600,19 @@ components:
NetworkResponse:
type: object
required:
# Since the querier uses an openapi. object, these will be displayed in alphabetical order,
# so the schema should also be in alphabetical order.
- bond_reward_rune
- total_bond_units
- total_reserve
- burned_bep_2_rune
- burned_erc_20_rune
- total_bond_units
- total_reserve
- vaults_migrating
properties:
bond_reward_rune:
type: string
example: "857134475040"
description: total amount of RUNE awarded to node operators
total_bond_units:
type: string
example: "0"
description: total bonded RUNE
total_reserve:
type: string
example: "21999180112172346"
description: total reserve RUNE
burned_bep_2_rune:
type: string
example: "674699077345087"
......@@ -1630,6 +1621,18 @@ components:
type: string
example: "66369401654835"
description: total of burned ERC20 RUNE
total_bond_units:
type: string
example: "0"
description: total bonded RUNE
total_reserve:
type: string
example: "21999180112172346"
description: total reserve RUNE
vaults_migrating:
type: boolean
example: false
description: Returns true if there exist RetiringVaults which have not finished migrating funds to new ActiveVaults
POLResponse:
type: object
......
......@@ -52,7 +52,9 @@ func (Test) TestJSONSpec(c *C) {
assertJSONStructTagsMatch(c, types.QueryNodeAccountPreflightCheck{}, gen.NodePreflightStatus{})
assertJSONStructTagsMatch(c, types.QueryNodeAccount{}, gen.Node{})
assertJSONStructTagsMatch(c, types.QueryChainHeight{}, gen.ChainHeight{})
assertJSONStructTagsMatch(c, types.Jail{}, gen.NodeJail{})
// As node_address is omitted from the jail display,
// skip assertJSONStructTagsMatch for types.Jail{} / gen.NodeJail{}
// so that the spec can match the display.
// tss
assertJSONStructTagsMatch(c, types.NodeTssTime{}, gen.NodeKeygenMetric{})
......@@ -77,7 +79,7 @@ func (Test) TestJSONSpec(c *C) {
func assertJSONStructTagsMatch(c *C, thor, spec interface{}) {
thorType := reflect.TypeOf(thor)
specType := reflect.TypeOf(spec)
comment := Commentf("type=%s", specType.Name())
comment := Commentf("thorType=%s; specType=%s", thorType.Name(), specType.Name())
c.Assert(specType.NumField(), Equals, thorType.NumField(), comment)
for i := 0; i < thorType.NumField(); i++ {
......
......@@ -392,15 +392,25 @@ func queryVaultsPubkeys(ctx cosmos.Context, mgr *Mgrs) ([]byte, error) {
func queryNetwork(ctx cosmos.Context, mgr *Mgrs) ([]byte, error) {
data, err := mgr.Keeper().GetNetwork(ctx)
if err != nil {
ctx.Logger().Error("fail to get vault", "error", err)
return nil, fmt.Errorf("fail to get vault: %w", err)
ctx.Logger().Error("fail to get network", "error", err)
return nil, fmt.Errorf("fail to get network: %w", err)
}
vaults, err := mgr.Keeper().GetAsgardVaultsByStatus(ctx, RetiringVault)
if err != nil {
return nil, fmt.Errorf("fail to get retiring vaults: %w", err)
}
vaultsMigrating := (len(vaults) != 0)
result := openapi.NetworkResponse{
// Due to using openapi. this will be displayed in alphabetical order,
// so its schema (and order here) should also be in alphabetical order.
BondRewardRune: data.BondRewardRune.String(),
TotalBondUnits: data.TotalBondUnits.String(),
TotalReserve: mgr.Keeper().GetRuneBalanceOfModule(ctx, ReserveName).String(),
BurnedBep2Rune: data.BurnedBep2Rune.String(),
BurnedErc20Rune: data.BurnedErc20Rune.String(),
TotalBondUnits: data.TotalBondUnits.String(),
TotalReserve: mgr.Keeper().GetRuneBalanceOfModule(ctx, ReserveName).String(),
VaultsMigrating: vaultsMigrating,
}
res, err := json.MarshalIndent(result, "", " ")
......@@ -564,8 +574,18 @@ func queryNode(ctx cosmos.Context, path []string, req abci.RequestQuery, mgr *Mg
result := NewQueryNodeAccount(nodeAcc)
result.SlashPoints = slashPts
result.Jail = jail
result.BondProviders = bp
result.Jail = Jail{
// Since redundant, leave out the node address
ReleaseHeight: jail.ReleaseHeight,
Reason: jail.Reason,
}
result.BondProviders = BondProviders{
// Since redundant, leave out the node address
NodeOperatorFee: bp.NodeOperatorFee,
Providers: bp.Providers,
}
// CurrentAward is an estimation of reward for node in active status
// Node in other status should not have current reward
......@@ -754,7 +774,11 @@ func queryNodes(ctx cosmos.Context, path []string, req abci.RequestQuery, mgr *M
if err != nil {
return nil, fmt.Errorf("fail to get node jail: %w", err)
}
result[i].Jail = jail
result[i].Jail = Jail{
// Since redundant, leave out the node address
ReleaseHeight: jail.ReleaseHeight,
Reason: jail.Reason,
}
chainHeights, err := mgr.Keeper().GetLastObserveHeight(ctx, na.NodeAddress)
if err != nil {
return nil, fmt.Errorf("fail to get last observe chain height: %w", err)
......@@ -774,11 +798,17 @@ func queryNodes(ctx cosmos.Context, path []string, req abci.RequestQuery, mgr *M
} else {
result[i].PreflightStatus = preflightCheckResult
}
result[i].BondProviders, err = mgr.Keeper().GetBondProviders(ctx, result[i].NodeAddress)
bp, err := mgr.Keeper().GetBondProviders(ctx, result[i].NodeAddress)
if err != nil {
ctx.Logger().Error("fail to get bond providers", "error", err)
}
result[i].BondProviders.Adjust(result[i].Bond)
bp.Adjust(na.Bond)
result[i].BondProviders = BondProviders{
// Since redundant, leave out the node address
NodeOperatorFee: bp.NodeOperatorFee,
Providers: bp.Providers,
}
}
res, err := json.MarshalIndent(result, "", " ")
......
......@@ -581,7 +581,7 @@ func (s *QuerierSuite) TestQueryNodeAccount(c *C) {
c.Assert(json.Unmarshal(result, &r2), IsNil)
// First node has 25% of bond, should have 25% of the rewards
c.Assert(r2.Bond.Uint64(), Equals, cosmos.NewUint(common.One*1000).Uint64())
c.Assert(r2.TotalBond.Uint64(), Equals, cosmos.NewUint(common.One*1000).Uint64())
c.Assert(r2.CurrentAward.Uint64(), Equals, cosmos.NewUint(common.One*250).Uint64())
// Get second node
......@@ -595,7 +595,7 @@ func (s *QuerierSuite) TestQueryNodeAccount(c *C) {
c.Assert(json.Unmarshal(result, &r3), IsNil)
// Second node has 75% of bond, should have 75% of the rewards
c.Assert(r3.Bond.Uint64(), Equals, cosmos.NewUint(common.One*3000).Uint64())
c.Assert(r3.TotalBond.Uint64(), Equals, cosmos.NewUint(common.One*3000).Uint64())
c.Assert(r3.CurrentAward.Uint64(), Equals, cosmos.NewUint(common.One*750).Uint64())
}
......
......@@ -129,10 +129,11 @@ type QueryNodeAccount struct {
Status NodeStatus `json:"status"`
PubKeySet common.PubKeySet `json:"pub_key_set"`
ValidatorConsPubKey string `json:"validator_cons_pub_key"`
Bond cosmos.Uint `json:"bond"`
ActiveBlockHeight int64 `json:"active_block_height"`
BondAddress common.Address `json:"bond_address"`
StatusSince int64 `json:"status_since"`
NodeOperatorAddress common.Address `json:"node_operator_address"`
TotalBond cosmos.Uint `json:"total_bond"`
BondProviders BondProviders `json:"bond_providers"`
SignerMembership common.PubKeys `json:"signer_membership"`
RequestedToLeave bool `json:"requested_to_leave"`
ForcedToLeave bool `json:"forced_to_leave"`
......@@ -144,7 +145,6 @@ type QueryNodeAccount struct {
CurrentAward cosmos.Uint `json:"current_award"`
ObserveChains []QueryChainHeight `json:"observe_chains"`
PreflightStatus QueryNodeAccountPreflightCheck `json:"preflight_status"`
BondProviders BondProviders `json:"bond_providers"`
}
// NewQueryNodeAccount create a new QueryNodeAccount based on the given node account parameter
......@@ -154,10 +154,10 @@ func NewQueryNodeAccount(na NodeAccount) QueryNodeAccount {
Status: na.Status,
PubKeySet: na.PubKeySet,
ValidatorConsPubKey: na.ValidatorConsPubKey,
Bond: na.Bond,
ActiveBlockHeight: na.ActiveBlockHeight,
BondAddress: na.BondAddress,
StatusSince: na.StatusSince,
NodeOperatorAddress: na.BondAddress,
TotalBond: na.Bond,
SignerMembership: na.GetSignerMembership(),
RequestedToLeave: na.RequestedToLeave,
ForcedToLeave: na.ForcedToLeave,
......