fix(consensus): rollback weight formula from BQIP-0007 to BQIP-0002#170
Open
fix(consensus): rollback weight formula from BQIP-0007 to BQIP-0002#170
Conversation
- whitepaper.tex: 10 sections covering protocol design, cryptography, consensus, security analysis, performance, and future work - Makefile: build (make), clean, view, watch commands - .gitignore: add LaTeX build artifacts (aux, log, out, toc, etc.) Build: cd whitepaper && make
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
BQIP-0007 (base×4 + witness×1) was copied from Bitcoin SegWit but hurts PQC performance because Dilithium5 signatures (~8KB) dwarf base data (~110B). The SegWit 4:1 discount penalizes the tiny base while witness still dominates, resulting in 46% fewer txs per block than the old formula. BQIP-0002 (base + sig_count×384 + witness×0.5) gives: - 1.86x more transactions per block (552 → 1,027) - Algorithm-agnostic: fixed 384 WU per signature regardless of size - 50% discount on witness bytes Closes #169
3a79852 to
f1a3270
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
calculate_tx_weight()from BQIP-0007 (base×4 + witness×1) to BQIP-0002 (base + sig_count×384 + witness×0.5)bitquan-consensusandbitquan-mempoolweight calculations to matchcalculate_block_weight_with_beta()since main formula is now beta-basedProblem
BQIP-0007 weight formula was copied from Bitcoin SegWit but hurts PQC performance:
Motivation
The SegWit-style discount (witness at 1 WU/byte vs base at 4 WU/byte) assumes signatures are small relative to base data. For PQC blockchain with 8KB signatures, this assumption is inverted.
BQIP-0002 uses:
Test Plan
cargo test -p bitquan-consensus— 146 passed, 0 failedcargo test -p bitquan-mempool— 22 passed, 0 failedcargo test -p bitquan-types— 44 passed, 0 failedcargo clippy— 0 warningsCloses #169