-
Notifications
You must be signed in to change notification settings - Fork 90
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
LPv2: Isolate gateway weights #1972
Conversation
); | ||
|
||
let weight = match counter { | ||
0 => LP_DEFENSIVE_WEIGHT / 10, |
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.
We want to add just a bit if we fail even before starting to process the first message
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.
Should we maybe add a LP_MIN_WEIGHT
or something?
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.
I would prefer hardcoding that as well, yes. An alternative would be a simple fn defensive_weight(counter)
.
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.
I didn't read it, and I had the auto-merge enabled. Tech-debt
return (Err(e), weight.saturating_mul(count)); | ||
} | ||
|
||
if let Err(e) = Self::upsert_pending_entry(message_proof, &router_id, inbound_entry) { |
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.
My eyes are not bleeding anymore when looking at this, thank you <3
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.
BTW, liked that you moved the outbound processing impl into the MessageProcessor
, now everything is quite unified 🙌🏻
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.
Thanks for tackling this! LGTM but I would prefer hardcoding the reduced defensive weight.
); | ||
|
||
let weight = match counter { | ||
0 => LP_DEFENSIVE_WEIGHT / 10, |
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.
I would prefer hardcoding that as well, yes. An alternative would be a simple fn defensive_weight(counter)
.
Description
Small PR to move the weight checks to
MessageProcessor
.Like the fact that now only the
MessageProcessor
trait implementation knows about weights