Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: submit MsgTransfer #50

Merged
merged 20 commits into from
Dec 23, 2024
Merged

Conversation

rootulp
Copy link
Collaborator

@rootulp rootulp commented Dec 18, 2024

Part 1 of #31

Description

  • Extract some utility methods to a utils package so they can be re-used by the initialize client commands and the transfer command.
  • Define the make transfer command
  • In SimApp, create a transfer module v2 and ibc router v2 (two new things that are introduced by IBC Eureka)
  • Miscellaneous clean-up like removing old debug logs, renaming things for clarity, etc.
  • Fixed make lint issues

@rootulp rootulp self-assigned this Dec 18, 2024
This is the type used in solidity-ibc-eureka e2e tests for sending
tokens from a Cosmos chain back to an EVM chain
2024-12-18 15:57:43 8:57PM ERR send packet failed error="send packet
failed: failed to get consensus state: consensus state does not exist
for height 0-19: consensus state not found
[/celestia_zkevm_ibc_demo/ibc/lightclients/groth16/store.go:68]"
module=server source-channel=channel-0
@rootulp
Copy link
Collaborator Author

rootulp commented Dec 19, 2024

Regardless of when I submit the MsgTransfer, I see the error:

2024-12-18 15:57:43 8:57PM ERR send packet failed error="send packet
failed: failed to get consensus state: consensus state does not exist
for height 0-19: consensus state not found
[/celestia_zkevm_ibc_demo/ibc/lightclients/groth16/store.go:68]"
module=server source-channel=channel-0

which makes me think the height 0-19 is hard-coded somewhere. I found the line consensusStates/{revision_number}-{revision_height} so it's likely:

  • revision number: 0
  • revision height: 19

@rootulp
Copy link
Collaborator Author

rootulp commented Dec 19, 2024

Ask questions in:

@rootulp
Copy link
Collaborator Author

rootulp commented Dec 19, 2024

Trying again, this time after setting the consensus state in initialize.

2024-12-19 13:52:36 SetConsensusState height 0-245

this time I hit:

2024-12-19 14:04:37 7:04PM ERR panic recovered in runTx
err="recovered: runtime error: invalid memory address or nil pointer dereference
stack:
goroutine 29 [running]:
runtime/debug.Stack()
    /usr/local/go/src/runtime/debug/stack.go:26 +0x64
github.com/cosmos/cosmos-sdk/baseapp.NewBaseApp.newDefaultRecoveryMiddleware.func5({0x29c9580, 0x5abbb60})
    /go/pkg/mod/github.com/cosmos/[email protected]/baseapp/recovery.go:74 +0x24
github.com/cosmos/cosmos-sdk/baseapp.NewBaseApp.newDefaultRecoveryMiddleware.newRecoveryMiddleware.func7({0x29c9580?, 0x5abbb60?})
    /go/pkg/mod/github.com/cosmos/[email protected]/baseapp/recovery.go:42 +0x38
github.com/cosmos/cosmos-sdk/baseapp.processRecovery({0x29c9580, 0x5abbb60}, 0x4006e2dbd8?)
    /go/pkg/mod/github.com/cosmos/[email protected]/baseapp/recovery.go:31 +0x38
github.com/cosmos/cosmos-sdk/baseapp.processRecovery({0x29c9580, 0x5abbb60}, 0x0?)
    /go/pkg/mod/github.com/cosmos/[email protected]/baseapp/recovery.go:36 +0x60
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runTx.func1()
    /go/pkg/mod/github.com/cosmos/[email protected]/baseapp/baseapp.go:842 +0xd4
panic({0x29c9580?, 0x5abbb60?})
    /usr/local/go/src/runtime/panic.go:785 +0x124
github.com/cosmos/ibc-go/v9/modules/core/api.(*Router).Route(0x40016a3270?, {0x4005c91c30, 0x8})
    /go/pkg/mod/github.com/cosmos/ibc-go/[email protected]/modules/core/api/router.go:40 +0x20
github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/keeper.(*Keeper).SendPacket(0x40016a3270, {0x3c0a758, 0x4006754b70}, 0x400666cf00)
    /go/pkg/mod/github.com/cosmos/ibc-go/[email protected]/modules/core/04-channel/v2/keeper/msg_server.go:93 +0x530
github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types._Msg_SendPacket_Handler.func1({0x3c0a758?, 0x4006754b70?}, {0x2d8cb80?, 0x400666cf00?})
    /go/pkg/mod/github.com/cosmos/ibc-go/[email protected]/modules/core/04-channel/v2/types/tx.pb.go:815 +0xd0
github.com/cosmos/cosmos-sdk/baseapp.(*MsgServiceRouter).registerMsgServiceHandler.func2.1({0x3c0a5d0, 0x4006756008}, {0x4006e2f058?, 0x121c250?}, 0x358?, 0x40015ba348)
    /go/pkg/mod/github.com/cosmos/[email protected]/baseapp/msg_service_router.go:175 +0x98
github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types._Msg_SendPacket_Handler({0x2eaf760, 0x40016a3270}, {0x3c0a5d0, 0x4006756008}, 0x374f070, 0x4005e66a20)
    /go/pkg/mod/github.com/cosmos/ibc-go/[email protected]/modules/core/04-channel/v2/types/tx.pb.go:817 +0x148
github.com/cosmos/cosmos-sdk/baseapp.(*MsgServiceRouter).registerMsgServiceHandler.func2({{0x3c0a3d8, 0x5b7d040}, {0x3c2b1c0, 0x400666d180}, {{0x0, 0x0}, {0x40025864a0, 0xa}, 0xc9, {0x34fc522c, ...}, ...}, ...}, ...)
    /go/pkg/mod/github.com/cosmos/[email protected]/baseapp/msg_service_router.go:198 +0x2b0
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runMsgs(_, {{0x3c0a3d8, 0x5b7d040}, {0x3c2b1c0, 0x400666d180}, {{0x0, 0x0}, {0x40025864a0, 0xa}, 0xc9, ...}, ...}, ...)
    /go/pkg/mod/github.com/cosmos/[email protected]/baseapp/baseapp.go:1021 +0x170
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runTx(0x4001468908, 0x7, {0x4006684000, 0x365, 0x365})
    /go/pkg/mod/github.com/cosmos/[email protected]/baseapp/baseapp.go:959 +0xc98
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).deliverTx(0x4001468908, {0x4006684000?, 0x365?, 0x400684b140?})
    /go/pkg/mod/github.com/cosmos/[email protected]/baseapp/baseapp.go:768 +0x88
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).internalFinalizeBlock(0x4001468908, {0x3c0a3d8, 0x5b7d040}, 0x4006608e40)
    /go/pkg/mod/github.com/cosmos/[email protected]/baseapp/abci.go:793 +0xcb0
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).FinalizeBlock(0x4001468908, 0x4006608e40)
    /go/pkg/mod/github.com/cosmos/[email protected]/baseapp/abci.go:887 +0x118
github.com/cosmos/cosmos-sdk/server.cometABCIWrapper.FinalizeBlock(...)
    /go/pkg/mod/github.com/cosmos/[email protected]/server/cmt_abci.go:44
github.com/cometbft/cometbft/abci/client.(*localClient).FinalizeBlock(0xffff71a6f2e0?, {0x3c0a838?, 0x5b7d040?}, 0xffffb877c108?)
    /go/pkg/mod/github.com/cometbft/[email protected]/abci/client/local_client.go:185 +0xe4
github.com/cometbft/cometbft/proxy.(*appConnConsensus).FinalizeBlock(0x4001999ae8, {0x3c0a838, 0x5b7d040}, 0x4006608e40)
    /go/pkg/mod/github.com/cometbft/[email protected]/proxy/app_conn.go:104 +0x124
github.com/cometbft/cometbft/state.(*BlockExecutor).applyBlock(_, {{{0xb, 0x0}, {0x40025860b9, 0x7}}, {0x40025860d0, 0xa}, 0x1, 0xc8, {{0x4006b45580, ...}, ...}, ...}, ...)
    /go/pkg/mod/github.com/cometbft/[email protected]/state/execution.go:224 +0x410
github.com/cometbft/cometbft/state.(*BlockExecutor).ApplyVerifiedBlock(...)
    /go/pkg/mod/github.com/cometbft/[email protected]/state/execution.go:202
