-
Notifications
You must be signed in to change notification settings - Fork 712
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
Limit event msg size & event number per operation #4768
base: mainnet_2_3
Are you sure you want to change the base?
Conversation
// Note on lifetimes: | ||
// 'a -> is the lifetime for self -> because the iterator returns items from self | ||
// 'b -> is the lifetime for filter -> because the returning iterator captures filter | ||
// and we have lifetime 'a > 'b because filter can live less than self |
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.
do you mean "can't live"?
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.
No here lifetime 'b has the following bound: 'a: 'b. So it means that lifetime 'b can live less than lifetime 'a
@@ -1150,6 +1152,24 @@ impl Interface for InterfaceImpl { | |||
|
|||
let mut context = context_guard!(self); | |||
let event = context.event_create(data, false); |
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.
maybe move this line just after
if event_per_op >= self.config.max_event_per_operation {
bail!("Too many event for this operation");
}
(only create the event if it's possible)
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.
Fixed
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.
2 minor comments
it's looking good to me
No description provided.