Skip to content
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

Loosen constraint about Block.Timestamp #65

Closed
longfin opened this issue Feb 11, 2019 · 1 comment · Fixed by #70
Closed

Loosen constraint about Block.Timestamp #65

longfin opened this issue Feb 11, 2019 · 1 comment · Fixed by #70
Assignees
Labels
suggestion Suggestion or feature request

Comments

@longfin
Copy link
Member

longfin commented Feb 11, 2019

Currently we require that the generated block has a timestamp higher than the timestamp of the previous block. there are a few things to consider.

  • Block.Timestamp isn't always accurate because they are based on the local time of the system.
  • Additional things (like Add sleep to prevent test failure #64 ) are required for automated testing, since the latter block requires a later timestamp.

I think we'd better loosen this constraint like Ethereum or Bitcoin style.

  • In Bitcoin, a timestamp is accepted as valid if it is greater than the median timestamp of previous 11 blocks, and less than the network-adjusted time + 2 hours. (see also)
  • In Ethereum, a timestamp is accepted as valid if block.timestamp <= now + 900 and is block.timestamp >= parent.timestamp. (see also)

There are pros and cons, but I think the Ethereum style is more intuitive and easier to implement.

@dahlia @kijun @ipdae any ideas?

@longfin longfin self-assigned this Feb 11, 2019
@longfin longfin added the suggestion Suggestion or feature request label Feb 11, 2019
@dahlia
Copy link
Contributor

dahlia commented Feb 11, 2019

If the existing code is assuming that the order of blocks are determined by its timestamp we should get rid of the assumption as well. To me both of styles are fine.

@dahlia dahlia changed the title Suggestion: loosen constraint about Block.Timestamp Loosen constraint about Block.Timestamp Feb 11, 2019
longfin added a commit to longfin/libplanet.net that referenced this issue Feb 12, 2019
longfin added a commit to longfin/libplanet.net that referenced this issue Feb 12, 2019
longfin added a commit to longfin/libplanet.net that referenced this issue Feb 12, 2019
longfin added a commit to longfin/libplanet.net that referenced this issue Feb 12, 2019
longfin added a commit to longfin/libplanet.net that referenced this issue Feb 12, 2019
longfin added a commit that referenced this issue Feb 12, 2019
dahlia pushed a commit to dahlia/libplanet that referenced this issue Mar 9, 2021
Bump libplanet version 0.7.0-nightly.20191015
limebell pushed a commit to limebell/libplanet that referenced this issue Jul 7, 2021
OnedgeLee pushed a commit to OnedgeLee/libplanet that referenced this issue Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion Suggestion or feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants