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

Prevent execution to stop when pair that doesn't exist encountered #100

Closed
iVoider opened this issue Jul 2, 2023 · 6 comments
Closed

Prevent execution to stop when pair that doesn't exist encountered #100

iVoider opened this issue Jul 2, 2023 · 6 comments
Assignees

Comments

@iVoider
Copy link
Contributor

iVoider commented Jul 2, 2023

This happens with lots of contracts on all chains like: 0xFFE811714ab35360b67eE195acE7C10D93f89D8C (BSC).
thread 'main' panicked at 'called Result::unwrap()on anErrvalue: Error("missing fielddata", line: 1, column: 234)', /ityfuzz/src/evm/onchain/endpoints.rs:734:69

I had tried to use latest blocks avaliable on api, but problem remains.

Can we just omit such pair like this?
https://github.com/iVoider/ityfuzz/tree/pair-fix

@iVoider
Copy link
Contributor Author

iVoider commented Jul 4, 2023

Wrapping is not enough, I guess pair oracle should be turned off in case if pair list is empty.
Otherwise pop from empty list happens here in some contracts:
endpoints.rs 948:

let mut peg_info = self
            .get_pair_pegged(token, network, block)
            .get(0)
            .unwrap()
            .clone();

@rappie
Copy link

rappie commented Jul 5, 2023

Are you sure this isn't just this problem?:

#64 (comment)

@iVoider
Copy link
Contributor Author

iVoider commented Jul 5, 2023

Are you sure this isn't just this problem?:

#64 (comment)

No, this occurs even on blocks synced by graphapi. And my little fix helps in 90% such cases, as some pairs exists for such contracts.

@ByteSecurity
Copy link
Contributor

Hey bro, give this PR a try and see if it can solve the problem.#110

@iVoider
Copy link
Contributor Author

iVoider commented Jul 6, 2023

Hey bro, give this PR a try and see if it can solve the problem.#110

Nope. See another example, when it fails with original missing data exception.
/ityfuzz/cli/target/release/cli -c BSC --onchain --onchain-block-number 29693964 -f -i --selfdestruct-oracle -p --run-forever --target 0x9e9b768174ef24233bf8ac2f4131f10ff5e72dee

@ByteSecurity
Copy link
Contributor

fix #110

The reason for this error is that graphapi returned a value with "null", which caused serde_json to be unable to parse it.

The same question arises in
invalid type: null
Don't show null deps

Thanks a lot

@iVoider iVoider closed this as completed Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants