Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send mining notifications before global timeout #943

Closed
Neylix opened this issue Mar 16, 2023 · 0 comments · Fixed by #1142
Closed

Send mining notifications before global timeout #943

Neylix opened this issue Mar 16, 2023 · 0 comments · Fixed by #1142
Assignees
Labels
beacon chain Involve BeaconChain enhancements mining Involve transaction validation and mining
Milestone

Comments

@Neylix
Copy link
Member

Neylix commented Mar 16, 2023

Describe the problem you discovered

Actually there is a global timeout for a transaction to be mined (1 minute). If the timeout is reached the mining process notify the error and stop :

  def handle_event(
        {:timeout, :stop_timeout},
        :any,
        _state,
        data = %{context: %ValidationContext{transaction: tx}}
      ) do
    Logger.warning("Timeout reached during mining",
      transaction_type: tx.type,
      transaction_address: Base.encode16(tx.address)
    )

    notify_error(:timeout, data)
    :stop
  end

This can lead to a problem when some storage node do not respond with a storage confirmation. In order to notify the previous chain and the beacon chain, a validation node wait for all the storage confirmations, but if one of the storage node do not respond, the validation node will reach the global timeout and so don't notify beacon chain and previous chain. If this happen on all the validation nodes, the transaction will never be added into the beacon chain even if it has been replicated by 95 % of the storage nodes.

Describe the solution you'd like

To avoid this problem, when a node reach the global timeout, if the current state is replication then it should notify the previous chain and the beacon chain (if there is at least 1 storage confirmations)

Additional context

Epic: #306

@Neylix Neylix added bug Something isn't working mining Involve transaction validation and mining beacon chain Involve BeaconChain labels Mar 16, 2023
@github-project-automation github-project-automation bot moved this to Todo 🚩 in Dev Board Mar 16, 2023
@samuelmanzanera samuelmanzanera added enhancements and removed bug Something isn't working labels May 15, 2023
@samuelmanzanera samuelmanzanera added this to the 1.3.0 milestone May 15, 2023
@samuelmanzanera samuelmanzanera modified the milestones: 1.3.0, 1.2.4 Jul 3, 2023
@Neylix Neylix self-assigned this Jul 3, 2023
@Neylix Neylix moved this from Todo 🚩 to In Progress 🚧 in Dev Board Jul 3, 2023
@Neylix Neylix moved this from In Progress 🚧 to Review 💬 in Dev Board Jul 3, 2023
@github-project-automation github-project-automation bot moved this from Review 💬 to Done 🍻 in Dev Board Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beacon chain Involve BeaconChain enhancements mining Involve transaction validation and mining
Projects
Status: Done 🍻
Development

Successfully merging a pull request may close this issue.

2 participants