-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: Refactor filtering and adding std dev filter #300
Conversation
x/wasm-storage/keeper/filter.go
Outdated
if maxFreq*3 < len(reveals)*2 { | ||
return outliers, false, nil | ||
} | ||
|
||
for i, r := range revealVals { | ||
if freq[r] != maxFreq || reveals[i].ExitCode != 0 { | ||
continue | ||
if freq[r] == maxFreq { |
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 reasoning was that since we know at this point that
- Corrupt reveals are <= 1/3
- Max frequency occurs >= 2/3
=> corrupt reveals can never have the frequency of maxFreq
.
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.
At a high level the code makes sense to me (as names of functions, location in files, etc). I need to take a real close look at the filters: how they determine consensus and if this aligns with what Franklin and Mario have in mind. I'm not sharp enough right now, so I'll have a look tomorrow together with Franklin.
@Thomasvdam Sounds good and thanks. I'll have this PR fully ready for review by then. I will also share a flow chart I drew. |
Review was together done with @Thomasvdam btw |
Ready for final review. The simulation test fails due to its inherent instability. We will have to wait for Cosmos team's simulation test refactoring. |
@Thomasvdam Oh yes you're right. I thought we were assuming that the results would be base64-encoded, but I realized that I came up with that assumption myself. We should probably use JSON number for this instead, huh? |
Yeah I think so :) |
Fixed in 482764d. |
1938a02
to
482764d
Compare
Explanation of Changes
Fixing issues identified during devnet testing
This PR also refactors filtering and adds a new filter standard deviation.
Filter
to clean up the code.Closes: #284
Closes: #286