Skip to content
Discussion options

You must be logged in to vote

Una estrategia confiable combina confirmaciones on-chain, reintentos off-chain con backoff exponencial + jitter, procesamiento idempotente y un trabajo de reconciliación en segundo plano.

Ejemplo de retry con backoff:

import time, random

MAX_TRIES = 6
INIT_WAIT = 0.5

for t in range(MAX_TRIES):
data = fetch_offchain(event_id)
if data_is_final(data):
process(data)
break
wait = INIT_WAIT * (2 ** t) + random.uniform(0,0.3)
time.sleep(wait)
else:
enqueue_for_reconciliation(event_id)

Usar idempotencia para evitar duplicados.

  • Validar oráculos con firmas.
  • UX: flujos críticos esperan confirmaciones, flujos normales muestran estado optimista.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@KRSNA-BLR
Comment options

Answer selected by Viteri-code
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API and Webhooks Discussions related to GitHub's APIs or Webhooks Question Ask and answer questions about GitHub features and usage
3 participants