icon-project / icon-bridge

The centralized bridge of ICON
Apache License 2.0
21 stars 15 forks source link

fix(bmr): submit transaction to pool failed (#760) #761

Closed manishbista28 closed 1 year ago

manishbista28 commented 1 year ago

Closes #760

Checklist:

Please review the CONTRIBUTING.md file for detailed contributing guidelines.

manishbista28 commented 1 year ago

The workaround so far includes

  1. Increase retry limit to a larger value. It should cause the relay to wait approx 15 minutes for a single transaction. This avoids any doubt that the relay did not wait long enough for a transaction to complete.
  2. Use a larger gas price. Current gas price returned by ethclient.SuggestGasPrice() is low (8 units only). Though there are plenty of transactions which have successfully been processed with the low value (8 units), using a larger value would ensure that chain will not discard current txn based on gas price alone especially during high network activity. However, as a side note, transaction prioritization scheme could be dependent on the node's preferred scheme as well.

Since the exact cause of issue still needs to be figured out and there are more than a limited set of variables that could have lead to the problem, the above workaround will either work or it will serve to eliminate variables we presume are cause of the problem (i.e. the issue will repeat because of causes we do not know as of now).

Continuing if further improvements can help.

manishbista28 commented 1 year ago

Randomness to gas price has been introduced so that even if the relay needs to resubmit a transaction, there can be at least one parameter that's different from the one already submiited. This will bring difference in transaction hash, which is essential to avoid PoolBanned error.