-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extending the ttl of a temporal storage to exisiting maximum live until ledger would always fail #1329
Comments
Thanks @yanliu18 for reporting this issue. Indeed some of the terminologies defined can be a little confusing.
Although not a protocol bug, I think both of these points worth being clarified via better documentation, I will open a PR to do so. |
### What Resolves #1329 ### Why [TODO: Why this change is being made. Include any context required to understand the why.] ### Known limitations [TODO or N/A]
Thank you @jayz22 for addressing this issue and reply to us. The changes look good. |
What version are you using?
20.1.0
What did you do?
Formal Auditting for Client Code
rs-soroban-env/soroban-env-host/src/storage.rs
Line 382 in 36d33cb
When call to the
extend_ttl()
function in host/storage, when the function parameterextend_to
=li.max_entry_ttl
(li.max_entry_ttl
=host.with_ledger_info(|li| li.max_entry_ttl)
) and parameterkey
matchesContractData(LedgerKeyContractData {_, _, StorageType::Temporal, })
, the call toextend_ttl
will always return an error.This is because of the following condition checking where,
new_live_until
=li_sequece_number
+ extend_tohost.max_live_until_ledger()
=li_sequece_number
+ li.max_entry_ttl - 1will always go to the
else
branch.rs-soroban-env/soroban-env-host/src/storage.rs
Lines 436 to 446 in 36d33cb
What did you expect to see?
Though it is rare for a contract instance to set its temporal stroage to the exisiting max livable ledger sequence, it is still possible.
Maybe it is reasonable to calculate the
new_live_until
in the same way as themax_live_live_until_ledger
.The text was updated successfully, but these errors were encountered: