Skip to content

Conversation

@MantisClone
Copy link
Member

@MantisClone MantisClone commented Feb 27, 2023

Fixes #1074
Fixes #1075
Fixes dw-97

Changes:

  • Wait for 2 block confirmations when submitting hashes on-chain. EVM-like blockchains can experience chain reorgs. Usually they are only 1 block in depth. For example, Gnosis Chain experiences a 1-block reorg every few minutes so it's important to wait for 2 block confirmations before submitting the next transaction.

@MantisClone MantisClone changed the title fix(ethereum-storage): OldNonce error, wait for 1 confirmation when submitting transactions fix(ethereum-storage): OldNonce error, wait for 1 confirmation when submitting hashes Feb 27, 2023
@coveralls
Copy link

coveralls commented Feb 27, 2023

Coverage Status

Coverage: 87.784% (-0.05%) from 87.834% when pulling 1542565 on dw-97/fix-old-nonce into 27aaa1f on master.

retryDelay: 0,
safeGasPriceLimit: '500000000000',
transactionPollingTimeout: 300,
blockConfirmations: 2,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is ever used

Copy link
Member Author

@MantisClone MantisClone Mar 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, see comment below. it's used now.

* Retrieve from config the default number of block confirmations to wait before considering a transaction successful
* @returns the number of block confirmations
*/
export function getDefaultEthereumBlockConfirmations(): number {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. I called it as a fallback.

return (
(argv.blockConfirmations && Number(argv.blockConfirmations)) ||
(process.env.BLOCK_CONFIRMATIONS && Number(process.env.BLOCK_CONFIRMATIONS)) ||
defaultValues.ethereumStorage.ethereum.blockConfirmations
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is never set, see at the top of this file

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@MantisClone MantisClone requested a review from benjlevesque March 3, 2023 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix FeeTooLow error in request-node Fix OldNonce error in request-node

6 participants