Lazychain / artela-rollkit

0 stars 0 forks source link

Error by modifying chainId on `entrypoint.sh` #2

Open pablin-dev opened 1 month ago

pablin-dev commented 1 month ago

Problem

When changing the blockchain chainId to integrate it into Metamask/leap wallet, an error occur:

runTx err="recovered: 11820: []: invalid chain ID

Reproduce

Initial conditions

Good case

At the end, last transaction should show developer wallet balance with 1000000aart tokens.

Checking dev wallet balance {{kurtosis:1d0467b0a9d94259aa29d0ad67b19730:output.runtime_value}}
Command returned with exit code '0' and the following output:
--------------------
balances:
- amount: "1000000"
  denom: aart
pagination:
  total: "1"

--------------------

Starlark code successfully run. Output was:
{
    "dev_addr": "art16gmzttwf80hfxvdq3hy45nqmwugmjn5tgqpx5j",
    "validator_addr": "art1udzvrkgjz68mqzljta2pt7q4gu2h9d8pu73fcq"
}

Error case

Note: the entrypoint.sh runs the go executable generated artrolld start --rollkit.aggregator --rollkit.da_address $DA_ADDRESS

10:27AM INF initializing blockchain state from genesis.json module=server
  10:27AM INF asserted all invariants duration=0.00009 height=0 module=x/crisis
  10:27AM ERR panic recovered in runTx err="recovered: 11820: []: invalid chain ID [/app/ethereum/types/chain_id.go:45]\nstack:\ngoroutine 1 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x5e\ngithub.com/cosmos/cosmos-sdk/baseapp.NewBaseApp.newDefaultRecoveryMiddleware.func5({0x483bb80, 0xc00184c5c0})\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/baseapp/recovery.go:74 +0x25\ngithub.com/cosmos/cosmos-sdk/baseapp.NewBaseApp.newDefaultRecoveryMiddleware.newRecoveryMiddleware.func7({0x483bb80?, 0xc00184c5c0?})\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/baseapp/recovery.go:42 +0x2d\ngithub.com/cosmos/cosmos-sdk/baseapp.processRecovery({0x483bb80, 0xc00184c5c0}, 0x8b6c4c0?)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/baseapp/recovery.go:31 +0x2f\ngithub.com/cosmos/cosmos-sdk/baseapp.processRecovery({0x483bb80, 0xc00184c5c0}, 0xc000b4ccc0?)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/baseapp/recovery.go:36 +0x53\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runTx.func1()\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/baseapp/baseapp.go:837 +0x156\npanic({0x483bb80?, 0xc00184c5c0?})\n\t/usr/local/go/src/runtime/panic.go:770 +0x132\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.SetUpContextDecorator.AnteHandle.func1()\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/x/auth/ante/setup.go:65 +0x1fb\npanic({0x483bb80?, 0xc00184c5c0?})\n\t/usr/local/go/src/runtime/panic.go:770 +0x132\ngithub.com/artela-network/artela-rollkit/x/evm/keeper.(*Keeper).InitChainID(0xc001ad41c0)\n\t/app/x/evm/keeper/keeper.go:173 +0xc5\ngithub.com/artela-network/artela-rollkit/x/evm/keeper.Keeper.ChainID(...)\n\t/app/x/evm/keeper/keeper.go:186\ngithub.com/artela-network/artela-rollkit/app/ante/evm.GasWantedDecorator.AnteHandle({{_, _}, {_, _}}, {{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, ...}, ...}, ...)\n\t/app/app/ante/evm/gaswanted_checker.go:36 +0x199\ngithub.com/artela-network/artela-rollkit/app/ante.newCosmosAnteHandler.ChainAnteDecorators.func2({{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, {0x17bf9069, ...}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/types/handler.go:48 +0x105\ngithub.com/cosmos/ibc-go/v8/modules/core/ante.RedundantRelayDecorator.AnteHandle({_}, {{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/ibc-go/v8@v8.2.0/modules/core/ante/ante.go:91 +0x1c3\ngithub.com/artela-network/artela-rollkit/app/ante.newCosmosAnteHandler.ChainAnteDecorators.func2({{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, {0x17bf9069, ...}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/types/handler.go:48 +0x105\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.IncrementSequenceDecorator.AnteHandle({{_, _}}, {{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/x/auth/ante/sigverify.go:382 +0x30e\ngithub.com/artela-network/artela-rollkit/app/ante.newCosmosAnteHandler.ChainAnteDecorators.func2({{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, {0x17bf9069, ...}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/types/handler.go:48 +0x105\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.SigVerificationDecorator.AnteHandle({{_, _}, _}, {{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, ...}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/x/auth/ante/sigverify.go:339 +0x7ae\ngithub.com/artela-network/artela-rollkit/app/ante.newCosmosAnteHandler.ChainAnteDecorators.func2({{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, {0x17bf9069, ...}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/types/handler.go:48 +0x105\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.SigGasConsumeDecorator.AnteHandle({{_, _}, _}, {{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, ...}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/x/auth/ante/sigverify.go:212 +0x62e\ngithub.com/artela-network/artela-rollkit/app/ante.newCosmosAnteHandler.ChainAnteDecorators.func2({{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, {0x17bf9069, ...}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/types/handler.go:48 +0x105\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.ValidateSigCountDecorator.AnteHandle({{_, _}}, {{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/x/auth/ante/sigverify.go:420 +0x3ee\ngithub.com/artela-network/artela-rollkit/app/ante.newCosmosAnteHandler.ChainAnteDecorators.func2({{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, {0x17bf9069, ...}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/types/handler.go:48 +0x105\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.SetPubKeyDecorator.AnteHandle({{_, _}}, {{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/x/auth/ante/sigverify.go:141 +0xb52\ngithub.com/artela-network/artela-rollkit/app/ante.newCosmosAnteHandler.ChainAnteDecorators.func2({{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, {0x17bf9069, ...}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/types/handler.go:48 +0x105\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.ConsumeTxSizeGasDecorator.AnteHandle({{_, _}}, {{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/x/auth/ante/basic.go:153 +0x666\ngithub.com/artela-network/artela-rollkit/app/ante.newCosmosAnteHandler.ChainAnteDecorators.func2({{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, {0x17bf9069, ...}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/types/handler.go:48 +0x105\ngithub.com/artela-network/artela-rollkit/app/ante/cosmos.MinGasPriceDecorator.AnteHandle({{_, _}, {_, _}}, {{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, ...}, ...}, ...)\n\t/app/app/ante/cosmos/gas_checker.go:81 +0x6d0\ngithub.com/artela-network/artela-rollkit/app/ante.newCosmosAnteHandler.ChainAnteDecorators.func2({{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, {0x17bf9069, ...}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/types/handler.go:48 +0x105\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.ValidateMemoDecorator.AnteHandle({{_, _}}, {{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/x/auth/ante/basic.go:72 +0x20e\ngithub.com/artela-network/artela-rollkit/app/ante.newCosmosAnteHandler.ChainAnteDecorators.func2({{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, {0x17bf9069, ...}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/types/handler.go:48 +0x105\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.TxTimeoutHeightDecorator.AnteHandle({}, {{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/x/auth/ante/basic.go:216 +0x2ae\ngithub.com/artela-network/artela-rollkit/app/ante.newCosmosAnteHandler.ChainAnteDecorators.func2({{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, {0x17bf9069, ...}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/types/handler.go:48 +0x105\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.ValidateBasicDecorator.AnteHandle({}, {{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/x/auth/ante/basic.go:39 +0x276\ngithub.com/artela-network/artela-rollkit/app/ante.newCosmosAnteHandler.ChainAnteDecorators.func2({{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, {0x17bf9069, ...}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/types/handler.go:48 +0x105\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.RejectExtensionOptionsDecorator.AnteHandle({_}, {{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/x/auth/ante/ext.go:52 +0x14e\ngithub.com/artela-network/artela-rollkit/app/ante.newCosmosAnteHandler.ChainAnteDecorators.func2({{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, {0x17bf9069, ...}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/types/handler.go:48 +0x105\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.SetUpContextDecorator.AnteHandle({}, {{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/x/auth/ante/setup.go:70 +0x7e6\ngithub.com/artela-network/artela-rollkit/app/ante.newCosmosAnteHandler.ChainAnteDecorators.func2({{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, {0x17bf9069, ...}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/types/handler.go:48 +0x105\ngithub.com/artela-network/artela-rollkit/app/ante/cosmos.AuthzLimiterDecorator.AnteHandle({{_, _, _}}, {{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, ...}, ...}, ...}, ...)\n\t/app/app/ante/cosmos/authz_checker.go:33 +0x1ce\ngithub.com/artela-network/artela-rollkit/app/ante.newCosmosAnteHandler.ChainAnteDecorators.func2({{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, {0x17bf9069, ...}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/types/handler.go:48 +0x105\ngithub.com/artela-network/artela-rollkit/app/ante/cosmos.RejectMessagesDecorator.AnteHandle({}, {{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, ...}, ...}, ...)\n\t/app/app/ante/cosmos/msg_checker.go:26 +0x18e\ngithub.com/artela-network/artela-rollkit/app/ante.newCosmosAnteHandler.ChainAnteDecorators.func2({{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, {0x17bf9069, ...}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/types/handler.go:48 +0x105\ngithub.com/artela-network/artela-rollkit/app.(*App).setAnteHandler.NewAnteHandler.func2({{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc0015e51c0}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, {0x17bf9069, ...}, ...}, ...}, ...)\n\t/app/app/ante/handler.go:54 +0x5b6\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runTx(0xc001afcff8, 0x7, {0xc0012de240, 0x210, 0x210})\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/baseapp/baseapp.go:900 +0x97f\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).deliverTx(0xc001afcff8, {0xc0012de240?, 0xc003353170?, 0xc003353200?})\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/baseapp/baseapp.go:763 +0xc6\ngithub.com/cosmos/cosmos-sdk/baseapp.BaseApp.ExecuteGenesisTx({{0x60bdca0, 0xc000843e30}, {0xc0014013f0, 0x7}, {0x60dd020, 0xc0011870e8}, {0x61199b0, 0xc000f13400}, {0x0, 0x0}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/baseapp/genesis.go:16 +0x2d\ngithub.com/cosmos/cosmos-sdk/x/genutil.DeliverGenTxs({{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc002514840}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, {0x17bf9069, ...}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/x/genutil/gentx.go:108 +0x14a\ngithub.com/cosmos/cosmos-sdk/x/genutil.InitGenesis(...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/x/genutil/genesis.go:20\ngithub.com/cosmos/cosmos-sdk/x/genutil.AppModule.InitGenesis({{_}, {_, _}, {_, _}, {_, _}, {_, _}}, {{0x60b1540, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/x/genutil/module.go:106 +0x148\ngithub.com/cosmos/cosmos-sdk/types/module.(*Manager).InitGenesis(_, {{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc002514840}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/types/module/module.go:508 +0x854\ngithub.com/cosmos/cosmos-sdk/runtime.(*App).InitChainer(_, {{0x60b1540, 0x8b6c4c0}, {0x60d7fb0, 0xc002514840}, {{0x0, 0x0}, {0xc002f7ac60, 0x5}, 0x0, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/runtime/app.go:188 +0xdf\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).InitChain(0xc0002ddd48, 0xc000bd8850)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/baseapp/abci.go:105 +0x6a2\ngithub.com/cosmos/cosmos-sdk/server.cometABCIWrapper.InitChain(...)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/server/cmt_abci.go:32\ngithub.com/cometbft/cometbft/abci/client.(*localClient).InitChain(0xc0030b6300?, {0x60b1540?, 0x8b6c4c0?}, 0x7f3120218a78?)\n\t/go/pkg/mod/github.com/cometbft/cometbft@v0.38.7/abci/client/local_client.go:120 +0xcd\ngithub.com/cometbft/cometbft/proxy.(*appConnConsensus).InitChain(0xc0030b43c0, {0x60b1540, 0x8b6c4c0}, 0xc000bd8850)\n\t/go/pkg/mod/github.com/cometbft/cometbft@v0.38.7/proxy/app_conn.go:78 +0x170\ngithub.com/rollkit/rollkit/state.(*BlockExecutor).InitChain(0xc000bd87e0, 0xc002f77100)\n\t/go/pkg/mod/github.com/rollkit/rollkit@v0.13.6/state/executor.go:66 +0x4ce\ngithub.com/rollkit/rollkit/block.NewManager({0x60babc0, 0xc002e7d3c8}, {0x3b9aca00, 0x37e11d600, 0x0, 0x19, 0x0, 0xdf8475800}, 0xc002f77100, {0x60fb2e0, ...}, ...)\n\t/go/pkg/mod/github.com/rollkit/rollkit@v0.13.6/block/manager.go:209 +0x545\ngithub.com/rollkit/rollkit/node.initBlockManager({_, _}, {{0xc0014017c0, 0xe}, {0xc001184608, 0x4}, {{0xc002f515a0, 0x16}, {0x0, 0x0}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/rollkit/rollkit@v0.13.6/node/full.go:267 +0x1dd\ngithub.com/rollkit/rollkit/node.newFullNode({_, _}, {{0xc0014017c0, 0xe}, {0xc001184608, 0x4}, {{0xc002f515a0, 0x16}, {0x0, 0x0}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/rollkit/rollkit@v0.13.6/node/full.go:158 +0x811\ngithub.com/rollkit/rollkit/node.NewNode({_, _}, {{0xc0014017c0, 0xe}, {0xc001184608, 0x4}, {{0xc002f515a0, 0x16}, {0x0, 0x0}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/rollkit/rollkit@v0.13.6/node/node.go:37 +0x14e\ngithub.com/artela-network/artela-rollkit/ethereum/server.startNode({0x60b17a8, 0xc00199a3c0}, 0xc000c38780, {0x610a858, 0xc001030d88}, 0xc0008754c0)\n\t/app/ethereum/server/start.go:319 +0x566\ngithub.com/artela-network/artela-rollkit/ethereum/server.startInProcess[...](_, {{{0xc000b80cd9, 0x5}, 0x0, {0xc000b815f0, 0x7}, {0x4d01fcb, 0x1}, {0x4d01fcb, 0x1}, ...}, ...}, ...)\n\t/app/ethereum/server/start.go:110 +0x165\ngithub.com/artela-network/artela-rollkit/ethereum/server.StartHandler[...](_, {{0x0, 0x0, 0x0}, {0x60e4818, 0xc0014d6a20}, 0x0, {0xc001184480, 0x5}, {0x610a790, ...}, ...}, ...)\n\t/app/ethereum/server/start.go:70 +0x368\ngithub.com/cosmos/cosmos-sdk/server.StartCmdWithOptions.func2.1()\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/server/start.go:198 +0x63\ngithub.com/cosmos/cosmos-sdk/server.wrapCPUProfile(0xc0008754c0, 0xc00170f9f8)\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/server/start.go:570 +0x1b3\ngithub.com/cosmos/cosmos-sdk/server.StartCmdWithOptions.func2(0xc000e9f508, {0xc0014c4f00?, 0x0?, 0x3?})\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/server/start.go:197 +0x212\ngithub.com/spf13/cobra.(*Command).execute(0xc000e9f508, {0xc0014c4e10, 0x3, 0x3})\n\t/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:985 +0xaca\ngithub.com/spf13/cobra.(*Command).ExecuteC(0xc00179bb08)\n\t/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1117 +0x3ff\ngithub.com/spf13/cobra.(*Command).Execute(...)\n\t/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1041\ngithub.com/spf13/cobra.(*Command).ExecuteContext(...)\n\t/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1034\ngithub.com/cosmos/cosmos-sdk/server/cmd.Execute(0xc00179bb08, {0x0, 0x0}, {0xc0014017c0, 0xe})\n\t/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.50.6/server/cmd/execute.go:34 +0x187\nmain.main()\n\t/app/cmd/artrolld/main.go:15 +0x33\n: panic" module=server
