Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: AMM datanode panics on system-tests and market-sim fuzz #11705

Closed
wwestgarth opened this issue Sep 24, 2024 · 0 comments · Fixed by #11706
Closed

[Bug]: AMM datanode panics on system-tests and market-sim fuzz #11705

wwestgarth opened this issue Sep 24, 2024 · 0 comments · Fixed by #11706

Comments

@wwestgarth
Copy link
Contributor

Problem encountered

The latest change to allow low-volume AMM's has caused panics during the data-node's caculations of market-depths:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x320c472]
goroutine 1301121 [running]:
code.vegaprotocol.io/vega/core/execution/amm.(*Sqrter).sqrt(0xc003bf2580?, 0xc0ffffffe0?)
	/jenkins/workspace/common/system-tests-wrapper/vega/core/execution/amm/engine.go:99 +0x12
code.vegaprotocol.io/vega/core/execution/amm.EstimateBounds(0xc006274ab0, 0xc005c47540, 0xc005c474c0, _, {_, _}, {_, _}, _, {0xc003e2bdc0, ...}, ...)
	/jenkins/workspace/common/system-tests-wrapper/vega/core/execution/amm/estimator.go:78 +0x405
code.vegaprotocol.io/vega/datanode/api.(*TradingDataServiceV2).EstimateAMMBounds(0xc000c98000, {0x67a6008, 0xc002e27170}, 0xc0013ea580)
	/jenkins/workspace/common/system-tests-wrapper/vega/datanode/api/trading_data_v2.go:6011 +0xc6a

and

panic: runtime error: index out of range [0] with length 0

goroutine 315 [running]:
code.vegaprotocol.io/vega/datanode/service.(*MarketDepth).expandByLevels(_, {{0xc002630ec0, 0x40}, {0xc002630f00, 0x40}, {0xc002630f40, 0x40}, {0xc002630f80, 0x40}, {0xc002769ac0, ...}, ...}, ...)
	/jenkins/workspace/common/vega-market-sim-fuzzing-develop/extern/vega/datanode/service/market_depth_amm.go:248 +0x9d0
code.vegaprotocol.io/vega/datanode/service.(*MarketDepth).ExpandAMM(_, {_, _}, {{0xc002630ec0, 0x40}, {0xc002630f00, 0x40}, {0xc002630f40, 0x40}, {0xc002630f80, ...}, ...}, ...)
	/jenkins/workspace/common/vega-market-sim-fuzzing-develop/extern/vega/datanode/service/market_depth_amm.go:419 +0x1b9
code.vegaprotocol.io/vega/datanode/service.(*MarketDepth).refreshAMM(_, {{0xc002630ec0, 0x40}, {0xc002630f00, 0x40}, {0xc002630f40, 0x40}, {0xc002630f80, 0x40}, {0xc002769ac0, ...}, ...}, ...)
	/jenkins/workspace/common/vega-market-sim-fuzzing-develop/extern/vega/datanode/service/market_depth_amm.go:470 +0x453

Observed behaviour

Data node panics.

Expected behaviour

Data node does not panic.

Steps to reproduce

1. Submit `xyz` transaction
2. With this payload
3. Query `abc` API
4. Observe the error

Software version

develop

Failing test

No response

Jenkins run

No response

Configuration used

No response

Relevant log output

No response

@wwestgarth wwestgarth added this to the 🏯 Suzuka Castle milestone Sep 24, 2024
@wwestgarth wwestgarth self-assigned this Sep 24, 2024
@wwestgarth wwestgarth moved this to In Progress in Core Kanban Sep 24, 2024
@vega-issues vega-issues moved this from In Progress to Waiting Review in Core Kanban Sep 24, 2024
@vega-issues vega-issues moved this from Waiting Review to Approved in Core Kanban Sep 24, 2024
@github-project-automation github-project-automation bot moved this from Approved to Merged in Core Kanban Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant