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

Ensure consistency in data request execution across libraries #2140

Open
tmpolaczyk opened this issue Dec 16, 2021 · 7 comments
Open

Ensure consistency in data request execution across libraries #2140

tmpolaczyk opened this issue Dec 16, 2021 · 7 comments

Comments

@tmpolaczyk
Copy link
Contributor

PR #2139 fixes a mismatch between the execution of data requests by the node and the execution of data requests using the witnet-toolkit.

We should ensure that there are no more issues like this, by unifying all the "precondition/postcondition" logic in one place and adding tests in all the places that use witnet_rad as a library: node, wallet, cli, toolkit, node tests, ...

@tmpolaczyk
Copy link
Contributor Author

For example this function is missing the precondition logic, used in data request tests:

fn run_dr_locally_with_data(

@tmpolaczyk
Copy link
Contributor Author

Another example is the retrieval timeout: the witnet-toolkit does not implement that feature so sometimes it can "hang", breaking the bridge. See witnet/witnet-price-feeds-poller#34

@tmpolaczyk
Copy link
Contributor Author

Here witnet nodes ensure that less than 20% of the data sources are errors:

evaluate_tally_precondition_clause(retrieve_responses, 0.2, 1, &msg.active_wips);

But the witnet-toolkit seems to use a different percentage, right @guidiaz ?

@guidiaz
Copy link
Contributor

guidiaz commented Nov 14, 2022

But the witnet-toolkit seems to use a different percentage, right @guidiaz ?

Indeed. Witnet-toolkit solved successfully a 7-source pf, when 2 of them were emitting errors. That is, a 28% of failing sources passed through.

@tmpolaczyk
Copy link
Contributor Author

It seems that the toolkit is using witnet_rad::try_data_request to execute the data requests, and that function does implement the same 20% check as the node, here:

So not sure what could be the cause of the observed behavior.

@tmpolaczyk
Copy link
Contributor Author

Here witnet nodes ensure that less than 20% of the data sources are errors:

This is not true, that 0.2 is the minimum_consensus: at least 20% of the data sources are not errors. This is equivalent to 80% of the data sources being errors, so it is unlikely to be what's happening here. In that case the data request would resolve to RadError::InsufficientConsensus, so by looking at the specific error we can guess the cause of the inconsistency. But it looks like both the toolkit and the node use the same logic here.

@tmpolaczyk
Copy link
Contributor Author

Found a possible explanation, see #2306

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

2 participants