github.com/cometbft/cometbft/consensus.(*State).finalizeCommit(0x400139e388, 0xc9)
    /go/pkg/mod/github.com/cometbft/[email protected]/consensus/state.go:1772 +0x97c
github.com/cometbft/cometbft/consensus.(*State).tryFinalizeCommit(0x400139e388, 0xc9)
    /go/pkg/mod/github.com/cometbft/[email protected]/consensus/state.go:1682 +0x26c
github.com/cometbft/cometbft/consensus.(*State).enterCommit.func1()
    /go/pkg/mod/github.com/cometbft/[email protected]/consensus/state.go:1617 +0x8c
github.com/cometbft/cometbft/consensus.(*State).enterCommit(0x400139e388, 0xc9, 0x0)
    /go/pkg/mod/github.com/cometbft/[email protected]/consensus/state.go:1655 +0xac0
github.com/cometbft/cometbft/consensus.(*State).addVote(0x400139e388, 0x40014eb860, {0x0, 0x0})
    /go/pkg/mod/github.com/cometbft/[email protected]/consensus/state.go:2343 +0x1a10
github.com/cometbft/cometbft/consensus.(*State).tryAddVote(0x400139e388, 0x40014eb860, {0x0?, 0xdb7b0?})
    /go/pkg/mod/github.com/cometbft/[email protected]/consensus/state.go:2067 +0x28
github.com/cometbft/cometbft/consensus.(*State).handleMsg(0x400139e388, {{0x3bd9540, 0x4002125e08}, {0x0, 0x0}})
    /go/pkg/mod/github.com/cometbft/[email protected]/consensus/state.go:929 +0x2fc
github.com/cometbft/cometbft/consensus.(*State).receiveRoutine(0x400139e388, 0x0)
    /go/pkg/mod/github.com/cometbft/[email protected]/consensus/state.go:856 +0x364
created by github.com/cometbft/cometbft/consensus.(*State).OnStart in goroutine 1
    /go/pkg/mod/github.com/cometbft/[email protected]/consensus/state.go:398 +0xf0
: panic"
module=server

@cmwaters
Copy link
Collaborator

github.com/cosmos/ibc-go/v9/modules/core/api.(*Router).Route(0x40016a3270?, {0x4005c91c30, 0x8})
    /go/pkg/mod/github.com/cosmos/ibc-go/[email protected]/modules/core/api/router.go:40

Sounds like the router might not be correctly wired

@rootulp
Copy link
Collaborator Author

rootulp commented Dec 20, 2024

I figured out how to get ibc-go modifications into the simapp Docker image, I needed to push them to a branch: https://github.com/rootulp/ibc-go/tree/rp/debug

Logs:

