Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Replace epochTime with genesis block timestamp #5280

Closed
shuse2 opened this issue May 4, 2020 · 0 comments · Fixed by #5430
Closed

Replace epochTime with genesis block timestamp #5280

shuse2 opened this issue May 4, 2020 · 0 comments · Fixed by #5430
Assignees
Milestone

Comments

@shuse2
Copy link
Collaborator

shuse2 commented May 4, 2020

Description

  • Remove the epoch time from the config
  • Update the slot calculation in lisk-chain to use genesis block timestamp instead of epoch time.

The slot number will be calculated as:

Math.floor((slotTime - genesisBlock.timestamp) / this._interval);

Where slotTime can be any unix time and interval would be the block time which is default to 10s.

Motivation

  • With the new LIP, the epoch time difference is removed.

Acceptance Criteria

  • All tests are updated not to use the epoch time

Additional Information

The related information can be found on https://github.com/LiskHQ/lips/blob/master/proposals/lip-0034.md#block-processing

This way, the genesis block timestamp defines the block slots of the blockchain as [b.header.timestamp+BLOCK_SLOT_LENGTH, b.header.timestamp + 2*BLOCK_SLOT_LENGTH), [b.header.timestamp + 2*BLOCK_SLOT_LENGTH, b.header.timestamp + 3*BLOCK_SLOT_LENGTH), and so on.

Related issues #5234

  • lisk-chain/src/slots.ts contains the main logic of the epochTime usage
  • epochTime needs to be removed from framework/src/application/schema/application_config_schema.ts, and all other usages
@sridharmeganathan sridharmeganathan added this to the Sprint 21 milestone Jun 8, 2020
@nazarhussain nazarhussain changed the title Remove time offset for the slot calculation and the config setting Remove epochTime config and update the slot calculation to use genesis block timestamp Jun 10, 2020
@pablitovicente pablitovicente changed the title Remove epochTime config and update the slot calculation to use genesis block timestamp Replace epochTime with genesis block timestamp Jun 10, 2020
shuse2 added a commit that referenced this issue Jun 16, 2020
…sis_block_timestamp

Replace epochTime with genesis block timestamp - Closes #5280
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.