Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Partial Undelegate] The amount of the second partial undelegation is always in pending_undelegation_amount and cannot be withdrawn #274

Open
NellYao opened this issue Dec 25, 2024 · 1 comment
Assignees

Comments

@NellYao
Copy link

NellYao commented Dec 25, 2024

Summary of Bug:

The amount of the second partial undelegation is always in pending_undelegation_amount and cannot be withdrawn

Version: Exocore 1.0.9

Environment: Four validators built locally, without Oracle
Precondition:

  • Perform operations such as deposit, delegation, partial undelegate, withdraw on the node with a voting power of 2700 and query the changes in voting power, asset info of staker
  • Set epoch as minute

Steps to Reproduce:

1.Deposit 1000 ETH at 0:00:03(h:mm:ss)
./assetcli deposit --rpcUrl http://localhost:9545/ --staker 0x622869A3a10261019f88B64D312d0B8a77855390 --amount 1000000000000000000000 --privateKey 3EB1BDCCBACC8D5672918009F3F546EDC09E81BC0B58514C907D1C8C7E149352 --defaultAssetID 0x83E6850591425e3C1E263c054f4466838B9Bd9e4 --layerZeroID 40161

2.Delegate 1000 ETH at 0:00:22(h:mm:ss):
./assetcli delegate --rpcUrl http://localhost:9545/ --staker 0x622869A3a10261019f88B64D312d0B8a77855390 --amount 1000000000000000000000 --privateKey 3EB1BDCCBACC8D5672918009F3F546EDC09E81BC0B58514C907D1C8C7E149352 --defaultAssetID 0x83E6850591425e3C1E263c054f4466838B9Bd9e4 --layerZeroID 40161 --operator exo192mgay9r8mdgwcprcvgdm47td36n974h9r8z6q

3.Selfdelegate at 0:00:55(h:mm:ss):
./assetcli self-delegate --rpcUrl http://localhost:9545/ --staker 0x622869A3a10261019f88B64D312d0B8a77855390 --operator exo192mgay9r8mdgwcprcvgdm47td36n974h9r8z6q --privateKey 3EB1BDCCBACC8D5672918009F3F546EDC09E81BC0B58514C907D1C8C7E149352 --defaultAssetID 0x83E6850591425e3C1E263c054f4466838B9Bd9e4 --layerZeroID 40161

4.Query voting power at 0:02:16(h:mm:ss):
exocored q tendermint-validator-set --node http://localhost:20000/
result: the voting power of address: exovalcons1gzcn6md2xwregl9qjkxjtrfpg0f57g5y3xqmxt is 3700

5.Undeletega 550 ETH at 0:03:12(h:mm:ss):
./assetcli undelegate --rpcUrl http://localhost:9545/ --staker 0x622869A3a10261019f88B64D312d0B8a77855390 --amount 550000000000000000000 --privateKey 3EB1BDCCBACC8D5672918009F3F546EDC09E81BC0B58514C907D1C8C7E149352 --defaultAssetID 0x83E6850591425e3C1E263c054f4466838B9Bd9e4 --layerZeroID 40161 --operator exo192mgay9r8mdgwcprcvgdm47td36n974h9r8z6q

6.Query assetinfo of staker at 0:03:22(h:mm:ss):
exocored query assets QueStakerAssetInfos 0x622869A3a10261019f88B64D312d0B8a77855390_0x9ce1 --node http://localhost:20000/
result: pending_undelegation_amount: 550
total_deposit_amount: 1000
withdrawable_amount: 0

7.Query voting power at 0:03:35(h:mm:ss):
exocored q tendermint-validator-set --node http://localhost:20000/
result: the voting power of address: exovalcons1gzcn6md2xwregl9qjkxjtrfpg0f57g5y3xqmxt changed from 3700 to 3150

8.Query undelegation amount at 0:04:07(h:mm:ss):
exocored q delegation QueryUndelegations 0x622869A3a10261019f88B64D312d0B8a77855390_0x9ce1 0x83e6850591425e3c1e263c054f4466838b9bd9e4_0x9ce1 --node http://localhost:20000/
result: undelegations:
actual_completed_amount: 550
amount: 500

9.Undelegate 450 ETH at 0:04:22(h:mm:ss):
./assetcli undelegate --rpcUrl http://localhost:9545/ --staker 0x622869A3a10261019f88B64D312d0B8a77855390 --amount 450000000000000000000 --privateKey 3EB1BDCCBACC8D5672918009F3F546EDC09E81BC0B58514C907D1C8C7E149352 --defaultAssetID 0x83E6850591425e3C1E263c054f4466838B9Bd9e4 --layerZeroID 40161 --operator exo192mgay9r8mdgwcprcvgdm47td36n974h9r8z6q

10.Query undelegation amount at 0:04:50(h:mm:ss):
exocored q delegation QueryUndelegations 0x622869A3a10261019f88B64D312d0B8a77855390_0x9ce1 0x83e6850591425e3c1e263c054f4466838b9bd9e4_0x9ce1 --node http://localhost:20000/
result: undelegations:
actual_completed_amount: 550
amount: 500

11.Query assetinfo of staker at 0:05:01(h:mm:ss):
exocored query assets QueStakerAssetInfos 0x622869A3a10261019f88B64D312d0B8a77855390_0x9ce1 --node http://localhost:20000/
result: pending_undelegation_amount: 1000
total_deposit_amount: 1000
withdrawable_amount: 0

12.Query undelegation amount at 0:05:30(h:mm:ss):
exocored q delegation QueryUndelegations 0x622869A3a10261019f88B64D312d0B8a77855390_0x9ce1 0x83e6850591425e3c1e263c054f4466838b9bd9e4_0x9ce1 --node http://localhost:20000/
result: undelegations: [ ]

Actual Result:1: This command does not return the amount of the 2nd partial undelegation.

Expected Result1: This command should return the amount of the 2nd partial undelegation.

13.Query voting power at 0:05:40(h:mm:ss):
exocored q tendermint-validator-set --node http://localhost:20000/
result: the voting power of address: exovalcons1gzcn6md2xwregl9qjkxjtrfpg0f57g5y3xqmxt changed from 3150 to 2700

14.Query assetinfo of staker at 0:07:07(h:mm:ss):
exocored query assets QueStakerAssetInfos 0x622869A3a10261019f88B64D312d0B8a77855390_0x9ce1 --node http://localhost:20000/
result: pending_undelegation_amount: 450
total_deposit_amount: 450
withdrawable_amount: 0

15.Query undelegation amount:
exocored q delegation QueryUndelegations 0x622869A3a10261019f88B64D312d0B8a77855390_0x9ce1 0x83e6850591425e3c1e263c054f4466838b9bd9e4_0x9ce1 --node http://localhost:20000/
result: undelegations: [ ]

Actual Result2: Two epochs have passed since the 2nd partial undelegate, but the amount of the 2nd partial undelegation is always in pending_undelegation_amount and cannot be withdrawn

Expected Result2: After 2 epochs of the 2nd partial undelegate, the 450 ETH of the 2nd partial undelegate should become witdrawable

@cloud8little
Copy link
Contributor

Simpler version of reproduction steps:

  1. Setup four validator nodes. (https://github.com/cloud8little/ExocoreValidators)
  2. Put node folders under /root/testnetV6 or update the oracle_feeder.yaml configuration to use the absolute path of node config folder.
  3. Use exocore v1.0.9.
  4. Run ./clean.sh
  5. Run ./copy.sh
  6. Use assetsTool to run deposit/delegation.
  7. Run a partial delegation.
  8. Run a second partial delegation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants