Agoric / agoric-sdk

monorepo for the Agoric Javascript smart contract platform
Apache License 2.0
327 stars 206 forks source link

PSM only bootstrap configuration #6009

Closed dckc closed 2 years ago

dckc commented 2 years ago

What is the Problem Being Solved?

We have convenient ways to launch the chain with no contracts or with all Inter Protocol contracts, but no convenient way to run just the PSM.

Description of the Design

decentral-pso-config.json, tweaks to inter-protocol/proposals etc.

PSM contract doesn't need to be launched separately from the platform (as in #5819)

Security Considerations

considerably smaller footprint than all of Inter Protocol

Test Plan

make scenario2-run-chain-pso

arirubinstein commented 2 years ago
2022-08-23T22:29:39.070Z launch-chain: polled; blockTime:1661293773, h:16; ADDED = false
2022-08-23T22:29:39.072Z block-manager: DELIVER_INBOUND error: (Error#1)
Error#1: error in inboundCallback: (Error#2)

  at Object.deliverInbound (packages/SwingSet/src/devices/mailbox/mailbox.js:188:14)
  at deliverInbound (packages/cosmic-swingset/src/launch-chain.js:312:13)
  at processAction (packages/cosmic-swingset/src/block-manager.js:57:13)
  at blockingSend (packages/cosmic-swingset/src/block-manager.js:232:19)
  at async portHandlers.<computed> (packages/cosmic-swingset/src/chain-main.js:232:16)

Nested error under Error#1
  Error#2: deliverInboundMessages before registerInboundHandler

    at deliverInboundMessages (.../swingset-vat/src/devices/mailbox/device-mailbox.js:38:1)
    at inboundCallback (.../swingset-vat/src/devices/mailbox/device-mailbox.js:25:1)
    at Object.deliverInbound (packages/SwingSet/src/devices/mailbox/mailbox.js:186:22)
    at deliverInbound (packages/cosmic-swingset/src/launch-chain.js:312:13)
    at processAction (packages/cosmic-swingset/src/block-manager.js:57:13)
    at blockingSend (packages/cosmic-swingset/src/block-manager.js:232:19)
    at async portHandlers.<computed> (packages/cosmic-swingset/src/chain-main.js:232:16)

portHandler threw (Error#1)
{"level":"error","module":"consensus","err":"Error: error in inboundCallback: (an Error)","stack":"goroutine 147 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x65\ngithub.com/tendermint/tendermint/consensus.(*State).receiveRoutine.func2()\n\t/go/pkg/mod/github.com/agoric-labs/tendermint@v0.34.14-alpha.agoric.1/consensus/state.go:726 +0x4c\npanic({0x7f86d2e240e0, 0xc0011c1cb0})\n\t/usr/local/go/src/runtime/panic.go:1038 +0x215\ngithub.com/Agoric/agoric-sdk/golang/cosmos/x/swingset.EndBlock({{0x7f86d30eae48, 0xc0001b4030}, {0x7f86d3116d40, 0xc001234940}, {{0xb, 0x0}, {0xc0001e1930, 0x10}, 0x10, {0x1f2f0fcc, ...}, ...}, ...}, ...)\n\t/usr/src/agoric-sdk/golang/cosmos/x/swingset/abci.go:69 +0x3b5\ngithub.com/Agoric/agoric-sdk/golang/cosmos/x/swingset.AppModule.EndBlock({{}, {{0x7f86d30b8e98, 0xc001284690}, {0x7f86d311bf18, 0xc000561cb0}, {{0x7f86d3111958, 0xc000561cb0}, 0xc00056a5c8, {0x7f86d30b8e98, 0xc001284600}, ...}, ...}}, ...)\n\t/usr/src/agoric-sdk/golang/cosmos/x/swingset/module.go:130 +0x7d\ngithub.com/cosmos/cosmos-sdk/types/module.(*Manager).EndBlock(_, {{0x7f86d30eae48, 0xc0001b4030}, {0x7f86d3116d40, 0xc001234940}, {{0xb, 0x0}, {0xc0001e1930, 0x10}, 0x10, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/agoric-labs/cosmos-sdk@v0.45.1-alpha.agoric.4/types/module/module.go:499 +0x45d\ngithub.com/Agoric/agoric-sdk/golang/cosmos/app.(*GaiaApp).EndBlocker(...)\n\t/usr/src/agoric-sdk/golang/cosmos/app/app.go:738\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).EndBlock(0xc0000cfa00, {0x100000000000000})\n\t/go/pkg/mod/github.com/agoric-labs/cosmos-sdk@v0.45.1-alpha.agoric.4/baseapp/abci.go:213 +0x31d\ngithub.com/tendermint/tendermint/abci/client.(*committingClient).EndBlockSync(0xc000dcb2c0, {0xc000dcb2c0})\n\t/go/pkg/mod/github.com/agoric-labs/tendermint@v0.34.14-alpha.agoric.1/abci/client/committing_client.go:339 +0xe8\ngithub.com/tendermint/tendermint/proxy.(*appConnConsensus).EndBlockSync(0xc000f73ac0, {0xc0038a06c0})\n\t/go/pkg/mod/github.com/agoric-labs/tendermint@v0.34.14-alpha.agoric.1/proxy/app_conn.go:89 +0x24\ngithub.com/tendermint/tendermint/state.execBlockOnProxyApp({0x7f86d30ebba0, 0xc0001b1140}, {0x7f86d3100390, 0xc001291090}, 0xc002ae8000, {0x7f86d310f580, 0xc001290b90}, 0xf)\n\t/go/pkg/mod/github.com/agoric-labs/tendermint@v0.34.14-alpha.agoric.1/state/execution.go:327 +0x54e\ngithub.com/tendermint/tendermint/state.(*BlockExecutor).ApplyBlock(_, {{{0xb, 0x0}, {0xc0000e4630, 0x7}}, {0xc0000e4640, 0x10}, 0x1, 0xf, {{0xc00483e4a0, ...}, ...}, ...}, ...)\n\t/go/pkg/mod/github.com/agoric-labs/tendermint@v0.34.14-alpha.agoric.1/state/execution.go:140 +0x171\ngithub.com/tendermint/tendermint/consensus.(*State).finalizeCommit(0xc000127880, 0x10)\n\t/go/pkg/mod/github.com/agoric-labs/tendermint@v0.34.14-alpha.agoric.1/consensus/state.go:1635 +0x9fd\ngithub.com/tendermint/tendermint/consensus.(*State).tryFinalizeCommit(0xc000127880, 0x10)\n\t/go/pkg/mod/github.com/agoric-labs/tendermint@v0.34.14-alpha.agoric.1/consensus/state.go:1546 +0x305\ngithub.com/tendermint/tendermint/consensus.(*State).enterCommit.func1()\n\t/go/pkg/mod/github.com/agoric-labs/tendermint@v0.34.14-alpha.agoric.1/consensus/state.go:1481 +0x87\ngithub.com/tendermint/tendermint/consensus.(*State).enterCommit(0xc000127880, 0x10, 0x0)\n\t/go/pkg/mod/github.com/agoric-labs/tendermint@v0.34.14-alpha.agoric.1/consensus/state.go:1519 +0xc06\ngithub.com/tendermint/tendermint/consensus.(*State).addVote(0xc000127880, 0xc0037aa000, {0xc001064480, 0x28})\n\t/go/pkg/mod/github.com/agoric-labs/tendermint@v0.34.14-alpha.agoric.1/consensus/state.go:2132 +0xb6e\ngithub.com/tendermint/tendermint/consensus.(*State).tryAddVote(0xc000127880, 0xc0037aa000, {0xc001064480, 0xc000e02600})\n\t/go/pkg/mod/github.com/agoric-labs/tendermint@v0.34.14-alpha.agoric.1/consensus/state.go:1930 +0x2c\ngithub.com/tendermint/tendermint/consensus.(*State).handleMsg(0xc000127880, {{0x7f86d30aa460, 0xc000010758}, {0xc001064480, 0x0}})\n\t/go/pkg/mod/github.com/agoric-labs/tendermint@v0.34.14-alpha.agoric.1/consensus/state.go:838 +0x40b\ngithub.com/tendermint/tendermint/consensus.(*State).receiveRoutine(0xc000127880, 0x0)\n\t/go/pkg/mod/github.com/agoric-labs/tendermint@v0.34.14-alpha.agoric.1/consensus/state.go:762 +0x419\ncreated by github.com/tendermint/tendermint/consensus.(*State).OnStart\n\t/go/pkg/mod/github.com/agoric-labs/tendermint@v0.34.14-alpha.agoric.1/consensus/state.go:378 +0x12f\n","time":"2022-08-23T22:29:39Z","message":"CONSENSUS FAILURE!!!"}

the ag-solo-manual-0 crashes the chain on instagoric

dckc commented 2 years ago

@warner @michaelfig thoughts on how to deal with the mailbox inbound handler crash above? I was going to register a dummy inbound handler, but that seems to conflict with the goal of later turning on mailbox access with a core-eval thing.

michaelfig commented 2 years ago

I was going to register a dummy inbound handler, but that seems to conflict with the goal of later turning on mailbox access with a core-eval thing.

I would disable the "register only once" semantics of the mailbox inbound handler so that a later handler could take over from the earlier dummy. That seems to most closely enable what our goals are without having to indirectly kludge them.