ExocoreNetwork / exocore

Omnichain Restaking
7 stars 9 forks source link

Voting Power not Update After epoch times #58

Closed cloud8little closed 4 months ago

cloud8little commented 4 months ago

Summary of Bug

Initially three operators, each with 1000 * e18 delegations, and delegate to the first operator afterwards, wait for one day, and the voting power of the first operator does not change.

Version

tag: v0.1.2

Steps to Reproduce

  1. use the provided genesis file to start three exocore nodes. (upgraded_export_testbootstrap.json)
  2. deploy client chain gateway and exocore gateway, endpoint, etc.
  3. call deposit 1exoETH. https://sepolia.etherscan.io/tx/0x38f3ada87a58653afb74360051d1e6de00e9beeb764e316a38e62356ca06df6a
  4. delegate to the first operator. https://sepolia.etherscan.io/tx/0xd14e174fd18b892e29cc5005083aa582d818f2998d28b5f6601d527699a97111
  5. check voting power after one day.

contract address used:

{
  "clientChain": {
    "clientChainGateway": "0x50212515B347AD78fce9Bacb31C5854D41d01227",
    "erc20Token": "0x83E6850591425e3C1E263c054f4466838B9Bd9e4",
    "lzEndpoint": "0x885E0Ab4DA2b910fc65EbdD6Fc734Ae22d7D89Ce",
    "proxyAdmin": "0x22D098D7261DC315cE457B054C42203Af4D6a05e",
    "resVault": "0x80E1b2aCa117a79FD733EdcC84384FB06Ce47C3D"
  },
  "exocore": {
    "exocoreGateway": "0xEc0e2825d1341d4C0d1D169eaFa216F1B63BdD69",
    "lzEndpoint": "0x1f972cC7A42E2dB56586399B039eB6ED9F1eE9b5",
    "proxyAdmin": "0xE80C06850F2cba674115cd65b88aDdf46D698230"
  }
}

Screenshots

curl --request GET --url 'http://localhost:20000/validators?height=3975483&page=1&per_page=30' | jq

{
  "jsonrpc": "2.0",
  "id": -1,
  "result": {
    "block_height": "3975483",
    "validators": [
      {
        "address": "38A21AA8D3386568C4FC0B041F16B77A9D7F06AB",
        "pub_key": {
          "type": "tendermint/PubKeyEd25519",
          "value": "8PaRnlIsW5fbLIJVv/dD+d/d162fw3ywwWcLSA0PmRQ="
        },
        "voting_power": "3100211",
        "proposer_priority": "0"
      },
      {
        "address": "46B029E2D285423E4288C434D1AC727B8C9B97DE",
        "pub_key": {
          "type": "tendermint/PubKeyEd25519",
          "value": "TJ3pTh8yJZBmAq6BLjDxvlZCcSbWDy9stmG39P2mONw="
        },
        "voting_power": "3100211",
        "proposer_priority": "0"
      },
      {
        "address": "4FFE906A72A2F05770FD3A9AB034FD324CCED4EE",
        "pub_key": {
          "type": "tendermint/PubKeyEd25519",
          "value": "XLtFCK0/nB1xExSXEhH5kaxRte3aIXSGaBfWSeNOtpE="
        },
        "voting_power": "3100211",
        "proposer_priority": "0"
      }
    ],
    "count": "3",
    "total": "3"
  }
}

Additional context


For Admin Use

TimmyExogenous commented 4 months ago

This PR65 might fix the issue, please recheck it when you are free. @cloud8little. Setting the epoch to 1 hour to test the voting power is better. Additionally, maybe we need to implement the epoch of voting power update with a finer granularity.

cloud8little commented 4 months ago

Resolved in #65