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

Events’ indexes are incorrectly converted to bytes for use in Sparse Merkle Tree #8477

Closed
Tracked by #7226
shuse2 opened this issue May 22, 2023 · 0 comments
Closed
Tracked by #7226

Comments

@shuse2
Copy link
Collaborator

shuse2 commented May 22, 2023

Expected behavior

index bytes should be computed correctly for large value for event

Actual behavior

this._index << EVENT_TOPIC_INDEX_LENGTH_BITS will overflow when index is greater than 2 ** 29

https://github.com/LiskHQ/lisk-sdk/blob/89e7504ef5eb6183aefe576a93be3d6052e56038/elements/lisk-chain/src/event.ts#L71-L89

Steps to reproduce

Add test which includes the index more than 2 ** 29

Which version(s) does this affect? (Environment, OS, etc...)

6.0.0-beta.2-

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

2 participants