-
Notifications
You must be signed in to change notification settings - Fork 13
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
fix(iota-benchmark): fix test_upgrade_compatibility
#3732
Conversation
f2e5bc2
to
6f42e6d
Compare
So basically because we don't have a second bytecode snapshot which can be loaded right now, we never test this logic, right? |
@bingyanglin use |
Yes, no need to test snapshot loading now. We can revisit this once we have a protocol version 2 in place |
@@ -668,7 +668,7 @@ mod test { | |||
} | |||
|
|||
async fn test_protocol_upgrade_compatibility_impl() { | |||
let max_ver = ProtocolVersion::MAX.as_u64(); | |||
let max_ver = ProtocolVersion::MAX.as_u64() + 1; |
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.
Does this work as well? Then we don't have to remove the +1
in the future.
let max_ver = ProtocolVersion::MAX.as_u64() + 1; | |
let max_ver = ProtocolVersion::MAX_ALLOWED.as_u64(); |
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.
Under testing
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.
Unfortunately it does not pass.
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.
@muXxer @alexsporn I changed the MAX_ALLOWED
to be MAX + 1
to pass the upgrade testing in 60e3a3e.
Note that SUI also uses
#[cfg(msim)]
pub const MAX_ALLOWED: Self = Self(MAX_PROTOCOL_VERSION + 1);
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.
NOOO that breaks another test I fixed by doing +4. 😢
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.
@muXxer got it. Sorry for that. Then how about we use MAX + 1
inside test_upgrade_compatibility
now and add TODO
comments, so we can remember to modify it when we have really version 2? Also we keep MAX_ALLOWED
to be +4
.
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.
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.
Or I am fine with simply ignore it for now.
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.
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, where did you see it doesn't work? The CI was green for this test, or am I confused?
Sorry just saw this message. It was lagged because I didn't refresh this page. It failed twice in my machine. I reran the sim-testing GA for the commit to see if I missed something.
Description of change
Now our min and max version of
ProtocolVersion
are both 1. The old logic needs to go tomax version - 1
and upgrade to max version, which does not work because there is no version 0. In the testing we test the upgrade from 1 to 2 then it works.Links to any relevant issues
Part of #3321
Type of change
Choose a type of change, and delete any options that are not relevant.
How the change has been tested
Tested pass locally by
Change checklist