这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Conversation

@vminkov
Copy link

@vminkov vminkov commented Feb 23, 2022

No description provided.

@@ -1,4 +1,4 @@
pragma solidity 0.6.8;
pragma solidity >=0.8.0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explicit versions should be used to prevent unexpected/untested problems occurring. This does cause some difficulty when using libraries, but I think in this case (since money is almost always involved) safety trumps usability.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on tilde for this @MicahZoltu? Currently assessing this one for our use-case and I can imagine ~0.8 would likely keep it bounded enough to avoid most of the risk while not forcing a hard version fix.

function price1CumulativeLast() external view returns (uint256);

function getReserves() external view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast);
function getReserves() external view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the other files use tab to indent. The proper fix here would be to fix this file to be consistent with the rest of the repository. Not your fault though, so I'll accept this change as-is since it at least makes this file internally consistent.

Co-authored-by: Micah Zoltu <micah@zoltu.net>
@vminkov
Copy link
Author

vminkov commented Feb 23, 2022

this is the output from the tests

veliko@VM demo % npm run test

> test
> npx ts-node --project tsconfig.json source/test.ts

Started
FFFFF.FFFFFFFFF

Failures:
1) block verifier
  Message:
    TypeError: Cannot read property 'uniswapExchange' of undefined
  Stack:
        at <Jasmine>
        at UserContext.<anonymous> (/Users/veliko/git/uniswap-oracle/demo/source/test.ts:40:125)
        at processTicksAndRejections (node:internal/process/task_queues:96:5)

2) account proof
  Message:
    TypeError: Cannot read property 'token0' of undefined
  Stack:
        at <Jasmine>
        at UserContext.<anonymous> (/Users/veliko/git/uniswap-oracle/demo/source/test.ts:56:45)
        at processTicksAndRejections (node:internal/process/task_queues:96:5)

3) storage proof
  Message:
    TypeError: Cannot read property 'token0' of undefined
  Stack:
        at <Jasmine>
        at UserContext.<anonymous> (/Users/veliko/git/uniswap-oracle/demo/source/test.ts:73:22)
        at <Jasmine>
        at processImmediate (node:internal/timers:464:21)

4) block to storage
  Message:
    TypeError: Cannot read property 'token0' of undefined
  Stack:
        at <Jasmine>
        at UserContext.<anonymous> (/Users/veliko/git/uniswap-oracle/demo/source/test.ts:92:22)
        at <Jasmine>
        at processImmediate (node:internal/timers:464:21)

5) oracle proof rlp encoding
  Message:
    TypeError: Cannot read property 'uniswapExchange' of undefined
  Stack:
        at <Jasmine>
        at UserContext.<anonymous> (/Users/veliko/git/uniswap-oracle/demo/source/test.ts:125:41)
        at <Jasmine>
        at processImmediate (node:internal/timers:464:21)

6) oracle vs contract price check expect price 1
  Message:
    TypeError: Cannot read property 'token0' of undefined
  Stack:
        at <Jasmine>
        at UserContext.<anonymous> (/Users/veliko/git/uniswap-oracle/demo/source/test.ts:191:40)
        at <Jasmine>
        at processImmediate (node:internal/timers:464:21)

7) oracle vs contract price check expect price 0.5
  Message:
    TypeError: Cannot read property 'token0' of undefined
  Stack:
        at <Jasmine>
        at UserContext.<anonymous> (/Users/veliko/git/uniswap-oracle/demo/source/test.ts:191:40)
        at <Jasmine>
        at processImmediate (node:internal/timers:464:21)

8) oracle vs contract price check expect price 2
  Message:
    TypeError: Cannot read property 'token0' of undefined
  Stack:
        at <Jasmine>
        at UserContext.<anonymous> (/Users/veliko/git/uniswap-oracle/demo/source/test.ts:191:40)
        at <Jasmine>
        at processImmediate (node:internal/timers:464:21)

9) one trade, sync before and after
  Message:
    TypeError: Cannot read property 'uniswapExchange' of undefined
  Stack:
        at <Jasmine>
        at UserContext.<anonymous> (/Users/veliko/git/uniswap-oracle/demo/source/test.ts:208:41)
        at <Jasmine>
        at processImmediate (node:internal/timers:464:21)

10) no trades, no sync
  Message:
    TypeError: Cannot read property 'uniswapExchange' of undefined
  Stack:
        at <Jasmine>
        at UserContext.<anonymous> (/Users/veliko/git/uniswap-oracle/demo/source/test.ts:223:41)
        at <Jasmine>
        at processImmediate (node:internal/timers:464:21)

11) no trades, sync before
  Message:
    TypeError: Cannot read property 'uniswapExchange' of undefined
  Stack:
        at <Jasmine>
        at UserContext.<anonymous> (/Users/veliko/git/uniswap-oracle/demo/source/test.ts:237:41)
        at <Jasmine>
        at processImmediate (node:internal/timers:464:21)

12) no trades, sync after
  Message:
    TypeError: Cannot read property 'uniswapExchange' of undefined
  Stack:
        at <Jasmine>
        at UserContext.<anonymous> (/Users/veliko/git/uniswap-oracle/demo/source/test.ts:251:41)
        at <Jasmine>
        at processImmediate (node:internal/timers:464:21)

13) no trades, sync before/after
  Message:
    TypeError: Cannot read property 'uniswapExchange' of undefined
  Stack:
        at <Jasmine>
        at UserContext.<anonymous> (/Users/veliko/git/uniswap-oracle/demo/source/test.ts:266:41)
        at <Jasmine>
        at processImmediate (node:internal/timers:464:21)

14) one trade
  Message:
    TypeError: Cannot read property 'uniswapExchange' of undefined
  Stack:
        at <Jasmine>
        at UserContext.<anonymous> (/Users/veliko/git/uniswap-oracle/demo/source/test.ts:281:41)
        at <Jasmine>
        at processImmediate (node:internal/timers:464:21)

Suite error: undefined
  Message:
    Error: Timeout - Async function did not complete within 5000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL)
  Stack:
    Error: Timeout - Async function did not complete within 5000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL)
        at <Jasmine>
        at listOnTimeout (node:internal/timers:557:17)
        at processTimers (node:internal/timers:500:7)

15 specs, 14 failures
Finished in 7.229 seconds

vminkov and others added 3 commits February 23, 2022 20:04
Co-authored-by: Micah Zoltu <micah@zoltu.net>
@MicahZoltu
Copy link

For troubleshooting the tests, the "Suite error" is the one that actually matters here (I don't know why it shows up last, and I have a bug filed with Jasmine about not running tests if the beforeAll fails).

When I dug into this, it appears that Nethermind (at least) is minting a block when the transaction arrives, but the transaction isn't included in the minted block. This suggests to me that something about the transaction makes it unincludable, but I can't figure out what. Maybe it is the nonce? Gas limit? Gas price? Account balance? This is on a brand new private chain (when using docker-compose), so maybe the gas limit is starting too low or I'm signing with an account with no money?

I also briefly tested against Geth (just change the JSON-RPC port in the tests to 1235 instead of 1237) and received some errors (though different ones). IIRC, Nethermind used to be the most reliable. It is possible that someone (likely me) updated the docker images this test setup is using and I was young and stupid when I wrote this and didn't hard-code a docker image hash. One option may be to just try using older versions of those docker images (if you can find them) until you get one that works. 🤔 more on this, this is the most likely issue given the symptoms.

The other option would be to upgrade the docker images to latest and then troubleshoot the problem from there. This will be necessary to also solve #33, which will be required to get the SDK working against London and newer.

I don't have time to troubleshoot this myself at the moment, but I'm happy to lend insight and talk anyone through troubleshooting steps and provide feedback on what I think are the best avenues to explore.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants