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

blockchain: ensure the block timestamp can't go below recent median #5902

Merged
merged 1 commit into from Sep 30, 2019

Conversation

@moneromooo-monero
Copy link
Contributor

commented Sep 10, 2019

This would create an invalid block, though would require an attacker
to have mined a long blockchain with drifting times (assuming the
miner's clock is roughly correct)

Fixed by crCr62U0

@iamsmooth

This comment has been minimized.

Copy link
Contributor

commented Sep 10, 2019

The wording in the description seemed a little unclear to me. This refers to the timestamp in newly-created block templates. The fix avoids creating an impossible template that would never be valid on the chain.

@moneromooo-monero

This comment has been minimized.

Copy link
Contributor Author

commented Sep 10, 2019

That's how I read the text. What change do you suggest ?

@iamsmooth

This comment has been minimized.

Copy link
Contributor

commented Sep 10, 2019

Mention template somewhere. Just saying 'block timestamp' is unclear to me as it could apply to any block in the chain.

In fact the template generator isn't even a consensus function it all, it is just a convenience for miners, and in that sense quite different from the rest of the 'blockchain' code.

@moneromooo-monero moneromooo-monero force-pushed the moneromooo-monero:btsm branch from 661c5af to 4a7fcfc Sep 11, 2019
@moneromooo-monero

This comment has been minimized.

Copy link
Contributor Author

commented Sep 11, 2019

Clearer ?

@stoffu
stoffu approved these changes Sep 11, 2019
@iamsmooth

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2019

@moneromooo-monero

Shouldn't it be "not below"?

Such a template would yield an invalid block, though would require
an attacker to have mined a long blockchain with drifting times
(assuming the miner's clock is roughly correct)

Fixed by crCr62U0
@moneromooo-monero moneromooo-monero force-pushed the moneromooo-monero:btsm branch from 4a7fcfc to b9da023 Sep 11, 2019
@tevador

This comment has been minimized.

Copy link
Contributor

commented Sep 27, 2019

FYI, the testnet is now being attacked with block timestamps in the future. Monerod will produce invalid blocks without this patch.

luigi1111 added a commit that referenced this pull request Sep 30, 2019
b9da023 blockchain: keep block template timestamp not below recent median (moneromooo-monero)
@luigi1111 luigi1111 merged commit b9da023 into monero-project:master Sep 30, 2019
5 of 8 checks passed
5 of 8 checks passed
buildbot/monero-static-osx-10.11 Build done.
Details
buildbot/monero-static-win32 Build done.
Details
continuous-integration/travis-ci/pr The Travis CI build failed
Details
buildbot/monero-static-osx-10.12 Build done.
Details
buildbot/monero-static-osx-10.13 Build done.
Details
buildbot/monero-static-ubuntu-amd64 Build done.
Details
buildbot/monero-static-ubuntu-i686 Build done.
Details
buildbot/monero-static-win64 Build done.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.