rs-soroban-env icon indicating copy to clipboard operation
rs-soroban-env copied to clipboard

function trapped tx result when footprint is insufficient

Open leighmcculloch opened this issue 1 year ago • 5 comments

What version are you using?

v20.0.0-rc.2.1

What did you do?

Invoked a transaction with insufficient footprint.

What did you expect to see?

An error indicating that the resources were exceeded.

What did you see instead?

"function trapped" error.

Discussion

Bundling footprints in with "function trapped" is pretty ambiguous. We return specific resource related errors when other resources are exceeded.

leighmcculloch avatar Oct 13 '23 17:10 leighmcculloch

Fixed in https://github.com/stellar/rs-soroban-env/pull/1112

anupsdf avatar Oct 13 '23 22:10 anupsdf

Does #1112 fix this for all insufficient footprints? or just nonce footprint? This issue is intended to be more general than the nonce case.

leighmcculloch avatar Oct 14 '23 07:10 leighmcculloch

Does https://github.com/stellar/rs-soroban-env/pull/1112 fix this for all insufficient footprints? or just nonce footprint? This issue is intended to be more general than the nonce case.

It fixes only the nonce case because other cases have been decorated before that. Nonce case was just missed during the initial round of fixes.

dmkozh avatar Oct 16 '23 16:10 dmkozh

Reopening the issue then because this issue is not about the nonce case not generating a diagnostic event. Rather, it's about how in general insufficient footprint errors are communicated to the user as a "function trapped" rather than a "exceeds resources" or "exceeds footprint".

leighmcculloch avatar Oct 16 '23 16:10 leighmcculloch

The footprint errors do have the corresponding diagnostic events. I'm not sure we have time/need to change the error code to resource limit exceeded - it doesn't seem like it would significantly more information and it won't be distinguishable from CPU/mem exceeded errors without diagnostics (at which point you don't care what's the top-level error code is).

dmkozh avatar Oct 16 '23 16:10 dmkozh