-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 units in timed feature flags #15391
base: main
Are you sure you want to change the base?
Conversation
⏱️ 30m total CI duration on this PR
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
7b9d699
to
1d9b5b7
Compare
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!
@@ -161,4 +160,86 @@ mod test { | |||
let testing = assert_ok!(bcs::to_bytes(&TimedFeatureOverride::Testing)); | |||
assert_ne!(replay, testing); | |||
} | |||
|
|||
#[test] | |||
fn test_timed_features_activation() { |
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.
Thank you for adding tests 👍
@@ -84,6 +82,7 @@ pub struct TimedFeaturesBuilder { | |||
} | |||
|
|||
impl TimedFeaturesBuilder { | |||
/// `timestamp` is a Unix Epoch timestamp in microseconds. | |||
pub fn new(chain_id: ChainId, timestamp: u64) -> Self { |
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.
This is probably super nit, but i think you can define a type alias pub type Micros = u64
. Then all callers of new(...)
have to cast (and therefore think about units)?
another nit: timestamp_micros
?
Description
Previously, timed feature flags activation time used millis as the unit,
last_reconfiguration_time
used micros as the unit, and these two were compared to see if timed feature flag was enabled (which was always true for any date on which blockchain has been around).DisableInvariantViolationCheckInSwapLoc
(keeping the same semantics as before, but applying a minor fix).EntryCompatibility
(as there are transactions on mainnet before this feature was activated that fail the corresponding check).How Has This Been Tested?
Type of Change
Which Components or Systems Does This Change Impact?