pablin-dev commented 1 month ago

Looking into the error case container via docker run -it --entrypoint /bin/bash ghcr.io/lazychain/artela-rollkit-lazy:v0.0.1-beta4, inside executing /opt/entrypoint.sh and later looking at the generated genesis.json via head -n 10 .artroll/config/genesis.json, it shows

{
  "app_name": "\u003cappd\u003e",
  "app_version": "",
  "genesis_time": "2024-10-16T10:51:12.767288993Z",
  "chain_id": "11820",
  "initial_height": 1,
  "app_hash": null,
  "app_state": {
    "06-solomachine": null,
    "07-tendermint": null,

The app name appear as strange, where it should be "app_name": "artela-rollkitd". Seems like the genesis.json is generating wrong?

The good case generates the same

{
  "app_name": "\u003cappd\u003e",
  "app_version": "",
  "genesis_time": "2024-10-16T11:10:15.489180645Z",
  "chain_id": "artroll_11820-1",
  "initial_height": 1,
  "app_hash": null,
  "app_state": {
    "06-solomachine": null,
    "07-tendermint": null,
pablin-dev commented 1 month ago

Manually executing the script step by step:

docker run -it --entrypoint /bin/bash ghcr.io/lazychain/artela-rollkit-lazy:v0.0.1-beta4
artrolld config set client chain-id 11820
artrolld config set client keyring-backend test
artrolld keys add validator --keyring-backend test --algo eth_secp256k1
artrolld init localtestnet --chain-id 11820
add-genesis-account validator "100000000000000000000000000aart" --keyring-backend test
artrolld gentx validator "1000000000000000000000aart" --keyring-backend test --chain-id 11820 --fees "4000000000000000aart"
ADDRESS=$(jq -r '.address' /root/.artroll/config/priv_validator_key.json)
PUB_KEY=$(jq -r '.pub_key' /root/.artroll/config/priv_validator_key.json)
jq --argjson pubKey "$PUB_KEY" '.consensus["validators"]=[{"address": "'$ADDRESS'", "pub_key": $pubKey, "power": "1000000000000000", "name": "Rollkit Sequencer"}]' /root/.artroll/config/genesis.json > temp.json && mv temp.json /root/.artroll/config/genesis.json
artrolld collect-gentxs
{
 "moniker": "localtestnet",
 "chain_id": "11820",
 "node_id": "2b2c486c248b54f18fcc1de96226ecdf8fdbfbc5",
 "gentxs_dir": "",
 "app_message": {
  "06-solomachine": null,
  "07-tendermint": null,
  "auth": {
   "params": {
    "max_memo_characters": "256",
    "tx_sig_limit": "7",
    "tx_size_cost_per_byte": "10",
    "sig_verify_cost_ed25519": "590",
    "sig_verify_cost_secp256k1": "1000"
   },
   "accounts": []
  },
  "authz": {
   "authorization": []
  },
  "bank": {
   "params": {
    "send_enabled": [],
    "default_send_enabled": true
   },
   "balances": [],
   "supply": [],
   "denom_metadata": [],
   "send_enabled": []
  },
  "capability": {
   "index": "1",
   "owners": []
  },
  "circuit": {
   "account_permissions": [],
   "disabled_type_urls": []
  },
  "consensus": null,
  "crisis": {
   "constant_fee": {
    "denom": "stake",
    "amount": "1000"
   }
  },
  "distribution": {
   "params": {
    "community_tax": "0.020000000000000000",
    "base_proposer_reward": "0.000000000000000000",
    "bonus_proposer_reward": "0.000000000000000000",
    "withdraw_addr_enabled": true
   },
   "fee_pool": {
    "community_pool": []
   },
   "delegator_withdraw_infos": [],
   "previous_proposer": "",
   "outstanding_rewards": [],
   "validator_accumulated_commissions": [],
   "validator_historical_rewards": [],
   "validator_current_rewards": [],
   "delegator_starting_infos": [],
   "validator_slash_events": []
  },
  "evidence": {
   "evidence": []
  },
  "evm": {
   "params": {
    "evm_denom": "aart",
    "enable_create": true,
    "enable_call": true,
    "extra_eips": [],
    "chain_config": {
     "homestead_block": "0",
     "dao_fork_block": "0",
     "dao_fork_support": true,
     "eip150_block": "0",
     "eip150_hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
     "eip155_block": "0",
     "eip158_block": "0",
     "byzantium_block": "0",
     "constantinople_block": "0",
     "petersburg_block": "0",
     "istanbul_block": "0",
     "muir_glacier_block": "0",
     "berlin_block": "0",
     "london_block": "0",
     "arrow_glacier_block": "0",
     "gray_glacier_block": "0",
     "merge_netsplit_block": "0",
     "shanghai_block": "0",
     "cancun_block": "0"
    },
    "allow_unprotected_txs": false
   },
   "accounts": []
  },
  "fee": {
   "params": {
    "no_base_fee": false,
    "base_fee_change_denominator": 8,
    "elasticity_multiplier": 2,
    "enable_height": "0",
    "base_fee": "1000000000",
    "min_gas_price": "20000000000.000000000000000000",
    "min_gas_multiplier": "0.500000000000000000"
   },
   "block_gas": "0"
  },
  "feegrant": {
   "allowances": []
  },
  "feeibc": {
   "identified_fees": [],
   "fee_enabled_channels": [],
   "registered_payees": [],
   "registered_counterparty_payees": [],
   "forward_relayers": []
  },
  "genutil": {
   "gen_txs": []
  },
  "gov": {
   "starting_proposal_id": "1",
   "deposits": [],
   "votes": [],
   "proposals": [],
   "deposit_params": null,
   "voting_params": null,
   "tally_params": null,
   "params": {
    "min_deposit": [
     {
      "denom": "stake",
      "amount": "10000000"
     }
    ],
    "max_deposit_period": "172800s",
    "voting_period": "172800s",
    "quorum": "0.334000000000000000",
    "threshold": "0.500000000000000000",
    "veto_threshold": "0.334000000000000000",
    "min_initial_deposit_ratio": "0.000000000000000000",
    "proposal_cancel_ratio": "0.500000000000000000",
    "proposal_cancel_dest": "",
    "expedited_voting_period": "86400s",
    "expedited_threshold": "0.667000000000000000",
    "expedited_min_deposit": [
     {
      "denom": "stake",
      "amount": "50000000"
     }
    ],
    "burn_vote_quorum": false,
    "burn_proposal_deposit_prevote": false,
    "burn_vote_veto": true,
    "min_deposit_ratio": "0.010000000000000000"
   },
   "constitution": ""
  },
  "group": {
   "group_seq": "0",
   "groups": [],
   "group_members": [],
   "group_policy_seq": "0",
   "group_policies": [],
   "proposal_seq": "0",
   "proposals": [],
   "votes": []
  },
  "ibc": {
   "client_genesis": {
    "clients": [],
    "clients_consensus": [],
    "clients_metadata": [],
    "params": {
     "allowed_clients": [
      "*"
     ]
    },
    "create_localhost": false,
    "next_client_sequence": "0"
   },
   "connection_genesis": {
    "connections": [],
    "client_connection_paths": [],
    "next_connection_sequence": "0",
    "params": {
     "max_expected_time_per_block": "30000000000"
    }
   },
   "channel_genesis": {
    "channels": [],
    "acknowledgements": [],
    "commitments": [],
    "receipts": [],
    "send_sequences": [],
    "recv_sequences": [],
    "ack_sequences": [],
    "next_channel_sequence": "0",
    "params": {
     "upgrade_timeout": {
      "height": {
       "revision_number": "0",
       "revision_height": "0"
      },
      "timestamp": "600000000000"
     }
    }
   }
  },
  "interchainaccounts": {
   "controller_genesis_state": {
    "active_channels": [],
    "interchain_accounts": [],
    "ports": [],
    "params": {
     "controller_enabled": true
    }
   },
   "host_genesis_state": {
    "active_channels": [],
    "interchain_accounts": [],
    "port": "icahost",
    "params": {
     "host_enabled": true,
     "allow_messages": [
      "*"
     ]
    }
   }
  },
  "mint": {
   "minter": {
    "inflation": "0.130000000000000000",
    "annual_provisions": "0.000000000000000000"
   },
   "params": {
    "mint_denom": "stake",
    "inflation_rate_change": "0.130000000000000000",
    "inflation_max": "0.200000000000000000",
    "inflation_min": "0.070000000000000000",
    "goal_bonded": "0.670000000000000000",
    "blocks_per_year": "6311520"
   }
  },
  "nft": {
   "classes": [],
   "entries": []
  },
  "params": null,
  "runtime": null,
  "slashing": {
   "params": {
    "signed_blocks_window": "100",
    "min_signed_per_window": "0.500000000000000000",
    "downtime_jail_duration": "600s",
    "slash_fraction_double_sign": "0.050000000000000000",
    "slash_fraction_downtime": "0.010000000000000000"
   },
   "signing_infos": [],
   "missed_blocks": []
  },
  "staking": {
   "params": {
    "unbonding_time": "1814400s",
    "max_validators": 100,
    "max_entries": 7,
    "historical_entries": 10000,
    "bond_denom": "stake",
    "min_commission_rate": "0.000000000000000000"
   },
   "last_total_power": "0",
   "last_validator_powers": [],
   "validators": [],
   "delegations": [],
   "unbonding_delegations": [],
   "redelegations": [],
   "exported": false
  },
  "transfer": {
   "port_id": "transfer",
   "denom_traces": [],
   "params": {
    "send_enabled": true,
    "receive_enabled": true
   },
   "total_escrowed": []
  },
  "upgrade": {},
  "vesting": {}
 }
}

Note:

"crisis": {
   "constant_fee": {
    "denom": "stake",
    "amount": "1000"
   }
  },
pablin-dev commented 1 month ago

Using only the following setup on entrpoint.sh

artrolld config set client chain-id 11820
artrolld config set client keyring-backend test
artrolld keys add validator --keyring-backend test --algo eth_secp256k1
artrolld init localtestnet --chain-id 11820
add-genesis-account validator "100000000000000000000000000aart" --keyring-backend test
artrolld gentx validator "1000000000000000000000aart" --keyring-backend test --chain-id 11820 --fees "4000000000000000aart"
ADDRESS=$(jq -r '.address' /root/.artroll/config/priv_validator_key.json)
PUB_KEY=$(jq -r '.pub_key' /root/.artroll/config/priv_validator_key.json)
jq --argjson pubKey "$PUB_KEY" '.consensus["validators"]=[{"address": "'$ADDRESS'", "pub_key": $pubKey, "power": "1000000000000000", "name": "Rollkit Sequencer"}]' /root/.artroll/config/genesis.json > temp.json && mv temp.json /root/.artroll/config/genesis.json
artrolld collect-gentxs

gives panic: failed to execute DeliverTx for

{
          "body": {
            "messages": [
              {
                "@type": "/cosmos.staking.v1beta1.MsgCreateValidator",
                "description": {
                  "moniker": "localtestnet",
                  "identity": "",
                  "website": "",
                  "security_contact": "",
                  "details": ""
                },
                "commission": {
                  "rate": "0.100000000000000000",
                  "max_rate": "0.200000000000000000",
                  "max_change_rate": "0.010000000000000000"
                },
                "min_self_delegation": "1",
                "delegator_address": "",
                "validator_address": "artvaloper10se9k6f20ck3hph0hklf6869w40kjpm8c95u4t",
                "pubkey": {
                  "@type": "/cosmos.crypto.ed25519.PubKey",
                  "key": "Bwhf36fg/uefcpBPCrc+nYj9HQxIln4FC2Rrb8DP9dA="
                },
                "value": {
                  "denom": "aart",
                  "amount": "1000000000000000000000"
                }
              }
            ],
            "memo": "95400d19973d8e6bffaeeddebe467f59ce272671@192.168.1.203:26656",
            "timeout_height": "0",
            "extension_options": [],
            "non_critical_extension_options": []
          },
          "auth_info": {
            "signer_infos": [
              {
                "public_key": {
                  "@type": "/artela.crypto.ethsecp256k1.PubKey",
                  "key": "A0Yk36P/LE4r1391YcJAxOwXEwbo6q43/M/T0JIZjBGI"
                },
                "mode_info": {
                  "single": {
                    "mode": "SIGN_MODE_DIRECT"
                  }
                },
                "sequence": "0"
              }
            ],
            "fee": {
              "amount": [
                {
                  "denom": "aart",
                  "amount": "4000000000000000"
                }
              ],
              "gas_limit": "200000",
              "payer": "",
              "granter": ""
            },
            "tip": null
          },
          "signatures": [
            "0bMA1s0QJfD/fIsbLBsKwgh57n9xFwi/l0wSQxcWixUV/kkfm3L29nhHzn84/Dxaqe2hKTSuknjfWNBY98oAIQA="
          ]
        }

recovered: 11820: []: invalid chain ID [/app/ethereum/types/chain_id.go:45]

    matches := artelaChainID.FindStringSubmatch(chainID)
    if matches == nil || len(matches) != 4 || matches[1] == "" {
        return nil, errorsmod.Wrapf(ErrInvalidChainID, "%s: %v", chainID, matches)
    }

source

var (
    regexChainID         = `[a-z]{1,}`
    regexEIP155Separator = `_{1}`
    regexEIP155          = `[1-9][0-9]*`
    regexEpochSeparator  = `-{1}`
    regexEpoch           = `[1-9][0-9]*`
    artelaChainID        = regexp.MustCompile(fmt.Sprintf(`^(%s)%s(%s)%s(%s)$`,
        regexChainID,
        regexEIP155Separator,
        regexEIP155,
        regexEpochSeparator,
        regexEpoch))
)

source

So, regular expression ^([a-z]{1,})_{1}([1-9][0-9]*)-{1}([1-9][0-9]*)$

Test Target String MatchString() FindAllString() FindAllStringIndex() FindAllStringSubmatch()
1 artroll_11820-1 true [artroll_11820-1] [0]: 0, 15 [0]: [artroll_11820-1, artroll, 11820, 1]
2 0 false nil nil nil
3 11822 false nil nil nil
4 1137 false nil nil nil
5 a_1137-1 true [a_1137-1] [0]: 0, 8 [0]: [a_1137-1, a, 1137, 1]
LukeNinjaX commented 2 weeks ago

Hi, since Artela is an EVM-compatible Cosmos chain, the chain ID in its genesis is in Cosmos format. However, you can still send transactions to the chain with id artroll_11820-1 using the Ethereum chain ID 11820. I'd like to know why you want to change the chain ID from artroll_11820-1 to 11820?

pablin-dev commented 2 weeks ago

I think if we can change from "artroll11820-1" to "artroll-11820-1", metamask would work. Metamask doesnt like the "" character. The other way would be ask metamask team to change his sanity check.

LukeNinjaX commented 2 weeks ago

Setting it to artroll_11820-1 should also work with MetaMask. In MetaMask, use the chainId 11820 but not artroll_11820-1. In fact, when artroll starts, it extracts the middle part, 11820, as the EVM-compatible chainId. When MetaMask connects to artroll's JSON-RPC (8545), it can read the chainId as 11820.

pablin-dev commented 1 week ago

I confirm that that works. You can close the issue. Thank you!