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

Variable height merkle trees for transactions #906

Merged
merged 3 commits into from
Sep 11, 2022

Conversation

RogerTaule
Copy link
Contributor

@RogerTaule RogerTaule commented Sep 6, 2022

Currently, each block contains a merkle tree of height 5 (32 leaves) no matter the actual number of transactions contained. This PR modifies that so the transactions' merkle tree will have a variable height depending on the number of transactions. If a block contains 12 transactions, a merkle tree of height 4 will be used.
The block will still be limited to 32 transactions by the TRANSACTIONS_PER_BLOCK parameter. This PR will allow increase / decrease that number by only modifying that config parameter in the default.js and Config.sol with no further modifications to the code.

@RogerTaule RogerTaule force-pushed the RogerTaule/variable-length-merkle-tree-transactions branch 2 times, most recently from d6c9541 to 2e2ba33 Compare September 9, 2022 07:45
@RogerTaule RogerTaule force-pushed the RogerTaule/variable-length-merkle-tree-transactions branch from 2e2ba33 to 4476d9d Compare September 9, 2022 16:14
@RogerTaule RogerTaule marked this pull request as ready for review September 9, 2022 17:25
@daveroga daveroga merged commit ea83d6e into master Sep 11, 2022
@RogerTaule RogerTaule deleted the RogerTaule/variable-length-merkle-tree-transactions branch September 16, 2022 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants