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

[BUG] - withdrawal doesn't work with transaction build command #3074

Closed
mkoura opened this issue Aug 13, 2021 · 7 comments
Closed

[BUG] - withdrawal doesn't work with transaction build command #3074

mkoura opened this issue Aug 13, 2021 · 7 comments
Assignees
Labels
alonzo-purple Relates to the Alonzo Purple Testnet API&CLI-Backlog bug Something isn't working comp: cardano-cli era: alonzo priority medium issues/PRs that SHOULD be addressed. This should be done for the release, but acceptable if it doesn priority: medium A bug that needs to be addressed after ongoing stories and tasks. For instance can be planned for ne type: bug Something is not working user type: internal Created by an IOG employee

Comments

@mkoura
Copy link
Contributor

mkoura commented Aug 13, 2021

Internal/External
Internal

Area
Other Any other topic (Delegation, Ranking, ...).

Summary
I'm using the cardano-cli transaction build command to build a transaction that withdraws from reward address. The transaction is build and submitted successfully, however no rewards are withdrawn.

# query UTxO and reward account balance
$ cardano-cli query utxo --address addr_test1qryajf46462yd40wpvwqwc33aavyc6v3vyyyjzxw6qnmf6wcp6xvu536j8j7q4nvt4lnur455zrt49ujwlk0xd50lcdsefjcxd --out-file /dev/stdout --testnet-magic 42 --cardano-mode
{
    "7f85ce8becaacfbe8d78eca4657965002d8562fadb28b6a2d3be54a1df850f67#0": {
        "address": "addr_test1qryajf46462yd40wpvwqwc33aavyc6v3vyyyjzxw6qnmf6wcp6xvu536j8j7q4nvt4lnur455zrt49ujwlk0xd50lcdsefjcxd",
        "value": {
            "lovelace": 991052534886
        }
    }
}

$ cardano-cli query stake-address-info --address stake_test1uzrjn9glcr66zcgymgdavvrcnm5vmcs3su46z7nr7yzkx2cm6m3gg --testnet-magic 42 --cardano-mode
[
    {
        "address": "stake_test1uzrjn9glcr66zcgymgdavvrcnm5vmcs3su46z7nr7yzkx2cm6m3gg",
        "rewardAccountBalance": 8946747450,
        "delegation": null
    }
]

# build, sign, submit a tx
$ cardano-cli transaction build --tx-in 7f85ce8becaacfbe8d78eca4657965002d8562fadb28b6a2d3be54a1df850f67#0 --withdrawal stake_test1uzrjn9gl
cr66zcgymgdavvrcnm5vmcs3su46z7nr7yzkx2cm6m3gg+8946747450 --tx-out addr_test1qryajf46462yd40wpvwqwc33aavyc6v3vyyyjzxw6qnmf6wcp6xvu536j8j7q4n
vt4lnur455zrt49ujwlk0xd50lcdsefjcxd+8946747450 --change-address addr_test1qryajf46462yd40wpvwqwc33aavyc6v3vyyyjzxw6qnmf6wcp6xvu536j8j7q4nvt
4lnur455zrt49ujwlk0xd50lcdsefjcxd --witness-override 4 --alonzo-era --testnet-magic 42 --out-file reward_withdrawal_tx.body

$ cardano-cli transaction sign --tx-body-file reward_withdrawal_tx.body --out-file reward_withdrawal_tx.signed --testnet-magic 42 --signing
-key-file /home/martink/Source/repos/cardano-node/state-cluster0/nodes/node-pool2/owner-utxo.skey --signing-key-file /home/martink/Source/r
epos/cardano-node/state-cluster0/nodes/node-pool2/reward.skey

$ cardano-cli transaction submit --testnet-magic 42 --tx-file reward_withdrawal_tx.signed --cardano-mode
Transaction successfully submitted.

