vegaprotocol / vega

A Go implementation of the Vega Protocol, a protocol for creating and trading derivatives on a fully decentralised network.
https://vega.xyz
GNU Affero General Public License v3.0
37 stars 19 forks source link

[Bug]: Data-node panics when the network history is disabled and you hit the ListAllHistorySegments endpoint #8633

Closed daniel1302 closed 1 year ago

daniel1302 commented 1 year ago

Problem encountered

Data-node panics when the network history is disabled and you hit the ListAllHistorySegments endpoint. The panic is like below

Observed behaviour

Panic

Expected behaviour

Not panic

Steps to reproduce

1. Start the network with data nodes that has network history disabled
2. Hit the endpoint like in the title

Software version

v0.71.6

Failing test

No response

Jenkins run

No response

Configuration used

No response

Relevant log output

Jun 28 14:31:43 metabase.vega.community visor[83959]: 2023-06-28T14:31:43.973Z        INFO        tendermint        consensus/state.go:1917        received complete proposal block        {"height": 4805458, "hash": "18F7B29AFFB355D8CEFD2F5D2CE4BC95669BA465186D056B94DB3CBD86796717"}
Jun 28 14:31:43 metabase.vega.community visor[83958]: panic: runtime error: invalid memory address or nil pointer dereference
Jun 28 14:31:43 metabase.vega.community visor[83958]: [signal SIGSEGV: segmentation violation code=0x1 addr=0xc8 pc=0x255db34]
Jun 28 14:31:43 metabase.vega.community visor[83958]: goroutine 3460 [running]:
Jun 28 14:31:43 metabase.vega.community visor[83958]: code.vegaprotocol.io/vega/datanode/networkhistory.(*Service).ListAllHistorySegments(0x35e876d?)
Jun 28 14:31:43 metabase.vega.community visor[83958]:         /home/runner/work/vega/vega/datanode/networkhistory/service.go:161 +0x14
Jun 28 14:31:43 metabase.vega.community visor[83958]: code.vegaprotocol.io/vega/datanode/api.(*TradingDataServiceV2).ListAllNetworkHistorySegments(0xc002a7c1e0, {0xc0035b1fb0, 0xc002a72000}, 0x5b2f100)
Jun 28 14:31:43 metabase.vega.community visor[83958]:         /home/runner/work/vega/vega/datanode/api/trading_data_v2.go:3433 +0x94
Jun 28 14:31:43 metabase.vega.community visor[83958]: code.vegaprotocol.io/vega/protos/data-node/api/v2._TradingDataService_ListAllNetworkHistorySegments_Handler.func1({0x3ccbea0, 0xc0055afe00}, {0x302bfc0?, 0xc0055afda0})
Jun 28 14:31:43 metabase.vega.community visor[83958]:         /home/runner/work/vega/vega/protos/data-node/api/v2/trading_data_grpc.pb.go:3913 +0x7b
Jun 28 14:31:43 metabase.vega.community visor[83958]: code.vegaprotocol.io/vega/datanode/ratelimit.(*RateLimit).GRPCInterceptor(0xc002a70020, {0x3ccbea0, 0xc0055afe00}, {0x302bfc0, 0xc0055afda0}, 0x0?, 0xc00543ff68)
Jun 28 14:31:43 metabase.vega.community visor[83958]:         /home/runner/work/vega/vega/datanode/ratelimit/ratelimit.go:184 +0x727
Jun 28 14:31:43 metabase.vega.community visor[83958]: google.golang.org/grpc.getChainUnaryHandler.func1({0x3ccbea0, 0xc0055afe00}, {0x302bfc0, 0xc0055afda0})
Jun 28 14:31:43 metabase.vega.community visor[83958]:         /home/runner/go/pkg/mod/google.golang.org/grpc@v1.52.0/server.go:1163 +0xb9
Jun 28 14:31:43 metabase.vega.community visor[83958]: code.vegaprotocol.io/vega/datanode/api.headersInterceptor.func1({0x3ccbea0, 0xc0055afe00}, {0x302bfc0, 0xc0055afda0}, 0xc004772280?, 0xc002eba8c0)
Jun 28 14:31:43 metabase.vega.community visor[83958]:         /home/runner/work/vega/vega/datanode/api/server.go:333 +0x4f2
Jun 28 14:31:43 metabase.vega.community visor[83958]: google.golang.org/grpc.getChainUnaryHandler.func1({0x3ccbea0, 0xc0055afe00}, {0x302bfc0, 0xc0055afda0})
Jun 28 14:31:43 metabase.vega.community visor[83958]:         /home/runner/go/pkg/mod/google.golang.org/grpc@v1.52.0/server.go:1163 +0xb9
Jun 28 14:31:43 metabase.vega.community visor[83958]: code.vegaprotocol.io/vega/datanode/api.remoteAddrInterceptor.func1({0x3ccbea0, 0xc0055afd70}, {0x302bfc0, 0xc0055afda0}, 0xc004772280, 0xc002eba880)
Jun 28 14:31:43 metabase.vega.community visor[83958]:         /home/runner/work/vega/vega/datanode/api/server.go:289 +0xef
Jun 28 14:31:43 metabase.vega.community visor[83958]: google.golang.org/grpc.chainUnaryInterceptors.func1({0x3ccbea0, 0xc0055afd70}, {0x302bfc0, 0xc0055afda0}, 0xc0066cea20?, 0x2e91940?)
Jun 28 14:31:43 metabase.vega.community visor[83958]:         /home/runner/go/pkg/mod/google.golang.org/grpc@v1.52.0/server.go:1154 +0x8f
Jun 28 14:31:43 metabase.vega.community visor[83958]: code.vegaprotocol.io/vega/protos/data-node/api/v2._TradingDataService_ListAllNetworkHistorySegments_Handler({0x340cf00?, 0xc002a7c1e0}, {0x3ccbea0, 0xc0055afd70}, 0xc0053d7180, 0xc002a700a0)
Jun 28 14:31:43 metabase.vega.community visor[83958]:         /home/runner/work/vega/vega/protos/data-node/api/v2/trading_data_grpc.pb.go:3915 +0x138
Jun 28 14:31:43 metabase.vega.community visor[83958]: google.golang.org/grpc.(*Server).processUnaryRPC(0xc002a7c000, {0x3ce4f80, 0xc003e10340}, 0xc00165c360, 0xc002a58570, 0x5898830, 0x0)
Jun 28 14:31:43 metabase.vega.community visor[83958]:         /home/runner/go/pkg/mod/google.golang.org/grpc@v1.52.0/server.go:1336 +0xd23
Jun 28 14:31:43 metabase.vega.community visor[83958]: google.golang.org/grpc.(*Server).handleStream(0xc002a7c000, {0x3ce4f80, 0xc003e10340}, 0xc00165c360, 0x0)
Jun 28 14:31:43 metabase.vega.community visor[83958]:         /home/runner/go/pkg/mod/google.golang.org/grpc@v1.52.0/server.go:1704 +0xa2f
Jun 28 14:31:43 metabase.vega.community visor[83958]: google.golang.org/grpc.(*Server).serveStreams.func1.2()
Jun 28 14:31:43 metabase.vega.community visor[83958]:         /home/runner/go/pkg/mod/google.golang.org/grpc@v1.52.0/server.go:965 +0x98
Jun 28 14:31:43 metabase.vega.community visor[83958]: created by google.golang.org/grpc.(*Server).serveStreams.func1
Jun 28 14:31:43 metabase.vega.community visor[83958]:         /home/runner/go/pkg/mod/google.golang.org/grpc@v1.52.0/server.go:963 +0x28a
ettec commented 1 year ago

this is a duplicate, issue was fixed and merged from branch networkhistory_nilcheck on 12/05/2023