Refactor how the next available nonce is obtained

Abierto
#5,666 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
go

Línea de trabajo

Start by reading nextNonce() in the transaction package and the transaction send flows that call it, including how the mutex is acquired and pending transactions are stored on disk. Trace how concurrent sends obtain nonces and where each flow broadcasts and persists its transaction. Done means nonce allocation handles parallel sends without requiring each caller to manage the transaction lifecycle around an external mutex.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Task

How it works now:
Before send any transaction, we need its nonce. nextNonce() in transaction package checks the latest nonce known onchain and among the pending transactions stored on disk. It picks the highest of them and then does +1

The problem:

  1. Two parallel calls receive the same nonce.
    This forces a mutex that blocks every transaction send until the current transaction has been broadcast and stored on disk. Because of that, all transaction sends line up in a queue.

  2. Contextual complexity.
    nextNonce() cannot be used as a black box: the mutex has to be taken outside the method. In each transaction flow developer must keep in mind transaction lifecycle.

AI Disclosure
  • This issue contains suggestions and text generated by an LLM.
  • I have reviewed the AI generated content thoroughly.
  • I possess the technical expertise to responsibly review the AI generated content mentioned in this issue.
Lenguaje dominante
Go
Estrellas
1.5k
Forks
390
Merge medio
2 d 22 h
PR fusionados (30 d)
24

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ethersphere/bee

Todos los issues de ethersphere/bee

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.