You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The max_block_number property is used to constrain things like SharedMutable (#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:
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.
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.
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.
LHerskind
changed the title
Change max_block_number to max_timestamp
refactor(StateVariables): Change max_block_number to max_timestamp
Jun 11, 2024
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: