channels_sv2::server::share_accounting keeps track of rejected shares#2149
channels_sv2::server::share_accounting keeps track of rejected shares#2149plebhash wants to merge 1 commit into
channels_sv2::server::share_accounting keeps track of rejected shares#2149Conversation
533ca1e to
47163fb
Compare
| } | ||
|
|
||
| /// Updates rejected-share accounting for an emitted `SubmitShares.Error`. | ||
| pub fn increment_rejected_shares(&mut self, error_code: &str) { |
There was a problem hiding this comment.
Shouldn't this be called internally by validate_share(), in case of an error?
There was a problem hiding this comment.
yeah I think this would be a more concise approach, since we would avoid the need for the app layer to explicitly call this
(or more importantly, we would eliminate the possibility of the app layer forgetting to call this while it should)
There was a problem hiding this comment.
but while trying to implement this approach, I actually started to think that it might make sense to tackle #2142 first
that way, validate_share could return ShareValidationError variants that already carry the needed error_code embedded into itself
the app layer would then be able to use those error_code without having to think too much about it
There was a problem hiding this comment.
btw I don't think we need to wait for stratum-mining/sv2-spec#194 before we tackle #2142
as is, SRI is already diverging from the spec sentence discussed in stratum-mining/sv2-spec#165, so the doing #2142 will not change anything with regards to that
There was a problem hiding this comment.
reverting this to draft while I work on #2142
| } | ||
|
|
||
| /// Updates rejected-share accounting for an emitted `SubmitShares.Error`. | ||
| pub fn increment_rejected_shares(&mut self, error_code: &str) { |
There was a problem hiding this comment.
Shouldn't this be called internally by validate_share(), in case of an error?
close #2119
companion stratum-mining/sv2-apps#491