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

Price-feeder: DAI is unavailable due to kraken sending expired rates, necessary for peggo. #1261

Closed
4 tasks
RafilxTenfen opened this issue Aug 22, 2022 · 4 comments
Assignees
Labels
C:Price-Feeder T:Bug A regression or bug in the Umee codebase.

Comments

@RafilxTenfen
Copy link
Contributor

Summary of Bug

Getting computed prices with old timestamp data panics

--- FAIL: TestGetComputedPricesPanic (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x63b7e8]

goroutine 58 [running]:
testing.tRunner.func1.2({0x19b51c0, 0x333c5e0})
	/usr/local/go/src/testing/testing.go:1396 +0x24e
testing.tRunner.func1()
	/usr/local/go/src/testing/testing.go:1399 +0x39f
panic({0x19b51c0, 0x333c5e0})
	/usr/local/go/src/runtime/panic.go:884 +0x212
math/big.(*Int).Mul(0xc001087760, 0xc001087760, 0x0)
	/usr/local/go/src/math/big/int.go:167 +0xa8
github.com/cosmos/cosmos-sdk/types.Dec.MulMut({0xffffffffffffffff?}, {0x0?})
	/home/rafilx/go/pkg/mod/github.com/umee-network/cosmos-sdk@v0.46.0-umee.0.20220812010629-4d5bb2e3f73c/types/decimal.go:289 +0x28
github.com/cosmos/cosmos-sdk/types.Dec.ImmutOp({0x1996c80?}, 0x22ee7d8, {0x1c01831?})
	/home/rafilx/go/pkg/mod/github.com/umee-network/cosmos-sdk@v0.46.0-umee.0.20220812010629-4d5bb2e3f73c/types/decimal.go:232 +0x162
github.com/cosmos/cosmos-sdk/types.Dec.Mul(...)
	/home/rafilx/go/pkg/mod/github.com/umee-network/cosmos-sdk@v0.46.0-umee.0.20220812010629-4d5bb2e3f73c/types/decimal.go:284
github.com/umee-network/umee/price-feeder/oracle.convertCandlesToUSD({{0x258f600, 0xc000eaa220}, 0x7, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x0, 0x0, ...}, ...}, ...)
	/home/rafilx/projects/github.com/umee-network/umee/price-feeder/oracle/convert.go:113 +0x3d5
github.com/umee-network/umee/price-feeder/oracle.GetComputedPrices({{0x258f600, 0xc000eaa220}, 0x7, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x0, 0x0, ...}, ...}, ...)
	/home/rafilx/projects/github.com/umee-network/umee/price-feeder/oracle/oracle.go:282 +0x67
github.com/umee-network/umee/price-feeder/oracle.TestGetComputedPricesPanic(0xc0014829c0?)
	/home/rafilx/projects/github.com/umee-network/umee/price-feeder/oracle/oracle_test.go:779 +0x838
testing.tRunner(0xc0014829c0, 0x22f05f8)
	/usr/local/go/src/testing/testing.go:1446 +0x10b
created by testing.(*T).Run
	/usr/local/go/src/testing/testing.go:1493 +0x35f
FAIL	github.com/umee-network/umee/price-feeder/oracle	0.038s
FAIL

Version

Please provide the output of the following commands:

  • $ umeed version
  • $ go version
  • $ uname -a

Steps to Reproduce

Steps to reproduce the behavior:

  1. ...

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@RafilxTenfen
Copy link
Contributor Author

A temporary fix is being placed to solve panic #1262, but we still need to look into the correct behavior of ComputeTVWAP -
see - #1262 (comment)

mergify bot pushed a commit that referenced this issue Aug 23, 2022
## Description

- Add verification for mapped value

related to: #1261

---

### Author Checklist

_All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues._

I have...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] added appropriate labels to the PR
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/umee-network/umee/blob/main/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

_All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items._

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed all author checklist items have been addressed
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
@adamewozniak
Copy link
Collaborator

Going to pick this up & try to see what's going on - this is a case where peggo does not need to be converted from DAI/ETH -> DAI/USD.

@adamewozniak
Copy link
Collaborator

adamewozniak commented Aug 25, 2022

Looks like the DAI candle here is expired (before timePeriod here)

This should be resolved by #1276 since FTX has a DAI/USD - I'll prioritize that since it'll help us with USDT too 😄

@adamewozniak adamewozniak changed the title Price-feeder: GetComputedPrices Panic Price-feeder: DAI is unavailable due to kraken sending expired rates, necessary for peggo. Aug 25, 2022
@RafilxTenfen
Copy link
Contributor Author

resolved by #1276

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:Price-Feeder T:Bug A regression or bug in the Umee codebase.
Projects
None yet
Development

No branches or pull requests

2 participants