IntersectMBO / cardano-node

The core component that is used to participate in a Cardano decentralised blockchain.
https://cardano.org
Apache License 2.0
3.06k stars 720 forks source link

[BUG] - `transaction build` does not balance correctly when the certificate is already submitted #3040

Closed dorin100 closed 3 years ago

dorin100 commented 3 years ago

Internal/External Internal if an IOHK staff member.

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

Summary We get error when submitting a tx based on transaction build

Steps to reproduce Steps to reproduce the behavior:

  1. try to submit a tx with a stake pool registration cert already registered.
cardano-cli transaction build \
    --alonzo-era \
    --testnet-magic $MAGIC \
    --tx-in ed977081747a09f922a3948531d9759e2857afa883cce14a1c1ead934589a274#0 \
    --change-address $(cat addr/addr1.addr) \
    --protocol-params-file protocol-params.json \
    --certificate-file pool/pool_registration.cert \
    --witness-override 3 \
    --out-file tx_raw1.body 

cardano-cli transaction sign \
  --tx-body-file tx_raw1.body \
  --testnet-magic $MAGIC \
  --signing-key-file addr/addr1.skey \
  --signing-key-file pool/pool_cold.skey \
  --signing-key-file addr/addr1_stake.skey \
  --out-file tx_raw1.signed

cardano-cli transaction submit \
    --testnet-magic $MAGIC \
    --tx-file tx_raw1.signed

Command failed: transaction submit  Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (UtxoFailure (ValueNotConservedUTxO (Value 998961429977 (fromList [])) (Value 998461429977 (fromList [])))))])

System info (please complete the following information):

$ cardano-node --version cardano-node 1.28.0 - linux-x86_64 - ghc-8.10 git rev 708de685d49ec6af4b2d8b3cbfa0eca0e9e43edf

dcoutts commented 3 years ago

We suspect that the cause of this bug is that the cli is currently passing an empty set of pool ids rather. To do this properly will require querying the current set of pool ids and passing them in place of the empty set.

dcoutts commented 3 years ago

Related #3101

Jimbo4350 commented 3 years ago

Fixed in: https://github.com/input-output-hk/cardano-node/pull/3176