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

make feed_value FreeOperational #86

Merged
merged 14 commits into from
Feb 16, 2020
Merged

Conversation

ermalkaleci
Copy link
Member

No description provided.

@ermalkaleci ermalkaleci requested a review from xlc February 6, 2020 17:50
oracle/src/lib.rs Outdated Show resolved Hide resolved
@xlc
Copy link
Member

xlc commented Feb 11, 2020

@shaopengw the one call per block rule is going to break your oracle server. you will need to implement laminar-protocol/oracle-server#15 once this is integrated

Copy link
Member

@xlc xlc left a comment

Choose a reason for hiding this comment

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

Actually you will also need to perform the check in _feed_values as well because it is possible to dispatch the call indirectly (e.g. via utility.batch) to bypass the check.

Add a hook OnRedundantCall (or other name if you can a better one) and call it when we detect a redundant call. Only do this in _feed_values not validate because validate may be called by tx pool, which is not on-chain.

@xlc
Copy link
Member

xlc commented Feb 11, 2020

we may want to generalize the one call per block rule to become one call per N blocks, but later

oracle/src/lib.rs Outdated Show resolved Hide resolved
let mut accounts = <HasDispatched<T>>::get();
if accounts.contains(&who) {
T::OnRedundantCall::multiple_calls_per_block(&who);
return Err(DispatchError::Module {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return Err(DispatchError::Module {
return Err(Error::<T>::UpdateAlreadyDispatched.into());

@xlc xlc merged commit dbcbf6d into master Feb 16, 2020
@xlc xlc deleted the feature/oracle_feed_free_operational branch February 16, 2020 22:47
@xlc xlc mentioned this pull request Feb 17, 2020
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

Successfully merging this pull request may close these issues.

None yet

2 participants