# query reward account balance - nothing was withdrawn
$ cardano-cli query stake-address-info --address stake_test1uzrjn9glcr66zcgymgdavvrcnm5vmcs3su46z7nr7yzkx2cm6m3gg --testnet-magic 42 --cardano-mode
[
    {
        "address": "stake_test1uzrjn9glcr66zcgymgdavvrcnm5vmcs3su46z7nr7yzkx2cm6m3gg",
        "rewardAccountBalance": 8946747450,
        "delegation": null
    }
]

# query UTxOs - inputs were spent, outputs were created
$ cardano-cli query utxo --address addr_test1qryajf46462yd40wpvwqwc33aavyc6v3vyyyjzxw6qnmf6wcp6xvu536j8j7q4nvt4lnur455zrt49ujwlk0xd50lcdsefjcxd --out-file /dev/stdout --testnet-magic 42 --cardano-mode
{
    "db486654ed06c49fe05494bdbba9f2cd7276259330fa8f9daa73ad3c222e6146#1": {
        "address": "addr_test1qryajf46462yd40wpvwqwc33aavyc6v3vyyyjzxw6qnmf6wcp6xvu536j8j7q4nvt4lnur455zrt49ujwlk0xd50lcdsefjcxd",
        "value": {
            "lovelace": 8946747450
        }
    },
    "db486654ed06c49fe05494bdbba9f2cd7276259330fa8f9daa73ad3c222e6146#0": {
        "address": "addr_test1qryajf46462yd40wpvwqwc33aavyc6v3vyyyjzxw6qnmf6wcp6xvu536j8j7q4nvt4lnur455zrt49ujwlk0xd50lcdsefjcxd",
        "value": {
            "lovelace": 982105605743
        }
    }
}

Expected behavior
Rewards are withdrawn from reward account.

System info (please complete the following information):

  • OS Name: Fedora 34
  • Node & CLI version:
cardano-node 1.28.0 - linux-x86_64 - ghc-8.10
git rev bf71fe31459905df8573e6d3f3cfe85af6ab1c99
@mkoura mkoura added the bug Something isn't working label Aug 13, 2021
@dorin100 dorin100 added the alonzo-purple Relates to the Alonzo Purple Testnet label Aug 13, 2021
@Jimbo4350
Copy link
Contributor

And withdrawals still work with build-raw?

@mkoura
Copy link
Contributor Author

mkoura commented Aug 13, 2021

@Jimbo4350 Yes, with build-raw it still works.

@newhoggy
Copy link
Contributor

newhoggy commented Oct 25, 2021

I have just now verified that build-raw works also and fails as described with build.

@JaredCorduan
Copy link
Contributor

@mkoura could you share the contents of reward_withdrawal_tx.body?

@newhoggy
Copy link
Contributor

This was mine:

tx.raw.gz

@JaredCorduan
Copy link
Contributor

This was mine:

tx.raw.gz

ok, yea, this transaction does not have a reward withdrawal in it. If you put the hex into cbor.me you'll see that the body has no 5 key.

https://github.com/input-output-hk/cardano-ledger-specs/blob/c89b8d1461b89a8a3b70899ac82b22850ab0b4f5/eras/shelley/test-suite/cddl-files/shelley.cddl#L57

@Jimbo4350
Copy link
Contributor

Jimbo4350 commented Nov 2, 2021

Resolved in #3317

mkoura added a commit to mkoura/cardano-node-tests that referenced this issue Nov 3, 2021
@dorin100 dorin100 added type: bug Something is not working user type: internal Created by an IOG employee era: alonzo priority: medium A bug that needs to be addressed after ongoing stories and tasks. For instance can be planned for ne comp: cardano-cli labels Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alonzo-purple Relates to the Alonzo Purple Testnet API&CLI-Backlog bug Something isn't working comp: cardano-cli era: alonzo priority medium issues/PRs that SHOULD be addressed. This should be done for the release, but acceptable if it doesn priority: medium A bug that needs to be addressed after ongoing stories and tasks. For instance can be planned for ne type: bug Something is not working user type: internal Created by an IOG employee
Projects
None yet
Development

No branches or pull requests

6 participants