autonity / aut

A command-line RPC client for Autonity
MIT License
11 stars 10 forks source link

`aut validator` commands `registerValidator` and `info` update for AGC v0.13.0 #146

Closed cmjc closed 5 months ago

cmjc commented 6 months ago

The AGC v0.13.0 Sumida Protocol upgrade modifies the registerValidator method signature to add a consensusKey parameter, changing the Autonity.abi contract interface, therefore.

https://github.com/autonity/autonity/blob/develop/autonity/solidity/contracts/Autonity.sol#L300

    function registerValidator(string memory _enode, address _oracleAddress, bytes memory _consensusKey, bytes memory _signatures) public virtual {
...

This has 2 consequences:

  1. aut validator register - needs to be modified for the new parameter
  2. aut validator info - errors because of the change

Consequence of running the commands is:

(1) the registration transaction will process but the validator will not be registered (2) the info call errors:

aut validator info --validator 0x439926f9A819e86aE284cEAa7E87909777cF8C84
eth_abi.exceptions.NonEmptyPaddingBytes: Padding bytes were not empty: b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03'

The above exception was the direct cause of the following exception:

web3.exceptions.BadFunctionCallOutput: Could not decode contract function call to getValidator with return data: b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf4\x7f\xdd\x88\xc8\xf6\xf8\x029\xe1w8l\xc5\xae=k\xcd\xee\xea\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00C\x99&\xf9\xa8\x19\xe8j\xe2\x84\xce\xaa~\x87\x90\x97w\xcf\x8c\x84\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf7\\\xad\xcb\xf2Rp\x8d\x7f\x03\tx\x92\x9d\xd6\x8dPF\xfb\xca\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xe8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00+\x0f\x15\x94CY\x9f\xbbg#\xcd\xb3=\r\xb9O\x96\xb9]\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x9d:\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9denode://02ad2d5ae371983f9aecadaee6fd300d3241b946d10c29ec59724ed6bcc41c05bedae9318fe566a2f2180be9783fd552f05a0d212a094304cdfbc8d87e70b0a3@86.182.102.239:30303\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x000\xad\xe5\xaf\xf4\x05?\x98i\x13\x11\xa4\xa5\x99\xc5\xc0\x82\x15\xd0\xadr\x13\xcf\xa5\x8e\x00\x14T\xe7_\x92r(?\xd4\xb7\x82\xe2\x08\x9a\xe8T\n@<\xd0\x8f\xcd\xd6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', output_types: ['(address,address,address,string,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,address,uint256,uint256,uint256,uint256,uint256,uint8)']

Expected behaviour

The register method succeeds.

The info method returns without error.

aut version

$ aut --version
aut, version 0.3.0
cmjc commented 6 months ago

The command aut validator info is fixed by aut release 0.4.0dev0:

aut validator info --validator 0x439926f9A819e86aE284cEAa7E87909777cF8C84
{
  "treasury": "0xF47FDD88C8f6F80239E177386cC5AE3d6BCdEeEa",
  "node_address": "0x439926f9A819e86aE284cEAa7E87909777cF8C84",
  "oracle_address": "0xF75Cadcbf252708D7F030978929dD68d5046fbcA",
  "enode": "enode://02ad2d5ae371983f9aecadaee6fd300d3241b946d10c29ec59724ed6bcc41c05bedae9318fe566a2f2180be9783fd552f05a0d212a094304cdfbc8d87e70b0a3@86.182.102.239: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,
  "self_unbonding_stake_locked": 0,
  "liquid_contract": "0x2B0f159443599FBB6723CDB33d0DB94F96B95d0F",
  "liquid_supply": 0,
  "registration_block": 171322,
  "total_slashed": 0,
  "jail_release_block": 0,
  "provable_fault_count": 0,
  "consensus_key": "0xade5aff4053f98691311a4a599c5c08215d0ad7213cfa58e001454e75f9272283fd4b782e2089ae8540a403cd08fcdd6",
  "state": 0
}
cmjc commented 6 months ago

Ditto for the command aut validator register.

With this test autonitykeys data:

Node address: 0x079Af643dC511E333160c66029eC02EF965A653C
Node public key: 0xc36481d70943dd046d8013f3d302cf0d2a17f5f5f3398cd47fbcb38edfe4e5b4207ea4e762ec52efb65f72bede5cd5a65e8380eaf0db9ef39a77cb6ec5694af9
Consensus public key: 0x978891bff952cd9614b36ff2cc57a47820204bc71b0131625964e6801c304836a7fa11a9c47ca2561cbfc74eb0b314ab

validator call:

% aut validator register enode://c36481d70943dd046d8013f3d302cf0d2a17f5f5f3398cd47fbcb38edfe4e5b4207ea4e762ec52efb65f72bede5cd5a65e8380eaf0db9ef39a77cb6ec5694af9@51.89.151.55:30303 0xFd91928d58Af4AFbD78C96821D3147ef1f517072 0x978891bff952cd9614b36ff2cc57a47820204bc71b0131625964e6801c304836a7fa11a9c47ca2561cbfc74eb0b314ab 0xfc92396148320f466f10f25abd312ed15ef31f6b29e8924b6f0592e585580f873f807304a540a8a436d92aed969aef0148ca8a2884fc7ad56f1cffa50bb7aa9a01a5189e8d50880faf97ad42501375b216b89304c3fd4acf548a1d7fd7136e74771791422819134e2e3fbf720c35652d8c163e3d4f22c798a3c648958f7abcda2c00b1e8cd80be821c23d41d4ccb6587685960519375762e9ccd8a95ba3fbeb7d47955990b33af65db5155d3d79d498152760d83ab8c92a132e94aeb458f556ff7ef9d5b78b2544a47939ae71a01faf5172c25b5102bc7eed886ff105e91283b3916 | aut tx sign - | aut tx send -
(consider using 'KEYFILEPWD' env var).
Enter passphrase (or CTRL-d to exit):
0x260e56b9e84799f3922629aeb842e37c1b5782de548d4828dc8ae29ec7af2838

Node address 0x079Af643dC511E333160c66029eC02EF965A653C registered as validator:

% aut validator list
...
0x079Af643dC511E333160c66029eC02EF965A653C

👍

aiman commented 5 months ago

Supported in v0.4.0