stellar / rs-soroban-sdk

Rust SDK for Soroban contracts.
Apache License 2.0
127 stars 67 forks source link

Test Bug: Temporary Storage #1232

Closed mootz12 closed 2 months ago

mootz12 commented 8 months ago

What version are you using?

[dependencies]
soroban-sdk = { version = "20.3.2" }

What did you do?

Used the test env to both read and set an expired temporary storage entry.

What did you expect to see?

  1. When the temporary storage entry is expired, the get call to return None
  2. A successful response when I set a temporary storage entry after it has expired

What did you see instead?

  1. The old value was returned
  2. A failure with:
    4: [Failed Diagnostic Event (not emitted)] contract:CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM, topics:[error, Error(Storage, InternalError)], data:["accessing no-longer-live entry", 220, 600]
    5: [Diagnostic Event] topics:[fn_call, Bytes(0000000000000000000000000000000000000000000000000000000000000001), set_temp], data:[CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4, 222, 120]

Reproduction: https://github.com/mootz12/temp-storage-repro

mootz12 commented 8 months ago

Note: I was able to verify this is working as expected on Futurenet using the same contract depicted in the reproduction example.

The transactions showing this were all done with the following source account: GCLVUQFX5SBMLCDPGMDRFQZQ5EL6C5WE2N6OU6KMZV63KT2CZTGOJQZX

dmkozh commented 2 months ago

SDK emulates state archival/temp entry removal more precisely since version 21+, as demonstrated in the example. Sorry for updating this so late as the issue should be long gone.