2024-12-20 14:41:18 portID: transfer
2024-12-20 14:41:18 7:41PM ERR panic recovered in runTx err="recovered: runtime error: invalid memory address or nil pointer dereference\nstack:\ngoroutine 254 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:26 +0x64\ngithub.com/cosmos/cosmos-sdk/baseapp.NewBaseApp.newDefaultRecoveryMiddleware.func5({0x29c9580, 0x5abbb60})\n\t/go/pkg/mod/github.com/cosmos/[email protected]/baseapp/recovery.go:74 +0x24\ngithub.com/cosmos/cosmos-sdk/baseapp.NewBaseApp.newDefaultRecoveryMiddleware.newRecoveryMiddleware.func7({0x29c9580?, 0x5abbb60?})\n\t/go/pkg/mod/github.com/cosmos/[email protected]/baseapp/recovery.go:42 +0x38\ngithub.com/cosmos/cosmos-sdk/baseapp.processRecovery({0x29c9580, 0x5abbb60}, 0x4001b49ba8?)\n\t/go/pkg/mod/github.com/cosmos/[email protected]/baseapp/recovery.go:31 +0x38\ngithub.com/cosmos/cosmos-sdk/baseapp.processRecovery({0x29c9580, 0x5abbb60}, 0x0?)\n\t/go/pkg/mod/github.com/cosmos/[email protected]/baseapp/recovery.go:36 +0x60\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runTx.func1()\n\t/go/pkg/mod/github.com/cosmos/[email protected]/baseapp/baseapp.go:842 +0xd4\npanic({0x29c9580?, 0x5abbb60?})\n\t/usr/local/go/src/runtime/panic.go:785 +0x124\ngithub.com/cosmos/ibc-go/v9/modules/core/api.(*Router).Route(0x0, {0x40067ffe30, 0x8})\n\t/go/pkg/mod/github.com/rootulp/ibc-go/[email protected]/modules/core/api/router.go:41 +0x78\ngithub.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/keeper.(*Keeper).SendPacket(0x4002234eb0, {0x3c0a798, 0x4002226f00}, 0x4002219f00)\n\t/go/pkg/mod/github.com/rootulp/ibc-go/[email protected]/modules/core/04-channel/v2/keeper/msg_server.go:93 +0x530\ngithub.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types._Msg_SendPacket_Handler.func1({0x3c0a798?, 0x4002226f00?}, {0x2d8cb80?, 0x4002219f00?})\n\t/go/pkg/mod/github.com/rootulp/ibc-go/[email protected]/modules/core/04-channel/v2/types/tx.pb.go:815 +0xd0\ngithub.com/cosmos/cosmos-sdk/baseapp.(*MsgServiceRouter).registerMsgServiceHandler.func2.1({0x3c0a610, 0x400199ae08}, {0x4001b4b058?, 0x121c250?}, 0x358?, 0x4000a52e10)\n\t/go/pkg/mod/github.com/cosmos/[email protected]/baseapp/msg_service_router.go:175 +0x98\ngithub.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types._Msg_SendPacket_Handler({0x2eaf760, 0x4002234eb0}, {0x3c0a610, 0x400199ae08}, 0x374f090, 0x4004fd04a0)\n\t/go/pkg/mod/github.com/rootulp/ibc-go/[email protected]/modules/core/04-channel/v2/types/tx.pb.go:817 +0x148\ngithub.com/cosmos/cosmos-sdk/baseapp.(*MsgServiceRouter).registerMsgServiceHandler.func2({{0x3c0a418, 0x5b7d040}, {0x3c2b200, 0x4002563380}, {{0x0, 0x0}, {0x4002516220, 0xa}, 0x1c, {0x1710eca5, ...}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/[email protected]/baseapp/msg_service_router.go:198 +0x2b0\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runMsgs(_, {{0x3c0a418, 0x5b7d040}, {0x3c2b200, 0x4002563380}, {{0x0, 0x0}, {0x4002516220, 0xa}, 0x1c, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/[email protected]/baseapp/baseapp.go:1021 +0x170\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runTx(0x4001700908, 0x7, {0x4000319500, 0x365, 0x365})\n\t/go/pkg/mod/github.com/cosmos/[email protected]/baseapp/baseapp.go:959 +0xc98\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).deliverTx(0x4001700908, {0x4000319500?, 0x365?, 0x40067fde00?})\n\t/go/pkg/mod/github.com/cosmos/[email protected]/baseapp/baseapp.go:768 +0x88\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).internalFinalizeBlock(0x4001700908, {0x3c0a418, 0x5b7d040}, 0x400195f080)\n\t/go/pkg/mod/github.com/cosmos/[email protected]/baseapp/abci.go:793 +0xcb0\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).FinalizeBlock(0x4001700908, 0x400195f080)\n\t/go/pkg/mod/github.com/cosmos/[email protected]/baseapp/abci.go:887 +0x118\ngithub.com/cosmos/cosmos-sdk/server.cometABCIWrapper.FinalizeBlock(...)\n\t/go/pkg/mod/github.com/cosmos/[email protected]/server/cmt_abci.go:44\ngithub.com/cometbft/cometbft/abci/client.(*localClient).FinalizeBlock(0xffff52171170?, {0x3c0a878?, 0x5b7d040?}, 0xffff992a9a68?)\n\t/go/pkg/mod/github.com/cometbft/[email protected]/abci/client/local_client.go:185 +0xe4\ngithub.com/cometbft/cometbft/proxy.(*appConnConsensus).FinalizeBlock(0x40019369f0, {0x3c0a878, 0x5b7d040}, 0x400195f080)\n\t/go/pkg/mod/github.com/cometbft/[email protected]/proxy/app_conn.go:104 +0x124\ngithub.com/cometbft/cometbft/state.(*BlockExecutor).applyBlock(_, {{{0xb, 0x0}, {0x4001b55f49, 0x7}}, {0x4001b55f60, 0xa}, 0x1, 0x1b, {{0x400674b7e0, ...}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cometbft/[email protected]/state/execution.go:224 +0x410\ngithub.com/cometbft/cometbft/state.(*BlockExecutor).ApplyVerifiedBlock(...)\n\t/go/pkg/mod/github.com/cometbft/[email protected]/state/execution.go:202\ngithub.com/cometbft/cometbft/consensus.(*State).finalizeCommit(0x4002159508, 0x1c)\n\t/go/pkg/mod/github.com/cometbft/[email protected]/consensus/state.go:1772 +0x97c\ngithub.com/cometbft/cometbft/consensus.(*State).tryFinalizeCommit(0x4002159508, 0x1c)\n\t/go/pkg/mod/github.com/cometbft/[email protected]/consensus/state.go:1682 +0x26c\ngithub.com/cometbft/cometbft/consensus.(*State).enterCommit.func1()\n\t/go/pkg/mod/github.com/cometbft/[email protected]/consensus/state.go:1617 +0x8c\ngithub.com/cometbft/cometbft/consensus.(*State).enterCommit(0x4002159508, 0x1c, 0x0)\n\t/go/pkg/mod/github.com/cometbft/[email protected]/consensus/state.go:1655 +0xac0\ngithub.com/cometbft/cometbft/consensus.(*State).addVote(0x4002159508, 0x4001a89ad0, {0x0, 0x0})\n\t/go/pkg/mod/github.com/cometbft/[email protected]/consensus/state.go:2343 +0x1a10\ngithub.com/cometbft/cometbft/consensus.(*State).tryAddVote(0x4002159508, 0x4001a89ad0, {0x0?, 0xdb7b0?})\n\t/go/pkg/mod/github.com/cometbft/[email protected]/consensus/state.go:2067 +0x28\ngithub.com/cometbft/cometbft/consensus.(*State).handleMsg(0x4002159508, {{0x3bd9580, 0x4001312c88}, {0x0, 0x0}})\n\t/go/pkg/mod/github.com/cometbft/[email protected]/consensus/state.go:929 +0x2fc\ngithub.com/cometbft/cometbft/consensus.(*State).receiveRoutine(0x4002159508, 0x0)\n\t/go/pkg/mod/github.com/cometbft/[email protected]/consensus/state.go:856 +0x364\ncreated by github.com/cometbft/cometbft/consensus.(*State).OnStart in goroutine 1\n\t/go/pkg/mod/github.com/cometbft/[email protected]/consensus/state.go:398 +0xf0\n: panic" module=server

