eigerco / lumina

Wasm friendly Celestia light node implementation in Rust
Apache License 2.0
123 stars 36 forks source link

Graceful handling and recovery for QuotaExceededError #317

Open fl0rek opened 5 months ago

fl0rek commented 5 months ago

Context

Browsers use quotas to limit the amount of data page can store locally, see mdn for details.

Available quota can be queried with StorageManager

Issue

When transaction which would put us above the quota is commited, QuotaExceededError is returned and transaction is rolled back. From this point on, Indexeddb is in read-only state until restart (note that this by itself doesn't change the quota, and db can lock up again, if quota is exceeded).

From the user perspective, node just stops syncing (as all the db inserts fail).

zvolin commented 1 month ago

from sync discussion: