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

consensus,store: enforce block size limits, compact serializations, misc badger fixes #1376

Merged
merged 3 commits into from
Feb 18, 2025

Conversation

jchappelow
Copy link
Member

@jchappelow jchappelow commented Feb 14, 2025

The PR starts with enforcing the consensus parameter (in genesis.json) for max block size.

This also led to several changes in block and transaction serialization, primarily the use of variable length integers in length-prefixed data, which includes many fields in the transaction and transaction body. None of the payloads that JS would have to serialize are changed. The size of a block with many fairly small transactions is drastically reduced.

The SerializeSize methods are added or improved, as these are required for efficient size checks without actually allocating huge amounts of memory.

Finally, this addresses some minor issues related to the block store:

  • much of the config was not working as intended, namely the logger was being overriden
  • our default of no-compression (an override from badger defaults) did not set badger's internal "block" cache to 0 (disabled) which the badger docs recommend if no compression or encryption are used
  • expose a store.compression option

Related: #1347

@charithabandi charithabandi self-requested a review February 14, 2025 14:31
@jchappelow jchappelow marked this pull request as draft February 14, 2025 15:14
@jchappelow jchappelow force-pushed the enforce-block-size branch 3 times, most recently from 771e234 to 385fbc8 Compare February 14, 2025 18:04
@jchappelow jchappelow marked this pull request as ready for review February 14, 2025 23:06
charithabandi
charithabandi previously approved these changes Feb 18, 2025
@charithabandi charithabandi merged commit d93b0ab into kwilteam:main Feb 18, 2025
4 checks passed
@jchappelow jchappelow deleted the enforce-block-size branch February 19, 2025 16:06
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.

2 participants