rtr.routes isn't created correctly: https://github.com/rootulp/ibc-go/blob/2f71b0ea9a2d83cefad1fcb94431e7dce24facf8/modules/core/api/router.go#L41 which should get created when running NewRouter.

ibc-go creates two routers here.

Our simapp only creates one router here

@rootulp
Copy link
Collaborator Author

rootulp commented Dec 20, 2024

MsgTransfer gets included now!

@rootulp rootulp changed the title feat: implement step 1 of make transfer feat: submit MsgTransfer via make transfer Dec 20, 2024
@rootulp rootulp changed the title feat: submit MsgTransfer via make transfer feat: submit MsgTransfer Dec 20, 2024
@rootulp rootulp mentioned this pull request Dec 20, 2024
6 tasks
@rootulp rootulp marked this pull request as ready for review December 20, 2024 20:25
// Replace ibc-go with the most recent commit on the feat/ibc-eureka branch.
// ea4e73629c55e35537467d9f032da5be8082b468 is the recent commit as of this writing.
// See https://github.com/cosmos/ibc-go/tree/feat/ibc-eureka
github.com/cosmos/ibc-go/v9 => github.com/cosmos/ibc-go/v9 v9.0.0-20241218142801-ea4e73629c55
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

slightly more recent commit of ibc-go

@rootulp rootulp merged commit d87ee7d into celestiaorg:main Dec 23, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants