XRPL-Labs / Xaman-App

Xaman (Formerly XUMM) for iOS and Android (React Native)
https://support.xumm.app
Other
104 stars 48 forks source link

FinishEscrow - Submission Failed! invalidTransaction, Field 'OfferSequence' is required but missing #90

Closed JulianKingman closed 1 year ago

JulianKingman commented 1 year ago

Describe the bug Can't finish an escrow because OfferSequence is missing

To Reproduce Steps to reproduce the behavior:

  1. Create an Escrow to your account (e.g. with Escrow Create xApp)
  2. Click on Events
  3. Click on the Escrow
  4. Click Finish Escrow, and sign

Expected behavior Escrow is finished and returned to account

Screenshots IMG_6ECB7D94A0BF-1

Environment

What build of XUMM are you running? Please provide the full version (you can find it in Settings > Advanced).

What device are you running XUMM on?

WietseWind commented 1 year ago

Thanks for reporting.

This is not a bug on the Xumm side: this is the XRP Ledger reporting that a mandatory transaction field, OfferSequence, is missing.

Xumm will provide any field to the XRPL as provided by the creator of the payload.

This means that the original transaction sent to Xumm to sign didn't contain this field, meaning the payload creator can control this.

Where did you create the payload?

JulianKingman commented 1 year ago

In the "Escrow creator" xapp.

Is there a way to add a field to a transaction in Xumm? It seems it would be useful for cases like this.

WietseWind commented 1 year ago

Aaaah I see, you are just picking a random escrow from your history and trying to finish it with the Finish button in Xumm?

Are you willing to share your r-address (account) and escrow this is about with me so I can investigate?

Also: I just tested this flow myself and it worked as expected. It could be you were connected to an XRPL node that wasn't fully synced up to the network. Can you still reproduce it?

JulianKingman commented 1 year ago

Yes, I can still reproduce it

Here's the r-address: rhJ6HKU4rLXGEkKHXLRoL7B61XvLz9JCem and escrow (ledger index?): D887344380DB997C59EB7C663063A79DEEF077ADCCD0006C6A8151DB03C89E3D

WietseWind commented 1 year ago

That escrow doesn't exist on XRPL mainnet, nor does the r-address have an Escrow on mainnet.

Are you on a different network?

You can check for yourself at e.g. https://xrpscan.com/account/rhJ6HKU4rLXGEkKHXLRoL7B61XvLz9JCem (tab Escrow)

JulianKingman commented 1 year ago

oh yes, sorry, it's on testnet.xrpl-labs.com

WietseWind commented 1 year ago

Aaaaaaaah ooh that explains everything!

So here's what happens:

To finish an escrow, one looks at the Escrow Ledger object. Then at the PreviousTxn for the transaction that created the Escrow Then you look up this transaction, and check the Sequence for that transaction

You can then finish the escrow with that Sequence that we look up.

However, XRPL Testnet isn't full history. So when looking up the transaction that created the Escrow in the first place, the TX can't be found, hence the Sequence can't be looked up.

You can try changing nodes from XRPL Labs testnet to Ripple's Testnet, and if they don't have the history either, you'll have to find your Sequence some way (or try some things, down by one each time) and finish with a manually composed JSON transaction using e.g. https://xumm.dev/signing-tool and JSON like https://xrpl.org/escrowfinish.html

This is something that wouldn't happen on Mainnet, as there are several Full History machines available on mainnet.

JulianKingman commented 1 year ago

Bingo! Thank you so much for explaining.