-
Notifications
You must be signed in to change notification settings - Fork 288
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
Conversation
@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 |
There was a problem hiding this 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.
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
let mut accounts = <HasDispatched<T>>::get(); | ||
if accounts.contains(&who) { | ||
T::OnRedundantCall::multiple_calls_per_block(&who); | ||
return Err(DispatchError::Module { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return Err(DispatchError::Module { | |
return Err(Error::<T>::UpdateAlreadyDispatched.into()); |
No description provided.