Skip to content

Commit 1a88b78

Browse files
damiannolanchatton
andauthored
fix: ensure core block api runs through multilplexer native app (#4767)
## Overview Due to the multiplexer copying start command functionality from the sdk, I discovered that running native apps (for example, v4) will not expose the core BlockAPI when through the multiplexer, i.e. the changes in celestiaorg/cosmos-sdk#455 do not take effect which spin up the core BlockAPI in-process. The BlockAPI is however available right now when: - Running embedded apps (for example, v3) through the multiplexer. - Running a v4 standalone app without the multiplexer. The replication of start command code being distributed and copied amongst different places is extremely error prone to manage, and quite frankly, its spaghetti. --------- Co-authored-by: chatton <[email protected]>
1 parent 179eaf3 commit 1a88b78

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

docker/multiplexer.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ARG MAX_SQUARE_SIZE
1616
ARG UPGRADE_HEIGHT_DELAY
1717
# the docker registry used for the embedded v3 binary.
1818
ARG CELESTIA_APP_REPOSITORY=ghcr.io/celestiaorg/celestia-app-standalone
19-
ARG CELESTIA_VERSION="v3.10.0-rc0"
19+
ARG CELESTIA_VERSION="v3.10.0-rc2"
2020

2121
# Stage 1: this base image contains already released binaries which can be embedded in the multiplexer.
2222
FROM ${CELESTIA_APP_REPOSITORY}:${CELESTIA_VERSION} AS base

multiplexer/abci/multiplexer.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
pvm "github.com/cometbft/cometbft/privval"
2222
"github.com/cometbft/cometbft/proxy"
2323
"github.com/cometbft/cometbft/rpc/client/local"
24+
coregrpc "github.com/cometbft/cometbft/rpc/grpc"
2425
db "github.com/cosmos/cosmos-db"
2526
"github.com/cosmos/cosmos-sdk/client"
2627
"github.com/cosmos/cosmos-sdk/codec"
@@ -314,6 +315,18 @@ func (m *Multiplexer) startGRPCServer() (*grpc.Server, client.Context, error) {
314315
return nil, m.clientContext, err
315316
}
316317

318+
coreEnv, err := m.cmNode.ConfigureRPC()
319+
if err != nil {
320+
return nil, m.clientContext, err
321+
}
322+
323+
blockAPI := coregrpc.NewBlockAPI(coreEnv)
324+
coregrpc.RegisterBlockAPIServer(grpcSrv, blockAPI)
325+
326+
m.g.Go(func() error {
327+
return blockAPI.StartNewBlockEventListener(m.ctx)
328+
})
329+
317330
// Start the gRPC server in a goroutine. Note, the provided ctx will ensure
318331
// that the server is gracefully shut down.
319332
m.g.Go(func() error {

0 commit comments

Comments
 (0)