Skip to content

Commit d8cae6e

Browse files
chattoncharleenfeicrodriguezvegasangiercolin-axner
authored
Enable Parallel Transfer Test Suite (#6721)
* Adding proto files for ics20-v2 (#6110) * chore: adding proto files for ics20-v2 * chore: add newline * update amount -> string (#6120) * Update MsgTransfer to accept sdk.Coins instead of sdk.Coin (#6113) * fix: allow base denom with trailing slash (#6148) * imp: add CurrentVersion, EscrowVersion (#6160) * add CurrentVersion, EscrowVersion, update tests * update hardcoded transfer channel version from interchaintest * chore: add function for converting packet data from v1 to v3 (#6116) --------- Co-authored-by: Charly <charly@interchain.berlin> * chore: implement required `FungibleTokenPacketData` v3 interface methods (#6126) * imp: `getMultiDenomFungibleTokenPacketData`to be used in packet unmarshalling/conversion (#6226) * chore: adding proto files for ics20-v2 * chore: add newline * chore: modify MsgTransfer to accept coins instead of coin * chore: reverted unintentional comment changes * chore: reverted unintentional comment changes * chore: adding test for conversion fn * chore: fix e2e linter * chore: adding docs * chore: addressing PR feedback * chore: remove duplicate import * chore: addressing PR feedback * chore: moved extration logic into internal package * chore: commented out failing test * chore: adding link to issue * chore: remove duplicate import * chore: fix linting errors * FungibleTokenPacketData interface methods + tests * linter * wip: token validation * update trace identifier validation in Token + tests * rm Printf * update with pr review * add CurrentVersion, EscrowVersion, update tests * pr review * fix e2e tests * pr review * update e2e test version * linter * update hardcoded transfer channel version from interchaintest * update hardcoded transfer channel version from interchaintest * wip packet unmarshaller * wip * wip testing * update test * linter * rm unnecessary version changes * rm unnecessary artifacts * update callbacks test * update comment * pr review * rename getMultiDenomFungibleTokenPacketData to unmarshalPacketDataBytesToICS20V2 --------- Co-authored-by: chatton <github.qpeyb@simplelogin.fr> Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * chore: implement version checking for channel handshake application callbacks (#6175) * add SupportedVersions array for different ics20 versions, add version checking on channel handshake application callbacks * add tests * update pr review * pr review * last few pr review nits * linter * add version counter proposing * fix missing app versino * update code + tests to return our proposed version if counterparty version is invalid * remove if statement * address review comments: return ics20-2 if counterparty version is not supported --------- Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * imp: update transfer authz implementation to account for multi denom transfers (#6252) * add transfer authz code + tests * linter * address review comments --------- Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * ics20-v2: backwards compatibility for transfer rpc and packet callbacks (#6189) * chore: adding proto files for ics20-v2 * chore: add newline * chore: modify MsgTransfer to accept coins instead of coin * chore: reverted unintentional comment changes * chore: reverted unintentional comment changes * chore: adding test for conversion fn * chore: fix e2e linter * chore: adding docs * chore: addressing PR feedback * chore: remove duplicate import * chore: addressing PR feedback * chore: moved extration logic into internal package * chore: commented out failing test * chore: adding link to issue * chore: remove duplicate import * chore: fix linting errors * FungibleTokenPacketData interface methods + tests * linter * wip: token validation * update trace identifier validation in Token + tests * rm Printf * update with pr review * pr review * linter * rm unused function: linter * wip pr feedback * fix test * pr review * lintttttt * wip: backwards compatibility for transfer rpc * implement changes for ics20-v2 packet data for onRecvPacket, onAcknowledgePacket and onTimeoutPacket * fix callbacks tests * lint --------- Co-authored-by: chatton <github.qpeyb@simplelogin.fr> Co-authored-by: Charly <charly@interchain.berlin> * add v3 packet proto * fix protos * fixes * test fixes * add forwardPath keys and memo check in sendTransfer * wip onRecvPacket logic * minor fixes * changes to transfer tx CLI to support multiple denoms * import renaming * onRecv logic completed * add revertInFlights function * add onAck && onTimeout logic * fix interchain accounts test * basic unit test for path forwarding * fix test unsuccessful refund from source * wip test fix * fix mbt test - need more investigation * revert test fix * add assertions * add support for async ack * wip test forwarding happy path * icsv20(path forwarding): use nil as default forwarding path when not set, use sequence in key to store forwarded packet (#6325) * use nil forwarding path as default when not set, use sequence in key to store forwarded packet * lint * add forwarding happy path tests * fix merge * Use type with V2 suffix for package data (#6330) * Adding additional comments and changing version variable names (#6345) * chore: correctly claim capability * lint * imp: change ics20 events to emit token set (#6348) * refactor: quick change to tokens event attribute * fix: various tests * lint * lint:fixeroni * imp: remove events variable in favour of direct event emission --------- Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com> * imp: check length tokens array against maximum allowed (#6349) * check length of tokens array against maximum allowed * chore: add note on arbitrary selection --------- Co-authored-by: Colin Axnér <25233464+colin-axner@users.noreply.github.com> * Modify UnmarshalPacketData interface to allow additional args (#6341) * api(port)!: Allow passing of context, port and channel identifier to unmarshal packet data interface as disussed. This allows us to grab the app version in transfer and unmarshal the packet based on that instead of a hacky unmarshal v2 then v1 and whatever happens. * lint: as we do * callbacks: fix signature of UnmarshalPacketData as per changes, make refactors to hopefully simplify signatures. * chore: lint and remove some todos. * review: address feedback. * Refactor packet data unmarshalling to use specific version (#6354) * chore: specifically unmarshal v1 or v2 without brute force * chore: fix TestPacketDataUnmarshalerInterface test in transfer module * Pass dest values OnRecv, refactor GetExpectedEvents * chore: fixing TestGetCallbackData test * chore: fixed remaining tests in callbacks module * test: simplify callbacks test, revert back to previous behaviour * chore: fix test case name * chore: addressing PR feedback * chore: added docstring for unmarshalPacketDataBytesToICS20V2 --------- Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com> Co-authored-by: Colin Axnér <25233464+colin-axner@users.noreply.github.com> * chore: fixing tests * imp: self review comments for ics20-v2 (#6360) * refactor: address various self review comments * revert: unnecessary change * lint * imp: self review on ics20-v2 part 2 (#6364) * refactor: apply review suggestions * imp: additional updates * refactor: make ValidateIBCDenom private * Update modules/apps/transfer/types/msgs.go Co-authored-by: Cian Hatton <cian@interchain.io> * apply review suggestions --------- Co-authored-by: Cian Hatton <cian@interchain.io> * chore: move functions from internal/denom back to trace.go (#6368) * chore: move functions from internal/denom to trace.go * lint * lint: the comeback * imp: ics20 v2 self review part 3 (#6373) * imp: self review items * apply jim's suggestion * Update modules/apps/transfer/keeper/msg_server_test.go * Update modules/apps/transfer/ibc_module.go * Update modules/apps/transfer/ibc_module.go * chore: remove duplicate test case * chore: address minor nits (#6374) * fix lint warning, add extra godocs, and some other small fixes and cleanup * fix finalReceiver address bug * wip - ack test scenario5 * add FungibleTokenPacketDataV2 test for ValidateBasic (#6398) * fix linter complaints * add test - currently faling on middle hop revert * add test comments * fixes * retrieve channel capability only if there is a previous packet in store * add missing parameter * fix: e2e build failures. * Use Transfer instead of sendTransfer when forwarding. (#6564) Pass nil as the next forwarding path if at final hop. Use consistent timeout for all hops. * lint: fix linter issues. * tests(transfer): move forwarding tests to separate file. (#6568) * chore: rename ForwardingInfo to Forwarding * Revert "chore: rename ForwardingInfo to Forwarding" This reverts commit e483b9a. * nit(transfer): Mark hops as non nullable. (#6566) * nit(transfer): Mark hops as non nullable. * lint: fix additional linting issues * feat(transfer): add forwarding info validation to token packet (#6571) * feat(transfer): add forwarding info validation to token packet * Added NewForwardingInfo constructor * Removed redundant check * Clean up tests per cr comments * Back to Validate and use NewDenom * feat(transfer): add validation for forwarding info in msg transfer validate basic (#6583) * Fix and simplify reverts of forwarding state (#6574) * refactor: initial simplification attempt * refactor: further organize * fix: all tests fixed * docs: improved godocs * fix: logic and testing error * style: self suggestion * docs: suggestion * docs: spellcheck * style: suggestions * style: renamed to revertForwardedPacket * style: suggestion * docs: remove docs * docs: godoc suggestion * style: suggestion * docs: colin suggestions * chore: rename ForwardingInfo to Forwarding (#6576) * chore: rename ForwardingInfo to Forwarding * chore: rename forwarding_path field to forwarding * chore: make lint-fix * chore: rename forwarding info -> forwarding * chore: renaming fixes before merge * Refactor packet forward functions (#6575) * feat(transfer): validate forwarding memo in transfer authorization (#6591) * Add func convert token to coin ibc (#6584) * add func convert token to coin ibc * fix command: change func to ToCoin and add godoc * add unit test * Revert using ToCoin on Recv where trace manipulation occurs. Use ToCoin while forwarding. Update tests as per Carlos's review. * rename variable --------- Co-authored-by: Carlos Rodriguez <carlos@interchain.io> Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com> * transfer: Disallow a forwarding object specified with zero hops and a memo (#6599) * transfer: Disallow a forwarding object specified with zero hops and a memo. * Apply suggestions from code review Co-authored-by: Carlos Rodriguez <carlos@interchain.io> --------- Co-authored-by: Carlos Rodriguez <carlos@interchain.io> Co-authored-by: Gjermund Garaba <bjaanes@gmail.com> * feat(transfer): move async decision and handling to the ibc module onrecv callback (#6592) * refactor: initial simplification attempt * refactor: further organize * fix: all tests fixed * chore: refactor packet forward functions * chore: use receiver address directly in msg transfer * feat(transfer): move async to ibc_module for onrecv * chore: fix linter * fix: logic and testing error * style: self suggestion * docs: suggestion * docs: spellcheck * style: suggestions * style: renamed to revertForwardedPacket * style: suggestion * docs: remove docs * Added tests for transfer OnRecv * Use new names and methods from feature branch * Apply suggestions from code review Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> * Clean up test from cr feedback * move vars to beginning of function * lint * Update modules/apps/transfer/ibc_module.go Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * lint --------- Co-authored-by: srdtrk <srdtrk@hotmail.com> Co-authored-by: chatton <cian@interchain.io> Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> Co-authored-by: Carlos Rodriguez <carlos@interchain.io> Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com> * chore: use NewForwarding instead of direct init (#6605) * Reduce max forwarding to 16 (#6610) * feat(transfer): use single byte ack for successful forward (#6604) Co-authored-by: Nikolas De Giorgis <bznein@gmail.com> * chore(transfer/cli): add forwarding flag to tx cli (#6609) Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * chore(transfer): make Forwarding non-null (#6618) * chore(transfer): make Forwarding non-null * chore(transfer): always validate forwarding. * chore: restructure functions with logical ordering (#6638) * test: Add tests for OnTimeoutPacket when middle chain times out packet (#6596) * Create ontimeoutpacket test for forwarding --------- Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * feat(transfer): add ShouldBeForwarded convenience method to msg transfer (#6595) * feat(transfer): add should-be-forwarded convenience method to msg transfer * Clean up packet and transfer msg validation for forwarding logic --------- Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * wip: relayer configuration experimentation * disallow timeout height usage when forwarding packets (#6641) * disallow non-zero timeout height when forwarding tokens * typo * move constant * use time to create default timeout timestamp delta * Apply suggestions from code review * refactor: add GetTimeoutTimestamp helper fn to the testing pkg * lint --------- Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> * nit: make set forwarded packet unexported (#6637) Co-authored-by: Gjermund Garaba <bjaanes@gmail.com> Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> * feat(transfer): use registered error code for error acks in token forwarding (#6648) * Add typed errors to packet forwarding * Use forward errors in tests * Make ack construction consistent * chore(transfer): emit forwarding information in events. (#6647) * chore(transfer): emit forwarding information in events. * nit: rename as per Carlos's suggestion * Fix e2e test * chore: test passing using relayer packet filter * Refactor forwarding messages for Transfer and Packet (#6655) * feat(transfer): add unwind, refactor proto structure. gen-all * tests(transfer/types): fix test failures in types tests. * tests(transfer/keeper): fix test failures in keeper tests. * cli(transfer): fix cli usage. pending flag for unwind. * tests(callbacks): fix failing tests in callbacks. * tests(transfer/internal): fix failures in internal package. * tests(transfer): fix test failures in top level tranfer package. * tests(ica/host/keeper): fix repr of msg transfer in ica host msg execution. * lint(all): lint this bad boy * chore(transfer/types): amend validation for MsgTransfer's ShouldBeForwarded, add tests for ForwardedPacketData, minor nits. * nit(self): only pass relevant fields to create packet data; minor comment improvement. * Apply suggestions from code review Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * chore(merge): fix merge issues. * chore(proto): mention optional nature of fields. * memo: do not drop it * validation: drop requirement on memo being empty on msg transfer. --------- Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * feat: allow authz granters to specify forwarding info for token transfer (#6661) * First attempt to modify proto and validation. * Fmt * Make it compile * Proto * Add basic validation * Added tests * Fix nil check and remove redundant code. * Move "forwarding" to non-pointer * Added one test case. * Moved error and changed method name. * PR Feedback. * Add nullable=false * Added test and fixed test names * Run make proto-all * Change pointer to non-pointer * Change Yet Another Pointer * More pointers * Comments and naming * Reintroduce brace removed while merging * Remove accidentally reintroduced tests * feat: delete forwarded packet when it is not needed anymore (#6621) * Create ontimeoutpacket test for forwarding * Propagate ack on A * Refactoring * Minor changes * Added comments * Fix type name. * Gofumpt * Update modules/apps/transfer/keeper/relay_forwarding_test.go Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * Update modules/apps/transfer/keeper/relay_forwarding_test.go Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * Update modules/apps/transfer/keeper/relay_forwarding_test.go Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * Update modules/apps/transfer/keeper/relay_forwarding_test.go Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * Add godoc to test. * Changed trace construction * Update modules/apps/transfer/keeper/relay_forwarding_test.go Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * remove error msg parameter from helper function * Add test for forwarded packet * Delete packet when not needed anymore. * Move deletion of packet in a single place. * Reintroduce newline * Do not ignore error. * PR feedback. * Construct packet for B ack check. * PR feedback * Pass packet to acknowledgeforwardedpacket * revert unwanted change * Another unwanted change * Better signature and fix source/dest * Added one more test. --------- Co-authored-by: Carlos Rodriguez <carlos@interchain.io> Co-authored-by: Gjermund Garaba <bjaanes@gmail.com> * test(transfer): forwarding acknowledgment errors in middle hop (#6659) * test(transfer): forwarding where middle chaind is source for receive and send * Fix errors after merge * Finish up the test * Update some out-of-date comments * test(transfer): multi-hop ack failure with middle chain NOT being source * Fix tests after height change * Fix tests after height change * Fix test after #6586 * Rename tests to not use scenario numbers * Rename test * address self-review comments * use boolean in NewForwarding parameter * some more review comments --------- Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * test(transfer): last chain in forwarding packet is ICS20 v1 (#6622) * test(transfer): last chain in forwarding being ICS20 v1 * Finish TestForwarding_WithLastChainBeingICS20v1_Succeeds * Update CreateNewPath signature Co-authored-by: Nikolas De Giorgis <bznein@gmail.com> * Fix PR review comments --------- Co-authored-by: Nikolas De Giorgis <bznein@gmail.com> * refactor: rename SetupPath to SetupPaths (#6674) * chore: configure the hermes config to watch a specific port and channel ID * chore: add flag for unwind in transfer cli (#6680) * add flag for unwind in transfer cli * update long description of cli --------- Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * chore: small refactor for SetupPath * chore: adding link to interchaintest issue and doing some cleanup * chore: adding interchaintest issue link in comment * chore: merge main * chore: fix linter * chore: sync main * feat: impl check reject transfer if len(hops) > 0 and ics20-1 (#6675) * impl check reject transfer if len(hops) > 0 and ics20-1 * add test case hops is not empty with ics20-2 * address review comments * reorder variable declaration --------- Co-authored-by: Carlos Rodriguez <carlos@interchain.io> Co-authored-by: Gjermund Garaba <bjaanes@gmail.com> * chore: fix go mod * feat(transfer): add unwinding ability (#6656) * Create ontimeoutpacket test for forwarding * Propagate ack on A * Refactoring * Minor changes * Added comments * Fix type name. * Gofumpt * Update modules/apps/transfer/keeper/relay_forwarding_test.go Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * Update modules/apps/transfer/keeper/relay_forwarding_test.go Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * Update modules/apps/transfer/keeper/relay_forwarding_test.go Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * Update modules/apps/transfer/keeper/relay_forwarding_test.go Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * Add godoc to test. * Changed trace construction * Update modules/apps/transfer/keeper/relay_forwarding_test.go Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * remove error msg parameter from helper function * Add test for forwarded packet * Construct packet for B ack check. * PR feedback * feat(transfer): add unwind, refactor proto structure. gen-all * tests(transfer/types): fix test failures in types tests. * tests(transfer/keeper): fix test failures in keeper tests. * cli(transfer): fix cli usage. pending flag for unwind. * tests(callbacks): fix failing tests in callbacks. * tests(transfer/internal): fix failures in internal package. * tests(transfer): fix test failures in top level tranfer package. * tests(ica/host/keeper): fix repr of msg transfer in ica host msg execution. * lint(all): lint this bad boy * chore(transfer/types): amend validation for MsgTransfer's ShouldBeForwarded, add tests for ForwardedPacketData, minor nits. * nit(self): only pass relevant fields to create packet data; minor comment improvement. * Apply suggestions from code review Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * chore(merge): fix merge issues. * chore(proto): mention optional nature of fields. * memo: do not drop it * validation: drop requirement on memo being empty on msg transfer. * feat(transfer): add unwinding ability, wip. * Added unwind to allocation forwarding. * Add tests and move some validation * Missing import * Fixed validation and added test * PR Feedback * Return nil when returning an error. * Cleaner comment * Add test case for multiple hos --------- Co-authored-by: bznein <nikolas.degiorgis@interchain.io> Co-authored-by: Nikolas De Giorgis <bznein@gmail.com> Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * chore: add support to run full test suite in run-e2e.sh * chore: only store last channel for each test * fix typo * remove unnecessary wrapping of function * Revert "remove unnecessary wrapping of function" This reverts commit c2a6bc6. * fix usage of function * (chore) replace reflect.DeepEqual with slices.Equal (#6697) * Replace reflect.DeepEqual with slices.Equal * Nit formatting * chore: comment hop slicing for clarity (#6702) Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * chore: cleanup forwarding tests (#6691) * chore: cleanup forwarding tests * lint * fix --------- Co-authored-by: Nikolas De Giorgis <nikolas.degiorgis@interchain.io> Co-authored-by: Gjermund Garaba <bjaanes@gmail.com> * chore: pull out hop validation and consolidate for transfer+packet (#6695) * chore: pull out hop validation and consolidate transfer+packet * Update modules/apps/transfer/types/forwarding_test.go Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * cr fixes --------- Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * Remove unwind field in authz (#6701) * chore: remove unwind field in authz * chore: remove duplicate test * Update modules/apps/transfer/types/transfer_authorization.go Co-authored-by: Carlos Rodriguez <carlos@interchain.io> --------- Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * chore: add packet data validation back (#6704) * (chore) Refactor code around forwarding validation (#6706) * Refactor validation * Fixed verification logic, added two tests * Fix check for unwind * removed unneeded indirection * Update modules/apps/transfer/types/msgs.go Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com> * Add docstring. --------- Co-authored-by: Gjermund Garaba <bjaanes@gmail.com> Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com> * use setupForwardingPaths in test * feat(transfer): allow non-cosmos-sdk AccAddress in final receiver for forwarded packets (#6709) * allow non-cosmos-sdk AccAddress for forwarded packets * cr fixes * chore: pass only hops to sendTransfer + events rename (#6703) Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * test: forwarding test that verifies forwarded memo (#6707) * test: forwarding with memo * fix test * cr fixes * chore: update godoc for relay forwarding tests * chore: use module account instead of custom forward address (#6688) * chore: use module account instead of custom forward address * pull blocked addr checker into keeper method * lint * clean up IsBlockedAddr * chore: replace continue with if/else (#6700) Co-authored-by: Nikolas De Giorgis <nikolas.degiorgis@interchain.io> * add changelog * add test for invalid receiver address * Update CHANGELOG.md * Update CHANGELOG.md * make getForwardedPacket private * remove auxiliary burn coins function * nit: rename func method recv args in types/forwarding.go * chore: rename ShouldBeForwarded to HasFowarding * e2e: remove template test for three chain setup. * nit: no generics silly * nit: add clarifying comment to validate basic call on msg. * nit: remove unused key. * nit: clean up cli help text. * nit: don't export is blocked address helper. * nit: docustring for e2e test and helper. * nit: improve documentation for transfer's OnRecv callback. Co-authored-by: Damian Nolan <damiannolan@gmail.com> * chore: move setup code into individual tests * chore: use custom setup functions in tests that need them * chore: remove unused function * Apply suggestions from code review Co-authored-by: Aditya <14364734+AdityaSripal@users.noreply.github.com> * chore: remove unused function * perf: allocate slice to length of packet data tokens * chore(transfer/authz): wrapf unauthorized forwarding hops * lint * Update modules/apps/transfer/types/forwarding.go Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com> * Preallocate slice but keep len==0 (#6725) * imp: validate allowed forwarding hops * test: unwind fails in Transfer rpc * wip: tests failing after merge conflict * chore: test passing with new config * wip: working on ensuring existing tests pass * wip: working on ensuring existing tests pass * chore: revert changes to ibc genesis test * wip: transfer tests passing in parallel * chore: add comments and max function * chore: fix e2e linting * chore: move param tests into their own files * chore: run transfer test in CI in parallel * chore: tweak run-e2e.sh to not check for fzf * chore: reference correct env var * chore: separate out transfer utility logic from test suite * chore: unexporting transfer tester type * chore: temporarily disable regular E2Es * chore: explicitly run a single test suite * chore: re-enable regular E2Es and remove redundant start relayer fn * chore: adding flag to workflow * chore: correctly store all channels created * chore: renaming based on PR feedback --------- Co-authored-by: Charly <charly@interchain.io> Co-authored-by: Carlos Rodriguez <carlos@interchain.io> Co-authored-by: Charly <charly@interchain.berlin> Co-authored-by: Stefano Angieri <stefano@interchain.io> Co-authored-by: sangier <45793271+sangier@users.noreply.github.com> Co-authored-by: Colin Axnér <25233464+colin-axner@users.noreply.github.com> Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com> Co-authored-by: Hastur <hasturtheyellowking199@gmail.com> Co-authored-by: Damian Nolan <damiannolan@gmail.com> Co-authored-by: Gjermund Garaba <bjaanes@gmail.com> Co-authored-by: srdtrk <59252793+srdtrk@users.noreply.github.com> Co-authored-by: Maintain <duonghb53@users.noreply.github.com> Co-authored-by: srdtrk <srdtrk@hotmail.com> Co-authored-by: Nikolas De Giorgis <bznein@gmail.com> Co-authored-by: Gjermund Garaba <gjermund@garaba.net> Co-authored-by: Dzung Do | Decentrio <neitdung@gmail.com> Co-authored-by: bznein <nikolas.degiorgis@interchain.io> Co-authored-by: Aditya <14364734+AdityaSripal@users.noreply.github.com>
1 parent b1ca4ef commit d8cae6e

27 files changed

+793
-484
lines changed

.github/workflows/e2e-test-workflow-call.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
66
required: false
77
type: string
88
default: '' # empty string means run all tests
9+
temp-run-full-suite:
10+
description: 'This flag exists to run a hard coded set of tests and will be phased out'
11+
required: false
12+
type: boolean
13+
default: false
914
test:
1015
description: 'test name to run as standalone'
1116
required: false
@@ -253,3 +258,49 @@ jobs:
253258
name: '${{ matrix.entrypoint }}-${{ matrix.test }}'
254259
path: e2e/diagnostics
255260
retention-days: 5
261+
262+
e2e-test-suites:
263+
# temporary flag. eventually this field will not exist and this will be the default.
264+
if: ${{ inputs.temp-run-full-suite }}
265+
runs-on: ubuntu-latest
266+
needs:
267+
- build-test-matrix
268+
- docker-build
269+
- docker-build-wasm
270+
env:
271+
CHAIN_IMAGE: '${{ inputs.chain-image }}'
272+
CHAIN_A_TAG: '${{ inputs.chain-a-tag }}'
273+
CHAIN_B_TAG: '${{ inputs.chain-b-tag }}'
274+
RELAYER_IMAGE: '${{ inputs.relayer-image }}'
275+
RELAYER_TAG: '${{ inputs.relayer-tag }}'
276+
RELAYER_ID: '${{ inputs.relayer-type }}'
277+
CHAIN_BINARY: '${{ inputs.chain-binary }}'
278+
CHAIN_UPGRADE_TAG: '${{ inputs.chain-upgrade-tag }}'
279+
CHAIN_UPGRADE_PLAN: '${{ inputs.upgrade-plan-name }}'
280+
strategy:
281+
fail-fast: false
282+
matrix:
283+
include:
284+
# for now we explicitly specify this test suite.
285+
- entrypoint: TestTransferTestSuite
286+
steps:
287+
- uses: actions/checkout@v4
288+
with:
289+
repository: cosmos/ibc-go
290+
- uses: actions/setup-go@v5
291+
with:
292+
go-version: '1.22'
293+
cache-dependency-path: 'e2e/go.sum'
294+
- name: Run e2e Test
295+
id: e2e_test
296+
run: |
297+
cd e2e
298+
make e2e-suite entrypoint=${{ matrix.entrypoint }}
299+
- name: Upload Diagnostics
300+
uses: actions/upload-artifact@v4
301+
if: ${{ failure() && inputs.upload-logs }}
302+
continue-on-error: true
303+
with:
304+
name: '${{ matrix.entrypoint }}-${{ matrix.test }}'
305+
path: e2e/diagnostics
306+
retention-days: 5

.github/workflows/e2e.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,6 @@ jobs:
6767
chain-b-tag: '${{ needs.determine-image-tag.outputs.simd-tag }}'
6868
chain-binary: 'simd'
6969
# on regular PRs we won't run upgrade tests.
70-
test-exclusions: 'TestUpgradeTestSuite,TestGrandpaTestSuite,TestIBCWasmUpgradeTestSuite'
70+
# NOTE: we are exluding TestTransferTestSuite as we run this full suite instead of each individual test.
71+
test-exclusions: 'TestUpgradeTestSuite,TestGrandpaTestSuite,TestIBCWasmUpgradeTestSuite,TestTransferTestSuite'
72+
temp-run-full-suite: true

e2e/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ e2e-test: init cleanup-ibc-test-containers
1414
./scripts/run-e2e.sh $(test) $(entrypoint)
1515

1616
e2e-suite: init cleanup-ibc-test-containers
17-
RUN_SUITE="true" ./scripts/run-e2e.sh $(test) $(entrypoint)
17+
RUN_SUITE="true" ./scripts/run-e2e.sh "" $(entrypoint)
1818

1919
compatibility-tests:
2020
./scripts/run-compatibility-tests.sh $(release_branch)

e2e/scripts/run-e2e.sh

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
set -eo pipefail
44

5-
TEST="${1}"
6-
ENTRY_POINT="${2:-}"
5+
TEST="${1:-}"
6+
export ENTRY_POINT="${2:-}"
77

88
function _verify_jq() {
99
if ! command -v jq > /dev/null ; then
@@ -19,7 +19,7 @@ function _verify_fzf() {
1919
fi
2020
}
2121

22-
function _verify_dependencies() {
22+
function _verify_test_dependencies() {
2323
if [ -z "${TEST}" ]; then
2424
# fzf is only required if we are not explicitly specifying a test.
2525
_verify_fzf
@@ -28,6 +28,14 @@ function _verify_dependencies() {
2828
_verify_jq
2929
}
3030

31+
function _verify_suite_dependencies() {
32+
if [ -z "${ENTRY_POINT}" ]; then
33+
# fzf is only required if we are not explicitly specifying an entrypoint.
34+
_verify_fzf
35+
fi
36+
# jq is always required to determine the entrypoint of the test.
37+
_verify_jq
38+
}
3139

3240
# _select_test_config lets you dynamically select a test config for the specific test.
3341
function _select_test_config() {
@@ -51,7 +59,7 @@ function _get_test(){
5159

5260
# run_test runs a single E2E test.
5361
function run_test() {
54-
# if the dev configs directory is present, enable fzf completion to select a test config file to use.
62+
_verify_test_dependencies
5563

5664
# if test is set, that is used directly, otherwise the test can be interactively provided if fzf is installed.
5765
TEST="$(_get_test ${TEST})"
@@ -78,23 +86,23 @@ function run_test() {
7886

7987
# run_suite runs a full E2E test suite.
8088
function run_suite() {
89+
_verify_suite_dependencies
8190
# if jq is installed, we can automatically determine the test entrypoint.
82-
if command -v jq > /dev/null; then
91+
if [ -z "${ENTRY_POINT}" ]; then
8392
cd ..
8493
ENTRY_POINT="$(go run -mod=readonly cmd/build_test_matrix/main.go | jq -r '.include[] | .entrypoint' | uniq | fzf)"
8594
cd - > /dev/null
8695
fi
8796

8897
# find the name of the file that has this test in it.
89-
test_file="$(grep --recursive --files-with-matches './tests' -e "${ENTRY_POINT}")"
98+
test_file="$(grep --recursive --files-with-matches './tests' -e "${ENTRY_POINT}(")"
9099
test_dir="$(dirname $test_file)"
91100

92-
# TODO: add the -p flag to run tests in parallel
93-
go test -v "${test_dir}" --run ${ENTRY_POINT} -timeout 30m
101+
go test -v "${test_dir}" --run ^${ENTRY_POINT}$ -timeout 30m -p 10
94102
}
95103

96-
_verify_dependencies
97104

105+
# if the dev configs directory is present, enable fzf completion to select a test config file to use.
98106
if [[ -d "dev-configs" ]]; then
99107
export E2E_CONFIG_PATH="$(pwd)/dev-configs/$(_select_test_config)"
100108
echo "Using configuration file at ${E2E_CONFIG_PATH}"

e2e/tests/core/02-client/client_test.go

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ func (s *ClientTestSuite) TestScheduleIBCUpgrade_Succeeds() {
6565
t := s.T()
6666
ctx := context.TODO()
6767

68+
testName := t.Name()
69+
s.CreateDefaultPaths(testName)
70+
6871
chainA, chainB := s.GetChains()
6972
chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount)
7073

@@ -169,14 +172,15 @@ func (s *ClientTestSuite) TestClientUpdateProposal_Succeeds() {
169172
badTrustingPeriod = time.Second * 10
170173
)
171174

172-
relayer := s.GetRelayer()
175+
testName := t.Name()
176+
relayer := s.CreateDefaultPaths(testName)
173177

174178
t.Run("create substitute client with correct trusting period", func(t *testing.T) {
175179
// TODO: update when client identifier created is accessible
176180
// currently assumes first client is 07-tendermint-0
177181
substituteClientID = clienttypes.FormatClientIdentifier(ibcexported.Tendermint, 0)
178182

179-
pathName = s.GetPaths()[0]
183+
pathName = s.GetPaths(testName)[0]
180184
})
181185

182186
chainA, chainB := s.GetChains()
@@ -249,14 +253,15 @@ func (s *ClientTestSuite) TestRecoverClient_Succeeds() {
249253
badTrustingPeriod = time.Second * 10
250254
)
251255

252-
relayer := s.GetRelayer()
256+
testName := t.Name()
257+
relayer := s.CreateDefaultPaths(testName)
253258

254259
t.Run("create substitute client with correct trusting period", func(t *testing.T) {
255260
// TODO: update when client identifier created is accessible
256261
// currently assumes first client is 07-tendermint-0
257262
substituteClientID = clienttypes.FormatClientIdentifier(ibcexported.Tendermint, 0)
258263

259-
pathName = s.GetPaths()[0]
264+
pathName = s.GetPaths(testName)[0]
260265
})
261266

262267
chainA, chainB := s.GetChains()
@@ -334,13 +339,15 @@ func (s *ClientTestSuite) TestClient_Update_Misbehaviour() {
334339
err error
335340
)
336341

337-
relayer := s.GetRelayer()
342+
testName := t.Name()
343+
relayer := s.CreateDefaultPaths(testName)
344+
338345
chainA, chainB := s.GetChains()
339346

340347
s.Require().NoError(test.WaitForBlocks(ctx, 10, chainA, chainB))
341348

342349
t.Run("update clients", func(t *testing.T) {
343-
err := relayer.UpdateClients(ctx, s.GetRelayerExecReporter(), s.GetPaths()[0])
350+
err := relayer.UpdateClients(ctx, s.GetRelayerExecReporter(), s.GetPaths(testName)[0])
344351
s.Require().NoError(err)
345352

346353
clientState, err = query.ClientState(ctx, chainA, ibctesting.FirstClientID)
@@ -356,7 +363,7 @@ func (s *ClientTestSuite) TestClient_Update_Misbehaviour() {
356363
})
357364

358365
t.Run("update clients", func(t *testing.T) {
359-
err := relayer.UpdateClients(ctx, s.GetRelayerExecReporter(), s.GetPaths()[0])
366+
err := relayer.UpdateClients(ctx, s.GetRelayerExecReporter(), s.GetPaths(testName)[0])
360367
s.Require().NoError(err)
361368

362369
clientState, err = query.ClientState(ctx, chainA, ibctesting.FirstClientID)
@@ -438,6 +445,9 @@ func (s *ClientTestSuite) TestAllowedClientsParam() {
438445
t := s.T()
439446
ctx := context.TODO()
440447

448+
testName := t.Name()
449+
s.CreateDefaultPaths(testName)
450+
441451
chainA, chainB := s.GetChains()
442452
chainAVersion := chainA.Config().Images[0].Version
443453
chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount)

e2e/tests/core/03-connection/connection_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ type ConnectionTestSuite struct {
3333
testsuite.E2ETestSuite
3434
}
3535

36-
func (s *ConnectionTestSuite) SetupTest() {
37-
s.SetupPaths(ibc.DefaultClientOpts(), s.TransferChannelOptions())
36+
func (s *ConnectionTestSuite) CreateConnectionTestPath(testName string) (ibc.Relayer, ibc.ChannelOutput) {
37+
return s.CreatePaths(ibc.DefaultClientOpts(), s.TransferChannelOptions(), testName), s.GetChainAChannelForTest(testName)
3838
}
3939

4040
// QueryMaxExpectedTimePerBlockParam queries the on-chain max expected time per block param for 03-connection
@@ -65,7 +65,8 @@ func (s *ConnectionTestSuite) TestMaxExpectedTimePerBlockParam() {
6565
t := s.T()
6666
ctx := context.TODO()
6767

68-
relayer, channelA := s.GetRelayer(), s.GetChainAChannel()
68+
testName := t.Name()
69+
relayer, channelA := s.CreateConnectionTestPath(testName)
6970

7071
chainA, chainB := s.GetChains()
7172
chainAVersion := chainA.Config().Images[0].Version
@@ -126,7 +127,7 @@ func (s *ConnectionTestSuite) TestMaxExpectedTimePerBlockParam() {
126127
})
127128

128129
t.Run("start relayer", func(t *testing.T) {
129-
s.StartRelayer(relayer)
130+
s.StartRelayer(relayer, testName)
130131
})
131132

132133
t.Run("packets are relayed", func(t *testing.T) {

e2e/tests/interchain_accounts/base_test.go

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ func (s *InterchainAccountsTestSuite) testMsgSendTxSuccessfulTransfer(order chan
6262
t := s.T()
6363
ctx := context.TODO()
6464

65-
// setup relayers and connection-0 between two chains
66-
// channel-0 is a transfer channel but it will not be used in this test case
67-
relayer := s.GetRelayer()
65+
testName := t.Name()
66+
relayer := s.CreateDefaultPaths(testName)
67+
6868
chainA, chainB := s.GetChains()
6969

7070
// setup 2 accounts: controller account on chain A, a second chain B account.
@@ -84,7 +84,7 @@ func (s *InterchainAccountsTestSuite) testMsgSendTxSuccessfulTransfer(order chan
8484
})
8585

8686
t.Run("start relayer", func(t *testing.T) {
87-
s.StartRelayer(relayer)
87+
s.StartRelayer(relayer, testName)
8888
})
8989

9090
t.Run("verify interchain account", func(t *testing.T) {
@@ -161,7 +161,9 @@ func (s *InterchainAccountsTestSuite) TestMsgSendTx_FailedTransfer_InsufficientF
161161
t := s.T()
162162
ctx := context.TODO()
163163

164-
relayer := s.GetRelayer()
164+
testName := t.Name()
165+
relayer := s.CreateDefaultPaths(testName)
166+
165167
chainA, chainB := s.GetChains()
166168

167169
// setup 2 accounts: controller account on chain A, a second chain B account.
@@ -181,7 +183,7 @@ func (s *InterchainAccountsTestSuite) TestMsgSendTx_FailedTransfer_InsufficientF
181183
})
182184

183185
t.Run("start relayer", func(t *testing.T) {
184-
s.StartRelayer(relayer)
186+
s.StartRelayer(relayer, testName)
185187
})
186188

187189
t.Run("verify interchain account", func(t *testing.T) {
@@ -249,7 +251,9 @@ func (s *InterchainAccountsTestSuite) TestMsgSendTx_SuccessfulTransfer_AfterReop
249251
t := s.T()
250252
ctx := context.TODO()
251253

252-
relayer := s.GetRelayer()
254+
testName := t.Name()
255+
relayer := s.CreateDefaultPaths(testName)
256+
253257
chainA, chainB := s.GetChains()
254258

255259
// setup 2 accounts: controller account on chain A, a second chain B account.
@@ -277,7 +281,7 @@ func (s *InterchainAccountsTestSuite) TestMsgSendTx_SuccessfulTransfer_AfterReop
277281
})
278282

279283
t.Run("start relayer", func(t *testing.T) {
280-
s.StartRelayer(relayer)
284+
s.StartRelayer(relayer, testName)
281285
})
282286

283287
t.Run("verify interchain account", func(t *testing.T) {
@@ -342,7 +346,7 @@ func (s *InterchainAccountsTestSuite) TestMsgSendTx_SuccessfulTransfer_AfterReop
342346
})
343347

344348
t.Run("start relayer", func(t *testing.T) {
345-
s.StartRelayer(relayer)
349+
s.StartRelayer(relayer, testName)
346350
})
347351

348352
t.Run("verify channel is closed due to timeout on ordered channel", func(t *testing.T) {
@@ -436,9 +440,9 @@ func (s *InterchainAccountsTestSuite) testMsgSendTxSuccessfulGovProposal(order c
436440
t := s.T()
437441
ctx := context.TODO()
438442

439-
// setup relayers and connection-0 between two chains
440-
// channel-0 is a transfer channel but it will not be used in this test case
441-
relayer := s.GetRelayer()
443+
testName := t.Name()
444+
relayer := s.CreateDefaultPaths(testName)
445+
442446
chainA, chainB := s.GetChains()
443447

444448
// setup 2 accounts: controller account on chain A, a second chain B account.
@@ -457,7 +461,7 @@ func (s *InterchainAccountsTestSuite) testMsgSendTxSuccessfulGovProposal(order c
457461
})
458462

459463
t.Run("start relayer", func(t *testing.T) {
460-
s.StartRelayer(relayer)
464+
s.StartRelayer(relayer, testName)
461465
})
462466

463467
t.Run("verify interchain account", func(t *testing.T) {

e2e/tests/interchain_accounts/gov_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ func (s *InterchainAccountsGovTestSuite) TestInterchainAccountsGovIntegration()
4040
t := s.T()
4141
ctx := context.TODO()
4242

43-
relayer := s.GetRelayer()
43+
testName := t.Name()
44+
relayer := s.CreateDefaultPaths(testName)
45+
4446
chainA, chainB := s.GetChains()
4547
controllerAccount := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount)
4648

@@ -58,7 +60,7 @@ func (s *InterchainAccountsGovTestSuite) TestInterchainAccountsGovIntegration()
5860
})
5961

6062
t.Run("start relayer", func(t *testing.T) {
61-
s.StartRelayer(relayer)
63+
s.StartRelayer(relayer, testName)
6264
})
6365

6466
s.Require().NoError(test.WaitForBlocks(ctx, 10, chainA, chainB))

e2e/tests/interchain_accounts/groups_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ func (s *InterchainAccountsGroupsTestSuite) TestInterchainAccountsGroupsIntegrat
8686
err error
8787
)
8888

89-
relayer := s.GetRelayer()
89+
testName := t.Name()
90+
relayer := s.CreateDefaultPaths(testName)
91+
9092
chainA, chainB := s.GetChains()
9193

9294
chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount)
@@ -135,7 +137,7 @@ func (s *InterchainAccountsGroupsTestSuite) TestInterchainAccountsGroupsIntegrat
135137
})
136138

137139
t.Run("start relayer", func(t *testing.T) {
138-
s.StartRelayer(relayer)
140+
s.StartRelayer(relayer, testName)
139141
})
140142

141143
t.Run("verify interchain account registration success", func(t *testing.T) {

0 commit comments

Comments
 (0)