diff --git a/.changelog/5481.bugfix.md b/.changelog/5481.bugfix.md new file mode 100644 index 00000000000..91f0be46b7f --- /dev/null +++ b/.changelog/5481.bugfix.md @@ -0,0 +1,5 @@ +go/consensus/cometbft/light: Only fetch from light store for now + +In practice the previously introduced fetch from light client caused +the light client to fall back to slow backwards verification due to +target blocks being in the past, below the pruning window. diff --git a/go/consensus/cometbft/light/service.go b/go/consensus/cometbft/light/service.go index 16b07a28407..0de447eac9c 100644 --- a/go/consensus/cometbft/light/service.go +++ b/go/consensus/cometbft/light/service.go @@ -289,21 +289,17 @@ func (c *client) GetLightBlock(ctx context.Context, height int64) (*consensus.Li return lb, rpc.NewNopPeerFeedback(), nil } - // Light client. - lightClientSource := func() (*consensus.LightBlock, rpc.PeerFeedback, error) { - clb, err := c.lc.GetVerifiedLightBlock(ctx, height) + // Light client store. + lightClientStoreSource := func() (*consensus.LightBlock, rpc.PeerFeedback, error) { + lb, err := c.GetStoredLightBlock(height) if err != nil { - c.logger.Debug("failed to fetch light block from light client", + c.logger.Debug("failed to fetch light block from light client store", "err", err, "height", height, ) return nil, nil, err } - lb, err := api.NewLightBlock(clb) - if err != nil { - return nil, nil, err - } return lb, rpc.NewNopPeerFeedback(), nil } @@ -316,7 +312,7 @@ func (c *client) GetLightBlock(ctx context.Context, height int64) (*consensus.Li var mergedErr error for _, src := range []func() (*consensus.LightBlock, rpc.PeerFeedback, error){ localBackendSource, - lightClientSource, + lightClientStoreSource, directPeerQuerySource, } { lb, pf, err := src()