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

discussion: Should Kindelia use a Median-Time-Past rule? #266

Open
dan-da opened this issue Dec 18, 2022 · 0 comments
Open

discussion: Should Kindelia use a Median-Time-Past rule? #266

dan-da opened this issue Dec 18, 2022 · 0 comments

Comments

@dan-da
Copy link

dan-da commented Dec 18, 2022

Node::add_block() is presently validating that timestamp of each block is greater than timestamp of parent block. This prevents any out-of-time-order blocks from occurring, which seems good, however it will lead to otherwise valid blocks from being included, and might lead to a lot of wasted cycles for some miners.

I have not looked deeply into this. There might be other ramifications, even possible attacks.

Bitcoin uses these rules:

  1. A node will not accept a block whose timestamp is more than two hours in the future.
  2. A node will not accept a block unless it has a timestamp greater than the median of the previous 11 blocks. In Bitcoin, we call this Median-Time-Past (MTP).

Apparently with Bitcoin blockchain, it is a common occurrence that miners have unsynced clocks and out-of-time-order blocks are created. quote:

it happens a ton! I was just looking at the last several weeks of block header data, there are a couple hundred blocks where timestamps are out of order - but only by a couple minutes, usually.

Clearly, if the kindelia rule were used, it would not "happen a ton", in fact it would never happen. Maybe this would only have the effect that all miners are more diligent about keeping their clocks synced using eg ntp. Or maybe it would mean some miners become unprofitable and thus choose not to mine anymore. If the latter, this is harmful to network security.

I am unsure of the right answer. I am just bringing this up for discussion.

It is probably worthwhile to review what other blockchain systems, in particular smart contract platforms have done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant