Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Increase AttachToTangle timeout #2692

Conversation

svenger87
Copy link
Contributor

@svenger87 svenger87 commented Apr 3, 2020

Description of change

Hornet remote POW (AVX enabled) on a hetzner CX21 instance often fails because the pow takes slightly more then 25 seconds.
Therefore Trinity falls back to local POW.

Type of change

  • Bug fix (a non-breaking change which fixes an issue)

How the change has been tested

Compiled Trinity from souce with increased timeout in config.js

API request performed several times with measured duration of POW:

DURATION: 22350
DURATION: 14593
DURATION: 8931
DURATION: 14619
DURATION: 26030 < Boing...this one would have failed in a trinity tx
DURATION: 19363
DURATION: 19687
DURATION: 10816
DURATION: 28896 < Boing...this one would have failed in a trinity tx

Tested with this script: https://cdn.discordapp.com/attachments/630794683920154676/694998985546661919/api_attachToTangle.sh

Change checklist

Add an x to the boxes that are relevant to your changes, and delete any items that are not.

  • My code follows the contribution guidelines for this project
  • For changes to shared: If applicable, I have verified that my changes are implemented correctly in desktop and mobile

@rajivshah3
Copy link
Member

While I think this change is fine, I did look into the PoW implementation that Hornet uses because >25 sec for AVX PoW on an average size bundle seems unusually long. I think iota.go (and thus Hornet) would benefit from using the optimized PCurl implementation from iotaledger/iota_common.

@rajivshah3 rajivshah3 added C - Shared T - Bug Type - Bug: Something isn't working labels Apr 3, 2020
@svenger87
Copy link
Contributor Author

I´d be happy if there are better options. @muXxer

@svenger87
Copy link
Contributor Author

In my manual build i increased the timeout to 60000. It seems trinity is NOT waiting 60s for remote POW. Am i missing something?

@laumair
Copy link
Contributor

laumair commented Apr 3, 2020

@svenger87

Hornet remote POW (AVX enabled) on a hetzner CX21 instance often fails because the pow takes slightly more then 25 seconds.
Therefore Trinity falls back to local POW.

Trinity should not instantly fall to local proof-of-work because of this handler used in the attachToTangle api.

It seems trinity is NOT waiting 60s for remote POW.

Does it error out or just retries? If it retries, then its intentional.

@svenger87
Copy link
Contributor Author

@laumair Remote POW gets a request timeout and falls back to local POW.
Which is particularly good. But I was thinking giving the node a bit more time to complete POW might make sense.

Feel free to try a few transactions with https://hornet.spdns.org:443

@cvarley100 cvarley100 merged commit 3e432b0 into iotaledger:develop Apr 6, 2020
@svenger87 svenger87 deleted the hotfix/increase-attachtotangle-timeout branch April 8, 2020 07:14
@rajivshah3 rajivshah3 mentioned this pull request May 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C - Shared T - Bug Type - Bug: Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants