-
Notifications
You must be signed in to change notification settings - Fork 59
No Op On Redundant Update #501
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
base: main
Are you sure you want to change the base?
Conversation
| let header_bz: Vec<u8> = serde_json::to_vec(&header).unwrap(); | ||
| let header_bz2: Vec<u8> = header_bz.clone(); | ||
| let header_bz3: Vec<u8> = header_bz.clone(); |
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.
did this just to shut the compiler up but lmk what the canonical solution is @srdtrk
| verify_client_message( | ||
| deps.as_ref(), | ||
| env2, | ||
| VerifyClientMessageMsg { | ||
| client_message: Binary::from(header_bz3), | ||
| }, | ||
| ) | ||
| .unwrap(); | ||
|
|
||
| update_state( | ||
| deps.as_mut(), | ||
| UpdateStateMsg { | ||
| client_message: Binary::from(header_bz4), | ||
| }, | ||
| ) | ||
| .unwrap(); |
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.
Both calls fail here with their respective no-op code commented out
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #501 +/- ##
=======================================
Coverage 99.86% 99.86%
=======================================
Files 15 15
Lines 766 766
=======================================
Hits 765 765
Misses 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
This PR intercepts the message before it reaches the ethereum client package and no-ops on
VerifyClientMessageandUpdateStateMsgif the header slot is the same as the latest consensus state height.It is intended as the most feasible stopgap solution before allowing historical updates
Note it does not check if the header is valid at all. We can't do header verification here without historical updates since the cosmwasm contract grabs the latest consensus state as the trusted state automatically. We cannot no-op in this case in the verification package as that would simply be a bug in the library.
It also does not implement automatic misbehaviour detection since this would require historical updates.
I have this PR up along with tests to show that this can work. But given the above reasons, I think it is most wise to simply go directly to allowing historical updates which is what i will work on next.
Leaving this PR up so that the team has context on my decision.
closes: #XXXX
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
godoccomments.Files changedin the GitHub PR explorer.SonarCloud Reportin the comment section below once CI passes.