"Invalid tx" error on mainnet. Goggle says it looks good

I’ve created a transaction and trying to broadcast it.

curl -X POST
https://mdw.aepps.com/v2/transactions
-H ‘Content-Type: application/json’
-d ‘{
“tx”: “tx_+KMLAfhCuEB4g/ooO2ki635OKOysSLm7RBec7Dh+Iu1PAMWKk50fgpTjCEr+5gBoSZO0vMe5fKr7Cj11rG9TuFQ6JwZ0DncPuFv4WQwBoQEGHGKdrSpWH5qhZCyYWEh25Z4DCbkQPfQbaM2KcjMF+aEBpWWSAdbrSb/zkqs79IqGVvTehr75bKJvnwssneqT3/SIAsaK8LsUAACGD0w2IAgAgASAZjUG8g==”
}’

This is real transaction.
Goggles say it’s fine, but when I send it I get “Invalid tx”.
Is there’s any way to get more specific error, I cannot figure out what’s wrong?
I’ve created tx myself.

I tried to increase fee up to 40000000000000, still same issue

tx_+KMLAfhCuECAR3zTv49RgbyCLPXTIFcTf8LVtyNtld9efM74R/nmyAvA0DcXfajb1r0ke3vJ9xfwnq1U8eK9qLyZaX7OToMPuFv4WQwBoQEGHGKdrSpWH5qhZCyYWEh25Z4DCbkQPfQbaM2KcjMF+aEBpWWSAdbrSb/zkqs79IqGVvTehr75bKJvnwssneqT3/SIAsaK8LsUAACGJGE5yoAAgASAV8FWqQ==

Ok, it seems like my tx encoding when ttl = 0 is incorrect.

Others have had the same issue… Creation of ContractTx (Java-SDK) - #22 by marco.chain

Ok, what I’ve found is that my RLP encoding is valid (0 is encoded into \x80), although Aeternity sdks encode 0 values as empty bite arrays. I compared with go sdk. If I do the same it works and I get same result as go sdk. Although it’s not straightforward and should be either fixed of at least mentioned somewhere with a good reason for such non trivial behaviour.

Or am I missing something?

How are you creating the transaction? Do you use a SDK?

  • if your are using the Java SDK which Hans mentioned you should update to v1.2.0 where this issue is solved (we detected this when implementing the support for smart contracts)

No, I don’t. I’m using Trust Wallet c++ sdk and same RLP functions they use for Ethereum.

we also encode 0 values as empty bytearrays now. I suggest you to do the same as long as it works then. we have also struggled a while with this topic