Skip to content
This repository has been archived by the owner on Jul 20, 2021. It is now read-only.

Stop block creators from knowingly creating blocks in the past #615

Open
LeeSmet opened this issue Nov 6, 2019 · 4 comments
Open

Stop block creators from knowingly creating blocks in the past #615

LeeSmet opened this issue Nov 6, 2019 · 4 comments

Comments

@LeeSmet
Copy link
Collaborator

LeeSmet commented Nov 6, 2019

No description provided.

@LeeSmet LeeSmet added this to To do in rivine_1.3 via automation Nov 6, 2019
@GlenDC
Copy link
Contributor

GlenDC commented Nov 6, 2019

Should it be possible to create multiple blocks on the same exact timestamp?

@robvanmieghem
Copy link
Contributor

@LeeSmet a problem in the consensus or just in the implementation of the blockcreator?

@LeeSmet
Copy link
Collaborator Author

LeeSmet commented Nov 7, 2019

The specific problem being refered to:

The consensus allows blocks to be created some time in the future, and be immediately accepted. This prevents local forking behavior in case the local time is lagging a bit behind the rest of the network nodes. At the same time, the POBS protocol evaluates blocks up to 10 seconds in the future. So if a block is found by the block creator to be valid if created at time(now + 10 secs), it will create the block now, set the block timestamp to the aforementioned timestamp (which is in the future), and submit the block to the cs. The block is accepted, and propagated. Now other block creators (or the same block creator) try to create blocks again (having added the future block, which has a timestamp higher than the block creators current timestamp). If a block is now found at time(now + 1sec), then the block is once again created and submitted (and accepted), but with a lower timestamp than the previous block.

The reason the Cs allows this to happen is due to the mediantimestampwindow variable. This variable takes the median timestamp of the last few (in tfchain 11 or so iirc) blocks, and only verifies the new bock timestamp to be higher than the median of these few blocks

@robvanmieghem
Copy link
Contributor

We do have to make sure that 1 badly behaving blockcreator ( might be on purpose) does not limit the blockcreation chances of the rest( and as such increases his).

@robvanmieghem robvanmieghem removed this from To do in rivine_1.3 Nov 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants