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

Fix handling of genesis block - Closes #6573 #6576

Merged
merged 3 commits into from
Jul 13, 2021

Conversation

shuse2
Copy link
Collaborator

@shuse2 shuse2 commented Jul 12, 2021

What was the problem?

This PR resolves #6573

How was it solved?

  • Update node instance to not hold genesis block in memory
  • Update getHighestCommonBlock to getHighestCommonBlockID

Below code should be removed with next version.
https://github.com/LiskHQ/lisk-sdk/pull/6576/files#diff-49cf44fda1c05aeae79dd1cd2b4d4a9c886c801fa800e3a269c8ac7a7c3adb01R217
https://github.com/LiskHQ/lisk-sdk/pull/6576/files#diff-297a5ae4736c65ff2f6ec1123c0c5f5f46742686b058b4471684e45bcba79bf7R298

They are required because running testnet node will not call the afterGenesisBlockApply hook.
The code will add the information from genesis block if it doesn't exist.

How was it tested?

Run 2 nodes with heavy genesis block (modified mainnet snapshot etc)

  • Check 2 nodes will sync even after 500 blocks. (after 500 blocks, genesis block will not be on cache)
  • Restart one of the node and check the starting time is significantly faster than 1st time

@shuse2 shuse2 self-assigned this Jul 12, 2021
@shuse2 shuse2 force-pushed the 6573-fix_common_block_resp branch 5 times, most recently from 5cc76bb to 3cbb644 Compare July 13, 2021 05:50
- Update not to hold genesis block in memory
- Update getHighestCommonBlock to getHighestCommonBlockID
@shuse2 shuse2 force-pushed the 6573-fix_common_block_resp branch from 3cbb644 to e0070cb Compare July 13, 2021 07:09
elements/lisk-chain/src/data_access/data_access.ts Outdated Show resolved Hide resolved
elements/lisk-chain/src/data_access/data_access.ts Outdated Show resolved Hide resolved
elements/lisk-chain/src/types.ts Outdated Show resolved Hide resolved
framework/src/node/transport/transport.ts Outdated Show resolved Hide resolved
@shuse2 shuse2 requested a review from ManuGowda July 13, 2021 07:26
@shuse2 shuse2 force-pushed the 6573-fix_common_block_resp branch from 41b062d to f9e6332 Compare July 13, 2021 07:34
@shuse2 shuse2 force-pushed the 6573-fix_common_block_resp branch from f9e6332 to 5c52046 Compare July 13, 2021 08:35
@shuse2 shuse2 force-pushed the 6573-fix_common_block_resp branch from 246d28e to 2a80293 Compare July 13, 2021 09:46
@shuse2 shuse2 merged commit c38fc36 into hotfix/5.1.2 Jul 13, 2021
@shuse2 shuse2 deleted the 6573-fix_common_block_resp branch July 13, 2021 10:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants