-
Notifications
You must be signed in to change notification settings - Fork 82
Description
Problem
Someone on discord reported an issue where the flow-cli shows a different transaction ID from the one requested. e.g.
$ flow transactions get 38559cfac11eba732f3de2420eac511393e223bc92b0c52f75b6604098e4181a --network=mainnet
Block ID 7db0f9d4867e1c895f83a5e03e932cebfd6e3daeed53b8108d9c75e097c58784
Block Height 56134268
Status ✅ SEALED
ID 06e254293add97d9a9519eac42a30c8450ff7f51556392901462f5476ca06a18
Payer 8da51d7dff4b3151
Authorizers [8da51d7dff4b3151]
Proposal Key:
Address 8da51d7dff4b3151
Index 0
Sequence 9633
No Payload Signatures
Envelope Signature 0: 8da51d7dff4b3151
Signatures (minimized, use --include signatures)
Events:
Index 0
Type A.1654653399040a61.FlowToken.TokensWithdrawn
Tx ID 38559cfac11eba732f3de2420eac511393e223bc92b0c52f75b6604098e4181a
Values
- amount (UFix64): 73.09790833
- from (Address?): 0x8da51d7dff4b3151
...
Note that the requested TX was 38559cfac11eba732f3de2420eac511393e223bc92b0c52f75b6604098e4181a, and the ID included in the response was 06e254293add97d9a9519eac42a30c8450ff7f51556392901462f5476ca06a18. Also note that the ID in the events correctly match the request.
Looking at the flow-cli code, the ID field is populated using the tx.ID() method on the transaction returned using the SDK.
The ID() generates a hash of the datastructure, so this most likely means that the serialized representation of the transaction produced by the sdk is different from the flow model used to produce the original.
Steps to Reproduce
I created this repo script: https://gist.github.com/peterargue/da744c9e7c4bddbfee4d89240a3f4244
It requests the same transaction from an AN using the sdk and grpc directly. Calling ID() on the sdk version produces 06e254293add97d9a9519eac42a30c8450ff7f51556392901462f5476ca06a18, but using the flow model, it returns 38559cfac11eba732f3de2420eac511393e223bc92b0c52f75b6604098e4181a.