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

Implement non-native tokens bridge e2e test #1746

Merged

Conversation

begmaroman
Copy link
Contributor

@begmaroman begmaroman commented Jul 25, 2023

Description

Implement non-native tokens bridge e2e test

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

@begmaroman begmaroman marked this pull request as draft July 25, 2023 10:13
@begmaroman begmaroman self-assigned this Jul 25, 2023
@begmaroman begmaroman added the feature New update to Polygon Edge label Jul 25, 2023
@begmaroman begmaroman marked this pull request as ready for review July 27, 2023 08:39
Copy link
Collaborator

@Stefan-Ethernal Stefan-Ethernal left a comment

Choose a reason for hiding this comment

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

Generaly looking good.

However, currently it is not possible to run this subtest in isolation:

go test -v -run "TestE2E_Bridge_Transfers/non_native_ERC20_deposit_and_withdraw" github.com/0xPolygon/polygon-edge/e2
e-polybft/e2e

This is the error message I'm witnessing:

bridge_test.go:429: 
                Error Trace:    /home/stefan/go/src/polygon-edge/e2e-polybft/e2e/bridge_test.go:429
                Error:          Received unexpected error:
                                failed to execute command: failed to get exit proof (exit id=5): {"code":-32603,"message":"checkpoint block not found for exit ID 5"}

e2e-polybft/e2e/bridge_test.go Show resolved Hide resolved
e2e-polybft/e2e/bridge_test.go Outdated Show resolved Hide resolved
e2e-polybft/e2e/bridge_test.go Outdated Show resolved Hide resolved
consensus/polybft/contractsapi/bindings-gen/main.go Outdated Show resolved Hide resolved
e2e-polybft/e2e/bridge_test.go Outdated Show resolved Hide resolved
e2e-polybft/e2e/bridge_test.go Outdated Show resolved Hide resolved
e2e-polybft/e2e/bridge_test.go Outdated Show resolved Hide resolved
@begmaroman
Copy link
Contributor Author

However, currently it is not possible to run this subtest in isolation:

It works on my end now

@Stefan-Ethernal
Copy link
Collaborator

It works on my end now

It still fails for me when run independently (even with the latest changes):

go test -v -run "TestE2E_Bridge_Transfers/non_native_ERC20_deposit_and_withdraw" github.com/0xPolygon/polygon-edge/e2e-polybft/e2e
=== RUN   TestE2E_Bridge_Transfers
    bridge_test.go:61: Receiver#1=0x6956A37a286Ebb4418E96593c0eEcED6584f7a56
    bridge_test.go:61: Receiver#2=0xe4d172e6a99Bf0C7237aDeFbeEee156C60cBcD99
    bridge_test.go:61: Receiver#3=0x0702F7228488de65198e052AFe40a97D23e4a6FA
    bridge_test.go:61: Receiver#4=0x33C6dB6de0fd95B4774704baE0baF968D29D07fE
    bridge_test.go:61: Receiver#5=0x5331fe9B67320f05790bc79b4f6263ebBb4F6345
    test-cluster.go:175: logs enabled for e2e test: ../../e2e-logs-1690463298158/TestE2E_Bridge_Transfers
    bridge_test.go:107: Block Number=17, Decoded Log={Counter:+1 Status:true Message:[]}
=== RUN   TestE2E_Bridge_Transfers/non_native_ERC20_deposit_and_withdraw
    bridge_test.go:314: Rootchain token address: 0x7cEb4C1695D2CB68E1e760eB1F88Fc9F5E340c0D
    bridge_test.go:324: Initial block number: 30
    bridge_test.go:344: Final block number: 80
    bridge_test.go:352: Block Number=42, Decoded Log={Counter:+2 Status:true Message:[]}
    bridge_test.go:352: Block Number=44, Decoded Log={Counter:+3 Status:true Message:[]}
    bridge_test.go:352: Block Number=46, Decoded Log={Counter:+4 Status:true Message:[]}
    bridge_test.go:352: Block Number=48, Decoded Log={Counter:+5 Status:true Message:[]}
    bridge_test.go:352: Block Number=50, Decoded Log={Counter:+6 Status:true Message:[]}
    bridge_test.go:352: Block Number=51, Decoded Log={Counter:+7 Status:true Message:[]}
    bridge_test.go:363: Childchain token address: 0x696307B455c1B44490cA40e1df9940B294E7455f
    bridge_test.go:371: Deposits were successfully processed
    bridge_test.go:375: initial exit id 0
    bridge_test.go:379: Withdraw to: 0x6956A37a286Ebb4418E96593c0eEcED6584f7a56
    bridge_test.go:379: Withdraw to: 0xe4d172e6a99Bf0C7237aDeFbeEee156C60cBcD99
    bridge_test.go:379: Withdraw to: 0x0702F7228488de65198e052AFe40a97D23e4a6FA
    bridge_test.go:379: Withdraw to: 0x33C6dB6de0fd95B4774704baE0baF968D29D07fE
    bridge_test.go:379: Withdraw to: 0x5331fe9B67320f05790bc79b4f6263ebBb4F6345
    bridge_test.go:400: Latest block number: 90, epoch number: 3
    bridge_test.go:418: 
                Error Trace:    /home/stefan/go/src/polygon-edge/e2e-polybft/e2e/bridge_test.go:418
                Error:          Received unexpected error:
                                failed to execute command: failed to get exit proof (exit id=5): {"code":-32603,"message":"checkpoint block not found for exit ID 5"}
                Test:           TestE2E_Bridge_Transfers/non_native_ERC20_deposit_and_withdraw
--- FAIL: TestE2E_Bridge_Transfers (273.24s)
    --- FAIL: TestE2E_Bridge_Transfers/non_native_ERC20_deposit_and_withdraw (150.03s)

However, it works if I change the test to wait for another epoch submission:

require.NoError(t, waitForRootchainEpoch(
			currentEpoch+1,
			3*time.Minute,
			rootchainTxRelayer,
			polybftCfg.Bridge.CheckpointManagerAddr,
		))

@begmaroman
Copy link
Contributor Author

However, it works if I change the test to wait for another epoch submission:

@Stefan-Ethernal updated this part

@begmaroman begmaroman merged commit af37011 into develop Jul 28, 2023
6 checks passed
@begmaroman begmaroman deleted the feature/EVM-610-Implement_non-native_tokens_bridge_e2e_test branch July 28, 2023 09:20
@github-actions github-actions bot locked and limited conversation to collaborators Jul 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New update to Polygon Edge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants