keep-network / local-setup

Allow to easily set up tBTC and Keep locally for development and test purposes.
MIT License
8 stars 16 forks source link

Some E2E tests on Testnet fail during deposit redemption #135

Open michalinacienciala opened 2 years ago

michalinacienciala commented 2 years ago

Some E2E tests / Testnet workflow executions fail with a GH Actionss timeout during redemption of the first deposit.

Starting redemption of the first deposit...

Using redeemer address: tb1qklp740pnnjwt2jz0atw66ucxh4jpdznsepkwgw
Connecting to electrum server...
You are connected to an ElectrumX 1.16.0 server.
Negotiated version: [ElectrumX 1.16.0,1.4.2]
Closing connection to electrum server...
Looking up Deposit contract at address 0xD6A3D14de2A8319F696AC1FbD2b2C43fc4966D9a...
Looking up Created event for deposit 0xD6A3D14de2A8319F696AC1FbD2b2C43fc4966D9a...
FromBlock is less or equal zero; setting FromBlock to source contract deployment block
Found keep address 0xb6f546Cb57bEfD9Bb0C0543d226E282590Bd00e1.
Found existing Bitcoin address for deposit 0xD6A3D14de2A8319F696AC1FbD2b2C43fc4966D9a...
Looking up UTXO size and transaction fee for redemption transaction...
Approving transfer of 100000000000000 to the vending machine....
Initiating redemption of deposit 0xD6A3D14de2A8319F696AC1FbD2b2C43fc4966D9a from vending machine...
Looking up latest redemption details for deposit 0xD6A3D14de2A8319F696AC1FbD2b2C43fc4966D9a...
Finding or waiting for transaction signature for deposit 0xD6A3D14de2A8319F696AC1FbD2b2C43fc4966D9a...
FromBlock is less or equal zero; setting FromBlock to source contract deployment block
FromBlock is less or equal zero; setting FromBlock to source contract deployment block
FromBlock is less or equal zero; setting FromBlock to source contract deployment block
FromBlock is less or equal zero; setting FromBlock to source contract deployment block
FromBlock is less or equal zero; setting FromBlock to source contract deployment block
FromBlock is less or equal zero; setting FromBlock to source contract deployment block

Example of such job: https://github.com/keep-network/local-setup/runs/5440977179?check_suite_focus=true)

Some history: Before we started to see problems described in https://github.com/keep-network/local-setup/issues/127, around 60% of executions of E2E tests / Testnet workflow were ending with a failure, 40% were successful. The errors that we saw were either:

The problems have been suspected to be related to the fact that relay maintainer updates difficulty less often that difficulty is being changed on testnet (on testnet the difficulty can increase/decrease the very next block), but the fix we tried to apply did not improve the failure/success ratio (still only ~40% jobs were passing).

After some time, problem described in https://github.com/keep-network/local-setup/issues/127 occurred. Since we fixed it, all E2E tests run on Testnet (Ropsten) are failing. Most fail pretty quick with already known Error: execution reverted: not at current or previous difficulty error (during creation of first deposit), but some fail due to a GH Actions timeout during redemption of the first deposit (this is something that we didn't see before and I hope may be fixed).

michalinacienciala commented 2 years ago

Update: since https://github.com/keep-network/local-setup/pull/136 got fixed, all Testnet jobs fail now with following error:

Test errored out with error:  Error: insufficient funds for gas * price + value

See https://github.com/keep-network/local-setup/runs/5712859794?check_suite_focus=true