Skip to content

Enhance Simulation to proactively record ReadWrite access for near-expiry Persistent entries #1630

@EFCCWEB3

Description

@EFCCWEB3

Description:

Is your feature request related to a problem? Please describe. Currently, a "Footprint-Restoration Deadlock" can occur when a Persistent ledger entry expires in the brief window between transaction simulation (Recording Mode) and execution (Enforcing Mode).

During simulation, if an entry is live, the host records AccessType::ReadOnly. However, if that entry expires before the transaction is processed, the host’s internal logic in handle_maybe_expired_entry attempts to auto-restore the entry. This requires ReadWrite access. Since the signed footprint only contains ReadOnly, the transaction fails with ScErrorCode::ExceededLimit. While this is a rare edge case, it creates non-deterministic execution failures for valid transactions.

Describe the solution you'd like I suggest modifying the simulation logic (Recording Mode) to include a "buffer zone" check for Persistent entries.

If a Persistent entry is accessed and its live_until sequence is within a certain threshold (e.g., the next 100–500 ledgers) of the current ledger sequence, the simulation should automatically record the access as ReadWrite instead of ReadOnly.

Describe alternatives you've considered

Manual Developer Intervention: Expecting developers to manually mark entries as ReadWrite defensively. This is inefficient and increases costs unnecessarily for the majority of the entry's lifespan.

Host-level Bypass: Allowing the Host to bypass the ExceededLimit check specifically for internal TTL restoration. However, this might complicate the security invariants of the Footprint system.

This improvement would align simulation more closely with the realities of network latency and submission delays, ensuring that a "successful" simulation is more robust and predictable upon execution. It reduces the likelihood of users paying non-refundable fees for transactions that fail due to unavoidable internal maintenance logic (Rent/TTL).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions