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

Add asset root on block generation - Closes #6750 #6882

Conversation

ishantiw
Copy link
Contributor

@ishantiw ishantiw commented Nov 4, 2021

What was the problem?

This PR resolves #6750

How was it solved?

🌱 Add block asset validation 004e232

  • Expose registered module ids from state machine
  • Check the size of data of an asset not exceeding the limit
  • Check a module asset is not duplicated
  • Check a module assets are sorted by id and are registered in state machine

🌱 Calculate asset root and add it to block header on block generation f9337ec

♻️ Add _validateBlockAsset d810783

✅ Add Block and BlockAssets validation tests 89778d6

✅ Add tests for BlockAssets validation in consensus and generator b9dea4f

How was it tested?

Under framework,
npm run test:unit consensus.spec
npm run test:unit generator.spec

Under lisk-chain,
npm run test block_asset.spec
npm run test block.spec

- Expose registered module ids from state machine
- Check the size of data of an asset not exceeding the limit
- Check a module asset is not duplicated
- Check a module assets are sorted by id and are registered in state machine
@ishantiw ishantiw requested a review from shuse2 November 4, 2021 22:15
@ishantiw ishantiw self-assigned this Nov 4, 2021
@ishantiw ishantiw requested a review from mehmetegemen November 5, 2021 08:50
@@ -28,3 +28,6 @@ export const GENESIS_BLOCK_TRANSACTION_ROOT = EMPTY_HASH;

export const TAG_BLOCK_HEADER = createMessageTag('BH');
export const TAG_TRANSACTION = createMessageTag('TX');

// TODO: Actual size TBD
export const MAX_ASSET_DATA_SIZE_BYTES = 64;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think genesis block will exceed this value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what could be the safe value until we get the announced value?

@ishantiw ishantiw requested a review from shuse2 November 5, 2021 14:25
Copy link
Contributor

@mehmetegemen mehmetegemen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a very minor comment, great job 🎉

@ishantiw ishantiw requested a review from mehmetegemen November 5, 2021 15:40
@shuse2 shuse2 merged commit 8b51ebe into feature/6554-improve-framework-architecture Nov 5, 2021
@shuse2 shuse2 deleted the 6750-addAssetRoot-block-generation branch November 5, 2021 19:05
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