Closed cmjc closed 8 months ago
Bug
Having registered and bonded to a validator, I now find aut validator info
is also returning an incorrect liquidSupply
, totalSlashed
and registrationBlock
value. Also, the selfUnbondingStakeLocked
field is missing.
Expected behaviour The correct data object and values are returned.
aut version
$ aut --version
aut, version 0.3.0.dev1
Example
At this point the validator is registered, but has no bonded stake:
ubuntu@vps-c7c3e8c7:~/TEST/autcli$ aut validator info --validator 0xa418A886fbE5E08016d59AD90FC84fEe912D7A5B
{
"treasury": "0xF47FDD88C8f6F80239E177386cC5AE3d6BCdEeEa",
"node_address": "0xa418A886fbE5E08016d59AD90FC84fEe912D7A5B",
"oracle_address": "0xFd91928d58Af4AFbD78C96821D3147ef1f517072",
"enode": "enode://a3b821f89d8ea172421dedacdb00e76d8d6a929e4c5ff3c2b30ec84144a7405698ce30ba2ed482770ad2df94d050311b350c036d7f2cef3c9ef32be3f635d62e@51.89.151.55:30303",
"commission_rate": 1000,
"bonded_stake": 0,
"unbonding_stake": 0,
"unbonding_shares": 0,
"self_bonded_stake": 0,
"self_unbonding_stake": 0,
"self_unbonding_shares": 0,
"liquid_contract": "0x0000000000000000000000000000000000000000",
"liquid_supply": 245822994132721560041932967934037774519317912847,
"registration_block": 0,
"total_slashed": 573883,
"jail_release_block": 0,
"provable_fault_count": 0,
"state": 0
}
Now I bond 1 NTN from Alice (validator operator, self-bonded stake) and 0.5 NTN from Bob (delegator, delegated stake):
ubuntu@vps-c7c3e8c7:~/TEST/autcli$ aut validator bond --validator 0xa418A886fbE5E08016d59AD90FC84fEe912D7A5B 1 | aut tx sign - | aut tx send -
(consider using 'KEYFILEPWD' env var).
Enter passphrase (or CTRL-d to exit):
0x2f80ce1539d8eb688b5ed953b20d1f72a0967abfcee3934f87c7b1d4b88a6b38
ubuntu@vps-c7c3e8c7:~/TEST/autcli$ nano .autrc
ubuntu@vps-c7c3e8c7:~/TEST/autcli$ aut validator bond --validator 0xa418A886fbE5E08016d59AD90FC84fEe912D7A5B 0.5 | aut tx sign - | aut tx send -
(consider using 'KEYFILEPWD' env var).
Enter passphrase (or CTRL-d to exit):
0x59d05fd010ba67ac9fdd3c02874bc99fa0f8315a4d8db66f81de0bc6282600bb
ubuntu@vps-c7c3e8c7:~/TEST/autcli$ aut validator info --validator 0xa418A886fbE5E08016d59AD90FC84fEe912D7A5B
{
"treasury": "0xF47FDD88C8f6F80239E177386cC5AE3d6BCdEeEa",
"node_address": "0xa418A886fbE5E08016d59AD90FC84fEe912D7A5B",
"oracle_address": "0xFd91928d58Af4AFbD78C96821D3147ef1f517072",
"enode": "enode://a3b821f89d8ea172421dedacdb00e76d8d6a929e4c5ff3c2b30ec84144a7405698ce30ba2ed482770ad2df94d050311b350c036d7f2cef3c9ef32be3f635d62e@51.89.151.55:30303",
"commission_rate": 1000,
"bonded_stake": 0,
"unbonding_stake": 0,
"unbonding_shares": 0,
"self_bonded_stake": 0,
"self_unbonding_stake": 0,
"self_unbonding_shares": 0,
"liquid_contract": "0x0000000000000000000000000000000000000000",
"liquid_supply": 245822994132721560041932967934037774519317912847,
"registration_block": 0,
"total_slashed": 573883,
"jail_release_block": 0,
"provable_fault_count": 0,
"state": 0
}
After the staking transition has been applied, bonded_stake
and self_bonded_stake
values are updated correctly. The registration_block
, liquid_supply
and total_slashed
values are incorrect. There should be selfUnbondingStakeLocked
i.e. self_unbonding_stake_locked
with a value of 0
before liquid_contract
:
ubuntu@vps-c7c3e8c7:~/TEST/autcli$ aut validator info --validator 0xa418A886fbE5E08016d59AD90FC84fEe912D7A5B
{
"treasury": "0xF47FDD88C8f6F80239E177386cC5AE3d6BCdEeEa",
"node_address": "0xa418A886fbE5E08016d59AD90FC84fEe912D7A5B",
"oracle_address": "0xFd91928d58Af4AFbD78C96821D3147ef1f517072",
"enode": "enode://a3b821f89d8ea172421dedacdb00e76d8d6a929e4c5ff3c2b30ec84144a7405698ce30ba2ed482770ad2df94d050311b350c036d7f2cef3c9ef32be3f635d62e@51.89.151.55:30303",
"commission_rate": 1000,
"bonded_stake": 1500000000000000000,
"unbonding_stake": 0,
"unbonding_shares": 0,
"self_bonded_stake": 1000000000000000000,
"self_unbonding_stake": 0,
"self_unbonding_shares": 0,
"liquid_contract": "0x0000000000000000000000000000000000000000",
"liquid_supply": 245822994132721560041932967934037774519317912847,
"registration_block": 500000000000000000,
"total_slashed": 573883,
"jail_release_block": 0,
"provable_fault_count": 0,
"state": 0
}
A curl
returns the correct result:
ubuntu@vps-c7c3e8c7:~/TEST/autcli$ curl --silent --location --request GET 'http://127.0.0.1:8545' --header 'Content-Type: application/json' --data-raw '{
"jsonrpc":"2.0",
"method":"aut_getValidator", "params":["0xa418A886fbE5E08016d59AD90FC84fEe912D7A5B"],
"id":1}' | jq
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"treasury": "0xf47fdd88c8f6f80239e177386cc5ae3d6bcdeeea",
"nodeAddress": "0xa418a886fbe5e08016d59ad90fc84fee912d7a5b",
"oracleAddress": "0xfd91928d58af4afbd78c96821d3147ef1f517072",
"enode": "enode://a3b821f89d8ea172421dedacdb00e76d8d6a929e4c5ff3c2b30ec84144a7405698ce30ba2ed482770ad2df94d050311b350c036d7f2cef3c9ef32be3f635d62e@51.89.151.55:30303",
"commissionRate": 1000,
"bondedStake": 1.5e+18,
"unbondingStake": 0,
"unbondingShares": 0,
"selfBondedStake": 1e+18,
"selfUnbondingStake": 0,
"selfUnbondingShares": 0,
"selfUnbondingStakeLocked": 0,
"liquidContract": "0x2b0f159443599fbb6723cdb33d0db94f96b95d0f",
"liquidSupply": 5e+17,
"registrationBlock": 573883,
"totalSlashed": 0,
"jailReleaseBlock": 0,
"provableFaultCount": 0,
"state": 0
}
}
I.e.:
field | aut | curl |
---|---|---|
"bonded_stake" | 1500000000000000000 | 1.5e+18 |
"unbonding_stake" | 0 | 0 |
"unbonding_shares" | 0 | 0 |
"self_bonded_stake" | 1000000000000000000 | 1e+18 |
"self_unbonding_stake" | 0 | 0 |
"self_unbonding_shares" | 0 | 0 |
"selfUnbondingStakeLocked" | Missing | 0 |
"liquid_contract" | "0x0000000000000000000000000000000000000000" | "0x2b0f159443599fbb6723cdb33d0db94f96b95d0f" |
"liquid_supply" | 245822994132721560041932967934037774519317912847 | 5e+17 |
"registration_block" | 500000000000000000 | 573883 |
"total_slashed" | 573883 | 0 |
In aut
:
@aiman I can confirm this is fixed with the dev2 patch:
% aut validator info --validator 0x13a21D4BcE7Dc097596327898c46963b85De9dAC
{
"treasury": "0xF47FDD88C8f6F80239E177386cC5AE3d6BCdEeEa",
"node_address": "0x13a21D4BcE7Dc097596327898c46963b85De9dAC",
"oracle_address": "0x3967A8575B6D81c0C0f2840abf591E584F47fa1C",
"enode": "enode://fc1330bccd700af3d91372b7a68145dd5f1b809737e71fca89542926755cb1d73feac132f8863628fc4af9560bde0e5ff6df24e61aff74dd9917b138c290f78c@51.89.151.55:30303",
"commission_rate": 1000,
"bonded_stake": 750000000000000000,
"self_bonded_stake": 0,
"liquid_contract": "0x0000000000000000000000000000000000000000",
"liquid_supply": 750000000000000000,
"registration_block": 0,
"total_slashed": 0,
"jail_release_block": 0,
"provable_fault_count": 505848991113437799075886508572918351698200139580,
"state": 0
}
Thanks, fixed in v0.3.0.dev2
See also following comment where a second bug was found after bonding self-bonded and delegated stake
Bug The command
validator info
is returning the zero address in theliquidContract
field instead of the actual validator liquid contract address.Expected behaviour The correct address is returned.
aut version
Example
Using an RPC curl the actual value is correctly returned:
To replicate
aut validator list
to return the list of validators.aut validator info
on one of the validatorsliquidContract
value is the zero addresscurl
- actualliquidContract
address is returned