-
Notifications
You must be signed in to change notification settings - Fork 310
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
refactor(StateVariables): Change max_block_number to max_timestamp #5757
Comments
Another issue with using block numbers is that we're unable to magically change this value for testing purposes - we must actually mine full blocks, which is quite slow. This makes us want to have short delays (e.g. 3-5 blocks). But it's also error-prone if tests need to send more transactions, potentially unintentionally pushing past the block of change. Changing the time on the other hand is instant and cannot result in accidental errors. |
Using blocks, a halted network does not move any of the delayed actions forward, whereas using timestamps it'd be possible to have a value change to through without actors having the opportunity to react to this. I'd argue however that this sounds like a network issue and not an application one. |
|
The
max_block_number
property is used to constrain things likeSharedMutable
(#5490), but choosing delays in blocks is both awkward and prone to issues if the block time ever changes. It'd be much better if we could have these work with actual timestamps.A problem with using timestamps would be that if block production were to suddenly halt, transactions would become invalidated due to having expired, which would not occur with block numbers. This may or may not be an issue.
The change itself is simple to make, since the entire structure is already there - it's simply a matter of changing the assertions and initializations to use time instead of block numbers.
The text was updated successfully, but these errors were encountered: