99 "sync"
1010
1111 cmtabcitypes "github.com/cometbft/cometbft/abci/types"
12- cmtpubsub "github.com/cometbft/cometbft/libs/pubsub"
1312 cmttypes "github.com/cometbft/cometbft/types"
1413
1514 "github.com/oasisprotocol/oasis-core/go/common"
@@ -23,7 +22,7 @@ import (
2322 "github.com/oasisprotocol/oasis-core/go/roothash/api/block"
2423 "github.com/oasisprotocol/oasis-core/go/roothash/api/commitment"
2524 "github.com/oasisprotocol/oasis-core/go/roothash/api/message"
26- runtimeRegistry "github.com/oasisprotocol/oasis-core/go/runtime/registry"
25+ "github.com/oasisprotocol/oasis-core/go/runtime/registry"
2726)
2827
2928const crashPointBlockBeforeIndex = "roothash.before_index"
@@ -56,14 +55,12 @@ type ServiceClient struct {
5655 runtimeNotifiers map [common.Namespace ]* runtimeBrokers
5756 genesisBlocks map [common.Namespace ]* block.Block
5857
59- queryCh chan cmtpubsub.Query
6058 trackedRuntimes map [common.Namespace ]* trackedRuntime
6159}
6260
6361// New constructs a new CometBFT-based roothash service client.
6462func New (consensus consensus.Backend , querier * app.QueryFactory ) * ServiceClient {
65- queryCh := make (chan cmtpubsub.Query , runtimeRegistry .MaxRuntimeCount )
66- descriptor := cmtapi .NewServiceDescriptor (api .ModuleName , app .EventType , queryCh )
63+ descriptor := cmtapi .NewServiceDescriptor (api .ModuleName , app .EventType , registry .MaxRuntimeCount )
6764
6865 return & ServiceClient {
6966 logger : logging .GetLogger ("cometbft/roothash" ),
@@ -237,7 +234,8 @@ func (sc *ServiceClient) trackRuntime(id common.Namespace) {
237234 }
238235
239236 // Request subscription to events for this runtime.
240- sc .queryCh <- app .QueryForRuntime (id )
237+ query := app .QueryForRuntime (id )
238+ sc .descriptor .AddQuery (query )
241239}
242240
243241// StateToGenesis implements api.Backend.
0 commit comments