MemoryStore should evict claims once their challenge expires
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Esamina l’interfaccia Store e l’implementazione di MemoryStore, quindi segui TempoChargeIntent.matchTransferLogs e il relativo flusso di challenge verificato. Verifica come i memo delle transazioni possano associare un pagamento a un solo challenge prima di modificare la gestione dei claim. Il lavoro è completato quando i claim scaduti possono essere eliminati senza consentire attacchi di replay, mantenendo coerenti l’interfaccia e il flusso di pagamento.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bind replay claims to challenge expiry. Ex. tryClaim(key, expiresAt).
Background
Store.tryClaim(key) (added in #24) retains transaction-hash claims forever. Every verified payment leaves a permanent entry, so any durable store grows without bound.
The typescript mppx SDK solved this by storing a marker that lapses at the challenge's expiry. One a challenge has expired, there's no reason to keep a cache entry for its associated transaction as it can no longer be claimed by an agent.
Using an expiry/TTL is safe in the typescript SDK because it cryptographically binds on-chain transaction memos to to a specific challenge. Therefore, a settled transaction can only satisfy exactly one challenge.
The mpp-java SDK has no such binding. TempoChargeIntent.matchTransferLogs compares only
currency, recipient, amount, and sender. Adding claim expiry would be a regression and make servers susceptible to replay attacks.
Proposed change
Implement memo binding between on-chain transactions and challenges. Then, once memo binding is in place, update the Store interface:
@FunctionalInterface
public interface Store {
boolean tryClaim(String key);
/** Claims {@code key} until {@code expiresAt}, after which the claim may be dropped. */
default boolean tryClaim(String key, Instant expiresAt) {
return tryClaim(key);
}
}
TempoChargeIntent should pass the verified challenge's expires as expiresAt.
Why?
- Prevents unbound growth in MemoryStore
- Achieves parity with other SDKs
- Lingua principale
- Java
- Stelle
- 7
- Fork
- 8
- Merge medio
- 18h 11m
- PR unite (30g)
- 4
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Issue simili
-
Bug Java Platform: Java
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
getsentry/sentry-java#6138 · 1 commento ·
-
bug needs triage p2
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
GoogleCloudPlatform/DataflowTemplates#4273 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
bug needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100