diff --git a/.github/ISSUE_TEMPLATE/e2e_test_case_template.yaml b/.github/ISSUE_TEMPLATE/e2e_test_case_template.yaml index 0d887583..837ff812 100644 --- a/.github/ISSUE_TEMPLATE/e2e_test_case_template.yaml +++ b/.github/ISSUE_TEMPLATE/e2e_test_case_template.yaml @@ -70,6 +70,7 @@ body: - "full node sync" - "base layer disconnection" - "sequencer rotation" + - "light client" validations: required: true diff --git a/.github/workflows/e2e-test-evm-workflow-call.yml b/.github/workflows/e2e-test-evm-workflow-call.yml index 2ff5beb7..ea8d5543 100644 --- a/.github/workflows/e2e-test-evm-workflow-call.yml +++ b/.github/workflows/e2e-test-evm-workflow-call.yml @@ -79,7 +79,7 @@ jobs: docker image ls -a - name: Rollapp-EVM E2E Tests - run: make e2e-test test=${{ matrix.test }} + run: sudo -E make e2e-test test=${{ matrix.test }} env: ROLLAPP_EVM_CI: ${{ inputs.rollapp_evm_ci }} DYMENSION_CI: ${{ inputs.dymension_ci }} diff --git a/.github/workflows/e2e-test-hub-upgrade-workflow-call.yml b/.github/workflows/e2e-test-hub-upgrade-workflow-call.yml index a749745a..b8dfed05 100644 --- a/.github/workflows/e2e-test-hub-upgrade-workflow-call.yml +++ b/.github/workflows/e2e-test-hub-upgrade-workflow-call.yml @@ -48,7 +48,7 @@ jobs: docker image ls -a - name: Upgrade Hub E2E Tests - run: make ${{ matrix.tests }} + run: sudo -E make ${{ matrix.tests }} env: DYMENSION_CI: ${{ inputs.dymension_ci }} UPGRADE_NAME: ${{ inputs.upgrade_name }} diff --git a/.github/workflows/e2e-test-rollapp-evm-upgrade-workflow-call.yml b/.github/workflows/e2e-test-rollapp-evm-upgrade-workflow-call.yml index 9016fcd7..b62a8132 100644 --- a/.github/workflows/e2e-test-rollapp-evm-upgrade-workflow-call.yml +++ b/.github/workflows/e2e-test-rollapp-evm-upgrade-workflow-call.yml @@ -53,7 +53,7 @@ jobs: docker image ls -a - name: Rollapp-EVM Upgrade E2E Tests - run: make ${{ matrix.tests }} + run: sudo -E make ${{ matrix.tests }} env: ROLLAPP_EVM_CI: ${{ inputs.rollapp_evm_ci }} UPGRADE_ROLLAPP_EVM_NAME: ${{ inputs.upgrade_name }} diff --git a/.github/workflows/e2e-test-rollapp-wasm-upgrade-workflow-call.yml b/.github/workflows/e2e-test-rollapp-wasm-upgrade-workflow-call.yml index 653823d8..9501d135 100644 --- a/.github/workflows/e2e-test-rollapp-wasm-upgrade-workflow-call.yml +++ b/.github/workflows/e2e-test-rollapp-wasm-upgrade-workflow-call.yml @@ -53,7 +53,7 @@ jobs: docker image ls -a - name: Rollapp-Wasm Upgrade E2E Tests - run: make ${{ matrix.tests }} + run: sudo -E make ${{ matrix.tests }} env: ROLLAPP_WASM_CI: ${{ inputs.rollapp_wasm_ci }} UPGRADE_ROLLAPP_WASM_NAME: ${{ inputs.upgrade_name }} diff --git a/.github/workflows/e2e-test-wasm-workflow-call.yaml b/.github/workflows/e2e-test-wasm-workflow-call.yaml index 3269c09f..9e066eed 100644 --- a/.github/workflows/e2e-test-wasm-workflow-call.yaml +++ b/.github/workflows/e2e-test-wasm-workflow-call.yaml @@ -78,7 +78,7 @@ jobs: docker image ls -a - name: Rollapp-Wasm E2E Tests - run: make e2e-test test=${{ matrix.test }} + run: sudo -E make e2e-test test=${{ matrix.test }} env: ROLLAPP_WASM_CI: ${{ inputs.rollapp_wasm_ci }} DYMENSION_CI: ${{ inputs.dymension_ci }} diff --git a/.github/workflows/e2e-test-workflow-call.yml b/.github/workflows/e2e-test-workflow-call.yml index 9aa752d1..5ff666d6 100644 --- a/.github/workflows/e2e-test-workflow-call.yml +++ b/.github/workflows/e2e-test-workflow-call.yml @@ -103,7 +103,7 @@ jobs: docker image ls -a - name: Rollapp-EVM E2E Tests - run: make e2e-test test=${{ matrix.test }} + run: sudo -E make e2e-test test=${{ matrix.test }} env: DYMENSION_CI: ${{ inputs.dymension_ci }} ROLLAPP_EVM_CI: ${{ inputs.rollapp_evm_ci }} @@ -140,7 +140,7 @@ jobs: docker image ls -a - name: Rollapp-Wasm E2E Tests - run: make e2e-test test=${{ matrix.test }} + run: sudo -E make e2e-test test=${{ matrix.test }} env: DYMENSION_CI: ${{ inputs.dymension_ci }} ROLLAPP_EVM_CI: ${{ inputs.rollapp_evm_ci }} diff --git a/.github/workflows/e2e_test.yml b/.github/workflows/e2e_test.yml index 07c42591..631843ad 100644 --- a/.github/workflows/e2e_test.yml +++ b/.github/workflows/e2e_test.yml @@ -73,7 +73,7 @@ jobs: go-version: "1.21.4" - name: Rollapp-EVM E2E Tests - run: make e2e-test test=${{ matrix.test }} + run: sudo make e2e-test test=${{ matrix.test }} # e2e-tests-by runs the actual go test command to trigger the test. rollapp-wasm: @@ -93,4 +93,4 @@ jobs: go-version: "1.21.4" - name: Rollapp-Wasm E2E Tests - run: make e2e-test test=${{ matrix.test }} + run: sudo make e2e-test test=${{ matrix.test }} diff --git a/clean.sh b/clean.sh index 4e6bb1cb..56ad5a37 100644 --- a/clean.sh +++ b/clean.sh @@ -5,5 +5,6 @@ rm -rf /tmp/rollapp* rm -rf /tmp/dym* rm -rf /tmp/sequencer* rm -rf /tmp/celes* +rm -rf /tmp/gaia* echo "Clean success!!" diff --git a/go.mod b/go.mod index 60fbcdac..7d6fd8ab 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ replace ( require ( github.com/decentrio/e2e-testing-live v0.0.0-20240718080249-ee255229c869 - github.com/decentrio/rollup-e2e-testing v0.0.0-20240819021909-ed72d19525f5 + github.com/decentrio/rollup-e2e-testing v0.0.0-20240911110829-da071a3f1628 github.com/dymensionxyz/dymension/v3 v3.1.0-rc03.0.20240717194206-54c0fca5fada github.com/dymensionxyz/dymint v1.2.0-rc01 ) diff --git a/go.sum b/go.sum index 82ebdb91..246d255a 100644 --- a/go.sum +++ b/go.sum @@ -770,8 +770,8 @@ github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U= github.com/decentrio/e2e-testing-live v0.0.0-20240718080249-ee255229c869 h1:qWpUYGOsrSC+1Vmd2TjhbsSpntvvx9PsX3AoeMunFxc= github.com/decentrio/e2e-testing-live v0.0.0-20240718080249-ee255229c869/go.mod h1:HZNYnPwmSxkwTPjSD5yolauc1Vx1ZzKL4FFMxTq4H5Y= -github.com/decentrio/rollup-e2e-testing v0.0.0-20240819021909-ed72d19525f5 h1:L9qJ8GSybCBICakC9fSvoHmUvrpW0dbTUJjGtk+UmQ0= -github.com/decentrio/rollup-e2e-testing v0.0.0-20240819021909-ed72d19525f5/go.mod h1:QmBrZgZplhtgHRWC0Z7LC7TDsKuC8sDyQvZyXXaqw/c= +github.com/decentrio/rollup-e2e-testing v0.0.0-20240911110829-da071a3f1628 h1:BaQci/ieiQ7+N0sRouA+CznSzPDbOx+ae/LsgcCQgSs= +github.com/decentrio/rollup-e2e-testing v0.0.0-20240911110829-da071a3f1628/go.mod h1:QmBrZgZplhtgHRWC0Z7LC7TDsKuC8sDyQvZyXXaqw/c= github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= diff --git a/live-tests/eibc_3rd_token_test.go b/live-tests/eibc_3rd_token_test.go index 784c1aca..8ac14406 100644 --- a/live-tests/eibc_3rd_token_test.go +++ b/live-tests/eibc_3rd_token_test.go @@ -184,7 +184,7 @@ func TestEIBC_3rd_Token_RolY_Live(t *testing.T) { re := regexp.MustCompile(`^\d+`) if re.ReplaceAllString(eibcEvent.Price, "") == mochaIBCDenom && eibcEvent.PacketStatus == "PENDING" { fmt.Println("EIBC Event:", eibcEvent) - _, err := cosmos.FullfillDemandOrder(&hub, eibcEvent.ID, marketMaker.Address, dymFee) + _, err := cosmos.FullfillDemandOrder(&hub, eibcEvent.OrderId, marketMaker.Address, dymFee) require.NoError(t, err) } } @@ -342,7 +342,7 @@ func TestEIBC_3rd_Token_Timeout_RolY_Live(t *testing.T) { re := regexp.MustCompile(`^\d+`) if re.ReplaceAllString(eibcEvent.Price, "") == mochaIBCDenom && eibcEvent.PacketStatus == "PENDING" { fmt.Println("EIBC Event:", eibcEvent) - _, err := cosmos.FullfillDemandOrder(&hub, eibcEvent.ID, marketMaker.Address, dymFee) + _, err := cosmos.FullfillDemandOrder(&hub, eibcEvent.OrderId, marketMaker.Address, dymFee) require.NoError(t, err) } } diff --git a/live-tests/eibc_fulfillment_test.go b/live-tests/eibc_fulfillment_test.go index f3295b48..d4d01166 100644 --- a/live-tests/eibc_fulfillment_test.go +++ b/live-tests/eibc_fulfillment_test.go @@ -140,7 +140,7 @@ func TestEIBCFulfillRolX_Live(t *testing.T) { re := regexp.MustCompile(`^\d+`) if re.ReplaceAllString(eibcEvent.Price, "") == rollappXIBCDenom && eibcEvent.PacketStatus == "PENDING"{ fmt.Println("EIBC Event:", eibcEvent) - _, err := cosmos.FullfillDemandOrder(&hub, eibcEvent.ID, marketMaker.Address, dymFee) + _, err := cosmos.FullfillDemandOrder(&hub, eibcEvent.OrderId, marketMaker.Address, dymFee) require.NoError(t, err) } } diff --git a/live-tests/setup.go b/live-tests/setup.go index e39dcb4b..f3f73532 100644 --- a/live-tests/setup.go +++ b/live-tests/setup.go @@ -88,7 +88,7 @@ func encodingConfig() *util.TestEncodingConfig { } func getEibcEventFromTx(t *testing.T, dymension *cosmos.CosmosChain, txResp types.TxResponse) *dymensiontesting.EibcEvent { - const evType = "eibc" + const evType = "dymensionxyz.dymension.eibc.EventDemandOrderFulfilled" events := txResp.Events var ( @@ -100,10 +100,10 @@ func getEibcEventFromTx(t *testing.T, dymension *cosmos.CosmosChain, txResp type ) eibcEvent := new(dymensiontesting.EibcEvent) - eibcEvent.ID = id + eibcEvent.OrderId = id eibcEvent.Price = price eibcEvent.Fee = fee - checkFulfilled, err := strconv.ParseBool(isFulfilled) + checkFulfilled, err := strconv.ParseBool(isFulfilled) if err != nil { require.NoError(t, err) return nil diff --git a/tests/admc_test.go b/tests/admc_test.go index 6304e94a..7d96f3e4 100644 --- a/tests/admc_test.go +++ b/tests/admc_test.go @@ -35,6 +35,8 @@ func TestADMC_Originates_HubtoRA_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension @@ -200,6 +202,8 @@ func TestADMC_Migrate_Empty_User_Memo_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension @@ -421,6 +425,8 @@ func TestADMC_Migrate_With_User_Memo_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension @@ -650,6 +656,8 @@ func TestADMC_Originates_HubtoRA_Wasm(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension @@ -815,6 +823,8 @@ func TestADMC_Migrate_Empty_User_Memo_Wasm(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension @@ -1033,6 +1043,8 @@ func TestADMC_Migrate_With_User_Memo_Wasm(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension @@ -1258,6 +1270,8 @@ func TestADMC_MetaData_NotFound_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides @@ -1453,6 +1467,8 @@ func TestADMC_MetaData_NotFound_Wasm(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides diff --git a/tests/automated_denommetadata_test.go b/tests/automated_denommetadata_test.go index 3320c732..8266c1a8 100644 --- a/tests/automated_denommetadata_test.go +++ b/tests/automated_denommetadata_test.go @@ -1276,6 +1276,8 @@ func TestADMC_Hub_to_RA_Migrate_Dym_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension @@ -1466,6 +1468,8 @@ func TestADMC_Hub_to_RA_Migrate_Dym_Wasm(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension diff --git a/tests/data/native_denom.json b/tests/data/native_denom.json new file mode 100644 index 00000000..d832ef49 --- /dev/null +++ b/tests/data/native_denom.json @@ -0,0 +1,5 @@ +{ + "display": "RAX", + "base": "urax", + "exponent": 18 +} diff --git a/tests/disconnection_test.go b/tests/disconnection_test.go index 686985b2..3b28ac7f 100644 --- a/tests/disconnection_test.go +++ b/tests/disconnection_test.go @@ -121,11 +121,13 @@ func TestDisconnection_EVM(t *testing.T) { dymintTomlOverrides["settlement_gas_prices"] = "0adym" dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" - dymintTomlOverrides["batch_submit_max_time"] = "5s" + dymintTomlOverrides["batch_submit_max_time"] = "20s" + dymintTomlOverrides["batch_submit_time"] = "20s" dymintTomlOverrides["block_batch_max_size_bytes"] = "1000" - dymintTomlOverrides["max_supported_batch_skew"] = "1" + dymintTomlOverrides["max_batch_skew"] = "1" dymintTomlOverrides["batch_acceptance_attempts"] = "1" dymintTomlOverrides["batch_acceptance_timeout"] = "5s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension @@ -194,6 +196,7 @@ func TestDisconnection_EVM(t *testing.T) { // Wait for rollapp finalized rollapp1Height, err := rollapp1.Height(ctx) + fmt.Println(rollapp1Height) require.NoError(t, err) dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollapp1Height, 300) @@ -203,6 +206,7 @@ func TestDisconnection_EVM(t *testing.T) { // Wait until rollapp stops produce block rollappHeight, err := rollapp1.Height(ctx) + fmt.Println(rollappHeight) require.NoError(t, err) err = testutil.WaitForCondition( @@ -210,6 +214,7 @@ func TestDisconnection_EVM(t *testing.T) { time.Second*5, // each epoch is 5 seconds func() (bool, error) { newRollappHeight, err := rollapp1.Height(ctx) + fmt.Println(newRollappHeight) require.NoError(t, err) if newRollappHeight > rollappHeight { @@ -247,10 +252,12 @@ func TestDisconnection_Wasm(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "5s" + dymintTomlOverrides["batch_submit_time"] = "5s" dymintTomlOverrides["block_batch_max_size_bytes"] = "1000" - dymintTomlOverrides["max_supported_batch_skew"] = "1" + dymintTomlOverrides["max_batch_skew"] = "1" dymintTomlOverrides["batch_acceptance_attempts"] = "1" dymintTomlOverrides["batch_acceptance_timeout"] = "5s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension diff --git a/tests/eibc_ack_error_test.go b/tests/eibc_ack_error_test.go index 735e7ddf..20396ec8 100644 --- a/tests/eibc_ack_error_test.go +++ b/tests/eibc_ack_error_test.go @@ -390,7 +390,7 @@ func TestEIBC_AckError_Dym_EVM(t *testing.T) { require.NoError(t, err) // fulfill demand order - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[len(eibcEvents)-1].ID, marketMakerAddr, eibcFee) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[len(eibcEvents)-1].OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) fmt.Println(txhash) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) @@ -757,7 +757,7 @@ func TestEIBC_AckError_RA_Token_EVM(t *testing.T) { require.Equal(t, eibcEvents[len(eibcEvents)-1].PacketStatus, "PENDING") // fulfill demand order - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[len(eibcEvents)-1].ID, marketMakerAddr, eibcFee) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[len(eibcEvents)-1].OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) fmt.Println(txhash) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) @@ -1194,7 +1194,7 @@ func TestEIBC_AckError_3rd_Party_Token_EVM(t *testing.T) { require.Equal(t, eibcEvents[len(eibcEvents)-1].PacketStatus, "PENDING") // fulfill demand order - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[len(eibcEvents)-1].ID, marketMakerAddr, eibcFee) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[len(eibcEvents)-1].OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) fmt.Println(txhash) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) @@ -1589,7 +1589,7 @@ func TestEIBC_AckError_Dym_Wasm(t *testing.T) { require.NoError(t, err) // fulfill demand order - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[len(eibcEvents)-1].ID, marketMakerAddr, eibcFee) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[len(eibcEvents)-1].OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) fmt.Println(txhash) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) @@ -1952,7 +1952,7 @@ func TestEIBC_AckError_RA_Token_Wasm(t *testing.T) { require.Equal(t, eibcEvents[len(eibcEvents)-1].PacketStatus, "PENDING") // fulfill demand order - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[len(eibcEvents)-1].ID, marketMakerAddr, eibcFee) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[len(eibcEvents)-1].OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) fmt.Println(txhash) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) @@ -2341,7 +2341,7 @@ func TestEIBC_AckError_3rd_Party_Token_Wasm(t *testing.T) { require.Equal(t, eibcEvents[len(eibcEvents)-1].PacketStatus, "PENDING") // fulfill demand order - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[len(eibcEvents)-1].ID, marketMakerAddr, eibcFee) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[len(eibcEvents)-1].OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) fmt.Println(txhash) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) diff --git a/tests/eibc_corrupted_memo_test.go b/tests/eibc_corrupted_memo_test.go index fc1563ce..250345fa 100644 --- a/tests/eibc_corrupted_memo_test.go +++ b/tests/eibc_corrupted_memo_test.go @@ -38,6 +38,8 @@ func TestEIBCCorruptedMemoNegative_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides diff --git a/tests/eibc_fee_market_test.go b/tests/eibc_fee_market_test.go index 21cdf1a0..65fa860a 100644 --- a/tests/eibc_fee_market_test.go +++ b/tests/eibc_fee_market_test.go @@ -272,9 +272,9 @@ func TestEIBCFulfillAlreadyFulfilledDemand_EVM(t *testing.T) { re := regexp.MustCompile(`^\d+`) if re.ReplaceAllString(eibcEvent.Fee, "") == rollappIBCDenom && eibcEvent.PacketStatus == "PENDING" { fmt.Println("EIBC Event:", eibcEvent) - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvent.ID, marketMakerAddr, eibcFee) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvent.OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) - demand_order_id = eibcEvent.ID + demand_order_id = eibcEvent.OrderId fmt.Println(txhash) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) // if eibcEvent != nil { @@ -587,9 +587,9 @@ func TestEIBCAlreadyFulfilledDemand_Wasm(t *testing.T) { re := regexp.MustCompile(`^\d+`) if re.ReplaceAllString(eibcEvent.Fee, "") == rollappIBCDenom && eibcEvent.PacketStatus == "PENDING" { fmt.Println("EIBC Event:", eibcEvent) - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvent.ID, marketMakerAddr, eibcFee) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvent.OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) - demand_order_id = eibcEvent.ID + demand_order_id = eibcEvent.OrderId fmt.Println(txhash) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) // if eibcEvent != nil { @@ -887,7 +887,7 @@ func TestEIBCUnallowedSigner_EVM(t *testing.T) { if re.ReplaceAllString(eibcEvent.Fee, "") == rollappIBCDenom && eibcEvent.PacketStatus == "PENDING" { fmt.Println("EIBC Event:", eibcEvent) // attempt to update the fee amount required by demand order with an unallowed signer - txhash, err := dymension.UpdateDemandOrder(ctx, eibcEvent.ID, marketMakerAddr, eibcFee.MulRaw(2)) + txhash, err := dymension.UpdateDemandOrder(ctx, eibcEvent.OrderId, marketMakerAddr, eibcFee.MulRaw(2)) require.NoError(t, err) res, err := dymension.GetTransaction(txhash) require.NoError(t, err) @@ -1147,7 +1147,7 @@ func TestEIBCUnallowedSigner_Wasm(t *testing.T) { if re.ReplaceAllString(eibcEvent.Fee, "") == rollappIBCDenom && eibcEvent.PacketStatus == "PENDING" { fmt.Println("EIBC Event:", eibcEvent) // attempt to update the fee amount required by demand order with an unallowed signer - txhash, err := dymension.UpdateDemandOrder(ctx, eibcEvent.ID, marketMakerAddr, eibcFee.MulRaw(2)) + txhash, err := dymension.UpdateDemandOrder(ctx, eibcEvent.OrderId, marketMakerAddr, eibcFee.MulRaw(2)) require.NoError(t, err) res, err := dymension.GetTransaction(txhash) require.NoError(t, err) diff --git a/tests/eibc_fee_test.go b/tests/eibc_fee_test.go index 34a031e8..b8500af5 100644 --- a/tests/eibc_fee_test.go +++ b/tests/eibc_fee_test.go @@ -38,6 +38,9 @@ func TestEIBCFeeTooHigh_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" + dymintTomlOverrides["block_time"] = "2s" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides @@ -210,6 +213,7 @@ func TestEIBCFeeTooHigh_EVM(t *testing.T) { // get eIbc event eibcEvents, _ := getEIbcEventsWithinBlockRange(ctx, dymension, 30, false) + fmt.Println(eibcEvents) require.True(t, len(eibcEvents) == 1) // verify there were no eibc events registered on the hub isFinalized, err = dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) diff --git a/tests/eibc_feemarket_test.go b/tests/eibc_feemarket_test.go index 12ec7431..11031911 100644 --- a/tests/eibc_feemarket_test.go +++ b/tests/eibc_feemarket_test.go @@ -268,14 +268,14 @@ func TestEIBC_Fee_Market_Success_EVM(t *testing.T) { require.NoError(t, err) fmt.Println("Event:", eibcEvents[1]) - _, err = dymension.UpdateDemandOrder(ctx, eibcEvents[1].ID, dymensionUserAddr, math.NewInt(100_000)) + _, err = dymension.UpdateDemandOrder(ctx, eibcEvents[1].OrderId, dymensionUserAddr, math.NewInt(100_000)) require.NoError(t, err) err = testutil.WaitForBlocks(ctx, 5, dymension) require.NoError(t, err) // fulfill demand order - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[1].ID, marketMakerAddr, math.NewInt(100_000)) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[1].OrderId, marketMakerAddr, math.NewInt(100_000)) require.NoError(t, err) fmt.Println(txhash) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) @@ -579,14 +579,14 @@ func TestEIBC_Fee_Market_Success_Wasm(t *testing.T) { require.NoError(t, err) fmt.Println("Event:", eibcEvents[1]) - _, err = dymension.UpdateDemandOrder(ctx, eibcEvents[1].ID, dymensionUserAddr, eibcFee.MulRaw(2)) + _, err = dymension.UpdateDemandOrder(ctx, eibcEvents[1].OrderId, dymensionUserAddr, eibcFee.MulRaw(2)) require.NoError(t, err) err = testutil.WaitForBlocks(ctx, 5, dymension) require.NoError(t, err) // fulfill demand order - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[1].ID, marketMakerAddr, eibcFee.MulRaw(2)) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[1].OrderId, marketMakerAddr, eibcFee.MulRaw(2)) require.NoError(t, err) fmt.Println(txhash) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) @@ -876,14 +876,14 @@ func TestEIBC_Fee_Market_Auto_Created_EVM(t *testing.T) { require.NoError(t, err) fmt.Println("Event:", eibcEvents[1]) - _, err = dymension.UpdateDemandOrder(ctx, eibcEvents[1].ID, dymensionUserAddr, eibcFee) + _, err = dymension.UpdateDemandOrder(ctx, eibcEvents[1].OrderId, dymensionUserAddr, eibcFee) require.NoError(t, err) err = testutil.WaitForBlocks(ctx, 5, dymension) require.NoError(t, err) // fulfill demand order - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[1].ID, marketMakerAddr, eibcFee) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[1].OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) fmt.Println(txhash) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) @@ -1182,14 +1182,14 @@ func TestEIBC_Fee_Market_Auto_Created_Wasm(t *testing.T) { require.NoError(t, err) fmt.Println("Event:", eibcEvents[1]) - _, err = dymension.UpdateDemandOrder(ctx, eibcEvents[1].ID, dymensionUserAddr, eibcFee.MulRaw(2)) + _, err = dymension.UpdateDemandOrder(ctx, eibcEvents[1].OrderId, dymensionUserAddr, eibcFee.MulRaw(2)) require.NoError(t, err) err = testutil.WaitForBlocks(ctx, 5, dymension) require.NoError(t, err) // fulfill demand order - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[1].ID, marketMakerAddr, eibcFee.MulRaw(2)) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[1].OrderId, marketMakerAddr, eibcFee.MulRaw(2)) require.NoError(t, err) fmt.Println(txhash) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) @@ -1249,6 +1249,8 @@ func TestEIBCUpdateOnAckErrAndTimeout_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides @@ -1442,11 +1444,11 @@ func TestEIBCUpdateOnAckErrAndTimeout_EVM(t *testing.T) { require.Equal(t, eibcEvents[0].Fee, fmt.Sprintf("%s%s", globalEIbcFee, dymension.Config().Denom)) // modify demand order with new fee - _, err = dymension.UpdateDemandOrder(ctx, eibcEvents[0].ID, dymensionUserAddr, globalEIbcFee.Mul(math.NewInt(2))) + _, err = dymension.UpdateDemandOrder(ctx, eibcEvents[0].OrderId, dymensionUserAddr, globalEIbcFee.Mul(math.NewInt(2))) require.NoError(t, err) // fulfill demand order - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[0].ID, marketMakerAddr, globalEIbcFee.Mul(math.NewInt(2))) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[0].OrderId, marketMakerAddr, globalEIbcFee.Mul(math.NewInt(2))) require.NoError(t, err) fmt.Println(txhash) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) @@ -1700,11 +1702,11 @@ func TestEIBCUpdateOnAckErrAndTimeout_Wasm(t *testing.T) { require.Equal(t, eibcEvents[0].Fee, fmt.Sprintf("%s%s", globalEIbcFee, dymension.Config().Denom)) // modify demand order with new fee - _, err = dymension.UpdateDemandOrder(ctx, eibcEvents[0].ID, dymensionUserAddr, globalEIbcFee.Mul(math.NewInt(2))) + _, err = dymension.UpdateDemandOrder(ctx, eibcEvents[0].OrderId, dymensionUserAddr, globalEIbcFee.Mul(math.NewInt(2))) require.NoError(t, err) // fulfill demand order - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[0].ID, marketMakerAddr, globalEIbcFee.Mul(math.NewInt(2))) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[0].OrderId, marketMakerAddr, globalEIbcFee.Mul(math.NewInt(2))) require.NoError(t, err) fmt.Println(txhash) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) @@ -1768,6 +1770,8 @@ func TestEIBCUpdateOnTimeout_Unallowed_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides @@ -1960,7 +1964,7 @@ func TestEIBCUpdateOnTimeout_Unallowed_EVM(t *testing.T) { require.Equal(t, eibcEvents[0].Fee, fmt.Sprintf("%s%s", globalEIbcFee, dymension.Config().Denom)) // modify demand order with new fee - txhash, err := dymension.UpdateDemandOrder(ctx, eibcEvents[0].ID, marketMakerAddr, globalEIbcFee.Mul(math.NewInt(2))) + txhash, err := dymension.UpdateDemandOrder(ctx, eibcEvents[0].OrderId, marketMakerAddr, globalEIbcFee.Mul(math.NewInt(2))) require.NoError(t, err) res, err := dymension.GetTransaction(txhash) @@ -2182,7 +2186,7 @@ func TestEIBCUpdateOnTimeout_Unallowed_Wasm(t *testing.T) { require.Equal(t, eibcEvents[0].Fee, fmt.Sprintf("%s%s", globalEIbcFee, dymension.Config().Denom)) // modify demand order with new fee - txhash, err := dymension.UpdateDemandOrder(ctx, eibcEvents[0].ID, marketMakerAddr, globalEIbcFee.Mul(math.NewInt(2))) + txhash, err := dymension.UpdateDemandOrder(ctx, eibcEvents[0].OrderId, marketMakerAddr, globalEIbcFee.Mul(math.NewInt(2))) require.NoError(t, err) res, err := dymension.GetTransaction(txhash) diff --git a/tests/eibc_fulfillment_test.go b/tests/eibc_fulfillment_test.go index 2655bcfa..46344491 100644 --- a/tests/eibc_fulfillment_test.go +++ b/tests/eibc_fulfillment_test.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "regexp" - "strconv" "testing" "cosmossdk.io/math" @@ -13,11 +12,9 @@ import ( "go.uber.org/zap/zaptest" test "github.com/decentrio/rollup-e2e-testing" - "github.com/decentrio/rollup-e2e-testing/blockdb" "github.com/decentrio/rollup-e2e-testing/cosmos" "github.com/decentrio/rollup-e2e-testing/cosmos/hub/dym_hub" "github.com/decentrio/rollup-e2e-testing/cosmos/rollapp/dym_rollapp" - dymensiontesting "github.com/decentrio/rollup-e2e-testing/dymension" "github.com/decentrio/rollup-e2e-testing/ibc" "github.com/decentrio/rollup-e2e-testing/relayer" "github.com/decentrio/rollup-e2e-testing/testreporter" @@ -338,7 +335,7 @@ func TestEIBCFulfillOnOneRollApp_EVM(t *testing.T) { re := regexp.MustCompile(`^\d+`) if re.ReplaceAllString(eibcEvent.Price, "") == rollappIBCDenom && eibcEvent.PacketStatus == "PENDING" { fmt.Println("EIBC Event:", eibcEvent) - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvent.ID, marketMakerAddr, eibcFee) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvent.OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) fmt.Println(txhash) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) @@ -723,7 +720,7 @@ func TestEIBCFulfillOnOneRollApp_Wasm(t *testing.T) { for _, eibcEvent := range eibcEvents { re := regexp.MustCompile(`^\d+`) if re.ReplaceAllString(eibcEvent.Price, "") == rollappIBCDenom && eibcEvent.PacketStatus == "PENDING" { - _, err := dymension.FullfillDemandOrder(ctx, eibcEvent.ID, marketMakerAddr, eibcFee) + _, err := dymension.FullfillDemandOrder(ctx, eibcEvent.OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) // if eibcEvent != nil { @@ -1048,7 +1045,7 @@ func TestEIBCFulfillment_EVM(t *testing.T) { fmt.Println("Event:", eibcEvents[1]) // fulfill demand order - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[1].ID, marketMakerAddr, eibcFee) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[1].OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) fmt.Println(txhash) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) @@ -1353,7 +1350,7 @@ func TestEIBCFulfillment_Wasm(t *testing.T) { fmt.Println("Event:", eibcEvents[1]) // fulfill demand order - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[1].ID, marketMakerAddr, eibcFee) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[1].OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) fmt.Println(txhash) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) @@ -1692,7 +1689,7 @@ func TestEIBCFulfillment_two_rollapps_EVM(t *testing.T) { require.Equal(t, eibcEvents[len(eibcEvents)-1].PacketStatus, "PENDING") // fulfill demand order 1 - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[len(eibcEvents)-1].ID, marketMakerAddr, eibcFee) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[len(eibcEvents)-1].OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) fmt.Println(txhash) eibcEvent := getEibcEventFromTx(t, dymension, txhash) @@ -1714,7 +1711,7 @@ func TestEIBCFulfillment_two_rollapps_EVM(t *testing.T) { require.Equal(t, eibcEvents[len(eibcEvents)-1].PacketStatus, "PENDING") // fulfill demand order 2 - txhash, err = dymension.FullfillDemandOrder(ctx, eibcEvents[len(eibcEvents)-1].ID, marketMakerAddr, eibcFee) + txhash, err = dymension.FullfillDemandOrder(ctx, eibcEvents[len(eibcEvents)-1].OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) fmt.Println(txhash) eibcEvent = getEibcEventFromTx(t, dymension, txhash) @@ -2120,7 +2117,7 @@ func TestEIBCFulfillment_ThirdParty_EVM(t *testing.T) { fmt.Println("Event:", eibcEvents[1]) // fulfill demand order - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[1].ID, marketMakerAddr, eibcFee) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[1].OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) fmt.Println(txhash) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) @@ -2523,7 +2520,7 @@ func TestEIBCFulfillment_ThirdParty_Wasm(t *testing.T) { fmt.Println("Event:", eibcEvents[1]) // fulfill demand order - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[1].ID, marketMakerAddr, eibcFee) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[1].OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) fmt.Println(txhash) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) @@ -3089,109 +3086,3 @@ func TestEIBCFulfillment_ignore_hub_to_RA_Wasm(t *testing.T) { }, ) } - -func getEibcEventFromTx(t *testing.T, dymension *dym_hub.DymHub, txhash string) *dymensiontesting.EibcEvent { - txResp, err := dymension.GetTransaction(txhash) - if err != nil { - require.NoError(t, err) - return nil - } - - const evType = "eibc" - events := txResp.Events - - var ( - id, _ = cosmos.AttributeValue(events, evType, "id") - price, _ = cosmos.AttributeValue(events, evType, "price") - fee, _ = cosmos.AttributeValue(events, evType, "fee") - isFulfilled, _ = cosmos.AttributeValue(events, evType, "is_fulfilled") - packetStatus, _ = cosmos.AttributeValue(events, evType, "packet_status") - ) - - eibcEvent := new(dymensiontesting.EibcEvent) - eibcEvent.ID = id - eibcEvent.Price = price - eibcEvent.Fee = fee - println("check datra is fulfilled: ", isFulfilled) - eibcEvent.IsFulfilled, err = strconv.ParseBool(isFulfilled) - if err != nil { - require.NoError(t, err) - return nil - } - eibcEvent.PacketStatus = packetStatus - - return eibcEvent -} - -func getEIbcEventsWithinBlockRange( - ctx context.Context, - dymension *dym_hub.DymHub, - blockRange int64, - breakOnFirstOccurence bool, -) ([]dymensiontesting.EibcEvent, error) { - var eibcEventsArray []dymensiontesting.EibcEvent - - height, err := dymension.Height(ctx) - if err != nil { - return nil, fmt.Errorf("failed to get Dymension height: %w", err) - } - fmt.Printf("Dymension height: %d\n", height) - - err = testutil.WaitForBlocks(ctx, int(blockRange), dymension) - if err != nil { - return nil, fmt.Errorf("error waiting for blocks: %w", err) - } - - eibcEvents, err := getEventsOfType(dymension.CosmosChain, height-5, height+blockRange, "eibc", breakOnFirstOccurence) - if err != nil { - return nil, fmt.Errorf("error getting events of type 'eibc': %w", err) - } - - if len(eibcEvents) == 0 { - return nil, fmt.Errorf("There wasn't a single 'eibc' event registered within the specified block range on the hub") - } - - for _, event := range eibcEvents { - eibcEvent, err := dymensiontesting.MapToEibcEvent(event) - if err != nil { - return nil, fmt.Errorf("error mapping to EibcEvent: %w", err) - } - eibcEventsArray = append(eibcEventsArray, eibcEvent) - } - - return eibcEventsArray, nil -} - -func getEventsOfType(chain *cosmos.CosmosChain, startHeight int64, endHeight int64, eventType string, breakOnFirstOccurence bool) ([]blockdb.Event, error) { - var eventTypeArray []blockdb.Event - shouldReturn := false - - for height := startHeight; height <= endHeight && !shouldReturn; height++ { - txs, err := chain.FindTxs(context.Background(), height) - if err != nil { - return nil, fmt.Errorf("error fetching transactions at height %d: %w", height, err) - } - - for _, tx := range txs { - for _, event := range tx.Events { - if event.Type == eventType { - eventTypeArray = append(eventTypeArray, event) - if breakOnFirstOccurence { - shouldReturn = true - fmt.Printf("%s event found on block height: %d", eventType, height) - break - } - } - } - if shouldReturn { - break - } - } - } - - return eventTypeArray, nil -} - -func BuildEIbcMemo(eibcFee math.Int) string { - return fmt.Sprintf(`{"eibc": {"fee": "%s"}}`, eibcFee.String()) -} diff --git a/tests/eibc_invariant_test.go b/tests/eibc_invariant_test.go index 1e591860..7eb16a99 100644 --- a/tests/eibc_invariant_test.go +++ b/tests/eibc_invariant_test.go @@ -300,14 +300,14 @@ func TestEIBCInvariant_EVM(t *testing.T) { require.NoError(t, err) // fulfill 2 demand order - _, err = dymension.FullfillDemandOrder(ctx, eibcEvents[1].ID, marketMakerAddr, eibcFee) + _, err = dymension.FullfillDemandOrder(ctx, eibcEvents[1].OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) // if eibcEvent != nil { // fmt.Println("After order fulfillment:", eibcEvent) // } - _, err = dymension.FullfillDemandOrder(ctx, eibcEvents[2].ID, marketMakerAddr, eibcFee) + _, err = dymension.FullfillDemandOrder(ctx, eibcEvents[2].OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) // eibcEvent = getEibcEventFromTx(t, dymension, txhash) // if eibcEvent != nil { @@ -648,14 +648,14 @@ func TestEIBCInvariant_Wasm(t *testing.T) { require.NoError(t, err) // fulfill 2 demand order - _, err = dymension.FullfillDemandOrder(ctx, eibcEvents[1].ID, marketMakerAddr, eibcFee) + _, err = dymension.FullfillDemandOrder(ctx, eibcEvents[1].OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) // if eibcEvent != nil { // fmt.Println("After order fulfillment:", eibcEvent) // } - _, err = dymension.FullfillDemandOrder(ctx, eibcEvents[2].ID, marketMakerAddr, eibcFee) + _, err = dymension.FullfillDemandOrder(ctx, eibcEvents[2].OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) // eibcEvent = getEibcEventFromTx(t, dymension, txhash) // if eibcEvent != nil { diff --git a/tests/eibc_nobalance_test.go b/tests/eibc_nobalance_test.go index 820cc932..9414a90d 100644 --- a/tests/eibc_nobalance_test.go +++ b/tests/eibc_nobalance_test.go @@ -39,6 +39,8 @@ func TestEIBCNoBalanceToFulfillOrder_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides @@ -199,7 +201,7 @@ func TestEIBCNoBalanceToFulfillOrder_EVM(t *testing.T) { fmt.Println("Event:", eibcEvents[0]) // attempt to fulfill demand order without having required denom balance - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[0].ID, marketMakerAddr, eibcFee) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[0].OrderId, marketMakerAddr, eibcFee) require.NoError(t, err) fmt.Println(txhash) txData, err := dymension.GetTransaction(txhash) diff --git a/tests/eibc_timeout_test.go b/tests/eibc_timeout_test.go index 1b62d5f4..5eb34945 100644 --- a/tests/eibc_timeout_test.go +++ b/tests/eibc_timeout_test.go @@ -38,6 +38,8 @@ func TestEIBCTimeoutDymToRollapp_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides @@ -230,7 +232,7 @@ func TestEIBCTimeoutDymToRollapp_EVM(t *testing.T) { require.Equal(t, eibcEvents[0].Fee, fmt.Sprintf("%s%s", globalEIbcFee, dymension.Config().Denom)) // fulfill demand order - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[0].ID, marketMakerAddr, globalEIbcFee) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[0].OrderId, marketMakerAddr, globalEIbcFee) require.NoError(t, err) fmt.Println(txhash) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) @@ -624,7 +626,7 @@ func TestEIBCTimeoutFulFillDymToRollapp_EVM(t *testing.T) { require.Equal(t, eibcEvents[0].Fee, fmt.Sprintf("%s%s", globalEIbcFee, gaiaIBCDenom)) // fulfill demand order - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[0].ID, marketMakerAddr, globalEIbcFee) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[0].OrderId, marketMakerAddr, globalEIbcFee) require.NoError(t, err) fmt.Println(txhash) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) @@ -1011,7 +1013,7 @@ func TestEIBCTimeoutFulFillDymToRollapp_Wasm(t *testing.T) { require.NoError(t, err) // fulfill demand order - txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[0].ID, marketMakerAddr, globalEIbcFee) + txhash, err := dymension.FullfillDemandOrder(ctx, eibcEvents[0].OrderId, marketMakerAddr, globalEIbcFee) // Pushing event assertion later in the test so that fulfill demand order can always be fulfilled fmt.Println("Event:", eibcEvents[0]) require.Equal(t, eibcEvents[0].Price, fmt.Sprintf("%s%s", transferAmountWithoutFee, gaiaIBCDenom)) diff --git a/tests/frozen_test.go b/tests/frozen_test.go index 4ecad76f..84e16234 100644 --- a/tests/frozen_test.go +++ b/tests/frozen_test.go @@ -1186,6 +1186,8 @@ func TestOtherRollappNotAffected_Wasm(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides @@ -1198,6 +1200,8 @@ func TestOtherRollappNotAffected_Wasm(t *testing.T) { dymintTomlOverrides2["max_proof_time"] = "500ms" dymintTomlOverrides2["max_idle_time"] = "3s" dymintTomlOverrides2["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides2["config/dymint.toml"] = dymintTomlOverrides2 // Create chain factory with dymension diff --git a/tests/fullnode_sync_block_sync_test.go b/tests/fullnode_sync_block_sync_test.go index 5781c994..3047d212 100644 --- a/tests/fullnode_sync_block_sync_test.go +++ b/tests/fullnode_sync_block_sync_test.go @@ -43,6 +43,7 @@ func TestSync_BlockSync_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "3600s" + dymintTomlOverrides["batch_submit_time"] = "20s" dymintTomlOverrides["block_time"] = "20ms" dymintTomlOverrides["p2p_gossip_cache_size"] = "1" dymintTomlOverrides["p2p_blocksync_enabled"] = "true" @@ -66,12 +67,12 @@ func TestSync_BlockSync_EVM(t *testing.T) { numRollAppVals := 1 nodeStore := "/home/celestia/light" p2pNetwork := "mocha-4" - coreIp := "celestia-testnet-consensus.itrocket.net" + coreIp := "rpc-mocha.pops.one" url := "https://api-mocha.celenium.io/v1/block/count" headerKey := "User-Agent" headerValue := "Apidog/1.0.0 (https://apidog.com)" - rpcEndpoint := "http://celestia-testnet-consensus.itrocket.net:26657" + rpcEndpoint := "http://rpc-mocha.pops.one:26657" cf := test.NewBuiltinChainFactory(zaptest.NewLogger(t), []*test.ChainSpec{ { @@ -138,12 +139,6 @@ func TestSync_BlockSync_EVM(t *testing.T) { err = testutil.WaitForBlocks(ctx, 3, celestia) require.NoError(t, err) - // Change the file permissions - command := []string{"chmod", "-R", "777", "/home/celestia/light/config.toml"} - - _, _, err = celestia.Exec(ctx, command, nil) - require.NoError(t, err) - file, err := os.Open("/tmp/celestia/light/config.toml") require.NoError(t, err) defer file.Close() @@ -186,7 +181,7 @@ func TestSync_BlockSync_EVM(t *testing.T) { // Create an exec instance execConfig := types.ExecConfig{ - Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.accname", "validator"}), // Replace with your command and arguments + Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.keyname", "validator"}), // Replace with your command and arguments } execIDResp, err := client.ContainerExecCreate(ctx, containerID, execConfig) @@ -291,12 +286,6 @@ func TestSync_BlockSync_EVM(t *testing.T) { rollapp1HomeDir := strings.Split(rollapp1.HomeDir(), "/") rollapp1FolderName := rollapp1HomeDir[len(rollapp1HomeDir)-1] - // Change the file permissions - command = []string{"chmod", "-R", "777", fmt.Sprintf("/var/cosmos-chain/%s/config/dymint.toml", rollapp1FolderName)} - - _, _, err = celestia.Exec(ctx, command, nil) - require.NoError(t, err) - file, err = os.Open(fmt.Sprintf("/tmp/%s/config/dymint.toml", rollapp1FolderName)) require.NoError(t, err) defer file.Close() @@ -321,16 +310,7 @@ func TestSync_BlockSync_EVM(t *testing.T) { _, err = file.Write([]byte(output)) require.NoError(t, err) - // update dymint.toml for full node to connect with Celestia DA - - fnHomeDir := strings.Split(rollapp1.FullNodes[0].HomeDir(), "/") - fnFolderName := fnHomeDir[len(fnHomeDir)-1] - command = []string{"chmod", "-R", "777", fmt.Sprintf("/var/cosmos-chain/%s/config/dymint.toml", fnFolderName)} - - _, _, err = celestia.Exec(ctx, command, nil) - require.NoError(t, err) - - file, err = os.Open(fmt.Sprintf("/tmp/%s/config/dymint.toml", fnFolderName)) + file, err = os.Open(fmt.Sprintf("/tmp/%s/config/dymint.toml", rollapp1FolderName)) require.NoError(t, err) defer file.Close() @@ -351,7 +331,7 @@ func TestSync_BlockSync_EVM(t *testing.T) { } output = strings.Join(lines, "\n") - file, err = os.Create(fmt.Sprintf("/tmp/%s/config/dymint.toml", fnFolderName)) + file, err = os.Create(fmt.Sprintf("/tmp/%s/config/dymint.toml", rollapp1FolderName)) require.NoError(t, err) defer file.Close() @@ -405,6 +385,7 @@ func TestSync_BlockSync_fn_disconnect_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "3600s" + dymintTomlOverrides["batch_submit_time"] = "20s" dymintTomlOverrides["block_time"] = "20ms" dymintTomlOverrides["p2p_gossip_cache_size"] = "1" dymintTomlOverrides["p2p_blocksync_enabled"] = "true" @@ -428,12 +409,12 @@ func TestSync_BlockSync_fn_disconnect_EVM(t *testing.T) { numRollAppVals := 1 nodeStore := "/home/celestia/light" p2pNetwork := "mocha-4" - coreIp := "celestia-testnet-consensus.itrocket.net" + coreIp := "rpc-mocha.pops.one" url := "https://api-mocha.celenium.io/v1/block/count" headerKey := "User-Agent" headerValue := "Apidog/1.0.0 (https://apidog.com)" - rpcEndpoint := "http://celestia-testnet-consensus.itrocket.net:26657" + rpcEndpoint := "http://rpc-mocha.pops.one:26657" cf := test.NewBuiltinChainFactory(zaptest.NewLogger(t), []*test.ChainSpec{ { @@ -500,12 +481,6 @@ func TestSync_BlockSync_fn_disconnect_EVM(t *testing.T) { err = testutil.WaitForBlocks(ctx, 3, celestia) require.NoError(t, err) - // Change the file permissions - command := []string{"chmod", "-R", "777", "/home/celestia/light/config.toml"} - - _, _, err = celestia.Exec(ctx, command, nil) - require.NoError(t, err) - file, err := os.Open("/tmp/celestia/light/config.toml") require.NoError(t, err) defer file.Close() @@ -548,7 +523,7 @@ func TestSync_BlockSync_fn_disconnect_EVM(t *testing.T) { // Create an exec instance execConfig := types.ExecConfig{ - Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.accname", "validator"}), + Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.keyname", "validator"}), } execIDResp, err := client.ContainerExecCreate(ctx, containerID, execConfig) @@ -653,12 +628,6 @@ func TestSync_BlockSync_fn_disconnect_EVM(t *testing.T) { rollapp1HomeDir := strings.Split(rollapp1.HomeDir(), "/") rollapp1FolderName := rollapp1HomeDir[len(rollapp1HomeDir)-1] - // Change the file permissions - command = []string{"chmod", "-R", "777", fmt.Sprintf("/var/cosmos-chain/%s/config/dymint.toml", rollapp1FolderName)} - - _, _, err = celestia.Exec(ctx, command, nil) - require.NoError(t, err) - file, err = os.Open(fmt.Sprintf("/tmp/%s/config/dymint.toml", rollapp1FolderName)) require.NoError(t, err) defer file.Close() @@ -687,11 +656,6 @@ func TestSync_BlockSync_fn_disconnect_EVM(t *testing.T) { fnHomeDir := strings.Split(rollapp1.FullNodes[0].HomeDir(), "/") fnFolderName := fnHomeDir[len(fnHomeDir)-1] - command = []string{"chmod", "-R", "777", fmt.Sprintf("/var/cosmos-chain/%s/config/dymint.toml", fnFolderName)} - - _, _, err = celestia.Exec(ctx, command, nil) - require.NoError(t, err) - file, err = os.Open(fmt.Sprintf("/tmp/%s/config/dymint.toml", fnFolderName)) require.NoError(t, err) defer file.Close() diff --git a/tests/fullnode_sync_gossip_test.go b/tests/fullnode_sync_gossip_test.go index 72324761..7e0aa48f 100644 --- a/tests/fullnode_sync_gossip_test.go +++ b/tests/fullnode_sync_gossip_test.go @@ -42,7 +42,9 @@ func TestSync_Celes_Rt_Gossip_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "200ms" dymintTomlOverrides["max_proof_time"] = "150ms" dymintTomlOverrides["batch_submit_max_time"] = "5s" + dymintTomlOverrides["batch_submit_time"] = "20s" dymintTomlOverrides["block_time"] = "190ms" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides1 := make(map[string]any) configTomlOverrides1 := make(testutil.Toml) @@ -60,12 +62,12 @@ func TestSync_Celes_Rt_Gossip_EVM(t *testing.T) { numRollAppVals := 1 nodeStore := "/home/celestia/light" p2pNetwork := "mocha-4" - coreIp := "celestia-testnet-consensus.itrocket.net" + coreIp := "rpc-mocha.pops.one" url := "https://api-mocha.celenium.io/v1/block/count" headerKey := "User-Agent" headerValue := "Apidog/1.0.0 (https://apidog.com)" - rpcEndpoint := "http://celestia-testnet-consensus.itrocket.net:26657" + rpcEndpoint := "http://rpc-mocha.pops.one:26657" cf := test.NewBuiltinChainFactory(zaptest.NewLogger(t), []*test.ChainSpec{ { @@ -132,12 +134,6 @@ func TestSync_Celes_Rt_Gossip_EVM(t *testing.T) { err = testutil.WaitForBlocks(ctx, 3, celestia) require.NoError(t, err) - // Change the file permissions - command := []string{"chmod", "-R", "777", "/home/celestia/light/config.toml"} - - _, _, err = celestia.Exec(ctx, command, nil) - require.NoError(t, err) - file, err := os.Open("/tmp/celestia/light/config.toml") require.NoError(t, err) defer file.Close() @@ -180,7 +176,7 @@ func TestSync_Celes_Rt_Gossip_EVM(t *testing.T) { // Create an exec instance execConfig := types.ExecConfig{ - Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.accname", "validator"}), // Replace with your command and arguments + Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.keyname", "validator"}), // Replace with your command and arguments } execIDResp, err := client.ContainerExecCreate(ctx, containerID, execConfig) @@ -287,12 +283,6 @@ func TestSync_Celes_Rt_Gossip_EVM(t *testing.T) { rollapp1HomeDir := strings.Split(rollapp1.HomeDir(), "/") rollapp1FolderName := rollapp1HomeDir[len(rollapp1HomeDir)-1] - // Change the file permissions - command = []string{"chmod", "-R", "777", fmt.Sprintf("/var/cosmos-chain/%s/config/dymint.toml", rollapp1FolderName)} - - _, _, err = celestia.Exec(ctx, command, nil) - require.NoError(t, err) - file, err = os.Open(fmt.Sprintf("/tmp/%s/config/dymint.toml", rollapp1FolderName)) require.NoError(t, err) defer file.Close() @@ -368,7 +358,9 @@ func TestSync_Celes_Rt_Gossip_Wasm(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "200ms" dymintTomlOverrides["max_proof_time"] = "150ms" dymintTomlOverrides["batch_submit_max_time"] = "80s" + dymintTomlOverrides["batch_submit_time"] = "20s" dymintTomlOverrides["block_time"] = "190ms" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides1 := make(map[string]any) configTomlOverrides1 := make(testutil.Toml) @@ -386,12 +378,12 @@ func TestSync_Celes_Rt_Gossip_Wasm(t *testing.T) { numCelestiaFn := 0 nodeStore := "/home/celestia/light" p2pNetwork := "mocha-4" - coreIp := "celestia-testnet-consensus.itrocket.net" + coreIp := "rpc-mocha.pops.one" url := "https://api-mocha.celenium.io/v1/block/count" headerKey := "User-Agent" headerValue := "Apidog/1.0.0 (https://apidog.com)" - rpcEndpoint := "http://celestia-testnet-consensus.itrocket.net:26657" + rpcEndpoint := "http://rpc-mocha.pops.one:26657" cf := test.NewBuiltinChainFactory(zaptest.NewLogger(t), []*test.ChainSpec{ { @@ -458,12 +450,6 @@ func TestSync_Celes_Rt_Gossip_Wasm(t *testing.T) { err = testutil.WaitForBlocks(ctx, 3, celestia) require.NoError(t, err) - // Change the file permissions - command := []string{"chmod", "-R", "777", "/home/celestia/light/config.toml"} - - _, _, err = celestia.Exec(ctx, command, nil) - require.NoError(t, err) - file, err := os.Open("/tmp/celestia/light/config.toml") require.NoError(t, err) defer file.Close() @@ -508,7 +494,7 @@ func TestSync_Celes_Rt_Gossip_Wasm(t *testing.T) { // Create an exec instance execConfig := types.ExecConfig{ - Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.accname", "validator"}), // Replace with your command and arguments + Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.keyname", "validator"}), // Replace with your command and arguments } execIDResp, err := client.ContainerExecCreate(ctx, containerID, execConfig) @@ -650,7 +636,9 @@ func TestSync_Sqc_Disconnect_Gossip_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "200ms" dymintTomlOverrides["max_proof_time"] = "150ms" dymintTomlOverrides["batch_submit_max_time"] = "5s" + dymintTomlOverrides["batch_submit_time"] = "5s" dymintTomlOverrides["block_time"] = "190ms" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides1 := make(map[string]any) configTomlOverrides1 := make(testutil.Toml) @@ -668,12 +656,12 @@ func TestSync_Sqc_Disconnect_Gossip_EVM(t *testing.T) { numRollAppVals := 1 nodeStore := "/home/celestia/light" p2pNetwork := "mocha-4" - coreIp := "celestia-testnet-consensus.itrocket.net" + coreIp := "rpc-mocha.pops.one" url := "https://api-mocha.celenium.io/v1/block/count" headerKey := "User-Agent" headerValue := "Apidog/1.0.0 (https://apidog.com)" - rpcEndpoint := "http://celestia-testnet-consensus.itrocket.net:26657" + rpcEndpoint := "http://rpc-mocha.pops.one:26657" cf := test.NewBuiltinChainFactory(zaptest.NewLogger(t), []*test.ChainSpec{ { @@ -740,12 +728,6 @@ func TestSync_Sqc_Disconnect_Gossip_EVM(t *testing.T) { err = testutil.WaitForBlocks(ctx, 3, celestia) require.NoError(t, err) - // Change the file permissions - command := []string{"chmod", "-R", "777", "/home/celestia/light/config.toml"} - - _, _, err = celestia.Exec(ctx, command, nil) - require.NoError(t, err) - file, err := os.Open("/tmp/celestia/light/config.toml") require.NoError(t, err) defer file.Close() @@ -788,7 +770,7 @@ func TestSync_Sqc_Disconnect_Gossip_EVM(t *testing.T) { // Create an exec instance execConfig := types.ExecConfig{ - Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.accname", "validator"}), // Replace with your command and arguments + Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.keyname", "validator"}), // Replace with your command and arguments } execIDResp, err := client.ContainerExecCreate(ctx, containerID, execConfig) @@ -895,12 +877,6 @@ func TestSync_Sqc_Disconnect_Gossip_EVM(t *testing.T) { rollapp1HomeDir := strings.Split(rollapp1.HomeDir(), "/") rollapp1FolderName := rollapp1HomeDir[len(rollapp1HomeDir)-1] - // Change the file permissions - command = []string{"chmod", "-R", "777", fmt.Sprintf("/var/cosmos-chain/%s/config/dymint.toml", rollapp1FolderName)} - - _, _, err = celestia.Exec(ctx, command, nil) - require.NoError(t, err) - file, err = os.Open(fmt.Sprintf("/tmp/%s/config/dymint.toml", rollapp1FolderName)) require.NoError(t, err) defer file.Close() @@ -1009,7 +985,9 @@ func TestSync_Sqc_Disconnect_Gossip_Wasm(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "200ms" dymintTomlOverrides["max_proof_time"] = "150ms" dymintTomlOverrides["batch_submit_max_time"] = "5s" + dymintTomlOverrides["batch_submit_time"] = "5s" dymintTomlOverrides["block_time"] = "190ms" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides1 := make(map[string]any) configTomlOverrides1 := make(testutil.Toml) @@ -1027,12 +1005,12 @@ func TestSync_Sqc_Disconnect_Gossip_Wasm(t *testing.T) { numRollAppVals := 1 nodeStore := "/home/celestia/light" p2pNetwork := "mocha-4" - coreIp := "celestia-testnet-consensus.itrocket.net" + coreIp := "rpc-mocha.pops.one" url := "https://api-mocha.celenium.io/v1/block/count" headerKey := "User-Agent" headerValue := "Apidog/1.0.0 (https://apidog.com)" - rpcEndpoint := "http://celestia-testnet-consensus.itrocket.net:26657" + rpcEndpoint := "http://rpc-mocha.pops.one:26657" cf := test.NewBuiltinChainFactory(zaptest.NewLogger(t), []*test.ChainSpec{ { @@ -1099,12 +1077,6 @@ func TestSync_Sqc_Disconnect_Gossip_Wasm(t *testing.T) { err = testutil.WaitForBlocks(ctx, 3, celestia) require.NoError(t, err) - // Change the file permissions - command := []string{"chmod", "-R", "777", "/home/celestia/light/config.toml"} - - _, _, err = celestia.Exec(ctx, command, nil) - require.NoError(t, err) - file, err := os.Open("/tmp/celestia/light/config.toml") require.NoError(t, err) defer file.Close() @@ -1147,7 +1119,7 @@ func TestSync_Sqc_Disconnect_Gossip_Wasm(t *testing.T) { // Create an exec instance execConfig := types.ExecConfig{ - Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.accname", "validator"}), // Replace with your command and arguments + Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.keyname", "validator"}), // Replace with your command and arguments } execIDResp, err := client.ContainerExecCreate(ctx, containerID, execConfig) @@ -1254,12 +1226,6 @@ func TestSync_Sqc_Disconnect_Gossip_Wasm(t *testing.T) { rollapp1HomeDir := strings.Split(rollapp1.HomeDir(), "/") rollapp1FolderName := rollapp1HomeDir[len(rollapp1HomeDir)-1] - // Change the file permissions - command = []string{"chmod", "-R", "777", fmt.Sprintf("/var/cosmos-chain/%s/config/dymint.toml", rollapp1FolderName)} - - _, _, err = celestia.Exec(ctx, command, nil) - require.NoError(t, err) - file, err = os.Open(fmt.Sprintf("/tmp/%s/config/dymint.toml", rollapp1FolderName)) require.NoError(t, err) defer file.Close() @@ -1368,7 +1334,9 @@ func TestSync_Fullnode_Disconnect_Gossip_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "200ms" dymintTomlOverrides["max_proof_time"] = "150ms" dymintTomlOverrides["batch_submit_max_time"] = "5s" + dymintTomlOverrides["batch_submit_time"] = "5s" dymintTomlOverrides["block_time"] = "190ms" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides1 := make(map[string]any) configTomlOverrides1 := make(testutil.Toml) @@ -1386,12 +1354,12 @@ func TestSync_Fullnode_Disconnect_Gossip_EVM(t *testing.T) { numRollAppVals := 1 nodeStore := "/home/celestia/light" p2pNetwork := "mocha-4" - coreIp := "celestia-testnet-consensus.itrocket.net" + coreIp := "rpc-mocha.pops.one" url := "https://api-mocha.celenium.io/v1/block/count" headerKey := "User-Agent" headerValue := "Apidog/1.0.0 (https://apidog.com)" - rpcEndpoint := "http://celestia-testnet-consensus.itrocket.net:26657" + rpcEndpoint := "http://rpc-mocha.pops.one:26657" cf := test.NewBuiltinChainFactory(zaptest.NewLogger(t), []*test.ChainSpec{ { @@ -1458,12 +1426,6 @@ func TestSync_Fullnode_Disconnect_Gossip_EVM(t *testing.T) { err = testutil.WaitForBlocks(ctx, 3, celestia) require.NoError(t, err) - // Change the file permissions - command := []string{"chmod", "-R", "777", "/home/celestia/light/config.toml"} - - _, _, err = celestia.Exec(ctx, command, nil) - require.NoError(t, err) - file, err := os.Open("/tmp/celestia/light/config.toml") require.NoError(t, err) defer file.Close() @@ -1506,7 +1468,7 @@ func TestSync_Fullnode_Disconnect_Gossip_EVM(t *testing.T) { // Create an exec instance execConfig := types.ExecConfig{ - Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.accname", "validator"}), // Replace with your command and arguments + Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.keyname", "validator"}), // Replace with your command and arguments } execIDResp, err := client.ContainerExecCreate(ctx, containerID, execConfig) @@ -1613,12 +1575,6 @@ func TestSync_Fullnode_Disconnect_Gossip_EVM(t *testing.T) { rollapp1HomeDir := strings.Split(rollapp1.HomeDir(), "/") rollapp1FolderName := rollapp1HomeDir[len(rollapp1HomeDir)-1] - // Change the file permissions - command = []string{"chmod", "-R", "777", fmt.Sprintf("/var/cosmos-chain/%s/config/dymint.toml", rollapp1FolderName)} - - _, _, err = celestia.Exec(ctx, command, nil) - require.NoError(t, err) - file, err = os.Open(fmt.Sprintf("/tmp/%s/config/dymint.toml", rollapp1FolderName)) require.NoError(t, err) defer file.Close() @@ -1724,7 +1680,9 @@ func TestSync_Fullnode_Disconnect_Gossip_Wasm(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "200ms" dymintTomlOverrides["max_proof_time"] = "150ms" dymintTomlOverrides["batch_submit_max_time"] = "5s" + dymintTomlOverrides["batch_submit_time"] = "5s" dymintTomlOverrides["block_time"] = "190ms" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides1 := make(map[string]any) configTomlOverrides1 := make(testutil.Toml) @@ -1742,12 +1700,12 @@ func TestSync_Fullnode_Disconnect_Gossip_Wasm(t *testing.T) { numRollAppVals := 1 nodeStore := "/home/celestia/light" p2pNetwork := "mocha-4" - coreIp := "celestia-testnet-consensus.itrocket.net" + coreIp := "rpc-mocha.pops.one" url := "https://api-mocha.celenium.io/v1/block/count" headerKey := "User-Agent" headerValue := "Apidog/1.0.0 (https://apidog.com)" - rpcEndpoint := "http://celestia-testnet-consensus.itrocket.net:26657" + rpcEndpoint := "http://rpc-mocha.pops.one:26657" cf := test.NewBuiltinChainFactory(zaptest.NewLogger(t), []*test.ChainSpec{ { @@ -1814,12 +1772,6 @@ func TestSync_Fullnode_Disconnect_Gossip_Wasm(t *testing.T) { err = testutil.WaitForBlocks(ctx, 3, celestia) require.NoError(t, err) - // Change the file permissions - command := []string{"chmod", "-R", "777", "/home/celestia/light/config.toml"} - - _, _, err = celestia.Exec(ctx, command, nil) - require.NoError(t, err) - file, err := os.Open("/tmp/celestia/light/config.toml") require.NoError(t, err) defer file.Close() @@ -1862,7 +1814,7 @@ func TestSync_Fullnode_Disconnect_Gossip_Wasm(t *testing.T) { // Create an exec instance execConfig := types.ExecConfig{ - Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.accname", "validator"}), // Replace with your command and arguments + Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.keyname", "validator"}), // Replace with your command and arguments } execIDResp, err := client.ContainerExecCreate(ctx, containerID, execConfig) @@ -1969,12 +1921,6 @@ func TestSync_Fullnode_Disconnect_Gossip_Wasm(t *testing.T) { rollapp1HomeDir := strings.Split(rollapp1.HomeDir(), "/") rollapp1FolderName := rollapp1HomeDir[len(rollapp1HomeDir)-1] - // Change the file permissions - command = []string{"chmod", "-R", "777", fmt.Sprintf("/var/cosmos-chain/%s/config/dymint.toml", rollapp1FolderName)} - - _, _, err = celestia.Exec(ctx, command, nil) - require.NoError(t, err) - file, err = os.Open(fmt.Sprintf("/tmp/%s/config/dymint.toml", rollapp1FolderName)) require.NoError(t, err) defer file.Close() diff --git a/tests/fullnode_sync_test.go b/tests/fullnode_sync_test.go index 3ac6ef29..5c0a893f 100644 --- a/tests/fullnode_sync_test.go +++ b/tests/fullnode_sync_test.go @@ -15,6 +15,7 @@ import ( "go.uber.org/zap/zaptest" test "github.com/decentrio/rollup-e2e-testing" + "github.com/decentrio/rollup-e2e-testing/cosmos" "github.com/decentrio/rollup-e2e-testing/cosmos/hub/celes_hub" "github.com/decentrio/rollup-e2e-testing/cosmos/hub/dym_hub" "github.com/decentrio/rollup-e2e-testing/cosmos/rollapp/dym_rollapp" @@ -194,6 +195,7 @@ func TestFullnodeSync_Wasm(t *testing.T) { dymintTomlOverrides["empty_blocks_max_time"] = "3s" dymintTomlOverrides["da_layer"] = "grpc" dymintTomlOverrides["da_config"] = "{\"host\":\"host.docker.internal\",\"port\": 7980}" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension @@ -317,6 +319,8 @@ func TestFullnodeSync_Celestia_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "80s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides1 := make(map[string]any) configTomlOverrides1 := make(testutil.Toml) @@ -327,6 +331,14 @@ func TestFullnodeSync_Celestia_EVM(t *testing.T) { configFileOverrides1["config/config.toml"] = configTomlOverrides1 + modifyEVMGenesisKV := append( + rollappEVMGenesisKV, + cosmos.GenesisKV{ + Key: "app_state.rollappparams.params.da", + Value: "celestia", + }, + ) + // Create chain factory with dymension numHubVals := 1 numHubFullNodes := 1 @@ -335,14 +347,14 @@ func TestFullnodeSync_Celestia_EVM(t *testing.T) { numRollAppVals := 1 nodeStore := "/home/celestia/light" p2pNetwork := "mocha-4" - coreIp := "celestia-testnet-consensus.itrocket.net" + coreIp := "mocha-4-consensus.mesa.newmetric.xyz" // trustedHash := "\"A62DD37EDF3DFF5A7383C6B5AA2AC619D1F8C8FEB7BA07730E50BBAAC8F2FF0C\"" // sampleFrom := 2395649 url := "https://api-mocha.celenium.io/v1/block/count" headerKey := "User-Agent" headerValue := "Apidog/1.0.0 (https://apidog.com)" - rpcEndpoint := "http://celestia-testnet-consensus.itrocket.net:26657" + rpcEndpoint := "http://rpc-mocha.pops.one:26657" cf := test.NewBuiltinChainFactory(zaptest.NewLogger(t), []*test.ChainSpec{ { @@ -398,25 +410,18 @@ func TestFullnodeSync_Celestia_EVM(t *testing.T) { }, nil, "", nil) // require.NoError(t, err) - // validator, err := celestia.Validators[0].AccountKeyBech32(ctx, "validator") - // require.NoError(t, err) + validator, err := celestia.Validators[0].AccountKeyBech32(ctx, "validator") + require.NoError(t, err) // Get fund for submit blob - // GetFaucet("http://18.184.170.181:3000/api/get-tia", validator) - // err = testutil.WaitForBlocks(ctx, 10, celestia) - // require.NoError(t, err) + GetFaucet("http://18.184.170.181:3000/api/get-tia", validator) - err = celestia.GetNode().InitCelestiaDaLightNode(ctx, nodeStore, p2pNetwork, nil) - require.NoError(t, err) + time.Sleep(30 * time.Second) - err = testutil.WaitForBlocks(ctx, 3, celestia) + err = celestia.GetNode().InitCelestiaDaLightNode(ctx, nodeStore, p2pNetwork, nil) require.NoError(t, err) - // Change the file permissions - command := []string{"chmod", "-R", "777", "/home/celestia/light/config.toml"} - - _, _, err = celestia.Exec(ctx, command, nil) - require.NoError(t, err) + time.Sleep(30 * time.Second) file, err := os.Open("/tmp/celestia/light/config.toml") require.NoError(t, err) @@ -460,7 +465,7 @@ func TestFullnodeSync_Celestia_EVM(t *testing.T) { // Create an exec instance execConfig := types.ExecConfig{ - Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.accname", "validator"}), // Replace with your command and arguments + Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.keyname", "validator"}), // Replace with your command and arguments } execIDResp, err := client.ContainerExecCreate(ctx, containerID, execConfig) @@ -479,8 +484,7 @@ func TestFullnodeSync_Celestia_EVM(t *testing.T) { panic(err) } - err = testutil.WaitForBlocks(ctx, 10, celestia) - require.NoError(t, err) + time.Sleep(30 * time.Second) celestia_token, err := celestia.GetNode().GetAuthTokenCelestiaDaLight(ctx, p2pNetwork, nodeStore) require.NoError(t, err) @@ -513,7 +517,7 @@ func TestFullnodeSync_Celestia_EVM(t *testing.T) { TrustingPeriod: "112h", EncodingConfig: encodingConfig(), NoHostMount: false, - ModifyGenesis: modifyRollappEVMGenesis(rollappEVMGenesisKV), + ModifyGenesis: modifyRollappEVMGenesis(modifyEVMGenesisKV), ConfigFileOverrides: configFileOverrides, }, NumValidators: &numRollAppVals, @@ -592,6 +596,8 @@ func TestFullnodeSync_Celestia_Wasm(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "80s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides1 := make(map[string]any) configTomlOverrides1 := make(testutil.Toml) @@ -610,14 +616,14 @@ func TestFullnodeSync_Celestia_Wasm(t *testing.T) { numRollAppVals := 1 nodeStore := "/home/celestia/light" p2pNetwork := "mocha-4" - coreIp := "celestia-testnet-consensus.itrocket.net" + coreIp := "rpc-mocha.pops.one" // trustedHash := "\"A62DD37EDF3DFF5A7383C6B5AA2AC619D1F8C8FEB7BA07730E50BBAAC8F2FF0C\"" // sampleFrom := 2395649 url := "https://api-mocha.celenium.io/v1/block/count" headerKey := "User-Agent" headerValue := "Apidog/1.0.0 (https://apidog.com)" - rpcEndpoint := "http://celestia-testnet-consensus.itrocket.net:26657" + rpcEndpoint := "http://rpc-mocha.pops.one:26657" cf := test.NewBuiltinChainFactory(zaptest.NewLogger(t), []*test.ChainSpec{ { @@ -687,12 +693,6 @@ func TestFullnodeSync_Celestia_Wasm(t *testing.T) { err = testutil.WaitForBlocks(ctx, 3, celestia) require.NoError(t, err) - // Change the file permissions - command := []string{"chmod", "-R", "777", "/home/celestia/light/config.toml"} - - _, _, err = celestia.Exec(ctx, command, nil) - require.NoError(t, err) - file, err := os.Open("/tmp/celestia/light/config.toml") require.NoError(t, err) defer file.Close() @@ -735,7 +735,7 @@ func TestFullnodeSync_Celestia_Wasm(t *testing.T) { // Create an exec instance execConfig := types.ExecConfig{ - Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.accname", "validator"}), // Replace with your command and arguments + Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.keyname", "validator"}), // Replace with your command and arguments } execIDResp, err := client.ContainerExecCreate(ctx, containerID, execConfig) diff --git a/tests/genesis_transfer_test.go b/tests/genesis_transfer_test.go index ef29a13c..7eb9e200 100644 --- a/tests/genesis_transfer_test.go +++ b/tests/genesis_transfer_test.go @@ -35,6 +35,8 @@ func TestGenesisTransferBridgeBlocking_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension @@ -184,6 +186,8 @@ func TestGenesisTransferBridgeBlocking_Wasm(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension @@ -333,6 +337,8 @@ func TestGenesisTransferConnectionBlock_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension @@ -491,6 +497,8 @@ func TestGenesisTransferConnectionBlock_Wasm(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension diff --git a/tests/ibc_pfm_test.go b/tests/ibc_pfm_test.go index a0d81891..2de4ea28 100644 --- a/tests/ibc_pfm_test.go +++ b/tests/ibc_pfm_test.go @@ -37,6 +37,7 @@ package tests // dymintTomlOverrides["max_idle_time"] = "3s" // dymintTomlOverrides["max_proof_time"] = "500ms" // dymintTomlOverrides["batch_submit_max_time"] = "100s" +// dymintTomlOverrides["batch_submit_time"] = "20s" // configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // // Create chain factory with dymension @@ -287,6 +288,7 @@ package tests // dymintTomlOverrides["max_idle_time"] = "3s" // dymintTomlOverrides["max_proof_time"] = "500ms" // dymintTomlOverrides["batch_submit_max_time"] = "100s" +// dymintTomlOverrides["batch_submit_time"] = "20s" // configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // // Create chain factory with dymension @@ -537,6 +539,7 @@ package tests // dymintTomlOverrides["max_idle_time"] = "3s" // dymintTomlOverrides["max_proof_time"] = "500ms" // dymintTomlOverrides["batch_submit_max_time"] = "100s" +// dymintTomlOverrides["batch_submit_time"] = "20s" // configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // // Create chain factory with dymension @@ -783,6 +786,7 @@ package tests // dymintTomlOverrides["max_idle_time"] = "3s" // dymintTomlOverrides["max_proof_time"] = "500ms" // dymintTomlOverrides["batch_submit_max_time"] = "100s" +// dymintTomlOverrides["batch_submit_time"] = "20s" // configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // // Create chain factory with dymension diff --git a/tests/ibc_pfm_with_grace_period_test.go b/tests/ibc_pfm_with_grace_period_test.go index 1616b409..1786baa8 100644 --- a/tests/ibc_pfm_with_grace_period_test.go +++ b/tests/ibc_pfm_with_grace_period_test.go @@ -38,6 +38,7 @@ package tests // dymintTomlOverrides["max_idle_time"] = "3s" // dymintTomlOverrides["max_proof_time"] = "500ms" // dymintTomlOverrides["batch_submit_max_time"] = "100s" +// dymintTomlOverrides["batch_submit_time"] = "20s" // modifyGenesisKV := append( // dymensionGenesisKV, @@ -333,6 +334,7 @@ package tests // dymintTomlOverrides["max_idle_time"] = "3s" // dymintTomlOverrides["max_proof_time"] = "500ms" // dymintTomlOverrides["batch_submit_max_time"] = "100s" +// dymintTomlOverrides["batch_submit_time"] = "20s" // modifyGenesisKV := append(dymensionGenesisKV, // cosmos.GenesisKV{ diff --git a/tests/ibc_timeout_test.go b/tests/ibc_timeout_test.go index fd03924c..8f554a86 100644 --- a/tests/ibc_timeout_test.go +++ b/tests/ibc_timeout_test.go @@ -38,6 +38,8 @@ func TestIBCTransferTimeout_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "30s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides @@ -286,6 +288,8 @@ func TestIBCTransferTimeout_Wasm(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "30s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides diff --git a/tests/ibc_transfer_test.go b/tests/ibc_transfer_test.go index af810bc6..0d5ce22a 100644 --- a/tests/ibc_transfer_test.go +++ b/tests/ibc_transfer_test.go @@ -34,6 +34,8 @@ func TestSpinUp(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension @@ -118,6 +120,8 @@ func TestIBCTransferSuccess_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension @@ -291,6 +295,7 @@ func TestIBCTransferSuccess_Wasm(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension @@ -462,6 +467,7 @@ func TestGenesisIBCTransferReservedMemo_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension @@ -618,6 +624,8 @@ func TestGenesisIBCTransferReservedMemo_Wasm(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" + dymintTomlOverrides["batch_submit_time"] = "20s" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension diff --git a/tests/rollapp_upgrade_test.go b/tests/rollapp_upgrade_test.go index a2124c9f..16ed23e6 100644 --- a/tests/rollapp_upgrade_test.go +++ b/tests/rollapp_upgrade_test.go @@ -36,6 +36,8 @@ func TestRollappUpgradeNonStateBreaking_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension @@ -242,6 +244,8 @@ func TestRollappUpgradeNonStateBreaking_Wasm(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension @@ -451,6 +455,8 @@ func TestRollapp_EVM_Upgrade(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension @@ -703,6 +709,8 @@ func TestRollapp_Wasm_Upgrade(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides // Create chain factory with dymension diff --git a/tests/sequencer_invariant_test.go b/tests/sequencer_invariant_test.go index d171b73e..f286e782 100644 --- a/tests/sequencer_invariant_test.go +++ b/tests/sequencer_invariant_test.go @@ -201,14 +201,14 @@ func TestSequencerInvariant_EVM(t *testing.T) { rollappUserAddr := rollappUser.FormattedAddress() command = []string{} - command = append(command, "sequencer", "create-sequencer", string(pub1), rollapp1.Config().ChainID, rollapp1.GetSequencerKeyDir()+"/metadata_sequencer.json", "1000000000adym", + command = append(command, "sequencer", "create-sequencer", string(pub1), rollapp1.Config().ChainID, "1000000000adym", rollapp1.GetSequencerKeyDir()+"/metadata_sequencer.json", "--broadcast-mode", "async") _, err = dymension.GetNode().ExecTx(ctx, sequencer1.KeyName(), command...) require.NoError(t, err) command = []string{} - command = append(command, "sequencer", "create-sequencer", string(pub2), rollapp1.Config().ChainID, rollapp1.GetSequencerKeyDir()+"/metadata_sequencer.json", "1000000000adym", + command = append(command, "sequencer", "create-sequencer", string(pub2), rollapp1.Config().ChainID, "1000000000adym", rollapp1.GetSequencerKeyDir()+"/metadata_sequencer.json", "--broadcast-mode", "async") _, err = dymension.GetNode().ExecTx(ctx, sequencer2.KeyName(), command...) @@ -467,14 +467,14 @@ func TestSequencerInvariant_Wasm(t *testing.T) { rollappUserAddr := rollappUser.FormattedAddress() command = []string{} - command = append(command, "sequencer", "create-sequencer", string(pub1), rollapp1.Config().ChainID, rollapp1.GetSequencerKeyDir()+"/metadata_sequencer.json", "1000000000adym", + command = append(command, "sequencer", "create-sequencer", string(pub1), rollapp1.Config().ChainID, "1000000000adym", rollapp1.GetSequencerKeyDir()+"/metadata_sequencer.json", "--broadcast-mode", "async") _, err = dymension.GetNode().ExecTx(ctx, sequencer1.KeyName(), command...) require.NoError(t, err) command = []string{} - command = append(command, "sequencer", "create-sequencer", string(pub2), rollapp1.Config().ChainID, rollapp1.GetSequencerKeyDir()+"/metadata_sequencer.json", "1000000000adym", + command = append(command, "sequencer", "create-sequencer", string(pub2), rollapp1.Config().ChainID, "1000000000adym", rollapp1.GetSequencerKeyDir()+"/metadata_sequencer.json", "--broadcast-mode", "async") _, err = dymension.GetNode().ExecTx(ctx, sequencer2.KeyName(), command...) diff --git a/tests/sequencer_test.go b/tests/sequencer_test.go index c054c2d0..1f65e5db 100644 --- a/tests/sequencer_test.go +++ b/tests/sequencer_test.go @@ -42,6 +42,8 @@ func TestSequencerCelestia_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "80s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides1 := make(map[string]any) configTomlOverrides1 := make(testutil.Toml) @@ -59,14 +61,14 @@ func TestSequencerCelestia_EVM(t *testing.T) { numRollAppVals := 1 nodeStore := "/home/celestia/light" p2pNetwork := "mocha-4" - coreIp := "celestia-testnet-consensus.itrocket.net" + coreIp := "rpc-mocha.pops.one" // trustedHash := "\"017428B113893E854767E626BC9CF860BDF49C2AC2DF56F3C1B6582B2597AC6E\"" // sampleFrom := 2423882 url := "https://api-mocha.celenium.io/v1/block/count" headerKey := "User-Agent" headerValue := "Apidog/1.0.0 (https://apidog.com)" - rpcEndpoint := "http://celestia-testnet-consensus.itrocket.net:26657" + rpcEndpoint := "http://rpc-mocha.pops.one:26657" cf := test.NewBuiltinChainFactory(zaptest.NewLogger(t), []*test.ChainSpec{ { @@ -122,11 +124,11 @@ func TestSequencerCelestia_EVM(t *testing.T) { }, nil, "", nil) require.NoError(t, err) - // validator, err := celestia.GetNode().AccountKeyBech32(ctx, "validator") - // require.NoError(t, err) - // // Get fund for submit blob - // GetFaucet("http://18.184.170.181:3000/api/get-tia", validator) - // err = testutil.WaitForBlocks(ctx, 8, celestia) + validator, err := celestia.GetNode().AccountKeyBech32(ctx, "validator") + require.NoError(t, err) + // Get fund for submit blob + GetFaucet("http://18.184.170.181:3000/api/get-tia", validator) + err = testutil.WaitForBlocks(ctx, 8, celestia) err = celestia.GetNode().InitCelestiaDaLightNode(ctx, nodeStore, p2pNetwork, nil) require.NoError(t, err) @@ -134,12 +136,6 @@ func TestSequencerCelestia_EVM(t *testing.T) { err = testutil.WaitForBlocks(ctx, 3, celestia) require.NoError(t, err) - // Change the file permissions - command := []string{"chmod", "-R", "777", "/home/celestia/light/config.toml"} - - _, _, err = celestia.Exec(ctx, command, nil) - require.NoError(t, err) - file, err := os.Open("/tmp/celestia/light/config.toml") require.NoError(t, err) defer file.Close() @@ -184,7 +180,7 @@ func TestSequencerCelestia_EVM(t *testing.T) { // Create an exec instance execConfig := types.ExecConfig{ - Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.accname", "validator"}), // Replace with your command and arguments + Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.keyname", "validator"}), // Replace with your command and arguments } execIDResp, err := client.ContainerExecCreate(ctx, containerID, execConfig) @@ -324,7 +320,9 @@ func TestSequencerHubDisconnection_EVM(t *testing.T) { dymintTomlOverrides["settlement_gas_prices"] = "0adym" dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" - dymintTomlOverrides["batch_submit_max_time"] = "80s" + dymintTomlOverrides["batch_submit_max_time"] = "30s" + dymintTomlOverrides["batch_submit_time"] = "20s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" configFileOverrides1 := make(map[string]any) configTomlOverrides1 := make(testutil.Toml) @@ -342,14 +340,14 @@ func TestSequencerHubDisconnection_EVM(t *testing.T) { numRollAppVals := 1 nodeStore := "/home/celestia/light" p2pNetwork := "mocha-4" - coreIp := "celestia-testnet-consensus.itrocket.net" + coreIp := "rpc-mocha.pops.one" // trustedHash := "\"017428B113893E854767E626BC9CF860BDF49C2AC2DF56F3C1B6582B2597AC6E\"" // sampleFrom := 2423882 url := "https://api-mocha.celenium.io/v1/block/count" headerKey := "User-Agent" headerValue := "Apidog/1.0.0 (https://apidog.com)" - rpcEndpoint := "http://celestia-testnet-consensus.itrocket.net:26657" + rpcEndpoint := "http://rpc-mocha.pops.one:26657" cf := test.NewBuiltinChainFactory(zaptest.NewLogger(t), []*test.ChainSpec{ { @@ -405,12 +403,12 @@ func TestSequencerHubDisconnection_EVM(t *testing.T) { }, nil, "", nil) require.NoError(t, err) - // validator, err := celestia.GetNode().AccountKeyBech32(ctx, "validator") - // require.NoError(t, err) - // // Get fund for submit blob - // GetFaucet("http://18.184.170.181:3000/api/get-tia", validator) - // err = testutil.WaitForBlocks(ctx, 8, celestia) - // require.NoError(t, err) + validator, err := celestia.GetNode().AccountKeyBech32(ctx, "validator") + require.NoError(t, err) + // Get fund for submit blob + GetFaucet("http://18.184.170.181:3000/api/get-tia", validator) + err = testutil.WaitForBlocks(ctx, 8, celestia) + require.NoError(t, err) err = celestia.GetNode().InitCelestiaDaLightNode(ctx, nodeStore, p2pNetwork, nil) require.NoError(t, err) @@ -418,12 +416,6 @@ func TestSequencerHubDisconnection_EVM(t *testing.T) { err = testutil.WaitForBlocks(ctx, 3, celestia) require.NoError(t, err) - // Change the file permissions - command := []string{"chmod", "-R", "777", "/home/celestia/light/config.toml"} - - _, _, err = celestia.Exec(ctx, command, nil) - require.NoError(t, err) - file, err := os.Open("/tmp/celestia/light/config.toml") require.NoError(t, err) defer file.Close() @@ -468,7 +460,7 @@ func TestSequencerHubDisconnection_EVM(t *testing.T) { // Create an exec instance execConfig := types.ExecConfig{ - Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.accname", "validator"}), // Replace with your command and arguments + Cmd: strslice.StrSlice([]string{"celestia", "light", "start", "--node.store", nodeStore, "--gateway", "--core.ip", coreIp, "--p2p.network", p2pNetwork, "--keyring.keyname", "validator"}), // Replace with your command and arguments } execIDResp, err := client.ContainerExecCreate(ctx, containerID, execConfig) @@ -570,13 +562,21 @@ func TestSequencerHubDisconnection_EVM(t *testing.T) { }, nil, "", nil) require.NoError(t, err) + rollappHeight, err := rollapp1.GetNode().Height(ctx) + require.NoError(t, err) + + // wait until the packet is finalized + isFinalized, err := dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 300) + require.NoError(t, err) + require.True(t, isFinalized) + dymension.StopAllNodes(ctx) - rollappHeight, err := rollapp1.GetNode().Height(ctx) + rollappHeight, err = rollapp1.GetNode().Height(ctx) require.NoError(t, err) // wait until the packet is finalized - isFinalized, err := dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 180) + isFinalized, err = dymension.WaitUntilRollappHeightIsFinalized(ctx, rollapp1.GetChainID(), rollappHeight, 180) require.Error(t, err) require.False(t, isFinalized) diff --git a/tests/setup.go b/tests/setup.go index 85a9d03c..4558e124 100644 --- a/tests/setup.go +++ b/tests/setup.go @@ -8,6 +8,7 @@ import ( "io" "net/http" "os" + "strconv" "testing" "time" @@ -16,7 +17,10 @@ import ( "cosmossdk.io/math" util "github.com/cosmos/cosmos-sdk/types/module/testutil" + "github.com/decentrio/rollup-e2e-testing/blockdb" "github.com/decentrio/rollup-e2e-testing/cosmos" + "github.com/decentrio/rollup-e2e-testing/cosmos/hub/dym_hub" + dymensiontesting "github.com/decentrio/rollup-e2e-testing/dymension" "github.com/decentrio/rollup-e2e-testing/ibc" "github.com/decentrio/rollup-e2e-testing/testreporter" "github.com/decentrio/rollup-e2e-testing/testutil" @@ -80,9 +84,13 @@ type ForwardMetadata struct { } const ( - ibcPath = "dymension-demo" - anotherIbcPath = "dymension-demo2" - BLOCK_FINALITY_PERIOD = 30 + ibcPath = "dymension-demo" + anotherIbcPath = "dymension-demo2" + BLOCK_FINALITY_PERIOD = 30 + EventDemandOrderCreated = "dymensionxyz.dymension.eibc.EventDemandOrderCreated" + EventDemandOrderFulfilled = "dymensionxyz.dymension.eibc.EventDemandOrderFulfilled" + EventDemandOrderFeeUpdated = "dymensionxyz.dymension.eibc.EventDemandOrderFeeUpdated" + EventDemandOrderPacketStatusUpdated = "dymensionxyz.dymension.eibc.EventDemandOrderPacketStatusUpdated" ) var ( @@ -114,7 +122,7 @@ var ( dymensionImage = ibc.DockerImage{ Repository: DymensionMainRepo, - Version: "a5dc63e3", + Version: dymensionVersion, UidGid: "1025:1025", } @@ -182,11 +190,26 @@ var ( GasAdjustment: 2, TrustingPeriod: "112h", NoHostMount: false, - ModifyGenesis: nil, + ModifyGenesis: cosmos.ModifyGenesis(gaiaGenesisKV), ConfigFileOverrides: nil, } + gaiaGenesisKV = []cosmos.GenesisKV{ + { + Key: "app_state.staking.params.unbonding_time", + Value: "600s", + }, + } + rollappEVMGenesisKV = []cosmos.GenesisKV{ + { + Key: "app_state.sequencers.params.unbonding_time", + Value: "600s", + }, + { + Key: "app_state.staking.params.unbonding_time", + Value: "600s", + }, { Key: "app_state.mint.params.mint_denom", Value: "urax", @@ -255,6 +278,14 @@ var ( } rollappWasmGenesisKV = []cosmos.GenesisKV{ + { + Key: "app_state.sequencers.params.unbonding_time", + Value: "600s", + }, + { + Key: "app_state.staking.params.unbonding_time", + Value: "600s", + }, // Bank denom metadata { Key: "app_state.bank.denom_metadata", @@ -283,6 +314,14 @@ var ( } dymensionGenesisKV = []cosmos.GenesisKV{ + { + Key: "app_state.sequencer.params.unbonding_time", + Value: "600s", + }, + { + Key: "app_state.staking.params.unbonding_time", + Value: "600s", + }, // gov params { Key: "app_state.gov.params.voting_period", @@ -635,6 +674,8 @@ func overridesDymintToml(settlemenLayer, nodeAddress, rollappId, gasPrices, maxI dymintTomlOverrides["max_idle_time"] = maxIdleTime dymintTomlOverrides["max_proof_time"] = maxProofTime dymintTomlOverrides["batch_submit_max_time"] = batchSubmitMaxTime + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" + dymintTomlOverrides["batch_submit_time"] = "20s" configFileOverrides["config/dymint.toml"] = dymintTomlOverrides @@ -829,3 +870,108 @@ func GetLatestBlockHeight(url, headerKey, headerValue string) (string, error) { } return string(body), nil } + +func getEibcEventFromTx(t *testing.T, dymension *dym_hub.DymHub, txhash string) *dymensiontesting.EibcEvent { + txResp, err := dymension.GetTransaction(txhash) + if err != nil { + require.NoError(t, err) + return nil + } + + events := txResp.Events + + var ( + id, _ = cosmos.AttributeValue(events, EventDemandOrderFulfilled, "order_id") + price, _ = cosmos.AttributeValue(events, EventDemandOrderFulfilled, "price") + fee, _ = cosmos.AttributeValue(events, EventDemandOrderFulfilled, "fee") + isFulfilled, _ = cosmos.AttributeValue(events, EventDemandOrderFulfilled, "is_fulfilled") + packetStatus, _ = cosmos.AttributeValue(events, EventDemandOrderFulfilled, "packet_status") + ) + + eibcEvent := new(dymensiontesting.EibcEvent) + eibcEvent.OrderId = id + eibcEvent.Price = price + eibcEvent.Fee = fee + eibcEvent.IsFulfilled, err = strconv.ParseBool(isFulfilled) + if err != nil { + require.NoError(t, err) + return nil + } + eibcEvent.PacketStatus = packetStatus + + return eibcEvent +} + +func getEIbcEventsWithinBlockRange( + ctx context.Context, + dymension *dym_hub.DymHub, + blockRange int64, + breakOnFirstOccurence bool, +) ([]dymensiontesting.EibcEvent, error) { + var eibcEventsArray []dymensiontesting.EibcEvent + + height, err := dymension.Height(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get Dymension height: %w", err) + } + fmt.Printf("Dymension height: %d\n", height) + + err = testutil.WaitForBlocks(ctx, int(blockRange), dymension) + if err != nil { + return nil, fmt.Errorf("error waiting for blocks: %w", err) + } + + eibcEvents, err := getEibcEventsOfType(dymension.CosmosChain, height-5, height+blockRange, breakOnFirstOccurence) + if err != nil { + return nil, fmt.Errorf("error getting events of type 'eibc': %w", err) + } + + if len(eibcEvents) == 0 { + return nil, fmt.Errorf("There wasn't a single 'eibc' event registered within the specified block range on the hub") + } + + for _, event := range eibcEvents { + eibcEvent, err := dymensiontesting.MapToEibcEvent(event) + if err != nil { + println("go to here man") + return nil, fmt.Errorf("error mapping to EibcEvent: %w", err) + } + eibcEventsArray = append(eibcEventsArray, eibcEvent) + } + + return eibcEventsArray, nil +} + +func getEibcEventsOfType(chain *cosmos.CosmosChain, startHeight int64, endHeight int64, breakOnFirstOccurence bool) ([]blockdb.Event, error) { + var eventTypeArray []blockdb.Event + shouldReturn := false + + for height := startHeight; height <= endHeight && !shouldReturn; height++ { + txs, err := chain.FindTxs(context.Background(), height) + if err != nil { + return nil, fmt.Errorf("error fetching transactions at height %d: %w", height, err) + } + + for _, tx := range txs { + for _, event := range tx.Events { + if event.Type == EventDemandOrderCreated || event.Type == EventDemandOrderFulfilled || event.Type == EventDemandOrderFeeUpdated || event.Type == EventDemandOrderPacketStatusUpdated { + eventTypeArray = append(eventTypeArray, event) + if breakOnFirstOccurence { + shouldReturn = true + fmt.Printf("%s event found on block height: %d", event.Type, height) + break + } + } + } + if shouldReturn { + break + } + } + } + + return eventTypeArray, nil +} + +func BuildEIbcMemo(eibcFee math.Int) string { + return fmt.Sprintf(`{"eibc": {"fee": "%s"}}`, eibcFee.String()) +} diff --git a/tests/tx_batch_finalization_test.go b/tests/tx_batch_finalization_test.go index 35273e6d..30b97363 100644 --- a/tests/tx_batch_finalization_test.go +++ b/tests/tx_batch_finalization_test.go @@ -43,6 +43,8 @@ func TestBatchFinalization_EVM(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "100s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" modifyGenesisKV := append( dymensionGenesisKV, @@ -181,6 +183,8 @@ func TestBatchFinalization_Wasm(t *testing.T) { dymintTomlOverrides["max_idle_time"] = "3s" dymintTomlOverrides["max_proof_time"] = "500ms" dymintTomlOverrides["batch_submit_max_time"] = "100s" + dymintTomlOverrides["batch_submit_time"] = "100s" + dymintTomlOverrides["p2p_blocksync_enabled"] = "false" modifyGenesisKV := append( dymensionGenesisKV, diff --git a/tests/upgrade_hub_test.go b/tests/upgrade_hub_test.go index 7b0554dd..75346e2e 100644 --- a/tests/upgrade_hub_test.go +++ b/tests/upgrade_hub_test.go @@ -422,7 +422,7 @@ func TestHubUpgrade(t *testing.T) { require.NoError(t, err) fmt.Println("Events:", eibcEvents) - _, err = dymension.FullfillDemandOrder(ctx, eibcEvents[len(eibcEvents)-1].ID, marketMaker1Addr, eibcFee) + _, err = dymension.FullfillDemandOrder(ctx, eibcEvents[len(eibcEvents)-1].OrderId, marketMaker1Addr, eibcFee) require.NoError(t, err) // eibcEvent := getEibcEventFromTx(t, dymension, txhash) // if eibcEvent != nil { @@ -534,7 +534,7 @@ func TestHubUpgrade(t *testing.T) { require.NoError(t, err) fmt.Println("Events:", eibcEvents) - _, err = dymension.FullfillDemandOrder(ctx, eibcEvents[len(eibcEvents)-1].ID, marketMaker2Addr, eibcFee) + _, err = dymension.FullfillDemandOrder(ctx, eibcEvents[len(eibcEvents)-1].OrderId, marketMaker2Addr, eibcFee) require.NoError(t, err) // eibcEvent = getEibcEventFromTx(t, dymension, txhash) // if eibcEvent != nil {